So a while ago I had a script that on new player entry to server it saw they had 0 EXP so it would strip them of everything they had and give them the set items and/or gold I wanted, then set them with 1 EXP so this would not trigger on them again. Anyone have a name or a link to this older post? I tried looking with key word search player strip, server entry and didnt come up with anything.
Assist please.
Crap. Cant find a script.
Débuté par
Starbridge
, janv. 09 2011 09:43
#1
Posté 09 janvier 2011 - 09:43
#2
Posté 09 janvier 2011 - 09:53
I have a script generator and I have dinked around with it for a while now and I cant figure out a way to get it to work.
#3
Posté 09 janvier 2011 - 10:33
Try this, I just whipped it up so it isn't tested:
-420
//Goes in module's OnClientEnter event
void main()
{
object oPC = GetEnteringObject();
if(GetXP(oPC) == 0)
{
SetXP(oPC, 1);
int iCounter;
object oItem;
//Strip equipped items
for (iCounter = 0; iCounter <= NUM_INVENTORY_SLOTS; iCounter++)
{
oItem = GetItemInSlot(iCounter, oPC);
DestroyObject(oItem);
}
//Strip inventory items
oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory();
}
TakeGoldFromCreature(GetGold(), oPC, TRUE);
//Give the PC gold
int nAmount = 10;
CreateItemOnObject("nw_it_gold001", oPC, nAmount);
//Give the PC items
CreateItemOnObject("item_resref_1", oPC);
CreateItemOnObject("item_resref_2", oPC);
CreateItemOnObject("item_resref_3", oPC);
}
}
-420
#4
Posté 10 janvier 2011 - 12:40
I'll test it out. Thank you.
*30 seconds later*
Ok, so it half worked?
All equipped items were deleted and the gold amount was added to starting pool, but I kinda like that about the gold. Still need to figure out a way to get rid of everything in inventory.
*30 seconds later*
Ok, so it half worked?
All equipped items were deleted and the gold amount was added to starting pool, but I kinda like that about the gold. Still need to figure out a way to get rid of everything in inventory.
#5
Posté 10 janvier 2011 - 01:35
Sorry, my bad. Copied it from another script and forgot to replace a default variable:Starbridge wrote...
All equipped items were deleted and the gold amount was added to starting pool, but I kinda like that about the gold. Still need to figure out a way to get rid of everything in inventory.
//Goes in module's OnClientEnter event
void main()
{
object oPC = GetEnteringObject();
if(GetXP(oPC) == 0)
{
SetXP(oPC, 1);
int iCounter;
object oItem;
//Strip equipped items
for (iCounter = 0; iCounter <= NUM_INVENTORY_SLOTS; iCounter++)
{
oItem = GetItemInSlot(iCounter, oPC);
DestroyObject(oItem);
}
//Strip inventory items
oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
TakeGoldFromCreature(GetGold(), oPC, TRUE);
//Give the PC gold
int nAmount = 10;
CreateItemOnObject("nw_it_gold001", oPC, nAmount);
//Give the PC items
CreateItemOnObject("item_resref_1", oPC);
CreateItemOnObject("item_resref_2", oPC);
CreateItemOnObject("item_resref_3", oPC);
}
}
-420
#6
Posté 10 janvier 2011 - 01:42
Thought this might help. It's from the 1st page of the 'Endless List of Homebrew Functions' thread on the old BioBoards and not by me.
//////////////////////////////////////////////////////////
// StripPC(oObject)
// Posted: Friday, 11 July 2003 01:20AM by Jassper
// oObject = A Player object
// Strips a PC of all Items
//////////////////////////////////////////////////////////
void StripPC(object oPC)
{
if(!GetIsPC(oPC)) return;
// Check Equip Items and get rid of them
int i;
for(i=0; i<14; i++)
{
object oEquip = GetItemInSlot(i,oPC);
if(GetIsObjectValid(oEquip))
{
SetPlotFlag(oEquip, FALSE);
DestroyObject(oEquip);
}
}
// Check general Inventory and clear it out.
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
SetPlotFlag(oItem, FALSE);
DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
//Take their Gold
int nAmount = GetGold(oPC);
if(nAmount > 0)
AssignCommand(oPC, TakeGoldFromCreature(nAmount, oPC, TRUE));
}
TR
//////////////////////////////////////////////////////////
// StripPC(oObject)
// Posted: Friday, 11 July 2003 01:20AM by Jassper
// oObject = A Player object
// Strips a PC of all Items
//////////////////////////////////////////////////////////
void StripPC(object oPC)
{
if(!GetIsPC(oPC)) return;
// Check Equip Items and get rid of them
int i;
for(i=0; i<14; i++)
{
object oEquip = GetItemInSlot(i,oPC);
if(GetIsObjectValid(oEquip))
{
SetPlotFlag(oEquip, FALSE);
DestroyObject(oEquip);
}
}
// Check general Inventory and clear it out.
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
SetPlotFlag(oItem, FALSE);
DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
//Take their Gold
int nAmount = GetGold(oPC);
if(nAmount > 0)
AssignCommand(oPC, TakeGoldFromCreature(nAmount, oPC, TRUE));
}
TR
#7
Posté 10 janvier 2011 - 04:18
Thank you. Both of you.
#8
Posté 10 janvier 2011 - 06:30





Retour en haut






