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

Solved Working MR for second promotion players?

Progenosis

Member
Joined
Sep 6, 2011
Messages
131
Reaction score
18
I have an script for a Mana Rune that works fine for: Druid, Sorcer, Paladin, Knight, Elder Druid, Master Sorcerer, Elite Knight and Royal Paladin.
But when a player gets second promotion the rune doesn't work on them :/
How can I make it work properly for all players?

This is the script:


Code:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local min, max
	local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
	if isSorcerer(cid) or isDruid(cid) then
		min = lvl * 1.0 + mag * 1.0
		max = lvl * 2.0 + mag * 2.0
	elseif isPaladin(cid) then
		min = lvl * 2.0 + mag * 2.0
		max = lvl * 2.0 + mag * 2.0
	elseif isKnight(cid) then
		min = lvl * 2.0 + mag * 2.0
		max = lvl * 3.0 + mag * 3.0
	end
	
	local rand = math.random(min, max)
	
	if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	end
	
	if not isPlayer(itemEx.uid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end
	
	if(getCreatureHealth(cid) >= getCreatureMaxHealth(cid)) then
	return doPlayerSendCancel(cid, "Your health is currently full.")
	end
	
	return doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doCreatureAddHealth(itemEx.uid, rand) and doAddCondition(cid, exhausted) and doCreatureSay(itemEx.uid, "Aaaah super UH...", TALKTYPE_ORANGE_1)
end
 
why even use second promotion? :p, use vip or something instead ^^ just an opinion, sorry but i dont know how to fix it anyway ^^ just bored
 
Umm i think i kno try to add this under

elseif isNameofPromotion(cid) then
min = lvl * 2.0 + mag * 2.0
max = lvl * 3.0 + mag * 3.0

and if its a sorc or w/e just copy the 2.0 or 3.0 or w/e to the same

Im new to this so i though i would try to help. :)
 
Add the vocation ids of the second promotion to the isSorcerer, isDruid, isPaladin and isKnight functions in data/lib/031-vocations.lua.
 
That's the script I made a while ago, I'll update it for you.

With second promotion you will need this:

LUA:
if(isInArray({1, 2, 5, 6, 9, 10}, getPlayerVocation(cid))) then
	min = lvl * 1.0 + mag * 1.0
	max = lvl * 2.0 + mag * 2.0
elseif(isInArray({3, 7, 11}, getPlayerVocation(cid))) then
	min = lvl * 2.0 + mag * 2.0
	max = lvl * 2.0 + mag * 2.0
else
	min = lvl * 2.0 + mag * 2.0
	max = lvl * 3.0 + mag * 3.0
end
Or do what Limos suggested. That is probably best. ^_^
 
Code:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local min, max
	local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
	 if(isInArray({1, 2, 5, 6, 9, 10}, getPlayerVocation(cid))) then
	min = lvl * 1.0 + mag * 1.0
	max = lvl * 2.0 + mag * 2.0
	elseif(isInArray({3, 7, 11}, getPlayerVocation(cid))) then
	min = lvl * 2.0 + mag * 2.0
	max = lvl * 2.0 + mag * 2.0
	end
	local rand = math.random(min, max)
	
	if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	end
	
	if not isPlayer(itemEx.uid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end
	
	if(getCreatureHealth(cid) >= getCreatureMaxHealth(cid)) then
	return doPlayerSendCancel(cid, "Your health is currently full.")
	end
	
	return doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doCreatureAddHealth(itemEx.uid, rand) and doAddCondition(cid, exhausted) and doCreatureSay(itemEx.uid, "Aaaah super UH...", TALKTYPE_ORANGE_1)
end
 
Back
Top