• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

onEquip different functions depending of the vocation

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hi there... Well the idea is to make 4 items (helmet, armor, legs and boots) which you equip having level 180 or more and then adds:

1) Helmet
- Knight: Adds 2 melee skills (axe, sword, fist, club, shield), 3% HP extra, and resistence 3% physical damage
- Paladin: Adds 2 distance skill, 1% HP and MP extra, and resistence 3% holy damage
- Sorcerer: Adds 1 magic level, 2% MP extra and resistence 3% to fire, energy and death
- Druid: Adds 1 magic level, 2% MP extra and resistence 3% to terra, frigo and death
2) Armor
- Knight: Adds 2 melee skills (axe, sword, fist, club, shield), 3% HP extra, and resistence 3% physical damage
- Paladin: Adds 2 distance skill, 1% HP and MP extra, and resistence 3% holy damage
- Sorcerer: Adds 1 magic level, 2% MP extra and resistence 3% to fire, energy and death
- Druid: Adds 1 magic level, 2% MP extra and resistence 3% to terra, frigo and death
3) Legs
- Knight: Adds 2 melee skills (axe, sword, fist, club, shield), 3% HP extra, and resistence 3% physical damage
- Paladin: Adds 2 distance skill, 1% HP and MP extra, and resistence 3% holy damage
- Sorcerer: Adds 1 magic level, 2% MP extra and resistence 3% to fire, energy and death
- Druid: Adds 1 magic level, 2% MP extra and resistence 3% to terra, frigo and death
4) Boots
- Knight: Adds 2 melee skills (axe, sword, fist, club, shield), 3% HP extra, and resistence 3% physical damage, and 30 speed, heal 20 HP per second
- Paladin: Adds 2 distance skill, 1% HP and MP extra, and resistence 3% holy damage, and 30 speed, heal 10 HP and MP per second
- Sorcerer: Adds 1 magic level, 2% MP extra and resistence 3% to fire, energy and death, and 30 speed, heal 20 MP per second
- Druid: Adds 1 magic level, 2% MP extra and resistence 3% to terra, frigo and death, and 30 speed, heal 20 MP per second

Can someone make this four items?

Thanksª
 
Last edited:
well, only way I found was edit of items.otb, cloning these items and onEquip transform and then oneequip of new id standard onEquip function
but its not really practical:/


if someone know any good answer I'll be greatful too
 
Uhmm... But there is a function to check player vocation, so it could check if the player has that vocation, if it has, it adds the skills and all that stuff, it doesnt, it check the other vocation, and like that... It is impossible?
 
I just don't know how to add the skills/resistances properly, my only ideas was really bugged:/

well, for skills you can try doPlayerAddSkill but remember that you need to remove it somehow onDeEquip... and I don't know if deequip is eqecuted on death

and about the resistances: I have no idea if some functions needed for this at least exists

@down: to be more precize: only way that I know and doesn't need BIG source edit(tfs 0.3.5 wasnt loading edited items.otb without small edit, dunno how about 0.3.6)
 
Last edited:
For magic level in your items.xml add:
<attribute key="magiclevelpoints" value="1"/>
for skills in your items.xml add:
<attribute key="skillDist" value="5"/>
and so on..
 
@up tried that also, but Iwas unable to execute onEquipItem, so player wasnt getting bonus(it was on 0.3.5 with old versions)
I can try again with bit fixed version of get attribute from new otlal(if getItemAttribute() isnumber return what was get if not return value from items.xml)
 
Back
Top