• 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 Heal Monsters

flaviiojr

Active Member
Joined
Jan 20, 2017
Messages
230
Solutions
13
Reaction score
39
When using "creature" just heal my summon, if you use "0", heal all the creatures around... How do I heal all the creatures around, showing that it was that sacred tree that healed them?

A sacred tree healed strong demon for 6 hitpoints. "This happens when used "creature""
An orc warlord was healed for 9 hitpoints. "This happens when used "0""

TFS 1.3

Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0);
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onCastSpell(creature, var)
    local spectators, spectator = Game.getSpectators(creature:getPosition(), false, false, 1, 1, 1, 1)
    for i = 1, #spectators do
        spectator = spectators[i]
        if spectator:isMonster() and spectator:getName():lower() ~= 'sacred tree' then
            doTargetCombatHealth(creature, spectator, COMBAT_HEALING, 5, 10, CONST_ME_NONE)
        end
    end
    return combat:execute(creature, var)
end
 
Back
Top