• 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 Manrune problem

jeppsonskate

Member
Joined
Apr 3, 2012
Messages
117
Reaction score
18
Location
Sweden
t0j4pd.png


When i use my Manarune i get this Blockingsquare and yellowskull..

Whats the problem??
 

Attachments

Lua:
[I]local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
 
function onGetFormulaValues(cid, level, maglevel)
	local min = 1200 
        local max = 1300
	return doPlayerAddMana(cid, math.random(min, max))
end[/I]
 
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
 
function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

- - - Updated - - -

pls replay if you know how to fix
 
Last edited:
Dont use as a spell, will add exhaust delay too spells. which is bad for pvp etc..
use this in actions
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- 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
 
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local hpmax = getCreatureMaxHealth(cid)
local min = 3200
local max = 4000
local hp_add = math.random((min), (max))
 
	if(hasCondition(cid, CONDITION_EXHAUST)) then
        	doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		return doPlayerSendCancel(cid, "You are exhausted")
	end
    	doCreatureAddHealth(cid, hp_add)
    	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    	doSendAnimatedText(getPlayerPosition(cid),""..hp_add.."", TEXTCOLOR_LIGHTBLUE)
		doAddCondition(cid, exhaust)
    	return true
end

just changed everything about mana to hp same script.
 
Back
Top