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

Lua Healing spells doesn't remove paralyze.

ferion

New Member
Joined
Mar 2, 2009
Messages
28
Reaction score
0
Hello :)

My healing spells doesn't remove paralyze from monsters. I've searched the forum but I didn't find anything helpfull.

My first thought was that the healing-spell-script didn't contain a remove paralyze function, but it did.

So I'm thinkin that maybe the monsters are using the wrong spell? Is the attack name suppose to be "Speed" or should it be "paralyze"?

Here is the light-healing script:
Code:
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_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid, level, maglevel)
	local min = ((level/5)+(maglevel*1.5))
	local max = ((level/5)+(maglevel*2))
	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

And here is the attack spell monsters use:
Code:
<attack name="speed" interval="2000" chance="18" range="7" speedchange="-600" duration="5000">

I would be so thankful if someone could help me!

//Ferion
 
here is my healing spell (exura vita) and it removes paralyze
Code:
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)

function onGetFormulaValues(cid, level, maglevel)
	local min =  (level * 3 + maglevel * 3) * 1.6 + 120
	local max = (level * 3.2 + maglevel * 3) * 1.7 + 370
	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
if getCreatureCondition(cid,CONDITION_PARALYZE) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
	return doCombat(cid, combat, var)
end

and here is code which i use to add paralyze attack
Code:
 <attack name="paralyze" interval="3000" chance="40" target="1">
 
Well! Reading over the posts I can see something you can try ..
-Make a backup of the current spell you are editing-

Inside

Code:
function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
Add this piece from Hrsha's script. Maybe it will work.


Code:
function onCastSpell(cid, var)
if getCreatureCondition(cid,CONDITION_PARALYZE) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
	return doCombat(cid, combat, var)
end

Now if that doesn't work, or gives you errors, try removing the
Code:
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
This is what I would try in your situation. I have not tested it.
There is no remove paralyze function because there is a doRemoveCondition which covers a wide variety of conditions on the player.
 
This is how my ultimate healing.lua looks like.

Lua:
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_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 4, 4, 8, 10)


function onCastSpell(cid, var)
    if isPlayer(cid) == TRUE then
        if exhaustion.check(cid, 30030) then
            return FALSE
        else
            return doRemoveCondition(cid, CONDITION_PARALYZE), doCombat(cid, combat, var)
        end
    else
        return doRemoveCondition(cid, CONDITION_PARALYZE), doCombat(cid, combat, var)
    end
end
 
function onCastSpell(cid, var)
if getCreatureCondition(cid,CONDITION_PARALYZE) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
return doCombat(cid, combat, var)
end

That one worked! Thank you very much :)
 
Back
Top