me senti ignorante.
vou me redimir
local sets = {
--descripcion, helmet, body, legs, boots
[1] = {'Lava Set', 7900, 7899, 7894, 7891},
[2] = {'Ice Set', 7902, 7897, 7896, 7892},
[3] = {'Energy Set', 7901, 7898, 7895, 7893},
[4] = {'Tera Set', 7903, 7884, 7885, 7886}
}
local speed1 = createConditionObject(CONDITION_HASTE)
setConditionParam(speed1, CONDITION_PARAM_TICKS, -1)
setConditionParam(speed1, CONDITION_PARAM_SPEED, 10)
local speed2 = createConditionObject(CONDITION_HASTE)
setConditionParam(speed1, CONDITION_PARAM_TICKS, -1)
setConditionParam(speed1, CONDITION_PARAM_SPEED, 20)
local shield1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(shield1, CONDITION_PARAM_TICKS, -1)
setConditionParam(shield1, CONDITION_PARAM_SKILL_SHIELD, 2)
local shield2 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(shield2, CONDITION_PARAM_TICKS, -1)
setConditionParam(shield2, CONDITION_PARAM_SKILL_SHIELD, 5)
setBonus = { --- [] = {condition = , maxHealth = , maxMana = }
[1] = {maxHealth = 200, maxMana = 200, condition = speed1, typ = CONDITION_HASTE}, --Lava Set
[2] = {maxMana = 350, maxHealth = 100, condition = shield1}, --Ice Set
[3] = {maxMana = 200, maxHealth = 100, condition = speed2, typ = CONDITION_HASTE}, --Energy Set
[4] = {maxHealth = 300, condition = shield2} --Terra Set
}
local storage = 17181
function onDeEquip(cid, item, slot)
for i=1, #sets do
if getPlayerStorageValue(cid, storage) > 0 then
if (slot == 1 and getPlayerSlotItem(cid, 4).itemid == sets[i][3] and getPlayerSlotItem(cid, 7).itemid == sets[i][4] and getPlayerSlotItem(cid, 8).itemid == sets[i][5])
or (slot == 4 and getPlayerSlotItem(cid, 1).itemid == sets[i][2] and getPlayerSlotItem(cid, 7).itemid == sets[i][4] and getPlayerSlotItem(cid, 8).itemid == sets[i][5])
or (slot == 7 and getPlayerSlotItem(cid, 1).itemid == sets[i][2] and getPlayerSlotItem(cid, 4).itemid == sets[i][3] and getPlayerSlotItem(cid, 8).itemid == sets[i][5])
or (slot == 8 and getPlayerSlotItem(cid, 1).itemid == sets[i][2] and getPlayerSlotItem(cid, 4).itemid == sets[i][3] and getPlayerSlotItem(cid, 7).itemid == sets[i][4]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, sets[i][1].." effects off.")
if (setBonus[i]).maxHealth ~= nil then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) -(setBonus[i]).maxHealth)
doCreatureAddHealth(cid, -(setBonus[i]).maxHealth)
doRemoveCondition(cid, CONDITION_INFIGHT)
end
if (setBonus[i]).maxMana ~= nil then
setCreatureMaxMana(cid, getCreatureMaxMana(cid) -(setBonus[i]).maxMana)
doCreatureAddMana(cid, -(setBonus[i]).maxMana)
doRemoveCondition(cid, CONDITION_INFIGHT)
end
if (setBonus[i]).condition ~= nil then
doRemoveCondition(cid, (setBonus[i]).condition)
end
setPlayerStorageValue(cid,storage,0)
end
end
end
return true
end
function onEquip(cid, item, slot)
for i=1, #sets do
if getPlayerStorageValue(cid, storage) < 1 then
if getPlayerSlotItem(cid, 1).itemid == sets[i][2] and getPlayerSlotItem(cid, 4).itemid == sets[i][3] and getPlayerSlotItem(cid, 7).itemid == sets[i][4] and getPlayerSlotItem(cid, 8).itemid == sets[i][5] then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, sets[i][1].." effects on.")
if (setBonus[i]).maxHealth ~= nil then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) +(setBonus[i]).maxHealth)
doCreatureAddHealth(cid, (setBonus[i]).maxHealth)
end
if (setBonus[i]).maxMana ~= nil then
setCreatureMaxMana(cid, getCreatureMaxMana(cid) +(setBonus[i]).maxMana)
doCreatureAddMana(cid, (setBonus[i]).maxMana)
end
if (setBonus[i]).condition ~= nil then
doAddCondition(cid, (setBonus[i]).condition)
end
setPlayerStorageValue(cid,storage,1)
end
end
end
return true
end
Boa-sorte !