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

CreatureEvent Kill Monster & Create Portal

Status
Not open for further replies.
but how about the loot of the boss? if it creates a tp at the corpse, then the players cant get the loot+ :S
 
but how about the loot of the boss? if it creates a tp at the corpse, then the players cant get the loot+ :S

Problem solved. :thumbup:
 
Problem solved. :thumbup:
If the monster dies next to a wall, the teleport might be created on a wall or other blocking object.
Why not add configurable teleport creation pos?
 
You guys expect too much.
But, it can be done, not now though.
 
If the monster dies next to a wall, the teleport might be created on a wall or other blocking object.
Why not add configurable teleport creation pos?

I think I just solved that problem, check the position.x.
Tell me if it will work or not, if you don't mind. :$
 
It wouldn't work, you can't use or like that; because positions.x is always true and getClosestFreeTile would never be triggered.

Even if it would, getClosestFreeTile returns a table with x,y,z .. which means position.x would be set to something like {x=100, y=100, z=7}

Oh, just noticed you made a typo with positions.x
 
the script wouldnt work.. and no error in console either.
 
So. JDB, hows the scripting going? Please optimize this one so that I can use it for my server.
 
i read this whole thread start to finish, i dont think ive seen updated and fixed said so many times :)

atleast your trying to release something
 
I am using another script and its working fine ;p
 
Ok, it does not summon a teleport.

Scripts:

teleports_inquisition.lua

Code:
local bosses = { -- Teleport Takes Player -- Teleport Is Created --
    ["Ushuriel"] = { x=1173, y=1141, z=12 }, { x=1097, y=1214, z=12 },
    ["Zugurosh"] = { x=1126, y=1151, z=12 }, { x=1149, y=1231, z=12 },
    ["Madareth"] = { x=1045, y=1206, z=13 }, { x=1112, y=1240, z=12 },
	["Latrivan"] = { x=1154, y=1195, z=13 }, { x=1147, y=1244, z=12 },
	["Annihilon"] = { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12 },
	["Hellgorak"] = { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12 }
				
}
local time = 30 -- Seconds
function onKill(cid, target, lastHit)
        for name, pos in pairs(bosses) do
                if (name == getCreatureName(target):lower()) then
                        doCreateTeleport(1387, pos, name.pos[2])
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. time .." seconds until the portal will disapear.")
                        addEvent(doRemoveItem, tpTime * 1000, getTileItemById(position, 1387).uid, 1)
                end
        end
        return true
end

login.lua
Code:
	registerCreatureEvent(cid, "monsterPortals")

xml.

Code:
	<event type="kill" name="monsterPortals" event="script" value="Inquisition/teleports_inquisition.lua"/>


So, why does it not make the teleport when i kill ushuriel?
 
Code:
local bosses = { -- Teleport Takes Player -- Teleport Is Created --
	["Ushuriel"] = { x=1173, y=1141, z=12 }, { x=1097, y=1214, z=12 },
	["Zugurosh"] = { x=1126, y=1151, z=12 }, { x=1149, y=1231, z=12 },
	["Madareth"] = { x=1045, y=1206, z=13 }, { x=1112, y=1240, z=12 },
	["Latrivan"] = { x=1154, y=1195, z=13 }, { x=1147, y=1244, z=12 },
	["Annihilon"] = { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12 },
	["Hellgorak"] = { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12 }			
}
local time = 30 -- Seconds
local function removeInqPortal(pos)
	local v = getTileItemById(pos, 1387).uid
	if 0 < v then
		doRemoveItem(v)
	end
end
function onKill(cid, target, lastHit)
	for name, pos in pairs(bosses) do
		if name:lower() == getCreatureName(target):lower() then
			doCreateTeleport(1387, pos[1], pos[2])
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. time .." seconds until the portal will disapear.")
			addEvent(removeInqPortal, time * 1000, pos[2])
		end
	end
	return TRUE
end
 
Code:
local bosses = { -- Teleport Takes Player -- Teleport Is Created --
	["Ushuriel"] = { x=1173, y=1141, z=12 }, { x=1097, y=1214, z=12 },
	["Zugurosh"] = { x=1126, y=1151, z=12 }, { x=1149, y=1231, z=12 },
	["Madareth"] = { x=1045, y=1206, z=13 }, { x=1112, y=1240, z=12 },
	["Latrivan"] = { x=1154, y=1195, z=13 }, { x=1147, y=1244, z=12 },
	["Annihilon"] = { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12 },
	["Hellgorak"] = { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12 }			
}
local time = 30 -- Seconds
local function removeInqPortal(pos)
	local v = getTileItemById(pos, 1387).uid
	if 0 < v then
		doRemoveItem(v)
	end
end
function onKill(cid, target, lastHit)
	for name, pos in pairs(bosses) do
		if name:lower() == getCreatureName(target):lower() then
			doCreateTeleport(1387, pos[1], pos[2])
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. time .." seconds until the portal will disapear.")
			addEvent(removeInqPortal, time * 1000, pos[2])
		end
	end
	return TRUE
end

Look at attachments.

1. When a player killed a monster; it did not die. Just stood there with 0 hp.

2. Check attachments for error message
 
Last edited:
Status
Not open for further replies.
Back
Top