• 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 0.X Error exhaust in heal magic script

gabriel28

Member
Joined
Mar 16, 2012
Messages
199
Solutions
6
Reaction score
24
As the title says, when I try to put exaust in heal magic it gets an error on the console. The error starts when I reload the spells. TFS 0.4 rev 3884
I searched on the internet and found a similar problem, which was related to the 'agressive' parameter of the spells. But I tested in Magic Shield, that the 'agressive' parameter is also false as heal, and it worked fine, so I do not think the problem is related to that.

Here is the script:
Lua:
~ normal parameters of a healing magic ~

function onCastSpell(cid, var)
if exhaustion.check(cid, 120021) == false then
        exhaustion.set(cid, 120021, 2)
        doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
    else
        doPlayerSendCancel(cid, "Wait "..exhaustion.get(cid, 120021).." second(s) to use this spell again.")
        return false
    end
    doCombat(cid, combat, var)
     return true
end

Error:
35026

Sorry for my translated english and thanks in advance.
 
Solution
change to this one:

Lua:
function onCastSpell(cid, var)
if exhaustion.check(cid, 120021) == false then
        exhaustion.set(cid, 120021, 2)
        doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
    else
        if isPlayer(cid) then
             doPlayerSendCancel(cid, "Wait "..exhaustion.get(cid, 120021).." second(s) to use this spell again.")
        end
        return false
    end
    doCombat(cid, combat, var)
     return true

end


This is most likely happening because there are monsters using this spell, and monsters cannot receive that exhausted message =)
change to this one:

Lua:
function onCastSpell(cid, var)
if exhaustion.check(cid, 120021) == false then
        exhaustion.set(cid, 120021, 2)
        doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
    else
        if isPlayer(cid) then
             doPlayerSendCancel(cid, "Wait "..exhaustion.get(cid, 120021).." second(s) to use this spell again.")
        end
        return false
    end
    doCombat(cid, combat, var)
     return true

end


This is most likely happening because there are monsters using this spell, and monsters cannot receive that exhausted message =)
 
Solution
Back
Top