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

Yalahar Quest (BIG ERROR)

Axelor

Member
Joined
Sep 2, 2010
Messages
505
Reaction score
9
PHP:
[15:17:46.493] [Error - MoveEvents Interface]
[15:17:46.493] data/movements/scripts/azerus.lua:onStepIn
[15:17:46.493] Description:
[15:17:46.494] (luaDoTeleportThing) Thing not found

[15:17:46.494] [Error - MoveEvents Interface]
[15:17:46.494] data/movements/scripts/azerus.lua:onStepIn
[15:17:46.494] Description:
[15:17:46.494] attempt to index a nil value
[15:17:46.494] stack traceback:
[15:17:46.494]  [C]: in function 'doTeleportThing'
[15:17:46.494]  data/movements/scripts/azerus.lua:47: in function <data/movements/scripts/azerus.lua:1>

error /\

Script of azerus.lua
PHP:
function onStepIn(cid, item, position, fromPosition)

--Config-->
local queststatus = getPlayerStorageValue(cid, 50001)
--EndConfig-->
	if item.actionid == 1974 and queststatus == -1 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "It seems by defeating Azerus you have stoped this army from entering your world! Better leave this ghastly place forever.")
		setPlayerStorageValue(cid, 4765, 1)
	return TRUE
end

if item.actionid == 1973 and queststatus == -1 then
-- Here is the code start:
starting={x = 576, y = 560, z = 10, stackpos = 253}
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending={x = 586, y = 572, z = 10, stackpos = 253}
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
 if creature.itemid > 0 then
 if getPlayerAccess(creature.uid) == 0 then
 players=players+1
 end
  if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
 totalmonsters=totalmonsters+1
  monster[totalmonsters]=creature.uid
   end
 end
checking.x=checking.x+1
  if checking.x>ending.x then
  checking.x=starting.x
  checking.y=checking.y+1
 end
until checking.y>ending.y
if players==0 then
trash= {x=33193, y=31689, z=15}
current=0
repeat
current=current+1
doTeleportThing(monster[current],trash)
until current>=totalmonsters
end
-- Here is the end of it

doTeleportThing(cid, player_pos_entrada)
doSendMagicEffect(player_pos_entrada, 10)

else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você já terminou a quest!')
end
end



SOme1 can help?
 
Last edited:
Code:
local entryPos = [B][COLOR="red"]{x=100, y=100, z=7}[/COLOR][/B]

function onStepIn(cid, item, position, fromPosition)
	if not isPlayer(cid) then
		return
	elseif item.actionid == 1974 and getCreatureStorage(cid, 4765) == -1 then
		doCreatureSay(cid, 'It seems by defeating Azerus you have stopped this army from entering your world! Better leave this ghastly place forever.', TALKTYPE_ORANGE_1, false, cid)
		doCreatureSetStorage(cid, 4765, 1)
	elseif item.actionid == 1973 then
		if getCreatureStorage(cid, 50001) == -1 then
			local t = {}
			for x=576, 586 do
				for y=560, 572 do
					local v = getTopCreature({x=x, y=y, z=10}).uid
					if isPlayer(v) and getPlayerAccess(v) < 2 then
						t = {}
						break
					elseif isMonster(v) and (not getCreatureMaster(v) or getCreatureMaster(v) == v) then
						table.insert(t, v)
					end
				end
			end
			for i = 1, #t do
				doRemoveCreature(t[i])
			end

			doTeleportThing(cid, entryPos)
			doSendMagicEffect(position, CONST_ME_TELEPORT)
			doSendMagicEffect(entryPos, CONST_ME_TELEPORT)
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você já terminou a quest!')
		end
	end
end
 
Code:
local entryPos = [B][COLOR="red"]{x=100, y=100, z=7}[/COLOR][/B]

function onStepIn(cid, item, position, fromPosition)
	if not isPlayer(cid) then
		return
	elseif item.actionid == 1974 and getCreatureStorage(cid, 4765) == -1 then
		doCreatureSay(cid, 'It seems by defeating Azerus you have stopped this army from entering your world! Better leave this ghastly place forever.', TALKTYPE_ORANGE_1, false, cid)
		doCreatureSetStorage(cid, 4765, 1)
	elseif item.actionid == 1973 then
		if getCreatureStorage(cid, 50001) == -1 then
			local t = {}
			for x=576, 586 do
				for y=560, 572 do
					local v = getTopCreature({x=x, y=y, z=10}).uid
					if isPlayer(v) and getPlayerAccess(v) < 2 then
						t = {}
						break
					elseif isMonster(v) and (not getCreatureMaster(v) or getCreatureMaster(v) == v) then
						table.insert(t, v)
					end
				end
			end
			for i = 1, #t do
				doRemoveCreature(t[i])
			end

			doTeleportThing(cid, entryPos)
			doSendMagicEffect(position, CONST_ME_TELEPORT)
			doSendMagicEffect(entryPos, CONST_ME_TELEPORT)
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você já terminou a quest!')
		end
	end
end

error is gone,

but when I go into the tp. there is already a azerus spawned..
how to fix that, that they only sspawn when using that strange big thing
 
Remove him from map, and use a script for summoning Azerus?
LUA:
-- Yalahar 10th mission By QuaS~~ 
 
function mapArea(fromPos, toPos, stack) 
	-- Area iterator by Colandus. 
	local pos = {x=fromPos.x, y=fromPos.y-1, z=fromPos.z} 
	return function() 
		if (pos.y < toPos.y) then 
			pos.y = pos.y+1 
		elseif (pos.x <= toPos.x) then 
			pos.y = fromPos.y 
			pos.x = pos.x+1 
		else 
			pos.x = fromPos.x 
			pos.y = fromPos.y 
			pos.z = pos.z+1 
		end 
		if (pos.x <= toPos.x and pos.y <= toPos.y or pos.z < toPos.z) then 
			if (stack == nil) then 
				return pos 
			else 
				pos.stackpos = stack 
				return pos, getThingfromPos(pos) 
			end 
		end 
	end 
end 
 
-- CONFIG !!!! -- 
 
-- Map checking -- 
local topLeft = {x=574, y=560, z=10} 
local buttomRight = {x=589, y=576, z=10} 
 
local BlindField = {x=579, y=557, z=10}
 
-- Position Of TP -- 
local tp = {x=581, y=575, z=10} 
 
-- Position of Globe
local glo = {x=581, y=566, z=10} 
 
-- END OF CONFIG! --
 
function getMonstersfromArea(fromPos, toPos)
	local monsters = {}
	for _, thing in mapArea(fromPos, toPos, 253) do
		if isMonster(thing.uid) == TRUE then
			table.insert(monsters, thing.uid)
		end
	end 
	local bfm = getTopCreature(BlindField).uid
	if isMonster(bfm) then 
		table.insert(monsters, bfm) 
	end 
	return monsters 
end 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
	if item.actionid == 58261 then 
		doItemSetAttribute(item.uid, 'aid', 58263)
		local v = getTileItemById(tp,1387).uid
		if v > 0 then 
			doRemoveItem(v)
		end 
 
		function FirstWave() 
			doCreateMonster("Rift Worm", {x= glo.x - 4,y=glo.y,z=glo.z}) 
			doCreateMonster("Rift Worm", {x= glo.x + 4,y=glo.y,z=glo.z}) 
			doCreateMonster("Rift Worm", {x=glo.x,y=glo.y + 4,z=glo.z}) 
			doCreateMonster("Rift Worm", {x=glo.x,y=glo.y - 4,z=glo.z}) 
			doCreateMonster("Rift Worm", {x=glo.x,y=glo.y + 5,z=glo.z}) 
			doCreateMonster("Azerus", {x=glo.x,y=glo.y - 5,z=glo.z}) 
		end 
 
		function SecondWave() 
			for _, monster in ipairs(getMonstersfromArea(topLeft, buttomRight) ) do 
				if getCreatureName(monster):lower() == 'azerus' then 
					doRemoveCreature(monster)
					break
				end 
			end 
			doCreateMonster("Azerus1", {x=glo.x,y=glo.y - 5,z=glo.z})
			doCreateMonster("Rift Brood", {x= glo.x - 4,y=glo.y,z=glo.z})
			doCreateMonster("Rift Brood", {x= glo.x + 4,y=glo.y,z=glo.z})
			doCreateMonster("Rift Brood", {x=glo.x,y=glo.y + 4,z=glo.z})
			doCreateMonster("Rift Brood", {x=glo.x,y=glo.y - 4,z=glo.z})
			doCreateMonster("Rift Brood", {x=glo.x,y=glo.y + 5,z=glo.z})
		end
 
		function ThirdWave()
			for _, monster in ipairs(getMonstersfromArea(topLeft, buttomRight) ) do 
				if getCreatureName(monster):lower() == 'azerus' then 
					doRemoveCreature(monster)
					break
				end
			end 
			doCreateMonster("Azerus2", {x= glo.x - 5,y=glo.y,z=glo.z}) 
			doCreateMonster("Rift Scythe", {x= glo.x - 4,y=glo.y,z=glo.z}) 
			doCreateMonster("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z}) 
		end 
 
		function ThirdWave1() --  with 2s delay 
			doCreateMonster("Rift Scythe", {x=glo.x,y=glo.y + 4,z=glo.z}) 
			doCreateMonster("Rift Scythe", {x=glo.x,y=glo.y - 4,z=glo.z}) 
			doCreateMonster("Rift Scythe", {x=glo.x,y=glo.y + 5,z=glo.z}) 
		end 
 
		function FourthWave() 
			for _, monster in ipairs(getMonstersfromArea(topLeft, buttomRight) ) do 
				if getCreatureName(monster):lower() == 'azerus' then
					doRemoveCreature(monster)
					break
				end
			end 
			doCreateMonster("Azerus3", {x= glo.x - 5,y=glo.y,z=glo.z}) 
			doCreateMonster("War Golem", {x= glo.x - 4,y=glo.y,z=glo.z}) 
			doCreateMonster("War Golem", {x= glo.x + 4,y=glo.y,z=glo.z}) 
			doCreateMonster("War Golem", {x=glo.x,y=glo.y - 4,z=glo.z}) 
			doCreateMonster("War Golem", {x=glo.x,y=glo.y + 4,z=glo.z}) 
		end 
 
		function Glllobe() 
			doItemSetAttribute(getTileItemById(glo,9767).uid, 'aid', 58261) 
		end
 
		addEvent(FirstWave, 0) 
		addEvent(SecondWave, 10 * 1000) 
		addEvent(ThirdWave, 20 * 1000) 
		addEvent(ThirdWave1, 24 * 1000) 
		addEvent(FourthWave, 38 * 1000) 
		addEvent(Glllobe, 15 * 60 * 1000)
	elseif item.actionid == 58263 then 
		doCreatureSay(cid, "You have to wait some time before this globe will charge.", TALKTYPE_ORANGE_1, false, cid)
	end
 
	return true
end
 
Back
Top