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

[Request] Despawning Spell

belal112

Basic Lua scripter
Joined
Dec 20, 2012
Messages
96
Solutions
1
Reaction score
11
Hello people!

I was wondering whether it is possible to make a spell (or, to be specific, a rune) that when you use on a monster, it despawns it (kills it but the monster wouldn't have a corpse or something). And it would be very much in favor if this rune would work only of specific creatures; for example, it would work only on a dragon and if you try using it on any other creature, if would fail.

Any ideas how can I achieve that? I am using TFS 1.3 and Tibia Client 10.98

Thanks for your concerns! :D
 
Solution
Best done in actions
Code:
 <action itemid="RUNEID" script="despawnrune.lua" allowfaruse="1" />
and in despawnrune.lua
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local monsters = {'Dragon Lord','Dragon'}
    if isInArray(monsters,target:getCreatureName()) then
        doRemoveCreature(target)
        position:sendDistanceEffect(fromPosition, 11)
        toPosition:sendMagicEffect(5)
    end
    return true
end
Best done in actions
Code:
 <action itemid="RUNEID" script="despawnrune.lua" allowfaruse="1" />
and in despawnrune.lua
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local monsters = {'Dragon Lord','Dragon'}
    if isInArray(monsters,target:getCreatureName()) then
        doRemoveCreature(target)
        position:sendDistanceEffect(fromPosition, 11)
        toPosition:sendMagicEffect(5)
    end
    return true
end
 
Last edited:
Solution
Back
Top