Rooteh
New Member
- Joined
- Jul 24, 2008
- Messages
- 95
- Reaction score
- 0
Addmana.lua
removemana.lua
movements.xml
Does anyone know why this doesn't work? It adds mana, but when you take off the armor it doesn't remove the mana.
Or.. Could you just explain to me how you use a script for an item on equip / deequip?
Code:
function onEquip(cid, item, slot)
if item.actionid == 2222 then
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
end
return true
end
removemana.lua
Code:
function onDeEquip(cid, item, slot)
if item.actionid == 2222 then
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-100)
end
return true
end
movements.xml
Code:
<movevent type="Equip" itemid="2465" slot="armor" event="script" value="addmana.lua"/>
<movevent type="DeEquip" itemid="2465" slot="armor" event="script" value="removemana.lua"/>
Does anyone know why this doesn't work? It adds mana, but when you take off the armor it doesn't remove the mana.
Or.. Could you just explain to me how you use a script for an item on equip / deequip?