Releasing a Totem
Posted: Fri Apr 06, 2012 6:05 pm
Hey guys, i was wondering how i would set this script so that when you release a totem, it returns to your backpack, rather than just dropping to the floor where it was?
here is the if statement for it
any help is appreciated 
here is the if statement for it
Code: Select all
if (totem)
set_critical (1);
var it := CreateItemAtLocation (me.x, me.y, me.z, totem, 1, me.realm);
if (!it)
say ("*Argh*");
set_critical (0);
return;
endif
it.decayat := 0;
it.movable := 1;
it.name := me.name;
it.usescript := ":dundee:totem";
it.color := CINT (GetObjProperty (me, "totemcolor"));
SetObjProperty (it, "critter", me.npctemplate);
if (GetObjProperty (it, "color"))
SetObjProperty (it, "critcolor", GetObjProperty (it, "color"));
else
SetObjProperty (it, "critcolor", me.color);
endif
SetObjProperty (it, "critgraphic", me.graphic);
SetObjProperty (it, "totemhp", CINT (GetVital (me, "Life")/100));
if (GetObjProperty (me, "ownerserial"))
SetObjProperty (it, "ownerserial", GetObjProperty (me, "ownerserial"));
SetObjProperty (it, "ownername", GetObjProperty (me, "ownername"));
SetObjProperty (it, "oldname", GetObjProperty (me, "oldname"));
endif
Drop ();
PlaySoundEffect (me, SFX_SPELL_DISPEL);
PlayStationaryEffect (me.x, me.y, me.z, FX_SMOKE, 0xA, 0xA, 0, me.realm);
KillMe ();
set_critical(0);
return;
endif