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

Mana Rune per vocations

exique

Natala-ot.com
Joined
Sep 28, 2008
Messages
1,673
Reaction score
25
Location
Sweden
It should heal differently pending on what vocation you are.
Example:

Knight: 900 - 1300 hp
Paladin: 600hp, 1000 mana
Mages: 1500 mana

:thumbup:
 
Lua:
local config = {
	[1] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = 1500,
		   addHealth = false,
		  },
		  
	[2] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = 1500,
		   addHealth = false,
		  },
	
	[3] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = 1000,
		   addHealth = 600,
		  },
		  
	[4] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = false,
		   addHealth = math.random(900,1500),
		  },


}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local get = {level=getPlayerLevel(cid), magLevel=getPlayerMagLevel(cid), voc=getPlayerVocation(cid), skill={}, mainSkill=0}
		for i=1,6 do get.skill[i] = getPlayerSkillLevel(cid, i); get.mainSkill = (get.skill[i] > get.mainSkill)and get.skill[i] or get.mainSkill; end
		if(isInArray(config, get.voc))then	config = config[get.voc]
			if(get.level < config.level)then doPlayerSendCancel(cid, "You don't have required level to use this item.") return TRUE end
			if(get.magLevel < config.magLevel)then doPlayerSendCancel(cid, "You don't have required magic level to use this item.") return TRUE end
			if(get.mainSkill < config.minSkill)then doPlayerSendCancel(cid, "You don't have required skill to use this item.") return TRUE end
			if(config.addMana == true)then doPlayerAddMana(cid, config.addMana) end
			if(config.addHealth == true)then doPlayerAddMana(cid, config.addHealth) end
		end
	return TRUE
end
Here you have only for 4 voc's... add for promotion vocs (5-8) : )
 
Lua:
local config = {
	[1] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = 1500,
		   addHealth = false,
		  },
		  
	[2] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = 1500,
		   addHealth = false,
		  },
	
	[3] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = 1000,
		   addHealth = 600,
		  },
		  
	[4] = {level = 50,
		   magLevel = 70,
		   minSkill = 10,
		   addMana = false,
		   addHealth = math.random(900,1500),
		  },


}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local get = {level=getPlayerLevel(cid), magLevel=getPlayerMagLevel(cid), voc=getPlayerVocation(cid), skill={}, mainSkill=0}
		for i=1,6 do get.skill[i] = getPlayerSkillLevel(cid, i); get.mainSkill = (get.skill[i] > get.mainSkill)and get.skill[i] or get.mainSkill; end
		if(isInArray(config, get.voc))then	config = config[get.voc]
			if(get.level < config.level)then doPlayerSendCancel(cid, "You don't have required level to use this item.") return TRUE end
			if(get.magLevel < config.magLevel)then doPlayerSendCancel(cid, "You don't have required magic level to use this item.") return TRUE end
			if(get.mainSkill < config.minSkill)then doPlayerSendCancel(cid, "You don't have required skill to use this item.") return TRUE end
			if(config.addMana == true)then doPlayerAddMana(cid, config.addMana) end
			if(config.addHealth == true)then doPlayerAddMana(cid, config.addHealth) end
		end
	return TRUE
end
Here you have only for 4 voc's... add for promotion vocs (5-8) : )

Thank you, rep.
 
Back
Top Bottom