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

TFS 1.X+ kill boss reward addon/mount

jel

Member
Joined
Mar 22, 2014
Messages
302
Reaction score
12
hi, could someone give me a script when defeating a boss to win an addon or mount, the winner will be the player who gives the last hit on the boss, obtaining the random reward, being able to obtain random addon or random mount.
thanks

tfs 1.3
 
LUA:
local mounts = {35,50,15,25}
local outfitsmale = {725, 633, 610}
local outfitsfemale = {746, 620, 759}
function onKill(player, target)
     local monster = target:getName():lower()
     local mount = mounts[math.random(#mounts)]
     if target:isPlayer() or not monster or target:getMaster() then
         return true
     end
     if monster == 'terrorsleep' then -- monsterName
        if not player:hasMount(mount) then
            player:addMount(mount)
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already own the mount you were going to be awarded with')
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
     return true
end
 
LUA:
local mounts = {35,50,15,25}
local outfitsmale = {725, 633, 610}
local outfitsfemale = {746, 620, 759}
function onKill(player, target)
     local monster = target:getName():lower()
     local mount = mounts[math.random(#mounts)]
     if target:isPlayer() or not monster or target:getMaster() then
         return true
     end
     if monster == 'terrorsleep' then -- monsterName
        if not player:hasMount(mount) then
            player:addMount(mount)
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already own the mount you were going to be awarded with')
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
     return true
end
will you get outfits also when killing the boss?
 
how would it look to get outfit
outfits males and females and mounts are adjustable through config in the top
LUA:
local mounts = {35,50,15,25}
local outfitsmale = {725, 633, 610}
local outfitsfemale = {746, 620, 759}
function onKill(player, target)
     local monster = target:getName():lower()
     local mount = mounts[math.random(#mounts)]
     if target:isPlayer() or not monster or target:getMaster() then
         return true
     end
     if monster == 'terrorsleep' then -- monsterName
        if not player:hasMount(mount) then
            player:addMount(mount)
        end
        local outfitmale = outfitsmale[math.random(#outfitsmale)]
        local outfitfemale = outfitsfemale[math.random(#outfitsfemale)]
            if(player:getSex(cid) == 1) then
                if not player:hasOutfit(outfitmale) then
                    player:addOutfit(outfitmale)
                    player:addOutfitAddon(outfitmale)
                    else
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'you already own this outfit')
                end
            elseif(player:getSex(cid) == 0) then
                if not player:hasOutfit(outfitfemale) then
                    player:addOutfit(outfitfemale)
                    player:addOutfitAddon(outfitfemale)
                    else
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'you already own this outfit')
                end
            end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already own the mount you were going to be awarded with')
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
     return true
end
 
outfits males and females and mounts are adjustable through config in the top
LUA:
local mounts = {35,50,15,25}
local outfitsmale = {725, 633, 610}
local outfitsfemale = {746, 620, 759}
function onKill(player, target)
     local monster = target:getName():lower()
     local mount = mounts[math.random(#mounts)]
     if target:isPlayer() or not monster or target:getMaster() then
         return true
     end
     if monster == 'terrorsleep' then -- monsterName
        if not player:hasMount(mount) then
            player:addMount(mount)
        end
        local outfitmale = outfitsmale[math.random(#outfitsmale)]
        local outfitfemale = outfitsfemale[math.random(#outfitsfemale)]
            if(player:getSex(cid) == 1) then
                if not player:hasOutfit(outfitmale) then
                    player:addOutfit(outfitmale)
                    player:addOutfitAddon(outfitmale)
                    else
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'you already own this outfit')
                end
            elseif(player:getSex(cid) == 0) then
                if not player:hasOutfit(outfitfemale) then
                    player:addOutfit(outfitfemale)
                    player:addOutfitAddon(outfitfemale)
                    else
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'you already own this outfit')
                end
            end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already own the mount you were going to be awarded with')
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
     return true
end
is winning by killing the wrong monster

11:57 You already own the mount you were going to be awarded with
11:57 Loot of an elf arcanist: an elven astral observer, an elvish talisman, a health potion, bread, a melon, a green tunic, an inkwell, a blank rune, 46 gold coins, a scroll
 

Similar threads

Back
Top