• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

war of emperium error

Ganjita

Active Member
Joined
Dec 15, 2009
Messages
493
Reaction score
37
hello i have that error when i try summon a guard of woe with the switch

Code:
[23:31:03.929] [Error - Action Interface]
[23:31:03.929] data/actions/scripts/woe.lua:onUse
[23:31:03.929] Description:
[23:31:03.930] (luaDoCreateMonster) Cannot create monster: guard

and the woe.lua is here

Code:
dofile("./_woe.lua")

local delays = 60

local guards_price = 30000    --30k

function onUse(cid, item, fromPosition, itemEx, toPosition)
    Woe.getInfo()
    if item.actionid == Castle.banderas then
        if Woe.isTime() then
            if Woe.isStarted() then
                if infoLua[2] == getPlayerGuildId(cid) then
                    doTeleportThing(cid, Castle.guildEntry, false)
                else
                    doPlayerSendCancel(cid, "You are not member of ".. Woe.guildName() ..".")
                end
            end
        else
            if infoLua[2] == getPlayerGuildId(cid) then
                doTeleportThing(cid, Castle.guildEntry, false)
            else
                doPlayerSendCancel(cid, "You are not member of ".. Woe.guildName() ..".")
            end
        end
    elseif (item.uid == 3134) then
        if not Woe.isStarted() or (infoLua[2] ~= getPlayerGuildId(cid)) or (getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER) then
            return true
        end
        if (getPlayerMoney(cid) < guards_price) then
            return doPlayerSendCancel(cid, "Not enough money.")
        end
        local varDelay = getGlobalStorageValue(24503)
        if (varDelay < 0) or ((os.time() - varDelay) >= delays) then
            if Woe.check() then
                Woe.summon()
                doPlayerRemoveMoney(cid, guards_price)
            else
                doPlayerSendCancel(cid, "There are still guards alive.")
            end
        else
            doPlayerSendCancel(cid, "Delay no listo.")
        end
    end
    return true
end

can someone help me?
 
You need to create the monster "guard".
If you already have it, make sure you edited the Castle.desde position (or another positions).
 
Code:
dofile("./var.woe")

local config = woe_config

fileStore = true

infoFile = 'tmp.woe'
infoLua = {}

Woe = {}
Woe.__index = Woe

function Woe.setup()
    db.executeQuery("DROP TABLE IF EXISTS `woe`;")
    db.executeQuery("CREATE TABLE `woe` (`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,`started` INT( 11 ) NOT NULL ,`guild` INT( 11 ) NOT NULL ,`breaker` INT( 11 ) NOT NULL ,`time` INT( 11 ) NOT NULL ,PRIMARY KEY ( `id` ) ,UNIQUE (`id`)) ENGINE = MYISAM")
    doBroadcastMessage("DB Added [...]", config.bcType)
    if fileStore then
        local newFile = io.open(infoFile, "w")
        for _, i in ipairs({'started', 'guild', 'breaker', 'time'}) do
            newFile:write(i .. ' = 0 ;end;\n')
        end
        newFile:close()
    else
        db.executeQuery("DROP TABLE IF EXISTS `tmpwoe`;")
        db.executeQuery("CREATE TABLE `tmpwoe` (`started` INT( 11 ) NOT NULL ,`guild` INT( 11 ) NOT NULL ,`breaker` INT( 111 ) NOT NULL ,`time` INT( 1 ) NOT NULL) ENGINE = MYISAM ;")
        db.executeQuery("ALTER TABLE `tmpwoe` ADD `indexer` INT NOT NULL ")
        db.executeQuery("INSERT INTO `tmpwoe` (`started` ,`guild` ,`breaker` ,`time`, `indexer`)VALUES ('0', '0', '0', '0', '1');")
    end
end

function Woe.getInfo()
    if fileStore then
        local open = io.open(infoFile, "r")
        if open then
            for i in io.lines(infoFile) do
                for v, k in ipairs({'started', 'guild', 'breaker', 'time'}) do
                    if (i:find(k)) then
                        n = i:match(k .. '.*')
                        infoLua[v] = tonumber(n:sub(n:find('=') + 2, n:find(';end;') - 2))
                    end
                end
            end
            open:close()
        end
    else
        for v, k in ipairs({'started', 'guild', 'breaker', 'time'}) do
            local tmp = db.getResult("SELECT " .. k .. " FROM `tmpwoe` WHERE `indexer` = '1';")
            infoLua[v] = tmp:getDataInt(k)
            tmp:free()
        end
    end
end

function Woe.updateInfo(tab)
    if fileStore then
        local open = io.open(infoFile, "w")
        if open then
            for k, i in ipairs({'started', 'guild', 'breaker', 'time'}) do
                open:write(i .. ' = ' .. tab[k] .. ' ;end;\n')
            end
            open:close()
        end
    else
        for v, k in ipairs({'started', 'guild', 'breaker', 'time'}) do
            db.executeQuery("UPDATE `tmpwoe` SET " .. k .. " =  " .. tab[v] .. " WHERE `indexer` = 1;")
        end
    end
end

function Woe.save()
    Woe.getInfo()
    db.executeQuery("INSERT INTO `woe` (`started`, `guild`, `breaker`, `time`) VALUES (" .. infoLua[1] .. ", " .. infoLua[2] .. ", " .. infoLua[3] .. ", " .. infoLua[4] .. ");")
end

function Woe.getGuildName(id)
    local res = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. ";")
    if (res:getID() ~= -1) then
        ret = res:getDataString('name')
        res:free()
    end
    return ret
end

function Woe.breakerName()
    Woe.getInfo()
    return infoLua[3] ~= 0 and getPlayerNameByGUID(infoLua[3]) or 'None'
end

function Woe.guildName()
    Woe.getInfo()
    return infoLua[2] ~= 0 and Woe.getGuildName(infoLua[2]) or 'Nones'
end

function Woe.startTime()
    Woe.getInfo()
    return os.date("%d %B %Y %X ", infoLua[1])
end

function Woe.breakTime()
    Woe.getInfo()
    return os.date("%d %B %Y %X ", infoLua[4])
end

function Woe.timeToEnd()
    Woe.getInfo()
    local myTable = {}
    for k, i in ipairs({"%M", "%S"}) do
        myTable[k] = os.date(i, os.difftime(os.time(), infoLua[1]))
    end
    return {mins = ((config.timeToEnd - 1) - myTable[1]), secs = (60 - myTable[2])}
end

function Woe.moveBack(cid, fromPosition, text)
    doTeleportThing(cid, fromPosition, TRUE)
    doPlayerSendCancel(cid, text)
end

function Woe.getGuildMembers(id)
    local members = {}
    for _, i in ipairs(getPlayersOnline()) do
        if id == getPlayerGuildId(i) then
            table.insert(members, i)
        end
    end
    return members
end

function Woe.deco(text)
    for _, i in ipairs(Castle.decoraciones) do
        doItemSetAttribute(i, "description", text)
    end
end

function Woe.removePortals()
    for _, i in ipairs(Castle.PrePortalsPos) do
        if (getThingFromPos(i).itemid > 0) then
            doRemoveItem(getThingFromPos(i).uid)
        end
    end
end

function Woe.removePre()
    for _, i in ipairs(Castle.PreEmpes) do
        if (isCreature(getThingFromPos(i).uid) == true) then
            doRemoveCreature(getThingFromPos(i).uid)
        end
    end
end

function Woe.checkPre()
    local Count = 0
    for _, i in ipairs(Castle.PreEmpes) do
        if (isCreature(getThingFromPos(i).uid) == false) then
            Count = Count + 1
        end
    end
    return (Count == #Castle.PreEmpes)
end

function Woe.isTime()
    return (getGlobalStorageValue(stor.WoeTime) == 1)
end

function Woe.isStarted()
    return (getGlobalStorageValue(stor.Started) == 1)
end

function Woe.isRegistered(cid)
    return (getPlayerStorageValue(cid, stor.register) == 1)
end

function Woe.isInCastle(cid)
    local myPos = getCreaturePosition(cid)
    if (myPos.x >= Castle.salas.a.fromx and myPos.x <= Castle.salas.a.tox) then
        if (myPos.y >= Castle.salas.a.fromy and myPos.y <= Castle.salas.a.toy) then
            if isInArray({Castle.salas.a.z, Castle.salas.b.z, Castle.salas.c.z}, myPos.z) then
                return true
            end
        end
    end
    return false
end

function Woe.expulsar(guild, fromx, tox, fromy, toy, z, outpos)
    for _x = fromx, tox do
        for _y = fromy, toy do
            local player = getThingFromPos({x = _x, y = _y, z = z, stackpos = 253}).uid
            if (isPlayer(player) == true) then
                if (getPlayerGuildId(player) ~= guild) then
                    doTeleportThing(player, outpos, false)
                end
            end
        end
    end
end

-- extras

function doSetItemActionId(uid, action)
    doItemSetAttribute(uid, "aid", action)
end

function exhaust(cid, storevalue, exhausttime)
-- Exhaustion function by Alreth, v1.1 2006-06-24 01:31
-- Returns 1 if not exhausted and 0 if exhausted
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storevalue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhausttime == nil or exhausttime < 0) then
        exhausttime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhausttime or diffTime < 0) then
        setPlayerStorageValue(cid, storevalue, newExhaust)
        return 1
    else
        return 0
    end
end

--new
guard_pos =
    {
        {x = 55, y = 31, z = 5},
        {x = 55, y = 30, z = 5},
        {x = 55, y = 29, z = 5},
        {x = 55, y = 28, z = 5},
        {x = 55, y = 27, z = 5},
        {x = 55, y = 26, z = 5},
        {x = 55, y = 25, z = 5}
    }
   
function Woe.check()
    for storage = 24504, 24511 do
        local pid = getGlobalStorageValue(storage)
        if isCreature(pid) then
            return false
        end
    end
    return true
end

function Woe.summon()
    for k, i in ipairs(guard_pos) do
        local pid = doSummonCreature("guard", i)
        setGlobalStorageValue(24503 + k, pid)
    end
end

function Woe.remove()
    for storage = 24504, 24511 do
        local pid = getGlobalStorageValue(storage)
        if isCreature(pid) then
            doRemoveCreature(pid)
        end
    end
end

that is my _woe.lua
 
solved, i forget change that line


--new
guard_pos =
{
{x = 55, y = 31, z = 5},
{x = 55, y = 30, z = 5},
{x = 55, y = 29, z = 5},
{x = 55, y = 28, z = 5},
{x = 55, y = 27, z = 5},
{x = 55, y = 26, z = 5},
{x = 55, y = 25, z = 5}
}

thanks <3
-----------------
i have other question, where i can change the time of start on woe?, for example all days 6:30 hrs?
 
Should be a file that uses globalevents, look in the xml part, if you can't find time="statment" or smth like that. Look in the files, should be a table with diffrent variables you can change.

** If its an automatic system, and not one that requires you to say !start or w/e.
 
--days
woe_config.dias = {"tuesday", "thursday", "saturday"}

--time to start
woe_config.horaPartida = 11


the time to start is the hour from my machine?
 
Back
Top