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

FireStorm Event

freddzor11

Member
Joined
May 25, 2009
Messages
695
Reaction score
5
Hello I am using this fire storm event -> http://pastebin.com/Hv9jBhyG

But when I am trying to join the event I getting this error:
Code:
[Error - TalkAction Interface]
buffer:onSay
Description:
data/lib/034-exhaustion.lua:8: field 'day' missing in date table
stack traceback:
        [C]: in function 'time'
        data/lib/034-exhaustion.lua:8: in function 'check'
        [string "loadBuffer"]:21: in function <[string "loadBuffer"]:3>

and I also got a question if it's possible to make it to open a Teleport instead of command and broadcast every minute until it starts

Kind regards
 
add this
Code:
                fireStormDelay = 1000, -- milisecond
above this
Code:
delayTime = 1.0, -- time in which players who joined to event are teleporting to teleport position
 
add this
Code:
                fireStormDelay = 1000, -- milisecond
above this
Code:
delayTime = 1.0, -- time in which players who joined to event are teleporting to teleport position
what about the error?
Code:
[Error - TalkAction Interface]
buffer:onSay
Description:
data/lib/034-exhaustion.lua:8: field 'day' missing in date table
stack traceback:
        [C]: in function 'time'
        data/lib/034-exhaustion.lua:8: in function 'check'
        [string "loadBuffer"]:21: in function <[string "loadBuffer"]:3>
 
Code:
    <lib name="lib_fire_storm_event">
        <![CDATA[
            function doStartFireStormEvent()
                doSetStorage(configFireStormEvent.storages.joining, -1)
              
                if configFireStormEvent.players.min <= doCountPlayersFireStormEvent() then      
                    for _, cid in ipairs(getPlayersOnline()) do
                        if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then
                            doCreatureSetNoMove(cid, false)
                            doRemoveCondition(cid, CONDITION_INFIGHT)
                            doTeleportThing(cid, configFireStormEvent.position)
                            doCreatureSetStorage(cid, configFireStormEvent.storages.player, -1)
                          
                            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Fire Storm Event start in '..configFireStormEvent.startEvent..' seconds.')
                        end
                    end
                  
                    addEvent(doSetStorage, configFireStormEvent.startEvent * 1000, configFireStormEvent.storages.main, 1)
                    addEvent(doRepeatCheckFireStorm, configFireStormEvent.startEvent * 1000 + 2000)
                  
                    doBroadcastMessage('Fire Storm Event has started. LET\'S GO!')
                else
                    for _, cid in ipairs(getPlayersOnline()) do
                        if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then
                            doCreatureSetNoMove(cid, false)
                            doRemoveCondition(cid, CONDITION_INFIGHT)
                        end
                    end
                  
                    doBroadcastMessage('Fire Storm hasn\'t started beacuse there were not enough players.')
                end
            end
          
            function doRepeatCheckFireStorm()
                if getStorage(configFireStormEvent.storages.main) > 0 then
                    local xTable, yTable, playerTable = {}, {}, {}

                    for x = configFireStormEvent.room.from.x, configFireStormEvent.room.to.x do
                        for y = configFireStormEvent.room.from.y, configFireStormEvent.room.to.y do
                            table.insert(xTable, x)
                            table.insert(yTable, y)

                            local n, i = getTileInfo({x=x, y=y, z=configFireStormEvent.room.to.z}).creatures, 1
                            if n ~= 0 then
                                local v = getThingfromPos({x=x, y=y, z=configFireStormEvent.room.to.z, stackpos=i}).uid
                                while v ~= 0 do
                                    if isPlayer(v) then
                                        table.insert(playerTable, v)
                                        if n == #playerTable then
                                            break
                                        end
                                    end
                                    i = i + 1
                                    v = getThingfromPos({x=x, y=y, z=configFireStormEvent.room.to.z, stackpos=i}).uid
                                end
                            end
                        end
                    end

                    if #playerTable == 1 then
                        local prize = math.random(#configFireStormEvent.rewards)
                        doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1]))
                        doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1]))
                        doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true)
                        doPlayerAddItem(playerTable[1], configFireStormEvent.rewards[prize], 1)
                        doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! You have received ' .. getItemNameById(configFireStormEvent.rewards[prize]) .. ' as reward.')
                        doBroadcastMessage('Fire Storm Event has finished. The winner is ' .. getCreatureName(playerTable[1]) .. '. Congratulations.')
                        doSetStorage(configFireStormEvent.storages.main, -1)
                      
                        db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Fire\", \"" .. getCreatureName(playerTable[1]) .. "\", \"" .. getItemNameById(configFireStormEvent.rewards[prize]) .. "\", " .. getStorage(configFireStormEvent.storages.countEvent) ..");")
                        doSetStorage(configFireStormEvent.storages.countEvent, getStorage(configFireStormEvent.storages.countEvent) + 1)
                      
                        x, y = 1, 1
                    elseif #playerTable > 1 then
                        for a = 1, y do
                            addEvent(
                                function()
                                    local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7}

                                    for _, player in ipairs(playerTable) do
                                        local pPos = getThingPos(player)
                                        if pPos.x == pos.x and pPos.y == pos.y and pPos.z == pos.z then
                                            doCreatureAddHealth(player, - getCreatureMaxHealth(player))
                                        end
                                    end
                                    doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE)

                                    addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE)
                                    addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA)
                                end,
                                math.random(100,1000)
                            )
                        end
                        if x == 5 * y then
                            y = y + 1
                        end
                      
                        x = x + 1
                    else
                        doBroadcastMessage('No one have won in Fire Storm Event.')
                        doSetStorage(configFireStormEvent.storages.main, -1)                      
                        doSetStorage(configFireStormEvent.storages.countEvent, getStorage(configFireStormEvent.storages.countEvent) + 1)
                        x, y = 1, 1
                    end
                  
                    addEvent(doRepeatCheckFireStorm, configFireStormEvent.fireStormDelay)
                end
            end
          
            function doCountPlayersFireStormEvent()
                local x = 0
                for _, cid in ipairs(getPlayersOnline()) do
                    if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then
                        x = x + 1
                    end
                end
                return x
            end
          
            function doStartCountingFireStormEvent(x)
                if configFireStormEvent.delayTime-x > 0 then
                    doBroadcastMessage('Fire Storm Event will start in '..configFireStormEvent.delayTime-x..' minutes. You can join to the event by say "!fire join".')
                    addEvent(doStartCountingFireStormEvent, 60*1000, x+1)
                end
            end
        ]]>
    </lib>
under
  1. </config>
replace this party from ur script ur script missing this fuction
 
Code:
    <lib name="lib_fire_storm_event">
        <![CDATA[
            function doStartFireStormEvent()
                doSetStorage(configFireStormEvent.storages.joining, -1)
             
                if configFireStormEvent.players.min <= doCountPlayersFireStormEvent() then     
                    for _, cid in ipairs(getPlayersOnline()) do
                        if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then
                            doCreatureSetNoMove(cid, false)
                            doRemoveCondition(cid, CONDITION_INFIGHT)
                            doTeleportThing(cid, configFireStormEvent.position)
                            doCreatureSetStorage(cid, configFireStormEvent.storages.player, -1)
                         
                            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Fire Storm Event start in '..configFireStormEvent.startEvent..' seconds.')
                        end
                    end
                 
                    addEvent(doSetStorage, configFireStormEvent.startEvent * 1000, configFireStormEvent.storages.main, 1)
                    addEvent(doRepeatCheckFireStorm, configFireStormEvent.startEvent * 1000 + 2000)
                 
                    doBroadcastMessage('Fire Storm Event has started. LET\'S GO!')
                else
                    for _, cid in ipairs(getPlayersOnline()) do
                        if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then
                            doCreatureSetNoMove(cid, false)
                            doRemoveCondition(cid, CONDITION_INFIGHT)
                        end
                    end
                 
                    doBroadcastMessage('Fire Storm hasn\'t started beacuse there were not enough players.')
                end
            end
         
            function doRepeatCheckFireStorm()
                if getStorage(configFireStormEvent.storages.main) > 0 then
                    local xTable, yTable, playerTable = {}, {}, {}

                    for x = configFireStormEvent.room.from.x, configFireStormEvent.room.to.x do
                        for y = configFireStormEvent.room.from.y, configFireStormEvent.room.to.y do
                            table.insert(xTable, x)
                            table.insert(yTable, y)

                            local n, i = getTileInfo({x=x, y=y, z=configFireStormEvent.room.to.z}).creatures, 1
                            if n ~= 0 then
                                local v = getThingfromPos({x=x, y=y, z=configFireStormEvent.room.to.z, stackpos=i}).uid
                                while v ~= 0 do
                                    if isPlayer(v) then
                                        table.insert(playerTable, v)
                                        if n == #playerTable then
                                            break
                                        end
                                    end
                                    i = i + 1
                                    v = getThingfromPos({x=x, y=y, z=configFireStormEvent.room.to.z, stackpos=i}).uid
                                end
                            end
                        end
                    end

                    if #playerTable == 1 then
                        local prize = math.random(#configFireStormEvent.rewards)
                        doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1]))
                        doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1]))
                        doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true)
                        doPlayerAddItem(playerTable[1], configFireStormEvent.rewards[prize], 1)
                        doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! You have received ' .. getItemNameById(configFireStormEvent.rewards[prize]) .. ' as reward.')
                        doBroadcastMessage('Fire Storm Event has finished. The winner is ' .. getCreatureName(playerTable[1]) .. '. Congratulations.')
                        doSetStorage(configFireStormEvent.storages.main, -1)
                     
                        db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Fire\", \"" .. getCreatureName(playerTable[1]) .. "\", \"" .. getItemNameById(configFireStormEvent.rewards[prize]) .. "\", " .. getStorage(configFireStormEvent.storages.countEvent) ..");")
                        doSetStorage(configFireStormEvent.storages.countEvent, getStorage(configFireStormEvent.storages.countEvent) + 1)
                     
                        x, y = 1, 1
                    elseif #playerTable > 1 then
                        for a = 1, y do
                            addEvent(
                                function()
                                    local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7}

                                    for _, player in ipairs(playerTable) do
                                        local pPos = getThingPos(player)
                                        if pPos.x == pos.x and pPos.y == pos.y and pPos.z == pos.z then
                                            doCreatureAddHealth(player, - getCreatureMaxHealth(player))
                                        end
                                    end
                                    doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE)

                                    addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE)
                                    addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA)
                                end,
                                math.random(100,1000)
                            )
                        end
                        if x == 5 * y then
                            y = y + 1
                        end
                     
                        x = x + 1
                    else
                        doBroadcastMessage('No one have won in Fire Storm Event.')
                        doSetStorage(configFireStormEvent.storages.main, -1)                     
                        doSetStorage(configFireStormEvent.storages.countEvent, getStorage(configFireStormEvent.storages.countEvent) + 1)
                        x, y = 1, 1
                    end
                 
                    addEvent(doRepeatCheckFireStorm, configFireStormEvent.fireStormDelay)
                end
            end
         
            function doCountPlayersFireStormEvent()
                local x = 0
                for _, cid in ipairs(getPlayersOnline()) do
                    if getCreatureStorage(cid, configFireStormEvent.storages.player) > 0 then
                        x = x + 1
                    end
                end
                return x
            end
         
            function doStartCountingFireStormEvent(x)
                if configFireStormEvent.delayTime-x > 0 then
                    doBroadcastMessage('Fire Storm Event will start in '..configFireStormEvent.delayTime-x..' minutes. You can join to the event by say "!fire join".')
                    addEvent(doStartCountingFireStormEvent, 60*1000, x+1)
                end
            end
        ]]>
    </lib>
under
  1. </config>
replace this party from ur script ur script missing this fuction
doesn't work, could you send me whole your script?
 
use it and edite ur postion and reward
still getting this error
Code:
[Error - TalkAction Interface]
buffer:onSay
Description:
data/lib/034-exhaustion.lua:8: field 'day' missing in date table
stack traceback:
        [C]: in function 'time'
        data/lib/034-exhaustion.lua:8: in function 'check'
        [string "loadBuffer"]:12: in function <[string "loadBuffer"]:3>

this is my 032 lib
Code:
function isInRange(position, fromPosition, toPosition)
    return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z)
end

function getDistanceBetween(firstPosition, secondPosition)
    local x, y = math.abs(firstPosition.x - secondPosition.x), math.abs(firstPosition.y - secondPosition.y)
    local diff = math.max(x, y)
    if(firstPosition.z ~= secondPosition.z) then
        diff = diff + 9 + 6
    end

    return diff
end

function getDirectionTo(pos1, pos2)
    local dir = NORTH
    if(pos1.x > pos2.x) then
        dir = WEST
        if(pos1.y > pos2.y) then
            dir = NORTHWEST
        elseif(pos1.y < pos2.y) then
            dir = SOUTHWEST
        end
    elseif(pos1.x < pos2.x) then
        dir = EAST
        if(pos1.y > pos2.y) then
            dir = NORTHEAST
        elseif(pos1.y < pos2.y) then
            dir = SOUTHEAST
        end
    else
        if(pos1.y > pos2.y) then
            dir = NORTH
        elseif(pos1.y < pos2.y) then
            dir = SOUTH
        end
    end
    return dir
end

function getCreatureLookPosition(cid)
    return getPosByDir(getThingPos(cid), getCreatureLookDirection(cid))
end

function getPosByDir(fromPosition, direction, size)
    local n = size or 1

    local pos = fromPosition
    if(direction == NORTH) then
        pos.y = pos.y - n
    elseif(direction == SOUTH) then
        pos.y = pos.y + n
    elseif(direction == WEST) then
        pos.x = pos.x - n
    elseif(direction == EAST) then
        pos.x = pos.x + n
    elseif(direction == NORTHWEST) then
        pos.y = pos.y - n
        pos.x = pos.x - n
    elseif(direction == NORTHEAST) then
        pos.y = pos.y - n
        pos.x = pos.x + n
    elseif(direction == SOUTHWEST) then
        pos.y = pos.y + n
        pos.x = pos.x - n
    elseif(direction == SOUTHEAST) then
        pos.y = pos.y + n
        pos.x = pos.x + n
    end

    return pos
end

function doComparePositions(pos, posEx)
    return pos.x == posEx.x and pos.y == posEx.y and pos.z == posEx.z
end

function getArea(pos, rangeX, rangeY)
    local t = {}
    for i = (pos.x - rangeX), (pos.x + rangeX) do
        for j = (pos.y - rangeY), (pos.y + rangeY) do
            table.insert(t, {x = i, y = j, z = pos.z})
        end
    end

    return t
end
 
replace it in ur
034-exhaustion.lua
Code:
exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time()
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time()
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time() + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}
 
I don't get this... I changed something, don't know what, after that I get this message when I do "!start fire"
Code:
01:06 ATENCAO! Registre-se no Rush Event, iremos comecar em 5 minutos. Se voce quiser entrar DIGA: !rush
01:07 O evento nao aconteceu porque poucas pessoas participaram.
01:09 Rush Event comecara em 2 minutos. Se voce quiser entrar DIGA: !rush

Don't got something with rush event in it

EDIT: maybe it's something with the storage?
 
copy it again and replace in ur xml and try it if u have doubble storge change it
I fixed it with the rush thing... but when I use your script now I getting theese errors
Code:
[Error - TalkAction Interface]
buffer:onSay
Description:
(luaCreateConditionObject) This function can only be used while loading the scri
pt.

[Error - TalkAction Interface]
buffer:onSay
Description:
(luaDoAddCondition) Condition not found

[Error - TalkAction Interface]
buffer:onSay
Description:
(luaCreateConditionObject) This function can only be used while loading the scri
pt.

[Error - TalkAction Interface]
buffer:onSay
Description:
(luaDoAddCondition) Condition not found

EDIT: also getting theese errors when it started
Code:
[Error - TalkAction Interface]
In a timer event called from:
buffer:onSay
Description:
(luaGetThingPosition) Thing not found

[Error - TalkAction Interface]
In a timer event called from:
buffer:onSay
Description:
[string "function doStartFireStormEvent()..."]:80: attempt to index local 'pPos'
 (a boolean value)
stack traceback:
        [string "function doStartFireStormEvent()..."]:80: in function <[string
"function doStartFireStormEvent()..."]:75>
 
Back
Top