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

Solved Game not creating teleport after boss is killed.

SlayingWorld

Active Member
Joined
Jan 23, 2014
Messages
156
Reaction score
37
Location
USA
Okay so i added the yalahar quest to my ot. Just the final mission part, i got it off the ORTS for TFS1.2
I am currently using the latest TFS 1.2 But im having problems with this part of the script.
Code:
local teleportToPosition = Position(757, 127, 14)

local function removeTeleport(position)
    local teleportItem = Tile(position):getItemById(1387)
    if teleportItem then
        teleportItem:remove()
        position:sendMagicEffect(CONST_ME_POFF)
    end
end

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

    if targetMonster:getName():lower() ~= 'azerus' then
        return true
    end
    local position = targetMonster:getPosition()
    position:sendMagicEffect(CONST_ME_TELEPORT)
    local item = Game.createItem(1387, 1, position)
    if item:isTeleport() then
        item:setDestination(teleportToPosition)
    end
    targetMonster:say('Azerus ran into teleporter! It will disappear in 2 minutes. Enter it!', TALKTYPE_MONSTER_SAY, 0, 0, position)

    --remove portal after 2 min
    addEvent(removeTeleport, 2 * 60 * 1000, position)

    --clean arena of monsters
    local spectators, spectator = Game.getSpectators(Position(759, 127, 10), false, false, 10, 10, 10, 10)
    for i = 1, #spectators do
        spectator = spectators[i]
        if spectator:isMonster() then
            spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
        end
    end
    return true
end
The rest of the parts are working as intented, i go inside the room, click on the aparatus and strong azerus is summoned to the room. After some time he is removed and replaced with weak azerus, but once i kill the weak azerus nothing happens. Not even the text "Azerus ran into teleporter! It will disappear in 2 minutes. Enter it!" So there has to be a problem starting from that text going up.


I understand that this part of the script is used to determine if the target is a monster:
Code:
local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

But i dont understand this part :
Code:
if targetMonster:getName():lower() ~= 'azerus' then
        return true
    end
What is the "lower()" doing and the "~=" doing in here?
 
I've also tried using this, but still getting nothing once i kill azerus.
Code:
local teleportToPosition = Position(757, 127, 14)

local function removeTeleport(position)
    local teleportItem = Tile(position):getItemById(1387)
    if teleportItem then
        teleportItem:remove()
        position:sendMagicEffect(CONST_ME_POFF)
    end
end

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

    if targetMonster:getName():lower() == 'azerus' then
    local position = targetMonster:getPosition()
    position:sendMagicEffect(CONST_ME_TELEPORT)
    local item = Game.createItem(1387, 1, position)
    if item:isTeleport() then
        item:setDestination(teleportToPosition)
    end
    targetMonster:say('Azerus ran into teleporter! It will disappear in 2 minutes. Enter it!', TALKTYPE_MONSTER_SAY, 0, 0, position)

    --remove portal after 2 min
    addEvent(removeTeleport, 2 * 60 * 1000, position)

    --clean arena of monsters
    local spectators, spectator = Game.getSpectators(Position(759, 127, 10), false, false, 10, 10, 10, 10)
    for i = 1, #spectators do
        spectator = spectators[i]
        if spectator:isMonster() then
            spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
        end
    end
    end
    return true
end
 
Code:
local events = {
    'SvargrondArenaKill',
    'InquisitionBosses',
    'PlayerDeath',
    'DropLoot',
    'modalAD',
    'modalMD',
    'fire_event',
    'Tasks'
}


:oops::oops::oops: Well shit, what a dumb mistake of mine, you dont know how stupid i feel now cause i was hopping on this for like 1-2 hours already editing/testing/editing/testing oh gawd
 
Code:
local events = {
    'SvargrondArenaKill',
    'InquisitionBosses',
    'PlayerDeath',
    'DropLoot',
    'modalAD',
    'modalMD',
    'fire_event',
    'Tasks'
}


:oops::oops::oops: Well shit, what a dumb mistake of mine, you dont know how stupid i feel now cause i was hopping on this for like 1-2 hours already editing/testing/editing/testing oh gawd
is funny when u realize that u r not stupid anymore :)
 
Back
Top