69 lines
1.4 KiB
Plaintext
69 lines
1.4 KiB
Plaintext
|
|
void CreateItemOnObjectVoid(string sItemTemplate, object oTarget=OBJECT_SELF, int nStackSize=1)
|
|
{
|
|
CreateItemOnObject(sItemTemplate, oTarget, nStackSize);
|
|
}
|
|
object oItem;
|
|
|
|
|
|
//Put this script OnEnter
|
|
void main()
|
|
{
|
|
|
|
object oPC = GetEnteringObject();
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));
|
|
|
|
if (DoOnce==TRUE) return;
|
|
|
|
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
|
|
|
|
|
|
if (GetItemPossessedBy(oPC, "shadowplate55")!= OBJECT_INVALID)
|
|
{
|
|
oItem = GetFirstItemInInventory(oPC);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem)=="shadowplate55") DestroyObject(oItem);
|
|
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
|
|
DelayCommand(1.0, CreateItemOnObjectVoid("shadowplate55", oPC));
|
|
|
|
}
|
|
else if (GetItemPossessedBy(oPC, "shadowlrdhelm4")!= OBJECT_INVALID)
|
|
{
|
|
oItem = GetFirstItemInInventory(oPC);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem)=="shadowlrdhelm4") DestroyObject(oItem);
|
|
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
|
|
DelayCommand(1.0, CreateItemOnObjectVoid("shadowlrdhelm4", oPC));
|
|
|
|
}
|
|
else if (GetItemPossessedBy(oPC, "queensband03")!= OBJECT_INVALID)
|
|
{
|
|
oItem = GetFirstItemInInventory(oPC);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem)=="queensband03") DestroyObject(oItem);
|
|
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
|
|
DelayCommand(1.0, CreateItemOnObjectVoid("queensband03", oPC));
|
|
|
|
}
|
|
|
|
|
|
}
|