• 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 1.X+ Mass Healing effect and heal target in area instead of area effect

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,837
Solutions
18
Reaction score
615
Location
Poland
Hello there!
Anyone know how I can do Mass Healing Spell (exura gran mas res) checks area and if player/players are inside the area of healing, caster heals the target and effect only show on player not on whole area like in old exura gran mas res?

Anyone can prompt? :(
 
Can you post your exura gran mas res code?
I'm not familiar with TFS but this doesn't sound hard to do
 
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))

local healMonsters = false

function onTargetCreature(creature, target)
    local player = creature:getPlayer()
    local min = (player:getLevel() / 5) + (player:getMagicLevel() * 4.6) + 100
    local max = (player:getLevel() / 5) + (player:getMagicLevel() * 9.6) + 125

    if not healMonsters then
        local master = target:getMaster()
        if target:isMonster() and not master or master and master:isMonster() then
            return true
        end
    end

    doTargetCombatHealth(creature:getId(), target, COMBAT_HEALING, min, max, CONST_ME_NONE)
    return true
end

combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

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

But its standard exura gran mas res with effect on all area. Now i want only to check who is inside the area and put effect and heal only on people positions.
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))

local healMonsters = false

function onTargetCreature(creature, target)
    local player = creature:getPlayer()
    local min = (player:getLevel() / 5) + (player:getMagicLevel() * 4.6) + 100
    local max = (player:getLevel() / 5) + (player:getMagicLevel() * 9.6) + 125

    if not healMonsters then
        local master = target:getMaster()
        if target:isMonster() and not master or master and master:isMonster() then
            return true
        end
    end

    target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    doTargetCombatHealth(creature:getId(), target, COMBAT_HEALING, min, max, CONST_ME_NONE)
    return true
end

combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
 
What Mr Trala posted, remove:
Code:
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
and
Code:
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
Those particular lines is the magic effect.

Remember to play around with your scripts, but be sure to make a backup.
Then you can test out what everything does and learn from the experience. :)

EDIT: Don't forget to tag Mr Trala's post as "Best Answer" if you got it to work.
 
Last edited:
Back
Top