SlayingWorld
Active Member
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.
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:
But i dont understand this part :
What is the "lower()" doing and the "~=" doing in here?
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
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