Hello this is a simple script made by me... =D
When you kill a Boss a teleport is created, 3 minutes later the teleport disappear.
Here is.. (Change the positions of agreement to your map)
.data/creaturescripts/scripts/teleport_creaturename.lua
in "if creaturename == 'creaturename' then" set the Monster name..
Example...
Warning!
In the function "removeTeleport" don't use the abbreviations (in_pos, checkIID and tpID). If you use them then the script will not work
In... .data/creaturescripts/scripts/login.lua
Add under onLogin...
example...
Add in .data/creaturescripts/creaturescripts.xml
Add in .data/monsters/creaturename.xml
under.. </flags>
For Example.. .data/monsters/Latrivan.xml
Enjoy it!
When you kill a Boss a teleport is created, 3 minutes later the teleport disappear.
Here is.. (Change the positions of agreement to your map)
.data/creaturescripts/scripts/teleport_creaturename.lua
Code:
[B]--- Created by Darkhaos
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "ushurielTeleport")
local creaturename = getCreatureName(cid)
local in_pos = {[COLOR="Red"]x[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]859[/COLOR], [COLOR="Red"]y[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]837[/COLOR], [COLOR="Red"]z[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]6[/COLOR], [COLOR="Red"]stackpos[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]2[/COLOR]}
local checkIID = getThingfromPos(in_pos)
local to_pos = {[COLOR="Red"]x[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]588[/COLOR], [COLOR="Red"]y[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]1086[/COLOR], [COLOR="Red"]z[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]7[/COLOR], [COLOR="Red"]stackpos[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]1[/COLOR]}
local time_to_pass = [COLOR="Orange"]180[/COLOR] -- in seconds
local tpID = [COLOR="Orange"]1387[/COLOR]
if creaturename == '[COLOR="Blue"]creaturename[/COLOR]' then
teleport = doCreateTeleport(tpID, to_pos, in_pos)
doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
doCreatureSay(cid, "[COLOR="Orange"]You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear[/COLOR]", TALKTYPE_ORANGE_1)
addEvent([COLOR="DarkGreen"]removeTeleport[/COLOR], (1000*time_to_pass))
end
end
[COLOR="DarkGreen"]function removeTeleport()[/COLOR]
if getThingfromPos({[COLOR="Red"]x[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]859[/COLOR], [COLOR="Red"]y[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]837[/COLOR], [COLOR="Red"]z[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]6[/COLOR], [COLOR="Red"]stackpos[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]1[/COLOR]}).itemid == 1387 then
doRemoveItem(getThingfromPos({[COLOR="Red"]x[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]859[/COLOR], [COLOR="Red"]y[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]837[/COLOR], [COLOR="Red"]z[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]6[/COLOR], [COLOR="Red"]stackpos[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]1[/COLOR]}).uid,1)
doSendMagicEffect({[COLOR="Red"]x[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]859[/COLOR], [COLOR="Red"]y[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]837[/COLOR], [COLOR="Red"]z[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]6[/COLOR], [COLOR="Red"]stackpos[/COLOR][COLOR="DarkGreen"]=[/COLOR][COLOR="Blue"]1[/COLOR]}, [COLOR="Orange"]CONST_ME_POFF[/COLOR])
return TRUE
end
end[/B]
in "if creaturename == 'creaturename' then" set the Monster name..
Example...
Code:
if creaturename == '[COLOR="Blue"]Latrivan[/COLOR]' then
Warning!
In the function "removeTeleport" don't use the abbreviations (in_pos, checkIID and tpID). If you use them then the script will not work
In... .data/creaturescripts/scripts/login.lua
Add under onLogin...
Code:
registerCreatureEvent(cid, "[COLOR="Blue"][B]creaturenameTeleport[/B][/COLOR]")
example...
Code:
registerCreatureEvent(cid, "[COLOR="Blue"][B]ushurielTeleport[/B][/COLOR]")
registerCreatureEvent(cid, "[COLOR="Blue"][B]zuguroshTeleport[/B][/COLOR]")
registerCreatureEvent(cid, "[COLOR="Blue"][B]madarethTeleport[/B][/COLOR]")
Add in .data/creaturescripts/creaturescripts.xml
Code:
<event type="death" name="[COLOR="Blue"][B]creaturenameTeleport[/B][/COLOR]" script="[COLOR="Blue"][B]teleport_creaturename.lua[/B][/COLOR]"/>
Add in .data/monsters/creaturename.xml
under.. </flags>
Code:
<scripts>
<event name="creaturenameTeleport"/>
</script>
For Example.. .data/monsters/Latrivan.xml
Code:
<scripts>
<event name="latrivanTeleport"/>
</script>
Enjoy it!
Last edited: