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

Svargrond Arena Quest for TFS 0.3.5

Valania

Learning PHP/Lua
Joined
Oct 23, 2009
Messages
315
Reaction score
1
Location
Germany
Important:
I didn't made this script by myself. It's made by Gesior and some other people but forgot names. I just post it because many people are asking for 0.3.5 which ain't working for them.

Here we start:

Go to data/actions/actions.xml:

Code:
        <!--Arena Quest-->
         <action actionid="42366" event="script" value="quests/arenadoors.lua"/>
         <action actionid="42376" event="script" value="quests/arenadoors.lua"/>
         <action actionid="42386" event="script" value="quests/arenadoors.lua"/>
         <action actionid="42357" event="script" value="quests/arenadoors.lua"/>
         <action fromaid="42361" toaid="42365" event="script" value="quests/arenareward.lua"/>
         <action fromaid="42371" toaid="42375" event="script" value="quests/arenareward.lua"/>
         <action fromaid="42381" toaid="42385" event="script" value="quests/arenareward.lua"/>

Then go to data/movements/movements.xml

Code:
        <!--Arena Quest-->
        <movevent type="StepIn" actionid="42360" event="script" value="arenagoblet.lua"/>
    <movevent type="StepIn" actionid="42370" event="script" value="arenagoblet.lua"/>
    <movevent type="StepIn" actionid="42380" event="script" value="arenagoblet.lua"/>
    <movevent type="StepOut" actionid="42360" event="script" value="arenagoblet.lua"/>
    <movevent type="StepOut" actionid="42370" event="script" value="arenagoblet.lua"/>
    <movevent type="StepOut" actionid="42380" event="script" value="arenagoblet.lua"/>
    <movevent type="StepIn" fromaid="42300" toaid="42309" event="script" value="arenaroom.lua"/>
    <movevent type="StepIn" actionid="42310" event="script" value="didarenalevel.lua"/>
    <movevent type="StepIn" fromaid="42321" toaid="42330" event="script" value="leavearena.lua"/>

Go to data/lib/data.lua

Code:
dofile(getDataDir() .. "lib/arena.lua")

Go to data/creaturescripts/creaturescripts.xml

Code:
<event type="kill" name="ArenaKill" event="script" value="arenakill.lua"/>

In your login.lua file copy this before your return true

Code:
  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

Add in your monster.xml file all the monsters which will be spawned in the arena quest.
At the end you just need to download the files from:
Upload Files / svargrond-arena-tfs034-english-v3.zip - UploadHyper.com -

Give me reputation for trying to help you guys who ain't know anything about lua etc AND
Give Gesior.pl Reputation for being a great scripter.

Kind Regards,
Valania
 
Hello friend, a mistake.
I talk to the NPC:
hi - fight - yes
step through the door, and try to enter the teleport. More every time I enter the Teleport speech: First kill monster!

That would be a bug? Or did something wrong?
 
Remember to put the movements and the actions in your xml-folder and did you received any messages in your console? This script works pefectly, did you guys added the scripts in the right folder?
 
Remember to put the movements and the actions in your xml-folder and did you received any messages in your console? This script works pefectly, did you guys added the scripts in the right folder?

It not works perfect then u entereing in last rooom u will by tped in kick position... so it mean u cant enter to reward room... if u will try to last tp enter a position where u right wanna to tped. example Tp to x:11 Y:11 Z:0 And The Action Will by XXXX u will get c++ Error And ur server Crash... So i thinked how to fix that one...And I was get the idea make a another npc. who will tp u to reward room. its easy to make but dont say it working becouse its true fake.

Here is A Npc...

Xml

Lua:
<npc name="rewarder" script="data/npc/scripts/yalaharxd.lua" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="300" head="" body="" legs="" feet="" addons="" corpse="5995"/>
	<parameters>
        <parameter key="module_travel" value="1"/>
	<parameter key="message_greet" value="Congratulations |PLAYERNAME|. Wanna you meet my ship rotes? If you say {travel}, I'll can help you!" />
        <parameter key="travel_destinations" value="reward,32312,31134,6,0"/>
	</parameters>
</npc>

And THe Lua One.:

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
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
-- OTServ event handling functions end


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Yalahar City for 1000 gold coins?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 100, cost = 1000, destination = {x=506, y=1855, z=6} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Yalahar\' for just a small fee.'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

insert the npc in place where stanting arener...


Kind Regards,
Apsivaflines
 
Valania@

Yes friend, I put everything right.

If for you saying kill first monster then check is everything good in ur lib folder...


be Sure U Inserted This

Lua:
dofile(getDataDir() .. "lib/arena.lua")

And Use Mine Data.

Lua:
InitArenaScript = 0
arena_room_max_time = 240 -- time in seconds for one arena room
arenaKickPosition = {x=32312, y=31148, z=7} -- position where kick from arena when you leave/you did arena level
arena_monsters = {}
arena_monsters[42300] = 'frostfur' -- first monster from 1 arena
arena_monsters[42301] = 'bloodpaw'
arena_monsters[42302] = 'bovinus'
arena_monsters[42303] = 'achad'
arena_monsters[42304] = 'colerian the barbarian'
arena_monsters[42305] = 'the hairy one'
arena_monsters[42306] = 'axeitus headbanger'
arena_monsters[42307] = 'rocky'
arena_monsters[42308] = 'cursed gladiator'
arena_monsters[42309] = 'orcus the cruel'
arena_monsters[42310] = 'avalanche' -- first monster from 2 arena
arena_monsters[42311] = 'kreebosh the exile'
arena_monsters[42312] = 'the dark dancer'
arena_monsters[42313] = 'the hag'
arena_monsters[42314] = 'slim'
arena_monsters[42315] = 'grimgor guteater'
arena_monsters[42316] = 'drasilla'
arena_monsters[42317] = 'spirit of earth'
arena_monsters[42318] = 'spirit of water'
arena_monsters[42319] = 'spirit of fire'
arena_monsters[42320] = 'webster' -- first monster from 3 arena
arena_monsters[42321] = 'darakan the executioner'
arena_monsters[42322] = 'norgle glacierbeard'
arena_monsters[42323] = 'the pit lord'
arena_monsters[42324] = 'svoren the mad'
arena_monsters[42325] = 'the masked marauder'
arena_monsters[42326] = 'gnorre chyllson'
arena_monsters[42327] = "fallen mooh'tah master ghar"
arena_monsters[42328] = 'deathbringer'
arena_monsters[42329] = 'the obliverator'

function getArenaMonsterIdByName(name)
    name = string.lower(tostring(name))
    for i = 42300, 42329 do
        if tostring(arena_monsters[i]) == name then
            return i
        end
    end
    return 0
end
 
Not All. Realy THen U entering Last Tp u will get c++ Error. (Map.h)

And i post mine npc.
 
No friend, I do not enter wrong, the error should be in the script of the portal, or the NPC, because when I talk to the NPC, that at the beginning of the arena. I ask first, Greehorn (ta do not know if the right name), he tells me to go to portal, and such. More when I get the portal, he says, what you said before.
This: First kill monster!
 
Thx for sharing Valania, working perfectly...
Dunno what all the other guys complain about. If there would be a misstake then they should learn to fix it by themselves.

Rep for ya++
 
when i done the first arena, say me to get the reward, and i go to the teleport again and say to me first kill monster.... why!!!
 
Back
Top