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

Solved Vocation for manarune

jeppsonskate

Member
Joined
Apr 3, 2012
Messages
117
Reaction score
18
Location
Sweden
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 700) -- time in seconds x1000
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local manamax = getPlayerMaxMana(cid)
local min = 1200
local max = 1300
local mana_add = math.random((min), (max))
 
	if(hasCondition(cid, CONDITION_EXHAUST)) then
        	doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		return doPlayerSendCancel(cid, "You are exhausted")
	end
    	doPlayerAddMana(cid, mana_add)
    	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    	doSendAnimatedText(getPlayerPosition(cid),""..mana_add.."", TEXTCOLOR_LIGHTBLUE)
		doAddCondition(cid, exhaust)
    	return true
end

<action itemid="2307" event="script" value="liquids/Donate manarune.lua"/>

Got this scripts for my manarune, but all vocations can use it. I want ONLY mages can use it!.

How do i do?
 
Lua:
if (not isInArray({1, 2, 5, 6}, getPlayerVocation(cid))) then
    return doPlayerSendCancel(cid, "Only druids and sorcerers can use this rune."), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF), false
end
 
Back
Top