Jump to content

Bound weapon script fror spell


kaipachi

Recommended Posts

Hi i'm new :wallbash: . I am making a mod that requires me to have a weapon with a bound spell that on cast binds another weapon.

 

I have run out of extra Bound weapon spells. :confused:

 

The only problem i have is that i need the weapon to be removed on unequip. What do I put where?

 

My script for my bound weapon spell:

 

ScriptName ShikaiBscript

 

ref UserRef

 

Begin ScriptEffectStart

AddItem ShiniLV2B 1

EquipItem ShiniLV2B

 

Endif

UserRef.UnequipItem ShiniLV2B

 

End

 

Begin ScriptEffectFinish

 

RemoveItem ShiniLV2B 1

 

 

End

 

The script for the bound spell:

 

scriptname ShikaiBAdd

 

ref Wearer

 

Begin OnEquip

set Wearer to GetContainer

Wearer.AddSpell ShikaiB

End

 

Begin OnUnEquip

set Wearer to GetContainer

Wearer.RemoveSpell ShikaiB

End

 

Thank you for your time.

Link to comment
Share on other sites

Hmm... Instead of UserRef, you could use Self.

 

scn ShikaiBscript

ref Self 
short Flag

Begin ScriptEffectStart

Set Flag to 0  ;Makes sure Flag variable is at 0 when this begins.
Set Self to GetSelf

if Flag == 0
Set Flag to 1
Self.AddItem ShiniLV2B 1  ;You ALWAYS need a reference for the scripts you do. 
Self.EquipItem ShiniLV2B 

Elseif Flag == 1
Set Flag to 2
Self.UnequipItem ShiniLV2B

Endif
End 

Begin ScriptEffectFinish

Set Self to GetSelf

If Flag == 2
Self.RemoveItem ShiniLV2B 1
Set Flag to 0

Endif
End

 

and

 

scn ShikaiBAdd

ref Self

Begin OnEquip

set Self to GetSelf
Self.AddSpell ShikaiB

End

Begin OnUnequip

set Self to GetSelf
Self.RemoveSpell ShikaiB

End

 

Hope it helps :thumbsup: I find that GetContainer doesn't work too well, but it may just be me.

Edited by Guest
Link to comment
Share on other sites

Unfortunatly it didn't work :wacko:, thanks for you help though.

 

I do have a theory.

 

In this section of your script.

Set Flag to 0 ;Makes sure Flag variable is at 0 when this begins.

Set Self to GetSelf

 

if Flag == 0

Set Flag to 1

Self.AddItem ShiniLV2B 1 ;You ALWAYS need a reference for the scripts you do.

Self.EquipItem ShiniLV2B

 

You have made it so when it runs it will always be zero. I beleive this makes the next section impossible.

 

II'm not sure how to correct it if it needs correcting.

Edited by kaipachi
Link to comment
Share on other sites

Ah. *facepalm* Try this:

 

if Flag > 0
Set Flag to 0 ;Makes sure Flag variable is at 0 when this begins. 

endif

Set Self to GetSelf 

if Flag == 0 
Set Flag to 1 
Self.AddItem ShiniLV2B 1 ;You ALWAYS need a reference for the scripts you do. 
Self.EquipItem ShiniLV2B 

 

THAT should work. If not, delete the Set Flag to 0 part :P

Edited by Guest
Link to comment
Share on other sites

  • Recently Browsing   0 members

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