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

Spell/Rune

Exura ATS

New Member
Joined
Feb 5, 2017
Messages
72
Reaction score
4
Hi again!

I want to make UH Rune remove any negative effect (electrify, curse, burned, etc.)

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_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
   return doCombat(cid, combat, var)
end  function onCastSpell(cid, var)
if getCreatureCondition(cid,CONDITION_PARALYZE) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
return doCombat(cid, combat, var)
end
 
Last edited by a moderator:
Solution
@Xeraphus
Like this?:


Still not working... ):
no, and please learn how to use code tags not quotes
How to display CODE properly in your post

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_TARGETCASTERORTOPMOST, true)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
    local conditions = {CONDITION_FIRE, CONDITION_PARALYZE, CONDITION_PHYSICAL, CONDITION_CURSED, CONDITION_ENERGY, CONDITION_POISON}
    for i = 1, #conditions do
        if getCreatureCondition(cid...
Once again, its simple, open exana pox spells or whatever effect you're looking for and look for this part

Lua:
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_XXXXXXXXXXXX)

where XXXXXXXXXXX is the effect you want to remove then make a new line for each effect
 
Once again, its simple, open exana pox spells or whatever effect you're looking for and look for this part

Lua:
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_XXXXXXXXXXXX)

where XXXXXXXXXXX is the effect you want to remove then make a new line for each effect

Sorry, I'm "newbie"...
Can you take a look on my script and tell me if something is wrong?

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)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PHYSICAL)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_FIRE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_CURSED)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_ENERGY)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_POISON)

setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end function onCastSpell(cid, var)
if getCreatureCondition(cid,CONDITION_PARALYZE) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
return doCombat(cid, combat, var)
end
 
It's not removing any negative effect:

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)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PHYSICAL)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_FIRE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_CURSED)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_ENERGY)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_POISON)

setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

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

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

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

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

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

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

function onCastSpell(cid, var)
if getCreatureCondition(cid,CONDITION_POISON) then
doRemoveCondition(cid, CONDITION_POISON)
end
return doCombat(cid, combat, var)
end
 
What tfs version are you using?

About your script, try like this:

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_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PHYSICAL)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_FIRE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_CURSED)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_ENERGY)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_POISON)

setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
It's not removing any negative effect:
you're reassigning the function different values, only the last one would work
here:
remove this
Lua:
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PHYSICAL)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_FIRE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_CURSED)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_ENERGY)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_POISON)

use this for onCastSpell instead:
Lua:
local conditions = {CONDITION_FIRE, CONDITION_PARALYZE, CONDITION_PHYSICAL, CONDITION_CURSED, CONDITION_ENERGY, CONDITION_POISON}

function onCastSpell(cid, var)
    for i = 1, #conditions do
        if getCreatureCondition(cid, conditions[i]) then
            doRemoveCondition(cid, conditions[i])
        end
    end
    return doCombat(cid, combat, var)
end
 
@Xeraphus
Like this?:
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)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
local conditions = {CONDITION_FIRE, CONDITION_PARALYZE, CONDITION_PHYSICAL, CONDITION_CURSED, CONDITION_ENERGY, CONDITION_POISON}
function onCastSpell(cid, var)
for i = 1, #conditions do
if getCreatureCondition(cid, conditions) then
doRemoveCondition(cid, conditions)
end
end
return doCombat(cid, combat, var)
end
return doCombat(cid, combat, var)
end

Still not working... ):
 
Last edited:
@Xeraphus
Like this?:


Still not working... ):
no, and please learn how to use code tags not quotes
How to display CODE properly in your post

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_TARGETCASTERORTOPMOST, true)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
    local conditions = {CONDITION_FIRE, CONDITION_PARALYZE, CONDITION_PHYSICAL, CONDITION_CURSED, CONDITION_ENERGY, CONDITION_POISON}
    for i = 1, #conditions do
        if getCreatureCondition(cid, conditions[i]) then
            doRemoveCondition(cid, conditions[i])
        end
    end
    return doCombat(cid, combat, var)
end
 
Solution
no, and please learn how to use code tags not quotes
How to display CODE properly in your post

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_TARGETCASTERORTOPMOST, true)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
    local conditions = {CONDITION_FIRE, CONDITION_PARALYZE, CONDITION_PHYSICAL, CONDITION_CURSED, CONDITION_ENERGY, CONDITION_POISON}
    for i = 1, #conditions do
        if getCreatureCondition(cid, conditions[i]) then
            doRemoveCondition(cid, conditions[i])
        end
    end
    return doCombat(cid, combat, var)
end

Thank you!
 
Back
Top