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

Goblet doesnt generate Arena

wafuboe

Member
Joined
Dec 24, 2010
Messages
882
Solutions
2
Reaction score
23
Well the problem is that when you succesfully finish arenas, once you enter to the reward rooms, on the trophy tile it doesnt works

it shows me this.
01:42 The tile seems to be protected against unwanted intruders.

no errors on console

Lib
Code:
KickPosition = {x=370, y=130, z=7} --if the player leave the arena or time is over, where he go.
RewardsRoom = {x=365, y=99, z=7} --rewards room position.
arenaRoomMaxTime = 600 --max time for each room 240 = 4 min.
OpenDoorsID = 5133 --if you change doors item ids, change me =D


TimeStor = 42350 --here will be saved the time.
myArenaLevel = 45450 --here will be saved the arena level.
talkNPC = 45451 --Storage to check if the player have paid to the npc and can enter to the arena.
RewardsStor = {42361, 42371, 42381} --Storage for greenhorn, scrapper, warlord.
isIN = 42352 --to check if the player is in the arena.
myRoom = 46000 --here will be saved the current room.
MonStor = 47000 --here will be saved the monster uid.


DoorsActID = 42357 --Doors near the npc.
LeavePortals = 42321 --The action id of the portal to leave the rooms (south portals).
GobletTiles = {42360, 42370, 42380} --Action ids of the tiles for Bronze, Silver and Gold Goblets.

Cancel = {
    --message when use door and have not paid to the npc.
    [1] = "The door seems to be sealed against unwanted intruders.",
    --message when leave arena.
    [2] = "You have left the arena.",
    --message when the player can't get the reward.
    [3] = "Nothing happend",
    --message when already got any reward.
    [4] = "It is empty.",
    --when try to open a reward door and haven't completed the level.
    [5] = "The door seems to be sealed against unwanted intruders.",
    --NPC answer if the player completed all arena levels.
    [6] = "Go take your rewards. You won all the challenges.",
    --message when time is over
    [7] = "The time is over.",
    --message when you can go to the next room
    [8] = "Enemy defeated. Continue to next room.",
    --when try to go to the next room and not killed the monster yet.
    [9] = "Your enemy is still alive.",
    --when try to go to the next room but there is a player yet...this text will be PLAYERNAME + this text
    [10] = "is still in next room."
    }

Completed = {
    [1] = "Congatulations! you have completed the arena in",
    --HERE WILL BE THE ARENA NAME.
    [2] = "difficulty!, now go and take your reward."}
    --then the message will be "Congatulations! you have completed the arena in greenhorn/scrapper/warlord difficulty!, now go and take your reward."
  

Arena = {
    --greenhorn
    [0] = {
        Cost = 10000,
        LevelName = 'greenhorn',
        LevelNeeded = 30,
        Goblet = 5807
        },
    --scrapper
    [1] = {
        Cost = 50000,
        LevelName = 'scrapper',
        LevelNeeded = 50,
        Goblet = 5806
        },
    --warlord
    [2] = {
        Cost = 100000,
        LevelName = 'warlord',  
        LevelNeeded = 80,
        Goblet = 5805
        }
    }

arena_monsters = {
    --greenhorn                            -scrapper                            --warlord
    [45300] = "Frostfur",                [45310] = "Avalanche",            [45320] = "Webster",
    [45301] = "Bloodpaw",                [45311] = "Kreebosh the Exile",    [45321] = "Darakan the Executioner",
    [45302] = "Bovinus",                [45312] = "The Dark Dancer",    [45322] = "Norgle Glacierbeard",
    [45303] = "Achad",                    [45313] = "The Hag",            [45323] = "The Pit Lord",
    [45304] = "Colerian The Barbarian",    [45314] = "Slim",                [45324] = "Svoren the Mad",
    [45305] = "The Hairy One",            [45315] = "Grimgor Guteater",    [45325] = "The Masked Marauder",
    [45306] = "Axeitus Headbanger",        [45316] = "Drasilla",            [45326] = "Gnorre Chyllson",
    [45307] = "Rocky",                    [45317] = "Spirit of Earth",    [45327] = "Fallen Mooh'tah Master Ghar",
    [45308] = "Cursed Gladiator",        [45318] = "Spirit of Water",    [45328] = "Deathbringer",
    [45309] = "Orcus the Cruel",        [45319] = "Spirit of Fire",        [45329] = "The Obliverator"}

Checking = false

RoomsACT = {42301, 42302, 42303, 42304, 42305, 42306, 42307, 42308, 42309}

Goblets = {
    [42360] = {Id=Arena[0].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[0].LevelName.." difficulty."},
    [42370] = {Id=Arena[1].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[1].LevelName.." difficulty."},
    [42380] = {Id=Arena[2].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[2].LevelName.." difficulty."}}

RewardsDoors = {[42366] = 1, [42376] = 2, [42386] = 3}

ArenaAdding = {[0] = 3000, [1] = 3010, [2] = 3020}

function myArenaLevelIs(cid)
    Stor = getPlayerStorageValue(cid, myArenaLevel)
    if Stor == -1 then
        setPlayerStorageValue(cid, myArenaLevel, 0)
        Stor = 0
    elseif Stor == 3 then Stor = 2
    end
    return {
        RC = Arena[Stor].Cost,
        LN = Arena[Stor].LevelName,
        RLV = Arena[Stor].LevelNeeded,
        LV = getPlayerStorageValue(cid, myArenaLevel)
    }
end

function getDirectionMove(cid, itempos)
    --function by Nahruto
    p = getCreaturePosition(cid)
    i = itempos
    if p.x > i.x then
        if p.y > i.y then
            ret = NORTHWEST
        elseif p.y < i.y then
            ret = SOUTHWEST
        else
            ret = WEST
        end
    elseif p.x < i.x then
        if p.y > i.y then
            ret = NORTHEAST
        elseif p.y < i.y then
            ret = SOUTHEAST
        else
            ret = EAST
        end
    else
        if p.y > i.y then
            ret = NORTH
        elseif p.y < i.y then
            ret = SOUTH
        else
            ret = nil
        end
    end
    return ret
end

function LeaveArena(cid)
    for i = 45300, 45329 do
        setPlayerStorageValue(cid, i, 0)
    end
    if isCreature(getPlayerStorageValue(cid, MonStor)) == TRUE then
        doRemoveCreature(getPlayerStorageValue(cid, MonStor))
    end
    setGlobalStorageValue(getPlayerStorageValue(cid, myRoom), 0)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[2])
    doTeleportThing(cid, KickPosition, FALSE)
    setPlayerStorageValue(cid, TimeStor, 0)
    setPlayerStorageValue(cid, isIN, 0)
    setPlayerStorageValue(cid, 75841, -1)
end

function CheckRooms()
    addEvent(CheckRooms, 1000)
    for i = 42300, 42309 do
        local Player = getGlobalStorageValue(i)
        if isPlayer(Player) == TRUE then
            local PlayerTime = getPlayerStorageValue(Player, TimeStor)
            if PlayerTime <= os.time() then
                doTeleportThing(Player, KickPosition, FALSE)
                setPlayerStorageValue(Player, TimeStor, 0)
                setGlobalStorageValue(i, 0)
                doPlayerSendTextMessage(Player,MESSAGE_INFO_DESCR, Cancel[7])
                if isCreature(getPlayerStorageValue(Player, MonStor)) == TRUE then
                    doRemoveCreature(getPlayerStorageValue(Player, MonStor))
                end
            elseif PlayerTime - 10 <= os.time() then
                doPlayerSendTextMessage(Player, MESSAGE_EVENT_DEFAULT, "you have "..PlayerTime - os.time().." seconds left.!")
            end
        else
            setGlobalStorageValue(i, 0)
        end
    end
end

function getArenaMonsterIdByName(name)
    for i = 45300, 45329 do
        if tostring(arena_monsters[i]) == string.lower(tostring(name)) then
            return i
        end
    end
    return false
end

arena.lua movement
Code:
function onStepIn(cid, item, position, fromPosition)
    local ArenaRoom = item.actionid
    if item.actionid == LeavePortals then
        LeaveArena(cid)
    elseif isInArray(GobletTiles, item.actionid) then
        return false
    elseif isInArray(RoomsACT, ArenaRoom) or ArenaRoom == 42300 then
        if Checking == FALSE then Checking = true CheckRooms() end
        local myLevelArena = myArenaLevelIs(cid).LV
        if ArenaAdding[myLevelArena] then
            Mons = ArenaRoom + ArenaAdding[myLevelArena]
        end
        if getGlobalStorageValue(ArenaRoom) == 0 then
            if isCreature(getPlayerStorageValue(cid, MonStor)) == FALSE then
                if ArenaRoom == 42300 and getPlayerStorageValue(cid, talkNPC) == 1 then
                    setPlayerStorageValue(cid, talkNPC, 0)
                    setPlayerStorageValue(cid, isIN, 1)
                    P = 1
                elseif ArenaRoom ~= 42300 and getPlayerStorageValue(cid, isIN) == 1 then
                    P = 1
                else
                    P = nil
                end      

                if P ~= nil then
                    local SpawnPos = getThingPos(ArenaRoom)
                    doTeleportThing(cid, SpawnPos, FALSE)
                    SpawnPos.x = SpawnPos.x - 1
                    SpawnPos.y = SpawnPos.y - 1
                    local Monster = doSummonCreature(arena_monsters[Mons], SpawnPos)
                    setGlobalStorageValue(ArenaRoom, cid)
                    setGlobalStorageValue(ArenaRoom - 1, 0)
                    setPlayerStorageValue(cid, TimeStor, os.time()+arenaRoomMaxTime)
                    setPlayerStorageValue(cid, MonStor, Monster)
                    setPlayerStorageValue(cid, myRoom, ArenaRoom)
                else
                    LeaveArena(cid)
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[9])
                doTeleportThing(cid, fromPosition, true)
            end
        else
            doTeleportThing(cid, fromPosition, true)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Someone "..Cancel[10].."")
        end
    elseif ArenaRoom == 42310 then
        if (not isCreature(getPlayerStorageValue(cid, MonStor))) then
            setPlayerStorageValue(cid, 75841, -1)
            setPlayerStorageValue(cid, myArenaLevel, getPlayerStorageValue(cid, myArenaLevel) + 1)
            setGlobalStorageValue(ArenaRoom - 1, 0)
            setPlayerStorageValue(cid, TimeStor, 0)
            setPlayerStorageValue(cid, isIN, 0)
            doTeleportThing(cid, RewardsRoom, true)
            doCreatureSay(cid,""..Completed[1].." "..myArenaLevelIs(cid).LN.." "..Completed[2].."", TALKTYPE_ORANGE_1)
        else
            doTeleportThing(cid, fromPosition, true)
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Enemy is still alive!')
        end
    end
    return true
end

movements.xml
Code:
<movevent event="StepIn" fromaid="42300" toaid="42359" script="arena.lua" />
    <movevent event="StepIn" fromaid="42361" toaid="42369" script="arena.lua" />
    <movevent event="StepIn" fromaid="42371" toaid="42379" script="arena.lua" />
    <movevent event="StepIn" fromaid="42380" toaid="42386" script="arena.lua" />
 
It's probably this stopping it:
Lua:
elseif isInArray(GobletTiles, item.actionid) then
      return false

Maybe there's supposed to be another script the trophy part?
 
Back
Top