wafuboe
Active Member
- Joined
- Dec 24, 2010
- Messages
- 884
- Solutions
- 2
- Reaction score
- 26
hello i got this versperoth script that when it kills it transform its hole into a tp but the tp is not working properly, in this case to give a proper solution i would like to when you kill the miniboss transform the hole into a teleport with action id 25701.
script>
Im using tfs 1.3thanks !
script>
LUA:
local teleportPosition = Position(683, 417, 15)
local function transformTeleport()
local teleportItem = Tile(teleportPosition):getItemById(1387)
if not teleportItem then
return
end
teleportItem:transform(18463)
end
local function clearArena()
local spectators = Game.getSpectators(Position(696, 451, 15), false, false, 15, 15, 15, 15)
local exitPosition = Position(601, 451, 15)
for i = 1, #spectators do
local spectator = spectators[i]
if spectator:isPlayer() then
spectator:teleportTo(exitPosition)
exitPosition:sendMagicEffect(CONST_ME_TELEPORT)
spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You were teleported out by the gnomish emergency device.')
else
spectator:remove()
end
end
end
function onKill(creature, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
if targetMonster:getName():lower() ~= 'versperoth' then
return true
end
Game.setStorageValue(GlobalStorage.Versperoth.Battle, 2)
addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.Versperoth.Battle, 0)
local holeItem = Tile(teleportPosition):getItemById(18462)
if holeItem then
holeItem:transform(1387)
end
--Game.createMonster('abyssador', Position(696, 456, 15))
addEvent(transformTeleport, 30 * 60 * 1000)
addEvent(clearArena, 32 * 60 * 1000)
return true
end