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

Helpp Spell Mass Healing

Lokizs

New Member
Joined
Sep 21, 2013
Messages
16
Reaction score
3
I need a script to spell mass healing (exura gran mas res) not heale monsters, ie, one that only heale players.
I use tfs 1.0!

Help please!!!
 
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_PARALYZE)

local area = createCombatArea(AREA_CIRCLE3X3)
combat:setArea(area)

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

    if not Player(target) then
        return true
    end
  
    doTargetCombatHealth(0, target, COMBAT_HEALING, min, max, CONST_ME_NONE)
    return true
end

combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onCastSpell(creature, var)
    return combat:execute(creature, var)
end
 
@Ninja just a question, should not it return false in "not player" case? xD I'm still trying to understand Lua =P

I think the return true in that case is just confirming that the target is not a player.
Check if someones age is lower than 7:
Code:
if age < 7 then
    return true (it is below 7)
else
    return false (its greater than 7)
so its the same with the player, if is not player then return true and then ends so nothing happens


but better wait @Ninja , im not even sure that this is the reason haha
he will explain it better for sure!
 
Last edited:
Here it doesn't really matter, with false it will still do the same thing.
But for example if you let function onCastSpell return false, then it won't execute the spell, as in it won't cost mana, you won't see the words and you have no exhaustion.
So this can be used to cancel the spell (it will still do the script part till return false).
It kind of depens what false and true does, same goes for lua made functions. You can let something return true, then while using the function check if it's true.
 
Last edited:
Back
Top