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

[Request] Teleport when boss/monster dies.

agel

New Member
Joined
Jul 21, 2009
Messages
49
Reaction score
0
Please, please. Do not tell me to search. I have - believe it or not - searched for this script, for hours. Both here and on Otfans.
There has been some half working piece of codes, or codes edited to work only for The Inquisition quest. Nothing that has actually worked though.

So please. Could anyone post a script, which - when a monster/boss dies, creates a teleport at X square meter. For a couple of seconds.
I'd appreciate it extremely much.

Also; I'm using TFS 0.3.4PL2.

Thanks /agel
 
Maybe I'm too late, but I've found this thread today.
I am using the TFS Crying Damson 8.5.

creaturescript/scripts/createTeleport.lua :
Code:
function onKill(cid, target)

local function onRemoveTeleport(tele)
doRemoveItem(getThingfromPos(teleSquare[value]).uid, 1)
end

--------------------config---------------------
bossMonster = {"orshabaal", "ghazbaran", "ferumbras"}
teleSquare = {
{x=1205, y=1051, z=7, stackpos=1}, 
{x=1000, y=1000, z=7, stackpos=1}, 
{x=1173, y=1061, z=7, stackpos=1}
             }
telePos = {{x=1207, y=1047, z=7},{x=999, y=1001, z=7}, {x=1173, y=1065, z=7}}
teleRemove = 10000
teleInfo = "A portal has been opened for " .. teleRemove / 1000 .. " seconds. Hurry up."
tpID = 5023
-------------------configEnd---------------------

if isPlayer(cid) == TRUE then
  if string.lower(getCreatureName(target)) == bossMonster[1] then
  value = 1
  elseif string.lower(getCreatureName(target)) == bossMonster[2] then
  value = 2
  elseif string.lower(getCreatureName(target)) == bossMonster[3] then
  value = 3     
  else
  return TRUE
  end 
    for i = 1, 31 do
    local fields = {1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473}
    if getThingfromPos(teleSquare[value]).itemid == fields[i] then
    doRemoveItem(getThingfromPos(teleSquare[value]).uid, 1)
    end  
doCreateTeleport(tpID, telePos[value], teleSquare[value])
doPlayerSendTextMessage(cid,22, teleInfo)
addEvent(onRemoveTeleport, teleRemove, {tele = tele, value = value})
end
end
return TRUE
end

then go to creaturescripts/scripts/login.lua and add this line next to the other registerCreatureEvent :
Code:
    registerCreatureEvent(cid, "createTeleport")

finally open your creaturescripts.xml and add this one :
Code:
<event type="kill" name="createTeleport" event="script" value="createTeleport.lua"/>

How to edit it :
you should only edit the config
PHP:
--------------------config---------------------
bossMonster = {"orshabaal", "ghazbaran", "ferumbras"}
teleSquare = {
{x=xxx, y=yyy, z=z, stackpos=stack}, 
{x=xxx, y=yyy, z=z, stackpos=stack}, 
{x=xx, y=yyy, z=z, stackpos=stack}
             }
telePos = {{x=1207, y=1047, z=7},{x=999, y=1001, z=7}, {x=1173, y=1065, z=7}}
teleRemove = 10000
teleInfo = "A portal has been opened for " .. teleRemove / 1000 .. " seconds. Hurry up."
tpID = 5023
-------------------configEnd---------------------
bossMonster = add all boss Monster that should have this special effect
teleSquare = write the coords where the tp should be created (NOTE: it MUST be in the same order than the bossMonster table) that means if your bossMonster table looks like this : bossMonster = {a, b, c} then your teleSquare table should like like this : {a-tp cords, b-tp cords, c-tp cords}
telePos = write the cords where you want to get tpd while steping into the TP. (NOTE: and again it MUST have the same order!)
teleRemove = the time in ms how long the tp stays 10000 = 10sec its like time in sec * 1000
the teleInfo sends a message to the player how long the tp will stay
tpID = the itemid of the magic forcefield (Don't edit it if you don't want errors or sth.)

Code:
    for i = 1, 31 do
    local fields = {1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473}

this table contains all items (fields) that get deleted if they're on the newTP pos. if you want to add an item you must also add +1 one line up, (for i = 1, 31+1 (32))

NOTE: check the newTP square in your mapeditor for its stackpos
if your not that good in lua you shouldn't edit the stackpos. then the tp MUST spawn at a swaure with 0 borders, items just a ground.

If a player stands on the TPsquare he has to walk up and down to get teleporter and if theres an item on that Square you should just ignore it and walk into the square, since the TP spawns UNDER items and fields.

sorry for my english today, but I am drunken and busy
I hope this script helps you
Credits 100% to me

~Daron
 
Last edited:
Back
Top