Heroid
Active Member
- Joined
- Mar 7, 2011
- Messages
- 332
- Solutions
- 11
- Reaction score
- 34
Hey, I'm wondering if someone can help me create a table for this script:
I want a table where different item ids get different amount of HP or Mana.
If someone could also help me add the attribute Protection All % when equipping the item I would be very grateful, thanks. :d
Lua:
local hp = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
hp:setParameter(CONDITION_PARAM_TICKS, -1)
hp:setParameter(CONDITION_PARAM_SUBID, 100)
hp:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 100)
local mp = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
mp:setParameter(CONDITION_PARAM_TICKS, -1)
mp:setParameter(CONDITION_PARAM_SUBID, 101)
mp:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTS, 100)
function onEquip(player, item, slot)
if player:getVocation():getId() == 1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "+100 Mana")
player:addCondition(mp)
player:addMana(100)
elseif player:getVocation():getId() == 3 or 4 then
player:addCondition(hp)
player:addHealth(100)
player:sendTextMessage(MESSAGE_INFO_DESCR, "+100 Health")
end
return true
end
function onDeEquip(player, item, slot)
if player:getVocation():getId() == 1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "-100 Mana")
player:removeCondition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT, 101)
elseif player:getVocation():getId() == 3 or 4 then
player:removeCondition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT, 100)
player:sendTextMessage(MESSAGE_INFO_DESCR, "-100 Health")
end
return true
end
I want a table where different item ids get different amount of HP or Mana.
If someone could also help me add the attribute Protection All % when equipping the item I would be very grateful, thanks. :d