Initial upload
Initial upload
This commit is contained in:
68
_module/nss/itemchangeout3.nss
Normal file
68
_module/nss/itemchangeout3.nss
Normal file
@@ -0,0 +1,68 @@
|
||||
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user