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

Lua "real tibia svargrond arena" for TFS 0.3.4 ver. 3

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Hello Guys/girls i need some help here whit "real tibia svargrond arena" for TFS 0.3.4 ver. 3 from geisor
Link :
http://otland.net/f81/real-tibia-svargrond-arena-forgotten-server-0-3-4-ver-3-a-33938/

This is the only error i get :S ?
Code:
[18/08/2009 10:50:27] Lua Script Error: [CreatureScript Interface] 
[18/08/2009 10:50:27] data/creaturescripts/scripts/login.lua

[18/08/2009 10:50:27] luaRegisterCreatureEvent(). Creature not found

[18/08/2009 10:50:27] Lua Script Error: [CreatureScript Interface] 
[18/08/2009 10:50:27] data/creaturescripts/scripts/login.lua

[18/08/2009 10:50:27] luaGetPlayerStorageValue(). Player not found

[18/08/2009 10:50:27] Lua Script Error: [CreatureScript Interface] 
[18/08/2009 10:50:27] data/creaturescripts/scripts/login.lua

[18/08/2009 10:50:27] data/creaturescripts/scripts/login.lua:24: attempt to compare boolean with number
[18/08/2009 10:50:27] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)
how do i fix that +
when i try to enter first tp after the door this come : ?

10:51 First kill monster!
but there arent any monster ?:blink:

data/creaturescripts/scripts/login.lua
Code:
function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "PlayerDeath")
	return TRUE
end

function onLogin(cid)
	local getStatus = getPlayerStorageValue(cid, 3293)
	if(getStatus ~= TRUE) then
		local str = "Crying Tibia\nPlayers Commands\n-!online ''Players Online''\n-!buyhouse ''Buy House''\n-!sellhouse ''Sell House''\n-!serverinfo ''Server info''\n-!frags ''Frags''\n-!createguild ''Creata Guild''\n-!joinguild ''Join Guild''\n-!leavehouse ''leave house''\n-/uptime ''look uptime'' \n-!ranks ''exp or skill rank here''\n-!aol ''Buy Aol''\n-!bp ''Buy Backpack''\n-!blankrune ''Buy Blankrune''\n-!spells ''Look your spell's''\nType !help to popup this window"
		doPlayerPopupFYI(cid, str)
		setPlayerStorageValue(cid, 3293, TRUE)
	end	
	return TRUE
end
    registerCreatureEvent(cid, "ArenaKill")
    -- 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
 
OM NOM NOM! ur login.lua is just piece of shit -.-// no kidding... And you want to create ots? o.O

LUA:
function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end
	
	local getStatus = getPlayerStorageValue(cid, 3293)
	if(getStatus ~= TRUE) then
		local str = "Crying Tibia\nPlayers Commands\n-!online ''Players Online''\n-!buyhouse ''Buy House''\n-!sellhouse ''Sell House''\n-!serverinfo ''Server info''\n-!frags ''Frags''\n-!createguild ''Creata Guild''\n-!joinguild ''Join Guild''\n-!leavehouse ''leave house''\n-/uptime ''look uptime'' \n-!ranks ''exp or skill rank here''\n-!aol ''Buy Aol''\n-!bp ''Buy Backpack''\n-!blankrune ''Buy Blankrune''\n-!spells ''Look your spell's''\nType !help to popup this window"
		doPlayerPopupFYI(cid, str)
		setPlayerStorageValue(cid, 3293, TRUE)
	end	
	
	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, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "PlayerDeath")
    registerCreatureEvent(cid, "ArenaKill")
	
	return TRUE
end
 
now i can make the quest but when iam in the last room i cant go in the TP ?
i have kill the mob but get this when i try to go in in the last tp ?
12:17 First kill monster!
 
fixed it only have two problem left.. when i enter the last tp server crash .. ?
error :
b1jsy8.png
 
Last edited:
Problem 2 , when i have made all arena's and talk to npc agien i cant make the arenas (and that good but i get a error)
[19/08/2009 14:35:44] Lua Script Error: [Npc interface]
[19/08/2009 14:35:44] data/npc/scripts/arena.lua:onCreatureSay

[19/08/2009 14:35:44] data/npc/scripts/arena.lua:30: attempt to compare nil with number
[19/08/2009 14:35:44] stack traceback:
[19/08/2009 14:35:44] data/npc/scripts/arena.lua:30: in function 'callback'
[19/08/2009 14:35:44] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[19/08/2009 14:35:44] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[19/08/2009 14:35:44] data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
[19/08/2009 14:35:44] data/npc/lib/npcsystem/npchandler.lua:380: in function 'onCreatureSay'
[19/08/2009 14:35:44] data/npc/scripts/arena.lua:7: in function <data/npc/scripts/arena.lua:7>
 
@up
create npc
name: Arener.lua
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Halvar" script="data/npc/scripts/arena.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
<look type="143" head="3" body="77" legs="78" feet="97" addons="1"/>
     <parameters>
  <parameter key="message_greet" value="Hello competitor! Do you want to fight in the arena or shall I explain the rules first?"/>
    
	    <parameter key="module_keywords" value="1" />
        <parameter key="keywords" value="rule;die;death;greenhorn;scrapper;warlord;price;general;difficulties;levels;difficulty;fee;"/>
        <parameter key="keyword_reply1" value="What do you want to know? Something about the three different {difficulties}, the {general} rules or the {prices}? Maybe you also want to know what happens when you {die}?" />
        <parameter key="keyword_reply2" value="It would be better not to {die}! In every pit there is an emergency exit, the portal to the south. If you {die} in a pit... well... your corpse and backpack are gone, so you enter the arena at your own risk." />
        <parameter key="keyword_reply3" value="It would be better not to {die}! In every pit there is an emergency exit, the portal to the south. If you {die} in a pit... well... your corpse and backpack are gone, so you enter the arena at your own risk." />
        <parameter key="keyword_reply4" value="That is the easiest way in our arena. The {fee} is 1500 gold. We were setting this up for of our children to challenge some easy monsters and train them for the future" />
        <parameter key="keyword_reply5" value="The most common difficulty for us. The {fee} is 5000 gold. So if you are experienced in fighting middle class monsters this is your challenge!" />
        <parameter key="keyword_reply6" value="Only the strongest among us will take this challenge. The {fee} is 10000 gold. If you pass that I promise you the respect of all citizens here. You will be a hero!" />
        <parameter key="keyword_reply7" value="The {fee} is either 1000, 5000 or 10000 gold for one try. Remember that if you {die}, it is YOUR problem and you won't be able to get back to your corpse and your backpack." />
        <parameter key="keyword_reply8" value="Basically you pay me a {fee}, and you are sent into an arena with 10 different stages. If you succeed you will be rewarded accordingly." />
        <parameter key="keyword_reply9" value="There are three difficulties: {Greenhorn}, {Scrapper} and {Warlord}. On each challenge you will be confronted with ten monsters increasing in strength." />
        <parameter key="keyword_reply10" value="There are three difficulties: {Greenhorn}, {Scrapper} and {Warlord}. On each challenge you will be confronted with ten monsters increasing in strength." />
        <parameter key="keyword_reply11" value="There are three difficulties: {Greenhorn}, {Scrapper} and {Warlord}. On each challenge you will be confronted with ten monsters increasing in strength." />
        <parameter key="keyword_reply12" value="The {fee} is either 1000, 5000 or 10000 gold for one try. Remember that if you {die}, it is YOUR problem and you won't be able to get back to your corpse and your backpack." />
</parameters>

</npc>

Now go folder Script
Create archive lua name: arena.lua
PHP:
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 = 'Greenhorn'
        levelneeded = 40
    elseif getPlayerStorageValue(cid, 42355) == 1 then
        cost = 5000
        levelname = 'Scrapper'
        levelneeded = 50
    elseif getPlayerStorageValue(cid, 42355) == 2 then
        cost = 10000
        levelname = 'Warlord'
        levelneeded = 60
    end
    if string.lower(keywords[1]) == 'yes' and parameters.prepare ~= 1 then
  if getPlayerStorageValue(cid, 42351) ~= 1 then
        if(getPlayerLevel(cid) >= levelneeded) then
            if(getPlayerMoney(cid) >= cost) then
                npcHandler:say('As you wish! You can pass the door now and enter the teleporter to the pits.', cid)
doPlayerRemoveMoney(cid, cost)
                setPlayerStorageValue(cid, 42351, 1)
            else
                npcHandler:say('You need ' .. cost .. ' gold pieces to enter this arena in this {difficulty}!', cid)
        npcHandler:resetNpc()
            end
        else
            npcHandler:say('You need level ' .. levelneeded .. ' for this arena {difficulty}!', cid)
        npcHandler:resetNpc()
        end
else
 npcHandler:say('You have already paid the {fee} for entering the arena pits!', cid)
end
        npcHandler:resetNpc()
    elseif string.lower(keywords[1]) == 'no' then
        npcHandler:say('Come back when you feel ready!', cid)
        npcHandler:resetNpc()
    else
        if getPlayerStorageValue(cid, 42355) < 3 then
            npcHandler:say('So you agree with the {rules} and want to participate in the challenge? The {fee} for one try in {' .. levelname .. '} {difficulty} {level} is ' .. cost .. ' gold pieces. Do you really want to participate and pay the {fee}?', cid)
        else
            npcHandler:say('You\'ve already completed the arena in all {difficulty} {levels}.',cid)

        npcHandler:resetNpc()
        end
    end
    return true
end

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 node2 = keywordHandler:addKeyword({'fight'}, enterArena, {prepare=1})
    node2:addChildKeywordNode(yesNode)
    node2:addChildKeywordNode(noNode)
local node3 = keywordHandler:addKeyword({'yes'}, enterArena, {prepare=1})
    node3:addChildKeywordNode(yesNode)
    node3:addChildKeywordNode(noNode)

npcHandler:addModule(FocusModule:new())
 
Back
Top