Strack
Member
- Joined
- May 15, 2009
- Messages
- 199
- Reaction score
- 14
Well I released a set system (all items equiped from a set => more hp, mana or others)
tested on tfs 0.3.6pl1, for 8.54
based on addons system
add on movements.xml
I used lava set, ice set, tera set and energy set for testing, but you can change it by modifying the script
move/scripts/ set system.lua
I hope you like it, and if have any doubt or find any bug please comment it
tested on tfs 0.3.6pl1, for 8.54
based on addons system
add on movements.xml
XML:
<movevent type="Equip" fromid="7900" toid="7903" slot="head" event="script" value="set system.lua"/>
<movevent type="Equip" itemid="7897;7898;7899;7884" slot="armor" event="script" value="set system.lua"/>
<movevent type="Equip" itemid="7894;7895;7896;7885" slot="legs" event="script" value="set system.lua"/>
<movevent type="Equip" itemid="7891;7892;7893;7886" slot="feet" event="script" value="set system.lua"/>
<movevent type="DeEquip" fromid="7900" toid="7903" slot="head" event="script" value="set system.lua"/>
<movevent type="DeEquip" itemid="7897;7898;7899;7884" slot="armor" event="script" value="set system.lua"/>
<movevent type="DeEquip" itemid="7894;7895;7896;7885" slot="legs" event="script" value="set system.lua"/>
<movevent type="DeEquip" itemid="7891;7892;7893;7886" slot="feet" event="script" value="set system.lua"/>
I used lava set, ice set, tera set and energy set for testing, but you can change it by modifying the script
move/scripts/ set system.lua
Lua:
--Set System by Strack
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)
--getPlayerSlotItem(cid, 1) --helmet
--getPlayerSlotItem(cid, 4) --armor
--getPlayerSlotItem(cid, 7) --legs
--getPlayerSlotItem(cid, 8) --boots
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
I hope you like it, and if have any doubt or find any bug please comment it
Last edited by a moderator: