Belfahar
New Member
- Joined
- Jul 21, 2016
- Messages
- 25
- Reaction score
- 3
creaturescripts/scripts/inquisitionPortals.lua
Code:
local monsters =
{
["Ushuriel"] = {teleportPos = {x = 366, y = 254, z = 5, stackpos= 1}, toPos = {x = 437, y = 325, z = 7}},
["Annihilon"] = {teleportPos = {x = 794, y = 356, z = 7, stackpos = 1}, toPos = {x = 823, y = 436, z = 8}},
["Hellgorak"] = {teleportPos = {x = 864, y = 344, z = 5, stackpos = 1}, toPos = {x = 809, y = 300, z = 7}},
["Madareth"] = {teleportPos = {x = 687, y = 353, z = 7, stackpos = 1}, toPos = {x = 100, y = 100, z = 100}},
["Zugurosh"] = {teleportPos = {x = 638, y = 312, z = 7, stackpos = 1}, toPos = {x = 662, y = 360, z = 7}}
}
local brothers =
{
["Golgordan"] = {teleportPos = {x = 745, y = 262, z = 7}, toPos = {x = 734, y = 284, z = 7}, brother = "Latrivan"},
["Latrivan"] = {teleportPos = {x = 745, y = 262, z = 7}, toPos = {x = 734, y = 284, z = 7}, brother = "Golgordan"},
brothersArea =
{
fromPos = {x = 745, y = 262, z = 7},
toPos = {x = 734, y = 284, z = 7}
}
}
local time = 180 --seconds(3 minutes)
function onKill(cid, target, lastHit)
if(monsters[getCreatureName(target)]) then
local t = monsters[getCreatureName(target)]
doCreateTeleport(1387, t.toPos, t.teleportPos)
doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
doCreatureSay(cid, "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", TALKTYPE_MONSTER, getCreaturePosition(target))
addEvent(doRemoveTeleport, time * 1000, t.teleportPos)
elseif(brothers[getCreatureName(target)]) then
t = brothers[getCreatureName(target)]
local brother = getCreatureByName(t.brother)
if(isMonster(brother) == true) then
if(isInRange(getCreaturePosition(brother), brothers.brothersArea.fromPos, brothers.brothersArea.toPos) == true) then
return true
else
doCreateTeleport(1387, t.toPos, t.teleportPos)
doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
doCreatureSay(cid, "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", TALKTYPE_MONSTER, getCreaturePosition(target))
addEvent(doRemoveTeleport, time * 1000, t.teleportPos)
end
end
end
return true
end
function doRemoveTeleport(position)
if(getTileThingByPos(position).itemid > 0) then
doRemoveItem(getTileThingByPos(position).uid)
doSendMagicEffect(position, CONST_ME_POFF)
end
end