Action Funny manarune

Erikas Kontenis

Well-Known Member
Joined
Jul 3, 2009
Messages
1,443
Best answers
0
Reaction score
76
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
 
OP
Erikas Kontenis

Erikas Kontenis

Well-Known Member
Joined
Jul 3, 2009
Messages
1,443
Best answers
0
Reaction score
76
Location
Lithuania
mayby latter... i hope somebody will post screens and test it self...
 

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,894
Best answers
4
Reaction score
817
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:

Perun

nems.online
Premium User
Joined
May 1, 2009
Messages
294
Best answers
5
Reaction score
116
Gratz ;p this no Funny, this Noob's :(
 

Rachaw

Experienced Member
Joined
Oct 17, 2009
Messages
602
Best answers
0
Reaction score
1
Location
Tha Sweden
lol i dont get it a normal rune but with not 3 effects? wtf, Make like fire and poisen on same time or something.
 

Rachaw

Experienced Member
Joined
Oct 17, 2009
Messages
602
Best answers
0
Reaction score
1
Location
Tha Sweden
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.
 
Top