• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MoveEvent Set System

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
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 :p
 
Last edited by a moderator:
\o woop, what else you got...this is nice using this in servers will make people actually want to wear the full set and not just the armor/legs

Also someone could edit this to make all full sets give something special...omg the possibilities...
 
I recall doing it through XML. Adding mana bonus etc for weapons n so, which is all he did in his script!
 
well colandus, you can add more attributes for the set if you want, but this bonus only runs with the full set, if you have body, helmet, boots but not legs, it wont give you any bonus, so I dont know if it can be done throught xml
 
Last edited:
well colandus, you can add more attributes for the set if you want, but this bonus only runs with the full set, if you have body, helmet, boots but not legs, it wont give you any bonus, so I dont know if it can be done throught xml

I see :p Pretty nice I guess ;)
 
PHP:
 setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) +(setBonus[i]).maxHealth)

this will be bugged
why?
for eg: i try to use ice set, and i have a ring what increase max mana by 100 and a weapon what incease max mana by 300.
so if i pickup all items from ice set my mana get bugged and i can make 100000000 mana in few minutes. try if u dont belive

the problem is
PHP:
getCreatureMaxHealth(cid)
if u have ring(+100mana) + weapon(+300mana) what increase mana (+400) and base 300 mana this function returns u have 700 mana.
when u pickup ice set (increase mana by 200) you max mana will set to NOT 700+200! but 700+(200+300for weap+100from ring) so u will have 1300 mana. Now i can take off weapon and ring - your mana will be 900, and take off ice set
your mana pernamently increased, and is now 700 :)
You can reply this proces alot of time.
 
Last edited:
it is possible to put it in source, and I want to do it
But I'd rather have it like in diablo, any id can be part of any set
additional attr like setId and list of sets loaded with attributes from xml(or stored in source=bad option)
 
@andu
thanks for info, I will test it and try to solve it later
 
I've been testing the pet system and it gave me pair of bugs:
- when running ot at the beggining it tells me:

[06/10/2010 19:14:55] [Warning - MoveEvents::addEvent] Duplicate move event found: 7886
[06/10/2010 19:14:55] [Warning - MoveEvents::addEvent] Duplicate move event found: 7886

And this with all ids of the set items.

Also i was testing if the % of fire defense (magma set) the item gives was still working but it seems it didn't.
 
[06/10/2010 19:14:55] [Warning - MoveEvents::addEvent] Duplicate move event found: 7886

you have that problem 'cause you have the same itemid (7886) repeated on movements.xml, on that case, non of the effects will be applied on that item, so if by default it gives you a % of resistence against an element, having that error on console will make it not run, so you must search for that itemid and make sure it's only 1 time on your movement.xml
 
So i have to choose between having this resistance, or having the set bonus, right? ;p
 
you've asked me via-private msg and I've asked u via-private msg, and the answer is the same, try to use only my set system and if it stills having default attribute
 
Back
Top