kxdace Posted July 14, 2017 Posted July 14, 2017 So I run the following code in the magic effect, add it to a spell, fire the spell, the NPC drops the requested item then a second later re-equips a new set of armor, wtf am I doing wrong it seems pretty strait forward. I tried reverse engineering the strip code from other mods but no one includes any darn source files!!! lol. Please help. Scriptname wrScriptSpellStrip extends activemagiceffect Event OnEffectStart(Actor akTarget, Actor akCaster) stripActor(akTarget)EndEventFunction stripActor(Actor stripper) ;stripper.UnequipItemSlot(32);body ;stripper.UnequipItemSlot(30);head ;stripper.UnequipItemSlot(31);hair ;stripper.UnequipItemSlot(39);shield ;Removes Cuirass Armor Cuirass = stripper.GetWornForm(0x00000004) as Armor stripper.DropObject(Cuirass, 1) stripper.RemoveItem(Cuirass, 1) ;Remove Helm Armor Helm = stripper.GetWornForm(0x00000001) as Armor stripper.DropObject(Helm, 1) stripper.RemoveItem(Helm, 1) ;Remove Gloves Armor Gloves = stripper.GetWornForm(0x00000008) as Armor stripper.DropObject(Gloves, 1) stripper.RemoveItem(Gloves, 1) ;Remove Boots Armor Boots = stripper.GetWornForm(0x00000080) as Armor stripper.DropObject(Boots, 1) stripper.RemoveItem(Boots, 1) ;Remove Hair\Helm Armor Helm2 = stripper.GetWornForm(0x00000002) as Armor stripper.DropObject(Helm2, 1) stripper.RemoveItem(Helm2, 1) ;Remove Shield Armor Shield = stripper.GetWornForm(0x00000200) as Armor stripper.DropObject(Shield, 1) stripper.RemoveItem(Shield, 1) ;Remove Left Equipped Weapon Weapon equippedLeft = stripper.GetEquippedWeapon (true) stripper.RemoveItem(equippedLeft) stripper.PlaceAtMe(equippedLeft) ;Remove Right Equipped Weapon Weapon equippedRight = stripper.GetEquippedWeapon () stripper.RemoveItem(equippedRight) stripper.PlaceAtMe(equippedRight) ;stripper.removeallitems() ;I dont want to use this as it may remove quest items ;or important items like keysEndFunction
Guest Posted July 14, 2017 Posted July 14, 2017 For each of the body slots do this: Armor item = stripper.GetWornForm(0x0XYZ) as Armor stripper.unequipItem(item, true, true) stripper.DropObject(Shield, 1) stripper.RemoveItem(Shield, 1) Be aware that if you change the cell the stripper will re-equip automatically the items. If you really want this to stop, then you have to force a new empty outfit for the actor. Outfit Property anEmptyOutfit Auto ... Outfit oldOutfit = stripper.getLeveledActorBase().getOutfit() stripper.setOutfit(anEmptyOutfit) ...
kxdace Posted July 14, 2017 Author Posted July 14, 2017 Worked like a charm thank you very much CPU your awesome! Crazy how un-intuitive CK can be sometimes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.