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

Rune Exhaust problem..

nystrom

New Member
Joined
Nov 17, 2009
Messages
269
Reaction score
0
hello i have a script that i converted from a ih to a manarune, but the problem is that when some one is using the manarune and then wants to heal right after he/she gets a exhaust on there healing spells.. this makes many of my players mad :p

well this is the script:
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
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 getCombatFormulas(cid, lv, maglv)
	local formula_min = ((lv*2.20 + maglv*3) * 1.0)
	local formula_max = ((lv*2.20 + maglv*3) * 1.0)

	if(formula_max < formula_min) then
		local tmp = formula_max
		formula_max = formula_min
		formula_min = tmp
	end
	return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

does anyone know how i can fix the rune so it dont exuasts with the healing spells? (A)
 
not is your script open data/monsters Monsters.xml
find line you have..
and change for
Lua:
<rune name="Mana Rune" id="2314" allowfaruse="1" charges="5" lvl="1" exhaustion="1500" maglv="45" aggressive="0" needtarget="1" blocktype="solid" script="manarune.lua"/>

edit name script, id and exhaustion
 
this is the one i use:

this is the code that i currently use in my spells.xml:
PHP:
	<rune name="ManaRune" id="2270" allowfaruse="1" charges="1" lvl="8" maglv="0" exhaustion="950" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/manarune.lua"/>

idk but why is this exuasting my players healing spells? =(
 
this is the code that i currently use in my spells.xml:
PHP:
	<rune name="ManaRune" id="2270" allowfaruse="1" charges="1" lvl="8" maglv="0" exhaustion="950" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/manarune.lua"/>

idk but why is this exuasting my players healing spells? =(





try change exhaustion exhaustion="1500" or 1000 as you wish
 
Runes have exhaustion, this also has influence on other runes or spells. Making the exhaustion less will make the mana rune heal faster, but would still exhaust other runes or spells. Best is to use potions for mana gain and make them custom like a mana rune.
 
change
Lua:
<rune name="ManaRune" id="2270" allowfaruse="1" charges="1" lvl="8" maglv="0" exhaustion="950" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/manarune.lua"/>
for
Lua:
<rune name="ManaRune" id="2270" allowfaruse="1" charges="1" lvl="1" exhaustion="1500" maglv="1" aggressive="0" needtarget="1" blocktype="solid" script="healing/manarune.lua"/>
 
change
Lua:
<rune name="ManaRune" id="2270" allowfaruse="1" charges="1" lvl="8" maglv="0" exhaustion="950" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/manarune.lua"/>
for
Lua:
<rune name="ManaRune" id="2270" allowfaruse="1" charges="1" lvl="1" exhaustion="1500" maglv="1" aggressive="0" needtarget="1" blocktype="solid" script="healing/manarune.lua"/>

i have done that now, but it does still exuast with healing spells.. =(
 
In config.lua You will find "timeBetweenActions = 200"

Change 200 to 100 or 50 as you wish and it may work more faster that it now.
Repp++ would be nice if it works.

Regards,
Sacred Anlyest
 
Use an action (onUse)

Lua:
local config = {
	effect = CONST_ME_MAGIC_BLUE,
	text = "Aaaaaah...",
	level = 8,
	extime = 1, --seconds for exhaustion
	exstorage = 40000 --exhaustion storage
	}

local function formula(cid, lv, maglv) 
    local min = ((getPlayerLevel(cid)*2.20 + getPlayerMagicLevel(cid)*3) * 1.0) 
    local max = ((getPlayerLevel(cid)*2.20 + getPlayerMagicLevel(cid)*3) * 1.0) 

    if(max < min) then 
        local tmp = max 
        max = min 
        min = tmp 
    end 
    return min, max 
end

function onUse(cid, item, fromPos, toPos)

	if getPlayerLevel(cid) >= config.level then
	 if exhaustion.get(cid, config.exstorage) == false then
		local mana = math.random(formula(min), formula(max))
		doPlayerAddMana(cid, mana)
		doSendMagicEffect(toPos, config.effect)
		doCreatureSay(cid, config.text)
		exhaustion.set(cid, config.exstorage, config.extime) 
	 else
		return doPlayerSendCancel(cid, "You're exhausted.")
	 end
	else
		return doPlayerSendCancel(cid, "You do not have the required level to use this item.")
	end
return true
end

No clue if that works though, scripted that at work without testing it.

Edit the actions.xml like usual (<action itemid="MANA_RUNE_ID" event="script" value="YOUR_SCRIPT.lua"/>)

The player can use the manarune and a spell at the same time now.

Hope it works ;)
 
Last edited:
Back
Top