Wilson Kaupert
New Member
- Joined
- Aug 23, 2007
- Messages
- 17
- Reaction score
- 1
Just to remember you guys, the stack is 1... does not works with 2 =].
Kaupert, W.
Kaupert, W.
local config = {
message = "Go into the teleport in 60 seconds, else it will disappear.",
timeToRemove = 60, -- seconds
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Hellgorak"] = { { x = 44, y = 94, z = 7 }, { x = 228, y = 141, z = 7, stackpos = 1 } },
["Zugurosh"] = { { x = 206, y = 25, z = 7 }, { x = 195, y = 88, z = 7, stackpos = 1 } },
["Madareth"] = { { x = 339, y = 526, z = 7 }, { x = 344, y = 531, z = 0, stackpos = 1 } },
["Morgaroth"] = { { x = 402, y = 425, z = 4 }, { x = 403, y = 425, z = 4, stackpos = 1 } }
}
}
local function removal(position)
if getThingfromPos(position).itemid == config.teleportId then
doRemoveItem(getThingfromPos(position).uid)
end
return TRUE
end
function onKill(cid, target, lastHit)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(target) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, pos[2])
end
end
return TRUE
end
Im update script from post number 4 to work with TFS 0.3.5
(Credits to Emma Watson ? )
(Now you don't need to add event to monster file, and now it is onKill function!)
Lua:local config = { message = "Go into the teleport in 60 seconds, else it will disappear.", timeToRemove = 60, -- seconds teleportId = 1387, bosses = { -- Monster Name, Teleport To Position, Teleport Position ["hellgorak"] = { { x = 44, y = 94, z = 7 }, { x = 228, y = 141, z = 7, stackpos = 1 } }, ["zugurosh"] = { { x = 206, y = 25, z = 7 }, { x = 195, y = 88, z = 7, stackpos = 1 } }, ["madareth"] = { { x = 339, y = 526, z = 7 }, { x = 344, y = 531, z = 0, stackpos = 1 } }, ["Morgaroth"] = { { x = 402, y = 425, z = 4 }, { x = 403, y = 425, z = 4, stackpos = 1 } } } } local function removal(position) if getThingfromPos(position).itemid == config.teleportId then doRemoveItem(getThingfromPos(position).uid) end return TRUE end function onKill(cid, target, lastHit) local position = getCreaturePosition(cid) for name, pos in pairs(config.bosses) do if name == getCreatureName(target) then teleport = doCreateTeleport(config.teleportId, pos[1], pos[2]) doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1) addEvent(removal, config.timeToRemove * 1000, pos[2]) end end return TRUE end
It isn't working ffs.