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

Solved Arena svargrond BUG

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
Code:
domodlib('arenaFunctions')
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                    npcHandler:onThink()                    end
local focus = 0

local talk_start = 0

local TS = 0



function onCreatureDisappear(cid, pos)

    if focus == cid then

        selfSay('Good bye then.')

        focus = 0

        talk_start = 0

    end

end



local function BYE()

    focus = 0

    talk_start = 0

    TS = 0

end



function msgcontains(txt, str)

      return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end



function onCreatureSay(cid, type, msg)



    msg = string.lower(msg)

    if (msgcontains(msg, 'hi') and (focus == 0)) then

        selfSay('Hello ' .. getCreatureName(cid) .. ', Do you want to make arena?.')

          focus = cid

          talk_start = os.clock()

        TS = 1

    elseif msgcontains(msg, 'hi') and (focus ~= cid) then

          selfSay('Im Bussy')

    elseif TS == 1 and msgcontains(msg, 'yes') or msgcontains(msg, 'fight') or msgcontains(msg, 'arena') then

        if getPlayerStorageValue(cid, myArenaLevel) < 3 then

            local enterArena = myArenaLevelIs(cid)

            if getPlayerLevel(cid) >= enterArena.RLV then

                if getPlayerMoney(cid) >= enterArena.RC then

                    setPlayerStorageValue(cid, talkNPC, 1)

                    doPlayerRemoveMoney(cid, enterArena.RC)

                    selfSay("Now you can go to test... ".. enterArena.LN .."")

                    BYE()

                else

                    selfSay("You don\'t have "..enterArena.RC.." gp! Come back when you will be ready!")

                    BYE()

                end

            else

                selfSay("You don\'t have "..enterArena.RLV.." level! Come back when you will be ready!")

                BYE()

            end

        else

            selfSay(Cancel[6])

            BYE()

        end

    elseif TS == 1 and msgcontains(msg, 'no') then

        selfSay("Bye!.")

        BYE()

    elseif msgcontains(msg, 'bye') then

        selfSay("Bye!.")

        BYE()

    end

    return true

end



function onThink()

    doNpcSetCreatureFocus(focus)

    if (os.clock() - talk_start) > 60 then

          if focus > 0 then

              selfSay('Good bye then.')

          end

          focus = 0

      end

end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

[18:50:02.162] Toph has logged out.
[18:49:20.780] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Halvar.xml).
[18:49:20.780] Line: 6, Info: Premature end of data in tag npc line 1


data/npc/Halvar.xml:6: parser error : Premature end of data in tag npc line 1
</parameters>
^
[18:49:21.839] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Halvar.xml).
[18:49:21.839] Line: 6, Info: Premature end of data in tag npc line 1


data/npc/Halvar.xml:6: parser error : Premature end of data in tag npc line 1
</parameters>
^
[18:49:22.970] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Halvar.xml).
[18:49:22.970] Line: 6, Info: Premature end of data in tag npc line 1

[18:50:05.349] Toph has logged in.
[18:49:20.780] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Halvar.xml).
[18:49:20.780] Line: 6, Info: Premature end of data in tag npc line 1


data/npc/Halvar.xml:6: parser error : Premature end of data in tag npc line 1
</parameters>
^
[18:49:21.839] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Halvar.xml).
[18:49:21.839] Line: 6, Info: Premature end of data in tag npc line 1


data/npc/Halvar.xml:6: parser error : Premature end of data in tag npc line 1
</parameters>
^
[18:49:22.970] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Halvar.xml).
[18:49:22.970] Line: 6, Info: Premature end of data in tag npc line 1
 
Last edited:
that's bug is not about lua file, but xml file of your npc.
you can't read or just posting on forum in think that they will do everything for me, because i cant do nothing by myself?
 
Back
Top