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

decrease the script

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hello i have one script, and i need decrease him!​

Lua:
function onDeath(cid, corpse, killer)

registerCreatureEvent(cid, "inquisitionPortals")

local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:

local ushuriel_in_pos = {x=246, y=351, z=12, stackpos=2}
local annihilon_in_pos = {x=637, y=472, z=13, stackpos=2}
local hellgorak_in_pos = {x=335, y=581, z=10, stackpos=2}
local madareth_in_pos = {x=340, y=460, z=13, stackpos=2}
local zugurosh_in_pos = {x=390, y=525, z=13, stackpos=2}
local brothers_in_pos = {x=505, y=345, z=13, stackpos=1}

--- positions where the teleports will be teleported you:

local ushuriel_to_pos = {x=172, y=559, z=13, stackpos=1}
local annihilon_to_pos = {x=294, y=681, z=13, stackpos=1}
local hellgorak_to_pos = {x=255, y=467, z=13, stackpos=1}
local madareth_to_pos = {x=287, y=365, z=13, stackpos=1}
local zugurosh_to_pos = {x=314, y=474, z=13, stackpos=1}
local brothers_to_pos = {x=408, y=413, z=13, stackpos=1}

local time_to_pass = 180 -- in seconds
local tpID = 5023
local doEffect = CONST_ME_ENERGYHIT
local message = "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."

if creaturename == 'Ushuriel' then

teleport = doCreateTeleport(tpID, ushuriel_to_pos, ushuriel_in_pos)

doSendMagicEffect(ushuriel_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))

elseif creaturename == 'Annihilon' then

teleport = doCreateTeleport(tpID, annihilon_to_pos, annihilon_in_pos)

doSendMagicEffect(annihilon_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInAnnihilonWard, (1000*time_to_pass))

elseif creaturename == 'Madareth' then

teleport = doCreateTeleport(tpID, madareth_to_pos, madareth_in_pos)

doSendMagicEffect(madareth_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInMadarethWard, (1000*time_to_pass))

elseif creaturename == 'Hellgorak' then

teleport = doCreateTeleport(tpID, hellgorak_to_pos, hellgorak_in_pos)

doSendMagicEffect(hellgorak_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInHellgorakWard, (1000*time_to_pass))

elseif creaturename == 'Zugurosh' then

teleport = doCreateTeleport(tpID, zugurosh_to_pos, zugurosh_in_pos)

doSendMagicEffect(zugurosh_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInZuguroshWard, (1000*time_to_pass))

elseif creaturename == 'Latrivan' then

teleport = doCreateTeleport(tpID, brothers_to_pos, brothers_in_pos)

doSendMagicEffect(brothers_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInBrothersWard, (1000*time_to_pass))

end
end

function removeTeleportInUshurielWard()
if getThingfromPos({x=246, y=351, z=12, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=246, y=351, z=12, stackpos=1}).uid,1)
doSendMagicEffect({x=246, y=351, z=12, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInAnnihilonWard()
if getThingfromPos({x=637, y=472, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=637, y=472, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=637, y=472, z=13, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInHellgorakWard()
if getThingfromPos({x=335, y=581, z=10, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=335, y=581, z=10, stackpos=1}).uid,1)
doSendMagicEffect({x=335, y=581, z=10, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInMadarethWard()
if getThingfromPos({x=340, y=460, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=340, y=460, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=340, y=460, z=13, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInZuguroshWard()
if getThingfromPos({x=390, y=525, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=390, y=525, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=390, y=525, z=13, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInBrothersWard()
if getThingfromPos({x=505, y=345, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=505, y=345, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=505, y=345, z=13, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
 
Code:
function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "inquisitionPortals")
	 
	local creaturename = getCreatureName(cid)
	 
	--- positions where the teleports will be created:
	 
	local ushuriel_in_pos = {x=246, y=351, z=12, stackpos=2}
	local annihilon_in_pos = {x=637, y=472, z=13, stackpos=2}
	local hellgorak_in_pos = {x=335, y=581, z=10, stackpos=2}
	local madareth_in_pos = {x=340, y=460, z=13, stackpos=2}
	local zugurosh_in_pos = {x=390, y=525, z=13, stackpos=2}
	local brothers_in_pos = {x=505, y=345, z=13, stackpos=1}
	 
	--- positions where the teleports will be teleported you:
	 
	local ushuriel_to_pos = {x=172, y=559, z=13, stackpos=1}
	local annihilon_to_pos = {x=294, y=681, z=13, stackpos=1}
	local hellgorak_to_pos = {x=255, y=467, z=13, stackpos=1}
	local madareth_to_pos = {x=287, y=365, z=13, stackpos=1}
	local zugurosh_to_pos = {x=314, y=474, z=13, stackpos=1}
	local brothers_to_pos = {x=408, y=413, z=13, stackpos=1}
	 
	local time_to_pass = 180 -- in seconds
	local tpID = 5023
	local doEffect = CONST_ME_ENERGYHIT
	local message = "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."
	local whatPos
	
	if creaturename == 'Ushuriel' then
		teleportPlayer(ushuriel_to_pos, ushuriel_in_pos)	
	 
	elseif creaturename == 'Annihilon' then
		teleportPlayer(annihilon_to_pos, annihilon_in_pos)	
	 
	elseif creaturename == 'Madareth' then
		teleportPlayer(madareth_to_pos, madareth_in_pos)	
	 
	elseif creaturename == 'Hellgorak' then
		teleportPlayer(hellgorak_to_pos, hellgorak_in_pos)	
	 
	elseif creaturename == 'Zugurosh' then
		teleportPlayer(zugurosh_to_pos, zugurosh_in_pos)	
	 
	elseif creaturename == 'Latrivan' then
		teleportPlayer(brothers_to_pos, brothers_in_pos)	
	end	
end

function teleportPlayer(toPos, inPos)
	teleport = doCreateTeleport(tpID, toPos, inPos)
	doSendMagicEffect(inPos, doEffect)
	doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
	
	whatPos = inPos
	addEvent(removeTeleport, (1000*time_to_pass))
end


function removeTeleport()
	if getThingfromPos({x=whatPos.x, y=whatPos.y, z=whatPos.z, stackpos=1}).itemid == 5023 then
		doRemoveItem(getThingfromPos({x=whatPos.x, y=whatPos.y, z=whatPos.z, stackpos=1}).uid,1)
		doSendMagicEffect({x=whatPos.x, y=whatPos.y, z=whatPos.z, stackpos=1}, CONST_ME_POFF)
		return TRUE
	end
end
 
Code:
function onKill(cid, target)
	local m = {
		["Morgaroth"] = {
			message = "Escape through the teleport quickly before it closes!",
			cfg = {
				{
					time = 10, -- Seconds until tp closes.
					to = { x = 95, y = 117, z = 7 }, -- Where the tp takes you.
					tp = { x = 95, y = 112, z = 7 } -- Where the tp creates.
				}
			}
		}
	}
	if isPlayer(target) then
		return true
	end
	local monster = m[getCreatureName(target)]
	if monster then
		for i = 1, #monster.cfg do
			local c = monster.cfg[i]
				local function deleteTeleport()
				        local teleport = getTileItemById(c.tp, 1387).uid
					if(teleport > 0) then
						doRemoveItem(teleport)
						doSendMagicEffect(c.tp, CONST_ME_POFF)
					end
					return true
				end
			doCreateTeleport(1387, c.to, c.tp)
			doSendMagicEffect(c.tp, CONST_ME_ENERGYAREA)
			addEvent(deleteTeleport, c.time * 1000)
		end

		doCreatureSay(monster, monster.message, TALKTYPE_ORANGE_1)
	end

	return true
end
 
Last edited:
One option of decrease is this, but the function of teleport removes it is possible be a bit more short.
Lua:
function onDeath(cid, corpse, killer)
 
registerCreatureEvent(cid, "inquisitionPortals")
 local monsters = {
 ["Ushuriel"] = {{x=246, y=351, z=12, stackpos=2},{x=172, y=559, z=13, stackpos=1},removeTeleportInUshurielWard()},
 ["Annihilon"] = {= {x=637, y=472, z=13, stackpos=2},{x=294, y=681, z=13, stackpos=1},removeTeleportInAnnihilonWard()},
 ["Madareth"] = {{x=340, y=460, z=13, stackpos=2},{x=287, y=365, z=13, stackpos=1},removeTeleportInMadarethWard()},
 ["Zugurosh"] = {{x=390, y=525, z=13, stackpos=2},{x=314, y=474, z=13, stackpos=1},removeTeleportInZuguroshWard()},
 ["Latrivan"] = {{x=505, y=345, z=13, stackpos=1}, {x=408, y=413, z=13, stackpos=1},removeTeleportInBrothersWard()},
 ["Hellgorak"] = {{x=335, y=581, z=10, stackpos=2}, {x=255, y=467, z=13, stackpos=1},removeTeleportInHellgorakWard()}
 }
local m = monsters[getCreatureName(killer)]
local time_to_pass = 180 -- in seconds
local tpID = 5023
local doEffect = CONST_ME_ENERGYHIT
local message = "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."
if m then
doCreateTeleport(tpID, m[2], m[1])
doSendMagicEffect(m[1], doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(m[3], (1000*time_to_pass))
end
function removeTeleportInUshurielWard()
if getThingfromPos({x=246, y=351, z=12, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=246, y=351, z=12, stackpos=1}).uid,1)
doSendMagicEffect({x=246, y=351, z=12, stackpos=1}, CONST_ME_POFF)
return true
end
end
function removeTeleportInAnnihilonWard()
if getThingfromPos({x=637, y=472, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=637, y=472, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=637, y=472, z=13, stackpos=1}, CONST_ME_POFF)
return true
end
end
 
function removeTeleportInHellgorakWard()
if getThingfromPos({x=335, y=581, z=10, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=335, y=581, z=10, stackpos=1}).uid,1)
doSendMagicEffect({x=335, y=581, z=10, stackpos=1}, CONST_ME_POFF)
return true
end
end
 
function removeTeleportInMadarethWard()
if getThingfromPos({x=340, y=460, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=340, y=460, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=340, y=460, z=13, stackpos=1}, CONST_ME_POFF)
return true
end
end
 
function removeTeleportInZuguroshWard()
if getThingfromPos({x=390, y=525, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=390, y=525, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=390, y=525, z=13, stackpos=1}, CONST_ME_POFF)
return true
end
end
function removeTeleportInBrothersWard()
if getThingfromPos({x=505, y=345, z=13, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=505, y=345, z=13, stackpos=1}).uid,1)
doSendMagicEffect({x=505, y=345, z=13, stackpos=1}, CONST_ME_POFF)
return true
end
end
return true
end
 
Code:
function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "inquisitionPortals")
	 	 	 
	local monster = {
	["Ushuriel"] = {{x=246, y=351, z=12, stackpos=2},{x=172, y=559, z=13, stackpos=1}},
	["Annihilon"] = {{x=637, y=472, z=13, stackpos=2},{x=294, y=681, z=13, stackpos=1}},
	["Madareth"] = {{x=340, y=460, z=13, stackpos=2},{x=287, y=365, z=13, stackpos=1}},
	["Zugurosh"] = {{x=390, y=525, z=13, stackpos=2},{x=314, y=474, z=13, stackpos=1}},
	["Latrivan"] = {{x=505, y=345, z=13, stackpos=1}, {x=408, y=413, z=13, stackpos=1}},
	["Hellgorak"] = {{x=335, y=581, z=10, stackpos=2}, {x=255, y=467, z=13, stackpos=1}}}
	 	 
	local message = "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."
	local whatPos
	
	monsterCheck = monster[getCreatureName(cid)] 	
	if(monsterCheck) then
		teleport = doCreateTeleport(5023, monsterCheck[0], monsterCheck[1])
		doSendMagicEffect(monsterCheck[1], CONST_ME_ENERGYHIT)
		doCreatureSay(cid, message, TALKTYPE_ORANGE_1)	
		whatPos = monsterCheck[1]
		addEvent(removeTeleport, (1000*180))
	end
end

function removeTeleport()
	if getThingfromPos({x=whatPos.x, y=whatPos.y, z=whatPos.z, stackpos=1}).itemid == 5023 then
		doRemoveItem(getThingfromPos({x=whatPos.x, y=whatPos.y, z=whatPos.z, stackpos=1}).uid,1)
		doSendMagicEffect({x=whatPos.x, y=whatPos.y, z=whatPos.z, stackpos=1}, CONST_ME_POFF)
		return TRUE
	end
end
 
Last edited:
Lua:
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "inquisitionPortals")
 local monsters = {
 ["Ushuriel"] = {{x=246, y=351, z=12, stackpos=2},{x=172, y=559, z=13, stackpos=1}},
 ["Annihilon"] = {{x=637, y=472, z=13, stackpos=2},{x=294, y=681, z=13, stackpos=1}},
 ["Madareth"] = {{x=340, y=460, z=13, stackpos=2},{x=287, y=365, z=13, stackpos=1}},
 ["Zugurosh"] = {{x=390, y=525, z=13, stackpos=2},{x=314, y=474, z=13, stackpos=1}},
 ["Latrivan"] = {{x=505, y=345, z=13, stackpos=1}, {x=408, y=413, z=13, stackpos=1}},
 ["Hellgorak"] = {{x=335, y=581, z=10, stackpos=2}, {x=255, y=467, z=13, stackpos=1}}
 }
local m = monsters[getCreatureName(killer)]
local time_ = 180 -- in seconds
local tpID = 5023
local doEffect = CONST_ME_ENERGYHIT
local message = "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."
if m then
doCreateTeleport(tpID, m[2], m[1])
doSendMagicEffect(m[1], doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(doRemoveItem, 1000*time_, getThingFromPos(m[1]).uid, 1)
addEvent(doSendMagicEffect, 1000*time_, m[1], CONST_ME_POFF)
end
return true
end
 
Back
Top