• 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 yalaharian quest

Michaeel

New Member
Joined
Mar 6, 2009
Messages
272
Reaction score
1
I've problem with yala quest. the script makes too much monsters:/
and all time i see error in console when i click on globus:
erroryala19.png


data/actions/scripts/questes/azerus.lua:
-- Yalahar 10th mission By QuaS~~

-- Config #1 --
local BlindField = {x=579, y=557, z=10, stackpos=1}
-- end --

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, getTileThingByPos(pos)
return pos, getThingfromPos(pos)
end
end
end
end


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 = getThingfromPos(BlindField)
if isMonster(bfm.uid) == TRUE then
table.insert(monsters, bfm.uid)
end
return monsters
end


function onUse(cid, item, fromPosition, itemEx, toPosition)

-- CONFIG #2!!!! --


-- Map checking --

local topLeft = {x=574, y=560, z=10}
local buttomRight = {x=589, y=576, z=10}

-- Immortality of Azerus
local monsters = getMonstersfromArea(topLeft, buttomRight)
local monsters1 = getMonstersfromArea(topLeft, buttomRight)

-- Position Of TP --
local tp = {x=581, y=575, z=10}

-- Position of Gllobus
local glo = {x=581, y=566, z=10}

-- END OF CONFIG! --



function FirstWave()
doSummonCreature("Rift Worm", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Worm", {x= glo.x + 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 4,z=glo.z})

doSummonCreature("Rift Worm", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 5,z=glo.z})

doSummonCreature("Azerus", {x=glo.x,y=glo.y - 5,z=glo.z})
end

function SecondWave()
local monsters1 = getMonstersfromArea(topLeft, buttomRight)

for _, monster in pairs(monsters1) do
if getCreatureName(monster) == "Azerus" then
doRemoveCreature(monster)
end
end
doSummonCreature("Azerus1", {x=glo.x,y=glo.y - 5,z=glo.z})

doSummonCreature("Rift Brood", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Brood", {x= glo.x + 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 4,z=glo.z})

doSummonCreature("Rift Brood", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 5,z=glo.z})
end
function ThirdWave()
local monsters1 = getMonstersfromArea(topLeft, buttomRight)

for _, monster in pairs(monsters1) do
if getCreatureName(monster) == "Azerus" then
doRemoveCreature(monster)
end
end
doSummonCreature("Azerus2", {x= glo.x - 5,y=glo.y,z=glo.z})

doSummonCreature("Rift Scythe", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z})
end

function ThirdWave1() -- with 2s delay

doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 4,z=glo.z})

doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 5,z=glo.z})
end

function FourthWave()
local monsters1 = getMonstersfromArea(topLeft, buttomRight)

for _, monster in pairs(monsters1) do
if getCreatureName(monster) == "Azerus" then
doRemoveCreature(monster)
end
end
doSummonCreature("Azerus3", {x= glo.x - 5,y=glo.y,z=glo.z})

doSummonCreature("War Golem", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("War Golem", {x= glo.x + 4,y=glo.y,z=glo.z})

doSummonCreature("War Golem", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("War Golem", {x=glo.x,y=glo.y + 4,z=glo.z})

end

function Glllobe()
item1 = getTileItemById(glo,9767)
doItemSetAttribute(item1.uid, 58261)
end



if item.actionid == 58261 then
doItemSetAttribute(item.uid, 58263)
local monsters = getMonstersfromArea(topLeft, buttomRight)
local monsters1 = getMonstersfromArea(topLeft, buttomRight)

if getTileItemById(tp,1387).itemid == 1387 then
doRemoveItem(getTileItemById(tp,1387).uid)
end

addEvent(FirstWave, 0)
addEvent(SecondWave, 10000)
addEvent(ThirdWave, 20000)
addEvent(ThirdWave1, 24000)
addEvent(FourthWave, 38000)
addEvent(Glllobe, 900000)


elseif item.actionid == 58263 then
doCreatureSay(cid, "You have to wait some time before this globe will charge.", TALKTYPE_ORANGE_1)
end


return TRUE
end
 
Code:
-- Yalahar 10th mission By QuaS~~

-- Config --
local BlindField = {x=579, y=557, z=10, stackpos=1}
-- Map checking --
local topLeft = {x=574, y=560, z=10}
local buttomRight = {x=589, y=576, z=10}
-- Position Of TP --
local tp = {x=581, y=575, z=10}
-- Position of Gllobus
local glo = {x=581, y=566, z=10}
-- end --

local 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, getTopCreature(pos).uid
			end
		end
	end
end


local function getMonstersfromArea(fromPos, toPos)
	local monsters = {}
	for _, thing in mapArea(fromPos, toPos, 253) do
		if isMonster(thing) == TRUE then
			table.insert(monsters, thing)
		end
	end
	local bfm = getTopCreature(BlindField).uid
	if isMonster(bfm) == TRUE then
		table.insert(monsters, bfm)
	end
	return monsters
end

local function FirstWave()
	doSummonCreature("Rift Worm", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Worm", {x= glo.x + 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 4,z=glo.z})
	doSummonCreature("Rift Worm", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 5,z=glo.z})
	doSummonCreature("Azerus", {x=glo.x,y=glo.y - 5,z=glo.z})
end

local function SecondWave()
	local monsters1 = getMonstersfromArea(topLeft, buttomRight)
	for _, monster in pairs(monsters1) do
		if getCreatureName(monster) == "Azerus" then
			doRemoveCreature(monster)
		end
	end
	doSummonCreature("Azerus1", {x=glo.x,y=glo.y - 5,z=glo.z})
	doSummonCreature("Rift Brood", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Brood", {x= glo.x + 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 4,z=glo.z})
	doSummonCreature("Rift Brood", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 5,z=glo.z})
end

local function ThirdWave()
	local monsters1 = getMonstersfromArea(topLeft, buttomRight)
	for _, monster in pairs(monsters1) do
		if getCreatureName(monster) == "Azerus" then
			doRemoveCreature(monster)
		end
	end
	doSummonCreature("Azerus2", {x= glo.x - 5,y=glo.y,z=glo.z})
	doSummonCreature("Rift Scythe", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z})
end

local function ThirdWave1() -- with 2s delay
	doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 4,z=glo.z})
	doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 5,z=glo.z})
end

local function FourthWave()
	local monsters1 = getMonstersfromArea(topLeft, buttomRight)
	for _, monster in pairs(monsters1) do
		if getCreatureName(monster) == "Azerus" then
			doRemoveCreature(monster)
		end
	end
	doSummonCreature("Azerus3", {x= glo.x - 5,y=glo.y,z=glo.z})
	doSummonCreature("War Golem", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("War Golem", {x= glo.x + 4,y=glo.y,z=glo.z})
	doSummonCreature("War Golem", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("War Golem", {x=glo.x,y=glo.y + 4,z=glo.z})
end

local function Glllobe()
	doItemSetAttribute(getTileItemById(glo,9767).uid, "aid", 58261)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.actionid == 58261 then
		doItemSetAttribute(item.uid, "aid", 58263)
		if getTileItemById(tp,1387).uid > 0 then
			doRemoveItem(getTileItemById(tp,1387).uid)
		end
		addEvent(FirstWave, 0)
		addEvent(SecondWave, 10000)
		addEvent(ThirdWave, 20000)
		addEvent(ThirdWave1, 24000)
		addEvent(FourthWave, 38000)
		addEvent(Glllobe, 900000)
	elseif item.actionid == 58263 then
		doCreatureSay(cid, "You have to wait some time before this globe will charge.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
	end
	return true
end
most likely won't work, you've been warned
 
Code:
-- Yalahar 10th mission By QuaS~~

-- Config --
local BlindField = {x=579, y=557, z=10, stackpos=1}
-- Map checking --
local topLeft = {x=574, y=560, z=10}
local buttomRight = {x=589, y=576, z=10}
-- Position Of TP --
local tp = {x=581, y=575, z=10}
-- Position of Gllobus
local glo = {x=581, y=566, z=10}
-- end --

local 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, getTopCreature(pos).uid
			end
		end
	end
end


local function getMonstersfromArea(fromPos, toPos)
	local monsters = {}
	for _, thing in mapArea(fromPos, toPos, 253) do
		if isMonster(thing) == TRUE then
			table.insert(monsters, thing)
		end
	end
	local bfm = getTopCreature(BlindField).uid
	if isMonster(bfm) == TRUE then
		table.insert(monsters, bfm)
	end
	return monsters
end

local function FirstWave()
	doSummonCreature("Rift Worm", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Worm", {x= glo.x + 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 4,z=glo.z})
	doSummonCreature("Rift Worm", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 5,z=glo.z})
	doSummonCreature("Azerus", {x=glo.x,y=glo.y - 5,z=glo.z})
end

local function SecondWave()
	local monsters1 = getMonstersfromArea(topLeft, buttomRight)
	for _, monster in pairs(monsters1) do
		if getCreatureName(monster) == "Azerus" then
			doRemoveCreature(monster)
		end
	end
	doSummonCreature("Azerus1", {x=glo.x,y=glo.y - 5,z=glo.z})
	doSummonCreature("Rift Brood", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Brood", {x= glo.x + 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 4,z=glo.z})
	doSummonCreature("Rift Brood", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 5,z=glo.z})
end

local function ThirdWave()
	local monsters1 = getMonstersfromArea(topLeft, buttomRight)
	for _, monster in pairs(monsters1) do
		if getCreatureName(monster) == "Azerus" then
			doRemoveCreature(monster)
		end
	end
	doSummonCreature("Azerus2", {x= glo.x - 5,y=glo.y,z=glo.z})
	doSummonCreature("Rift Scythe", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z})
end

local function ThirdWave1() -- with 2s delay
	doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 4,z=glo.z})
	doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 5,z=glo.z})
end

local function FourthWave()
	local monsters1 = getMonstersfromArea(topLeft, buttomRight)
	for _, monster in pairs(monsters1) do
		if getCreatureName(monster) == "Azerus" then
			doRemoveCreature(monster)
		end
	end
	doSummonCreature("Azerus3", {x= glo.x - 5,y=glo.y,z=glo.z})
	doSummonCreature("War Golem", {x= glo.x - 4,y=glo.y,z=glo.z})
	doSummonCreature("War Golem", {x= glo.x + 4,y=glo.y,z=glo.z})
	doSummonCreature("War Golem", {x=glo.x,y=glo.y - 4,z=glo.z})
	doSummonCreature("War Golem", {x=glo.x,y=glo.y + 4,z=glo.z})
end

local function Glllobe()
	doItemSetAttribute(getTileItemById(glo,9767).uid, "aid", 58261)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.actionid == 58261 then
		doItemSetAttribute(item.uid, "aid", 58263)
		if getTileItemById(tp,1387).uid > 0 then
			doRemoveItem(getTileItemById(tp,1387).uid)
		end
		addEvent(FirstWave, 0)
		addEvent(SecondWave, 10000)
		addEvent(ThirdWave, 20000)
		addEvent(ThirdWave1, 24000)
		addEvent(FourthWave, 38000)
		addEvent(Glllobe, 900000)
	elseif item.actionid == 58263 then
		doCreatureSay(cid, "You have to wait some time before this globe will charge.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
	end
	return true
end
most likely won't work, you've been warned

It fixed my problem :)
 
Yes I killed one azerus and teleport was created
because of
data/creaturescripts/azerus.lua:
local config = {
message = "Azerus ran into teleporter! It will disappear in 2 minutes. Enter It!",
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Azerus"] = { { x = 575, y = 606, z = 7 }, { x = 581, y = 567, z = 10 }},



}
}


function onDeath(cid, corpse, killer)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then

doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
end
end
return TRUE
end

how to fix it?
 
Code:
local function removeTP(pos)
	local v = getTileItemById(pos, 1387).uid
	return v > 0 and doRemoveItem(v)
end
function onDeath(cid, corpse, deathList)
	if getCreatureName(cid) == "Azerus" then
		doCreateTeleport(1387, {x = 575, y = 606, z = 7}, {x = 581, y = 567, z = 10})
		doCreatureSay(cid, "Azerus ran into teleporter! It will disappear in 2 minutes. Enter It!", TALKTYPE_ORANGE_1)
		addEvent(removeTP, 2 * 60 * 1000, {x = 581, y = 567, z = 10})
	end
	return TRUE
end
 
Nothing has changed, i killed one azerus and teleport appeared:
azerus98.png



EDIT: ok teleport disappeared after 2 minutes but quest is too easy, i killed one azeurs and around 10monsters...
 
Back
Top