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

Action Funny manarune

Erikas Kontenis

Board Moderator
Staff member
Board Moderator
Joined
Jul 3, 2009
Messages
1,863
Reaction score
564
Location
Lithuania
tested on 0.3.5 and it will work on 0.2.5 for 0.3.5 it got small errors in console but dont take it in hearth ! i hope us will rep me :D

Code:
local MIN = 200
local MAX = 300


function onUse(cid, item, fromPosition, itemEx, interval, lastexecution)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if((not(isSorcerer(itemEx.uid) or isDruid(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 80)) then
		doCreatureSay(itemEx.uid, "Only sorcerers and druids of level 80 or above use this mana rune.", TALKTYPE_ORANGE_1)
		return TRUE
	end

	if doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
		return FALSE
	end

	doAddCondition(cid, exhaust, lastExecution, interval, fromPosition, toPosition)
        doCreatureSay(cid,"Ahh, manarune rocks!",19) 
        doSendMagicEffect(fromPosition, math.random( 1, 50 ) ) 
	return TRUE
end
 
Why would you need a screen?
It only some mana to target player, adds exhaust[fail]! to the user, sends orange text and a random magic effect, between ids 1 and 50.

As stated before, you failed with doAddCondition;
You used it wrong (too many parameters) and didn't create a corresponding condition.

Code:
doAddCondition(cid, exhaust, lastExecution, interval, fromPosition, toPosition)
...
Code:
local config = {
	mana = {200, 300},
	vocations = {1, 2, 5, 6},
	vocStr = "sorcerers and druids",
	level = 80,
	effect = {1, 50} -- number or a table with 2 numbers which will act as a random range
}

local exhaust = createConditionObject(CONDITION_EXHAUST or CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))

function onUse(cid, item, fromPosition, itemEx, interval, lastexecution)
	local tid = itemEx.uid or cid
	if(isPlayer(tid) == FALSE) then
		return FALSE
	elseif(isInArray(config.vocations, getPlayerVocation(cid)) == FALSE or getPlayerLevel(cid) < config.level) then
		doCreatureSay(cid, "Only " .. config.vocStr .. " of level " .. config.level .. " or above can use this mana rune.", TALKTYPE_ORANGE_1)
		return TRUE
	elseif(doPlayerAddMana(tid, math.random(mana[1], mana[2])) == LUA_ERROR) then
		return FALSE
	end
	doAddCondition(cid, exhaust)
	doCreatureSay(tid, "Ahh, manarune rocks!", TALKTYPE_ORANGE_1) 
	doSendMagicEffect(toPosition, type(config.effect) == "table" and math.random(config.effect[1], config.effect[2]) or config.effect)
	return TRUE
end
Should work on both 0.3 and 0.2
 
Last edited:
lol i dont get it a normal rune but with not 3 effects? wtf, Make like fire and poisen on same time or something.
 
nice? lol... Its rly suxxy come1 man make a new with like 10 nice effects YOU like and that its lvl based on mana per voc, mag-lvl.
 
Back
Top