|
Senior Member
Join Date: Oct 2010
Location: Cincinnati, OH
Posts: 328
|
I am trying to get a trait to work. It works with Chains or Whips.
Spiked chains are 2handers, and Whips can be held in the offhand, so I am trying to check to see if either gIsEquip or wIs2nd is <> 0. However, it appears that whenever you equip a 2hander, and unequip it, it still flags as your Offhand being equipped, even though when I check the value for wIs2nd it says "0". So when I equip the Spiked Chain (2hander) it activated the script, and applies the bonus. However it stays even when I unequip it. (Unless I equip and unequip a whip, which is a one hander. This seems to reset it) It works as intended with a whip when you equip or unequip in either hand. Here is my code. Code:
First 1000 (Tried Prelevels 10000 too, as Taldan Duelist does to check something similar.) var Equip as number ~ Search for any Chains or Whips on the hero and see if they are equipped in either the main or off hand. If none are go no further. foreach pick in hero from BaseWep where "IsWeapon.wChainSpk | IsWeapon.wWhip | IsWeapon.wWhipNine | IsWeapon.wStingWhip | IsWeapon.wPFWhipSco | IsWeapon.wPFUrumi | IsWeapon.wWhipTrain" if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then Equip = 1 endif nexteach doneif (Equip <> 1) hero.child[manTrip].field[BonTrait].value += 2 hero.child[manTrip].field[manCMB].value += hero.child[manTrip].field[BonTrait].value Edit: The following code works. Code:
First 1000 var Equip as number ~ Search for any Chains or Whips on the hero and see if they are equipped in either the main or off hand. If none are go no further. foreach pick in hero from BaseWep where "IsWeapon.wWhip | IsWeapon.wWhipNine | IsWeapon.wStingWhip | IsWeapon.wPFWhipSco | IsWeapon.wPFUrumi | IsWeapon.wWhipTrain" if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then Equip = 1 endif nexteach foreach pick in hero from BaseWep where "IsWeapon.wChainSpk" if (eachpick.field[gIsEquip].value <> 0) then Equip = 1 endif nexteach doneif (Equip <> 1) hero.child[manTrip].field[BonTrait].value += 2 hero.child[manTrip].field[manCMB].value += hero.child[manTrip].field[BonTrait].value probably not a huge deal, but it does seem as if something is a bit buggy. Either that or I am missing something. Last edited by Pezmerga; June 15th, 2013 at 06:53 AM. Reason: Code update |
#1 |
|
|