• 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!

Armor gives mlvl, skills depends on vocation.

Status
Not open for further replies.

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
Hello, i'm requesting a armor that when you put it on your self it checks if the player is sorcerer it gives magic level (example 5 mlvl extra) else if the player is knight or paladin then it gives 10 extra skills, distance sword, club etc etc..

Also i forget:p if is sorcerer or druid then mlvl not only sorcerer.
 
The lua part(aArmor.lua):
Code:
 local tries =
{
   magLevel = xxx,
   distFight = xxx,
   clubFight = xxx,
   swordFight = xxx,
   axeFight = xxx
}

function onEquip(cid, item, slot)
	if ((isSorcerer(cid) == TRUE) or (isDruid(cid) == TRUE)) then
	       doPlayerAddSkillTry(cid, SKILL__MAGLEVEL, tries.magLevel)
	 elseif isPaladin(cid) == TRUE then
	       doPlayerAddSkillTry(cid, SKILL_DISTANCE, tries.distFight)
	 elseif isKnight(cid) == TRUE then
	   doPlayerAddSkillTry(cid, SKILL_CLUB, tries.clubFight)
	   doPlayerAddSkillTry(cid, SKILL_SWORD, tries.swordFight)
	   doPlayerAddSkillTry(cid, SKILL_AXE, tries.axeFight)
 end
 return TRUE
end

function onDeEquip(cid, item, slot)
	if ((isSorcerer(cid) == TRUE) or (isDruid(cid) == TRUE)) then
	       doPlayerAddSkillTry(cid, SKILL__MAGLEVEL, -tries.magLevel)
	 elseif isPaladin(cid) == TRUE then
	       doPlayerAddSkillTry(cid, SKILL_DISTANCE, -tries.distFight)
	 elseif isKnight(cid) == TRUE then
	   doPlayerAddSkillTry(cid, SKILL_CLUB, -tries.clubFight)
	   doPlayerAddSkillTry(cid, SKILL_SWORD, -tries.swordFight)
	   doPlayerAddSkillTry(cid, SKILL_AXE, -tries.axeFight)
 end
 return TRUE
end

The xml part(change the itemid):
Code:
	<movevent event="Equip" itemid="ARMOR_ID" slot="armor" function="onEquipItem" script="aArmor.lua"/>
	<movevent event="DeEquip" itemid="ARMOR_ID" slot="armor" function="onDeEquipItem" script="aArmor.lua"/>
 
I got question. How can I make my lavos armor wearable for all vocations??!! Now only knights can use it. I searched a place to change it in items.xml , but didn't find it.
 
Status
Not open for further replies.
Back
Top