• 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 [Warning - Npc::createNpc] Cannot find npc with name: Azerus1-2-3.

Mariuskens

Sword Art Online 2D-MMORPG
Joined
Nov 21, 2008
Messages
1,010
Reaction score
120
Location
Spain
GitHub
Olimpotibia
Hi Otland !! i've little bug here in Yalahari 10th mission.

When Azerus Removed to come Azerus1 not appear any azerus:

Errors in Console:
[Warning - Npc::createNpc] Cannot find npc with name: Azerus1.
[Warning - Npc::createNpc] Cannot find npc with name: Azerus2.
[Warning - Npc::createNpc] Cannot find npc with name: Azerus3.

So i've in monsters Folder Azerus.xml, Azerus1.xml, Azerus2.xml, Azerus3.xml and Put in Monsters.xml.

I don't now where is bug :S

Here is my Script:

LUA:
-- Yalahar 10th mission By QuaS~~ 

-- Config #1 --  
local BlindField = {x=32781, y=31157, 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=32776, y=31159, z=10} 
local buttomRight = {x=32790, y=31176, z=10} 

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

-- Position Of TP -- 
local tp = {x=32783, y=31175, z=10} 

-- Position of Gllobus 
local glo = {x=32783, y=31166, 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 FifthWave() 
    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}) 

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 SixthWave() 
    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}) 
	
	doSummonCreature("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z}) 

    doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 4,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() 

    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 SevenWave() 
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 
local function createWall(p)
local janek = doCreateItem(1387,1,{x=32784, y=31177, z=9})
doItemSetAttribute(janek, "aid", 9105)
end
local function createWalll(i)
local ela = doCreateItem(2180,1,{x=32783, y=31175, z=10})
doItemSetAttribute(ela, "aid", 9106)
end



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

if getTileItemById(tp,2180).itemid == 2180 then 
doRemoveItem(getTileItemById(tp,2180).uid) 
end 
wall0 = {x=32784, y=31177, z=9, stackpos=1}
getwall0 = getThingfromPos(wall0)
wall1 = {x=32783, y=31175, z=10, stackpos=1}
getwall1 = getThingfromPos(wall1)
doRemoveItem(getwall0.uid,1)
addEvent(FirstWave, 0) 
addEvent(FifthWave, 10000)
addEvent(SecondWave, 20000) 
addEvent(SixthWave, 25000) 
addEvent(ThirdWave, 31000) 
addEvent(ThirdWave1, 38000) 
addEvent(FourthWave, 50000) 
addEvent(SevenWave, 60000) 
addEvent(Glllobe, 400000) 
p = {wallid = getwall0.itemid}
	addEvent(createWall, 300*1000, p)
	i = {wallid = getwall1.itemid}
	addEvent(createWalll, 300*1000, i)


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
 
Please How i fix this Error in NPCs???

- - - Updated - - -

Help me please Muki

- - - Updated - - -

Explain to me that I do to fix it and I'll instantly informing
 
if these are npc's you need make like azerus1.xml and the file should look like this
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Name" script="ur lua file" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="332" head="128" body="139" legs="145" feet="7" addons="1"/>
</npc>
and on lua file try name.lua or data/npc/scripts/name.lua
 
I change this :

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

In 3 parts of script and work good but when i cant kill Azerus...

- - - Updated - - -

okay i make 3 Monsters with name Azerus and last monsters not Immune to pysical,dead, ice and fire so i need when die tp appear
or script when kill last azerus create one tp ??
 
Back
Top