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

Monster die become portal

Kisskotte

New Member
Joined
May 26, 2008
Messages
60
Reaction score
1
Hello!

Have an ide to make when a monster die he become a portal that you can use ? is it posible to make this happend?
 
I going to Work in the creature "Ferumbras"


Place This Extra Code In Your Creature (the monster that must die to become portal):

After:
Code:
  </flags>
Place:
Code:
        <script>
      <event name="Hiportal"/>
      </script>

Now in Creaturescripts.xml Add:
Code:
<event type="death" name="Hiportal" script="Portal.lua"/>

In the scripts create the file named Portal.lua and save this code on it:
Code:
function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "Hiportal")
	local creaturename = getCreatureName(cid)
--- Position of the Created Portal
	local FerIn    = {x=1275, y=404, z=9, stackpos=1} 
--- Destination of the Portal
	local FerTo    = {x=1310, y=430, z=9, stackpos=1}


	local TicToc     = 120 -- en segundos
	local tpID       = 1387
	local doEffect   = CONST_ME_TELEPORT
    local Puf        = CONST_ME_POFF
	local message    = "You Have 2 Minutes to Pass in the Teleport!!!"

	if creaturename == 'Ferumbras' then
			teleport = doCreateTeleport(tpID, FerTo, FerIn)
			doSendMagicEffect(FerIn, doEffect)
			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
			addEvent(byeTP,(1000*TicToc),FerIn,tpID,Puf)
	end 
end
function byeTP(FerIn,tpID,Puf)
	 if getThingfromPos(FerIn).itemid == tpID then
	    doRemoveItem(getThingfromPos(FerIn).uid,1)
	    doSendMagicEffect(FerIn, Puf)
	    return TRUE
	 end
end


Finally you must change the creature and the coordinates
 
I going to Work in the creature "Ferumbras"


Place This Extra Code In Your Creature (the monster that must die to become portal):

After:
Code:
  </flags>
Place:
Code:
        <script>
      <event name="Hiportal"/>
      </script>

Now in Creaturescripts.xml Add:
Code:
<event type="death" name="Hiportal" script="Portal.lua"/>

In the scripts create the file named Portal.lua and save this code on it:
Code:
function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "Hiportal")
	local creaturename = getCreatureName(cid)
--- Position of the Created Portal
	local FerIn    = {x=1275, y=404, z=9, stackpos=1} 
--- Destination of the Portal
	local FerTo    = {x=1310, y=430, z=9, stackpos=1}


	local TicToc     = 120 -- en segundos
	local tpID       = 1387
	local doEffect   = CONST_ME_TELEPORT
    local Puf        = CONST_ME_POFF
	local message    = "You Have 2 Minutes to Pass in the Teleport!!!"

	if creaturename == 'Ferumbras' then
			teleport = doCreateTeleport(tpID, FerTo, FerIn)
			doSendMagicEffect(FerIn, doEffect)
			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
			addEvent(byeTP,(1000*TicToc),FerIn,tpID,Puf)
	end 
end
function byeTP(FerIn,tpID,Puf)
	 if getThingfromPos(FerIn).itemid == tpID then
	    doRemoveItem(getThingfromPos(FerIn).uid,1)
	    doSendMagicEffect(FerIn, Puf)
	    return TRUE
	 end
end


Finally you must change the creature and the coordinates

Worked FANTASTIC thank you so much have tryied to make this work for weeks and now you come like a angel and make it work Thank you Big love and rep++!
 
Back
Top