• 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.2 Bosses Teleport problem

undead mage

Active Member
Joined
Mar 25, 2012
Messages
364
Solutions
2
Reaction score
47
Location
Amsterdam
So im using the scripts for both Yalahar quest and Inquisition quest from https://github.com/orts/server
but at yalahar quest when I kill Azerus he doesn't spawn a teleport and at inquisition when like Ushuriel gets killed no message appears like "you have 3 minutes to enter the teleport" and if you enter the teleport it doesn't teleport you to the crystal cave but it just teleports you back. Im pretty sure that I configured everything right. Does anyone know what the problem could be?
Im using tfs 1.2 and these are the scripts

data/creaturescripts/creaturescripts.xml
Code:
    <event type="kill" name="ServiceOfYalaharAzerus" script="quests/yalahar/AzerusKill.lua" />

data/creaturescripts/scripts/quests/yalahar/AzerusKill.lua
Code:
local teleportToPosition = Position(1070, 735, 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 or 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(1066, 735, 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

data/creaturescripts/creaturescripts.xml
Code:
    <event type="kill" name="InquisitionBosses" script="quests/inquisition/inquisitionQuestBosses.lua" />

data/creaturescripts/scripts/quests/inquisition/inquisitionQuestBosses.lua
Code:
local bosses = {
    ['ushuriel'] = 200,
    ['zugurosh'] = 201,
    ['madareth'] = 202,
    ['latrivan'] = 203,
    ['golgordan'] = 203,
    ['annihilon'] = 204,
    ['hellgorak'] = 205
}

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

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

    local newValue = 2
    if targetName == 'latrivan' or targetName == 'golgordan' then
        newValue = math.max(0, Game.getStorageValue(bossStorage)) + 1
    end
    Game.setStorageValue(bossStorage, newValue)

    if newValue == 2 then
        player:say('You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room.', TALKTYPE_MONSTER_SAY)
        addEvent(Game.setStorageValue, 3 * 60 * 1000, bossStorage, 0)
    end
    return true
end
 
Last edited:
So im using the scripts for both Yalahar quest and Inquisition quest from https://github.com/orts/server
but at yalahar quest when I kill Azerus he doesn't spawn a teleport and at inquisition when like Ushuriel gets killed no message appears like "you have 3 minutes to enter the teleport" and if you enter the teleport it doesn't teleport you to the crystal cave but it just teleports you back. Im pretty sure that I configured everything right. Does anyone know what the problem could be?
Im using tfs 1.2 and these are the scripts

data/creaturescripts/creaturescripts.xml
Code:
    <event type="kill" name="ServiceOfYalaharAzerus" script="quests/yalahar/AzerusKill.lua" />

data/creaturescripts/scripts/quests/yalahar/AzerusKill.lua
Code:
local teleportToPosition = Position(1070, 735, 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 or 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(1066, 735, 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

data/creaturescripts/creaturescripts.xml
Code:
    <event type="kill" name="InquisitionBosses" script="quests/inquisition/inquisitionQuestBosses.lua" />

data/creaturescripts/scripts/quests/inquisition/inquisitionQuestBosses.lua
Code:
local bosses = {
    ['ushuriel'] = 200,
    ['zugurosh'] = 201,
    ['madareth'] = 202,
    ['latrivan'] = 203,
    ['golgordan'] = 203,
    ['annihilon'] = 204,
    ['hellgorak'] = 205
}

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

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

    local newValue = 2
    if targetName == 'latrivan' or targetName == 'golgordan' then
        newValue = math.max(0, Game.getStorageValue(bossStorage)) + 1
    end
    Game.setStorageValue(bossStorage, newValue)

    if newValue == 2 then
        player:say('You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room.', TALKTYPE_MONSTER_SAY)
        addEvent(Game.setStorageValue, 3 * 60 * 1000, bossStorage, 0)
    end
    return true
end
the message doesn't work because you're getting monster object from target, and monster has no method called say
you need to put target:say instead of targetMonster
also instead of creating item, checking if it's a teleport, then setting destination is useless when you have doCreateTeleport(itemid, topos, createpos)
 
the message doesn't work because you're getting monster object from target, and monster has no method called say
you need to put target:say instead of targetMonster
also instead of creating item, checking if it's a teleport, then setting destination is useless when you have doCreateTeleport(itemid, topos, createpos)
If I change targetMonster to target:say im getting this error
[Warning - Event::CheckScript] Can not load script: scripts/quests/inquisition/inquisitionQuestBosses.lua
...ts/scripts.quests/inquisition/inquisitionQuestBosses.lua:12: unexpected symbol near ':'

this script is from the official tfs 1.2 shouldn't it be working?
 
If I change targetMonster to target:say im getting this error


this script is from the official tfs 1.2 shouldn't it be working?
orts isnt official tfs ????????????????????????????????????????
official tfs is on otland github lol.

also i was talking about targetmonster in azerus script not inquisitionquestbosses
 
Back
Top