• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

"real tibia svargrond arena" by Gesior

i import arena map for my map, but cordenates is not same, but i change global.lua my kick position, i need change other script ?



------------ EDITED ------------------
WORKING GESIOR, THANKS, GREAT SCRIPT!
 
Last edited:
many people have problem with 'first kill monster'...
Could someone fix it please ? (I can't :p)
 
I have little problem o_O I use this arena.lua script:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

function enterArena(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local cost = 0
    local levelname = ''
    if getPlayerStorageValue(cid, 42355) < 1 then
        cost = 1000
        levelname = 'greenshore'
        levelneeded = 30
    elseif getPlayerStorageValue(cid, 42355) == 1 then
        cost = 5000
        levelname = 'scrapper'
        levelneeded = 50
    elseif getPlayerStorageValue(cid, 42355) == 2 then
        cost = 10000
        levelname = 'warlord'
        levelneeded = 80
    end
    if string.lower(keywords[1]) == 'yes' and parameters.prepare ~= 1 then
        if(getPlayerLevel(cid) >= levelneeded) then
            if(getPlayerMoney(cid) >= cost) then
                npcHandler:say('Now you can go to test.', cid)
                setPlayerStorageValue(cid, 42351, 1)
            else
                npcHandler:say('You don\'t have ' .. cost .. ' gp! Come back when you will be ready!', cid)
            end
        else
            npcHandler:say('You don\'t have ' .. levelneeded .. ' level! Come back when you will be ready!', cid)
        end
        npcHandler:resetNpc()
    elseif string.lower(keywords[1]) == 'no' then
        npcHandler:say('Come back later then!', cid)
        npcHandler:resetNpc()
    else
        if getPlayerStorageValue(cid, 42355) < 3 then
            npcHandler:say('You test will be ' .. levelname .. ' level. If you want enter you must pay ' .. cost .. ' gp and have ' .. levelneeded .. ' level. Wanna try?', cid)
        else
            npcHandler:say('You did all arena levels.',cid)
        end
    end
    return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|! Do you want to make arena?')

local yesNode = KeywordNode:new({'yes'}, enterArena, {})
local noNode = KeywordNode:new({'no'}, enterArena, {})

local node1 = keywordHandler:addKeyword({'arena'}, enterArena, {prepare=1})
    node1:addChildKeywordNode(yesNode)
    node1:addChildKeywordNode(noNode)
    
local node1 = keywordHandler:addKeyword({'fight'}, enterArena, {prepare=1})
    node1:addChildKeywordNode(yesNode)
    node1:addChildKeywordNode(noNode)
local node1 = keywordHandler:addKeyword({'yes'}, enterArena, {prepare=1})
    node1:addChildKeywordNode(yesNode)
    node1:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())

But when npc asks do you want go to example warlord and pay that and when answer yes it says you can go now ect.... but it dont take moneys.... Hope somebody understanded... Bad english :S So how make npc that will take that 10k of warlord...
 
I have little problem o_O I use this arena.lua script:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

function enterArena(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local cost = 0
    local levelname = ''
    if getPlayerStorageValue(cid, 42355) < 1 then
        cost = 1000
        levelname = 'greenshore'
        levelneeded = 30
    elseif getPlayerStorageValue(cid, 42355) == 1 then
        cost = 5000
        levelname = 'scrapper'
        levelneeded = 50
    elseif getPlayerStorageValue(cid, 42355) == 2 then
        cost = 10000
        levelname = 'warlord'
        levelneeded = 80
    end
    if string.lower(keywords[1]) == 'yes' and parameters.prepare ~= 1 then
        if(getPlayerLevel(cid) >= levelneeded) then
            if(getPlayerMoney(cid) >= cost) then
                npcHandler:say('Now you can go to test.', cid)
                setPlayerStorageValue(cid, 42351, 1)
            else
                npcHandler:say('You don\'t have ' .. cost .. ' gp! Come back when you will be ready!', cid)
            end
        else
            npcHandler:say('You don\'t have ' .. levelneeded .. ' level! Come back when you will be ready!', cid)
        end
        npcHandler:resetNpc()
    elseif string.lower(keywords[1]) == 'no' then
        npcHandler:say('Come back later then!', cid)
        npcHandler:resetNpc()
    else
        if getPlayerStorageValue(cid, 42355) < 3 then
            npcHandler:say('You test will be ' .. levelname .. ' level. If you want enter you must pay ' .. cost .. ' gp and have ' .. levelneeded .. ' level. Wanna try?', cid)
        else
            npcHandler:say('You did all arena levels.',cid)
        end
    end
    return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|! Do you want to make arena?')

local yesNode = KeywordNode:new({'yes'}, enterArena, {})
local noNode = KeywordNode:new({'no'}, enterArena, {})

local node1 = keywordHandler:addKeyword({'arena'}, enterArena, {prepare=1})
    node1:addChildKeywordNode(yesNode)
    node1:addChildKeywordNode(noNode)
    
local node1 = keywordHandler:addKeyword({'fight'}, enterArena, {prepare=1})
    node1:addChildKeywordNode(yesNode)
    node1:addChildKeywordNode(noNode)
local node1 = keywordHandler:addKeyword({'yes'}, enterArena, {prepare=1})
    node1:addChildKeywordNode(yesNode)
    node1:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())

But when npc asks do you want go to example warlord and pay that and when answer yes it says you can go now ect.... but it dont take moneys.... Hope somebody understanded... Bad english :S So how make npc that will take that 10k of warlord...

Change:
Code:
            if(getPlayerMoney(cid) >= cost) then
to
Code:
            if(doPlayerRemoveMoney(cid, cost) == TRUE) then
 
Code:
function onLogin(cid)
    registerCreatureEvent(cid, "PlayerKill")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena 
	registerCreatureEvent(cid, "PlayerDeath")
	return TRUE
end
Code:
[12/11/2008 15:02:29] Lua Script Error: [MoveEvents Interface] 
[12/11/2008 15:02:29] data/movements/scripts/arenaroom.lua:onStepIn

[12/11/2008 15:02:29] luaGetThingPos(). Thing not found

[12/11/2008 15:02:29] Lua Script Error: [MoveEvents Interface] 
[12/11/2008 15:02:29] data/movements/scripts/arenaroom.lua:onStepIn

[12/11/2008 15:02:29] luaDoSummonCreature(). Can not summon monster: frostfur

I added it to my own map but I'm wondering how it can recognize the coordinates of a room? Maybe it's trying to spawm the monster in a wall or something?
 
Last edited:
lols, why not use RME find a server that has already got the Arena delete what u dont want then import the arena into ur own map and transfer the scripts over?
 
i have eveythins working with this... idk why u guys got erros just import this map to ur map and import the script ...
 
when i did the arena i get tp'd to the npc and i can do the next one i don't get tp'd to the arena rewards:/ any ideas about how to fix this?
 
If someone writes,"Najpierw zabij potwora!"Let the paste to login.lua
Code:
function onLogin(cid)
    registerCreatureEvent(cid, "PlayerKill")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena 
	registerCreatureEvent(cid, "PlayerDeath")
	return TRUE
end
 
Last edited:
Back
Top