• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Yalahar Quest, help with the Script!

Caisto

New Member
Joined
Jan 12, 2009
Messages
18
Reaction score
0
Hi Otland, well I'm working on a really nice server 9.61 and I just putted Yalahar's Map, so I was trying to undestand the script of the Azerus and I really didn't get how to configure it to my map positions.
The thing is that the script crashes the server because of the wrong positions because I really don't know where to put each thing...

This is my Action/Azerus.lua:
Code:
local BlindField = {x=579, y=557, z=10, stackpos=1}

function mapArea(fromPos, toPos, stack)
        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)

local topLeft = {x=573, y=558, z=10}
local buttomRight = {x=589, y=576, z=10}

local monsters = getMonstersfromArea(topLeft, buttomRight)
local monsters1 = getMonstersfromArea(topLeft, buttomRight)

local tp = {x=581, y=575, z=10}

local glo = {x=2001, y=319, z=10}

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() 

    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)
doSetItemActionId(item1.uid, 58261)
end

if item.actionid == 58261 then
doSetItemActionId(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

And this is my Movements/Azerusdeath.lua:
Code:
function onStepIn(cid, item, position, fromPosition)

local yalahar = {x=579, y=569, z=14, stackpos=253}

        if item.itemid == 9738 then
        doTeleportThing(cid, yalahar, TRUE)
        doSendMagicEffect(yalahar,12)
        end
    
    return TRUE
end

What I dont understand is those lines in wich I have to put a possition of my map, for example this one:

Code:
local BlindField = {x=579, y=557, z=10, stackpos=1}

On the quest where do I have to set this position (with my cords)?, I hope you understand what I'm trying to say
 
No, its a custom map, but I put yalahar because of the quest

- - - Updated - - -

Anyone can help me a little bit with this?
 
Back
Top