• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Help with this spells

_Aion_

Nothing Else
Joined
Jan 19, 2010
Messages
401
Solutions
4
Reaction score
10
Location
Jequie,Bahia,Brazil
@Limos @Printer Someone can help me?
I made this script for heal per stages in percent.
But don't works :(
you can fix and tell why are the error?
Code:
local combat = createCombatObject()
--setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

local config = {
stage1 = 100000000,
stage2 = 200000000,
stage3 = 300000000,
stage4 = 600000000,
stage5 = 1000000000,
stage6 = 2000000000,
stage7 = 3000000000,

------Porcetagem dos stages-------
percent1 = 6.0,  --60%
percent2 = 5.0, --50%
percent3 = 4.0, --40%
percent4 = 3.0, --30%
percent5 = 1.5,  --15%
percent6 = 1.0,  --10%
percent7 = 0.7  --7%
} 
 

function onCastSpell(cid, var)
if not isPlayer(cid) then return true end
if getCreatureMaxHealth(cid) <= config.stage1 then
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) / 100) * config.percent1)
elseif getCreatureMaxHealth(cid) >= config.stage2 and getCreatureMaxHealth(cid) < config.stage3 then
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) / 100) * config.percent2)
elseif getCreatureMaxHealth(cid) >= config.stage3 and getCreatureMaxHealth(cid) < config.stage4 then
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) / 100) * config.percent3)
elseif getCreatureMaxHealth(cid) >= config.stage4 and getCreatureMaxHealth(cid) < config.stage5 then
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) / 100) * config.percent4)
elseif getCreatureMaxHealth(cid) >= config.stage5 and getCreatureMaxHealth(cid) < config.stage6 then
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) / 100) * config.percent5)
elseif getCreatureMaxHealth(cid) >= config.stage6 and getCreatureMaxHealth(cid) < config.stage7 then
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) / 100) * config.percent6)
elseif getCreatureMaxHealth(cid) >= config.stage7 then
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) / 100) * config.percent7) 
   return doCombat(cid, combat, var)
end

And when i use this spells, i take batle o_O
Healing give batle is tense
 
Last edited:
The problem is on script, because last works and dont give batle, after i remade script, and put stages.
gives this error and dont works perfecly.
Sorry my bad english.
Code:
<instant name="Light Healing" words="exura" lvl="9" mana="25" aggressive="0" selftarget="1" exhaustion="3000" needlearn="0" script="Healing/light healing.lua">
     <vocation name="Sorcerer" />
     <vocation name="Druid" />
     <vocation name="Paladin" />
     <vocation name="Knight" />
     <vocation name="Master Sorcerer" />
     <vocation name="Elder Druid" />
     <vocation name="Royal Paladin" />
     <vocation name="Elite Knight" />
     <vocation id="9"/>
     <vocation id="10"/>
     <vocation id="11"/>
     <vocation id="12"/>
   </instant>
 
Back
Top