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

TFS 0.X spell that use health to cure mana

zabuzo

Well-Known Member
Joined
Jun 10, 2016
Messages
238
Reaction score
54
I want to create a spell that uses health to regen some mana

I tried it:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onGetFormulaValues(cid, level, maglevel)
    min = 200
    max = 300
    return min, max
end

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


But didn't work as i want...
I want to cure 200-300 mana
But removes 150-300 health...

What i'm doing wrong?
 
Change the function:
Lua:
doCreatureAddHealth(cid, -(currentMaxHp * (config.removeHealth / 100)))
For:
Lua:
doCreatureAddHealth(cid, -(currentMaxHp * (config.removeHealth / 100)), 255, 0, true)

it did not work:
0 mana to 60 mana (my mana limit is: 1565)
hp 440 to 354

:(
 
Back
Top