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

Lua Problem with Yalahar Quest [azerus.lua]

butynhuuw

New Member
Joined
Nov 28, 2009
Messages
51
Reaction score
1
Hi guys, I use the Real Server 1.7 and got a little problem with the Yalahar Quest...

I talk to the NPCs about the mission (ok), get into the room (ok), but while I'm inside the room killing the summoned monsters, in the log of my server it appears this error:

[Error - MoveEvents Interface]
data/movements/scripts/azerus.lua:eek:nStepIn
Description:
<luaDoTeleportThing> Thing not found

[Error - MoveEvents Inferface]
data/movements/scripts/azerus.lua:eek:nStepIn
Description:
attempt to index a nil value
stack traceback:
[C]: in function 'doTeleportThing'
data/movements/scripts/azerus.lua:47 in function <data/movements/scripts/azerus.lua:1>

My azerus.lua:
Code:
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
 
Try this one:
Lua:
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, 'You have already done this quest!')
end
end
Or if it won't work, try this:
Lua:
function onStepIn(cid, item, position, fromPosition)
	if getCreatureStorage(cid, 50001) == -1 then
		if item.actionid == 1974 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)
			setPlayerStorageValue(cid, 4765, 1) 
		elseif item.actionid == 1973 then
			local t, f = {}
			for x = 576, 586 do
				for y = 560, 572 do
					local v = getTopCreature({x=x, y=y, z=10}).uid
					if isPlayer(v) then
						f = true
						break
					elseif isMonster(v) then
						table.insert(t, v)
					end
				end
			end
			if not f then
				for i = 1, #t do
					doRemoveCreature(t[i])
				end
			end
			doTeleportThing(cid, {x=579, y=575, z=10})
			doSendMagicEffect({x=579, y=575, z=10}, CONST_ME_TELEPORT)
		end
	else
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendCancel(cid, 'You have already done this quest!')
	end
end
 
Back
Top