oserc
Advanced OT User
Hey folks, I'm trying to make a brass helmet, when equipped, to give +1 critical chance and + 1 critical amount to the player. Obviously, with a movement script, that has been written as follows:
Inside movements.xml, I put this:
The problem is: when i equip the item, it gives me 3 (not 1) critical hit chance and critical amount, for NO reason. If I log out with the brass helmet equipped, when I log in again my crit chance/amount is 1 (correct), but if I dequip it and equip it again, it raises to 3 again.
Any thoughts about why is this happening?
XML:
function onEquip(player, item, slot)
player:addSpecialSkill(SPECIALSKILL_CRITICALHITCHANCE, 1)
player:addSpecialSkill(SPECIALSKILL_CRITICALHITAMOUNT, 1)
return true
end
function onDeEquip(player, item, slot)
player:addSpecialSkill(SPECIALSKILL_CRITICALHITCHANCE, -1)
player:addSpecialSkill(SPECIALSKILL_CRITICALHITAMOUNT, -1)
return true
end
Inside movements.xml, I put this:
XML:
<movevent event="Equip" itemid="2460" slot="head" script="brasshelmet.lua" />
<movevent event="DeEquip" itemid="2460" slot="head" script="brasshelmet.lua" />
The problem is: when i equip the item, it gives me 3 (not 1) critical hit chance and critical amount, for NO reason. If I log out with the brass helmet equipped, when I log in again my crit chance/amount is 1 (correct), but if I dequip it and equip it again, it raises to 3 again.
Any thoughts about why is this happening?