Jump to content

Custom Bound Item Spell


jefe323

Recommended Posts

I am working on a custom bound item spell for a mod I'm making. When I cast the spell in game, the items do not equip, and whatever my character was wearing (i.e helmet, curias and sword) where they were supposed to go gets unequipped. Any help would be appreciated.

 

Here is the script:

 

scn AAtyraelSpiritScript

begin ScriptEffectStart
player.additem AAbindMidasTyraelArmor, 1
player.additem AAbindMidasTyraellHood, 1
player.additem AAbindTyraelSword2, 1
player.EquipItem AAbindMidasTyraelArmor 0
player.EquipItem AAbindMidasTyraellHood 0
player.EquipItem AAbindTyraelSword2 0
end

begin ScriptEffectFinish
player.UnequipItem AAbindMidasTyraelArmor 0
player.UnequipItem AAbindMidasTyraellHood 0
player.UnequipItem AAbindTyraelSword2 0
player.removeitem AAbindMidasTyraelArmor, 1
player.removeitem AAbindMidasTyraellHood, 1
player.removeitem AAbindTyraelSword2, 1
end

Link to comment
Share on other sites

I think the problem is this: When the spell starts getting cast, the items are added and equipped. Then the spell's get's finished cast (imagine your character's arm lowering after casting the spell) and the "Begin ScriptEffectFinish" part of your script executes.

 

This is how I would have made my script:

 

scn AAtyraelSpiritScript

Short EquipmentPlaced <= this can be whatever variable you want

begin ScriptEffectStart

If EquipmentPlaced == 0
  player.additem AAbindMidasTyraelArmor, 1
  player.additem AAbindMidasTyraellHood, 1
  player.additem AAbindTyraelSword2, 1
  player.EquipItem AAbindMidasTyraelArmor
  player.EquipItem AAbindMidasTyraellHood
  player.EquipItem AAbindTyraelSword2
  Set EquipmentPlaced to 1
ElseIf EquipmentPlaced == 1
  player.UnequipItem AAbindMidasTyraelArmor
  player.UnequipItem AAbindMidasTyraellHood
  player.UnequipItem AAbindTyraelSword2
  player.removeitem AAbindMidasTyraelArmor, 1
  player.removeitem AAbindMidasTyraellHood, 1
  player.removeitem AAbindTyraelSword2, 1
  Set EquipmentPlaced to 0
EndIf

end

 

I hope this helps. Make a copy of your mod plugin before you try this edit in case it doesn't work (always make backups before following advice).

 

Kind regards

XJDHDR

Link to comment
Share on other sites

would that make it so the player would have to cast the spell a second time to unequip the items?

 

That's correct. If this isn't what you want, I'm sure I can work out a way to get what you want.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...