• Vote in November Mapping Competition to select a winner!
  • 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 Cure all

Vladimir Glebov

http://www.zorgania.com
Joined
Mar 25, 2016
Messages
79
Reaction score
14
Location
Russia
Hello all, how make Stops the all Special Condition Fire, Energy, Mort and etc in one spell on MAS area&

im try it -

Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)

function onCastSpell(creature, var)
    return combat:execute(creature, var)
end

and this
Code:
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

but didnt work, its realy made mass spell for Condition?
 

Codex NG

Recurrent Flamer
Joined
Jul 24, 2015
Messages
2,998
Solutions
12
Reaction score
1,544
Code:
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)
dispel means to get rid of, in this case it means to remove, what is it removing? a condition of poison.

If you want to remove every condition from the player you could create a table of conditions to dispel and then loop through them when you cast the spell.
 

Codex NG

Recurrent Flamer
Joined
Jul 24, 2015
Messages
2,998
Solutions
12
Reaction score
1,544
Can show?
Code:
local conditions = {
    CONDITION_POISON,
    --  add more conditions
}

local combat = {}

for i = 1, #conditions do
    combat[i] = Combat()
    combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    combat[i]:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
    combat[i]:setParameter(COMBAT_PARAM_DISPEL, conditions[i])
end

function dispel(creature var)
    for x = 1, #conditions do
        combat[x]:execute(creature, var)
    end
    return true
end

function onCastSpell(creature, var)
    return dispel(creature var)
end
 

demon088

#088 in the Horde
Joined
Jun 17, 2009
Messages
206
Solutions
3
Reaction score
19
Location
Hell
I'm trying this:

Lua:
local conditions = {
CONDITION_DROWN,
CONDITION_PARALYZE,
CONDITION_CURSED,
CONDITION_POISON,
CONDITION_BLEEDING,
CONDITION_FIRE,
CONDITION_ENERGY
}

local combat = {}

for i = 1, #conditions do
    combat[i] = Combat()
    combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    combat[i]:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
    combat[i]:setParameter(COMBAT_PARAM_DISPEL, conditions[i])
end

function dispel(creature var)
    for x = 1, #conditions do
        combat[x]:execute(creature, var)
    end
    return true
end

function onCastSpell(creature, var)
    return dispel(creature var)
end
Error:

[Warning - Event::checkScript] Can not load script: scripts/healing/cure_all.lua
data/spells/scripts/healing/cure_all.lua:20: ')' expected near 'var'

Spell is not working. I'm using TFS 1.2.
 
Last edited:

demon088

#088 in the Horde
Joined
Jun 17, 2009
Messages
206
Solutions
3
Reaction score
19
Location
Hell
Thanks for your help, haven't noticed the missing , ...
change line 20 to:
Lua:
function dispel(creature, var)
and line 28 to:
Code:
return dispel(creature, var)
TFS 1.2 - The next script is working, removing every listed condition:
Lua:
local conditions = {
CONDITION_DROWN,
CONDITION_PARALYZE,
CONDITION_CURSED,
CONDITION_POISON,
CONDITION_BLEEDING,
CONDITION_FIRE,
CONDITION_ENERGY
}
local combat = {}
for i = 1, #conditions do
    combat[i] = Combat()
    combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    combat[i]:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
    combat[i]:setParameter(COMBAT_PARAM_DISPEL, conditions[i])
end
function dispel(creature, var)
    for x = 1, #conditions do
        combat[x]:execute(creature, var)
    end
    return true
end
function onCastSpell(creature, var)
    return dispel(creature, var)
end
 
Top