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

Error on killing monster svargrond arena

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
Well when i kill a monster inside the arena, on the console it appears a massive bunch of errors, seems like something with the function get monster, but i dont have idea how to solve it, can anyone help?
Im using tfs 1.2
2s1koc1.png

Thanks :)
 
Last edited:
How do we know what are you even using? Without script or anything. Btw. i cant see anything on this screen at all.
 
Im sorry i forgot, there are a lot of errors on like 25+ scripts im going to post some

Code:
local bosses = {
    ['deathstrike'] = {status = 2, storage = Storage.BigfootBurden.Warzone1Reward},
    ['gnomevil'] = {status = 3, storage = Storage.BigfootBurden.Warzone2Reward},
    ['abyssador'] = {status = 4, storage = Storage.BigfootBurden.Warzone3Reward},
}

function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    local bossConfig = bosses[targetMonster:getName():lower()]
    if not bossConfig then
        return true
    end

    for pid, _ in pairs(targetMonster:getDamageMap()) do
        local attackerPlayer = Player(pid)
        if attackerPlayer then
            if attackerPlayer:getStorageValue(Storage.BigfootBurden.WarzoneStatus) < bossConfig.status then
                attackerPlayer:setStorageValue(Storage.BigfootBurden.WarzoneStatus, bossConfig.status)
            end

            attackerPlayer:setStorageValue(bossConfig.storage, 1)
        end
    end
end

Code:
local bossForms = {
    ['snake god essence'] = {
        text = 'IT\'S NOT THAT EASY MORTALS! FEEL THE POWER OF THE GOD!',
        newForm = 'snake thing'
    },
    ['snake thing'] = {
        text = 'NOOO! NOW YOU HERETICS WILL FACE MY GODLY WRATH!',
        newForm = 'lizard abomination'
    },
    ['lizard abomination'] = {
        text = 'YOU ... WILL ... PAY WITH ETERNITY ... OF AGONY!',
        newForm = 'mutated zalamon'
    }
}
function onKill(player, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end
    if targetMonster:getName():lower() == 'mutated zalamon' then
        Game.setStorageValue(Storage.WrathoftheEmperor.Mission11, -1)
        return true
    end
    local name = targetMonster:getName():lower()
    local bossConfig  = bossForms[name]
    if not bossConfig then
        return true
    end
    local found = false
    for k, v in ipairs(Game.getSpectators(targetMonster:getPosition())) do
        if v:getName():lower() == bossConfig.newForm then
            found = true
            break
        end
    end
    if not found then
        Game.createMonster(bossConfig.newForm, targetMonster:getPosition(), false, true)
        player:say(bossConfig.text, TALKTYPE_MONSTER_SAY)
    end
    return true
end

Code:
function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return
    end

    local player = creature:getPlayer()
    local pit = player:getStorageValue(Storage.SvargrondArena.Pit)
    if pit < 1 or pit > 10 then
        return
    end

    local arena = player:getStorageValue(Storage.SvargrondArena.Arena)
    if arena < 1 then
        return
    end

    if not table.contains(ARENA[arena].creatures, targetMonster:getName():lower()) then
        return
    end

    -- Remove pillar and create teleport
    local pillarTile = Tile(PITS[pit].pillar)
    if pillarTile then
        local pillarItem = pillarTile:getItemById(SvargrondArena.itemPillar)
        if pillarItem then
            pillarItem:remove()

            local teleportItem = Game.createItem(SvargrondArena.itemTeleport, 1, PITS[pit].tp)
            if teleportItem then
                teleportItem:setActionId(25200)
            end

            SvargrondArena.sendPillarEffect(pit)
        end
    end

    player:setStorageValue(Storage.SvargrondArena.Pit, pit + 1)
    player:say('Victory! Head through the new teleporter into the next room.', TALKTYPE_MONSTER_SAY)
    return true
end
 
Last edited:
I don't understand 1.2 scripting style very well.. but the source has
Code:
monster:isMonster()
as the suggested lua code..
I assume you just need change all of your
Code:
local targetMonster = target:getMonster()
to
Code:
local targetMonster = target:isMonster()

If nothing else, it's worth a try.
I'm sure someone will come along and correct me otherwise. xD


-- edit

Actually, I have no idea. This would only confirm if it IS a monster or not.
Why is that line trying to confirm the monsters creatureid if the "target" should be the creatureid?

zzz, I should've read these scripts more thoroughly before posting
 
Back
Top