• 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 Svargrond Arena [TFS v0.2.15]

Elvarion

Member
Joined
Apr 14, 2010
Messages
99
Reaction score
13
First tried out some scripts that i found here. Did not work for me whatsoever.

Found some other scripts.
Added them to the server and set up all the Action/Unique ids.

Npc enables you to enter the door > Teleport inside works.

When teleporting to the first room.
Code:
[08/12/2013 16:14:37] Lua Script Error: [MoveEvents Interface]
[08/12/2013 16:14:37] data/movements/scripts/svargrond arena quest/arena_enter.lua:onStepIn
[08/12/2013 16:14:37] .../movements/scripts/svargrond arena quest/arena_enter.lua:55: attempt to call global 'doForceSummonCreature' (a nil value)
[08/12/2013 16:14:37] stack traceback:
[08/12/2013 16:14:37]     [C]: in function 'doForceSummonCreature'
[08/12/2013 16:14:37]     .../movements/scripts/svargrond arena quest/arena_enter.lua:55: in function <.../movements/scripts/svargrond arena quest/arena_enter.lua:17>

Changing "doForceSummonCreature" to "doSummonCreature" works.
However when you kill the monster the pillar does not get removed. And if you try and use the portal to get out (Escape exit) you will get teleported back into the room and a new monster will spawn.

Console also prints this when using the portal (escape exit)
Code:
[08/12/2013 16:15:57] Lua Script Error: [MoveEvents Interface]
[08/12/2013 16:15:57] data/movements/scripts/svargrond arena quest/arena_pit.lua:onStepIn
[08/12/2013 16:15:57] data/movements/scripts/svargrond arena quest/arena_pit.lua:68: attempt to call global 'doForceSummonCreature' (a nil value)
[08/12/2013 16:15:57] stack traceback:
[08/12/2013 16:15:57]     [C]: in function 'doForceSummonCreature'
[08/12/2013 16:15:57]     data/movements/scripts/svargrond arena quest/arena_pit.lua:68: in function <data/movements/scripts/svargrond arena quest/arena_pit.lua:16>
Changing "doForceSummonCreature" to "doSummonCreature" removes the error in the log. But will still teleport you to the middle of the room.

arena_pit.lua
"doTeleportThing(cid, POSITION_KICK)"
svargrondarenaquest.lua
"POSITION_KICK = {x = 1484, y = 1062, z = 7}"

I did set the duration of how long you can stay in the arena to 60 sec to test the kick when taking to long. This works just fine and will teleport you to the "POSITION_KICK" coords.

So im stuck with no errors, just a script that does not do what its supposed to do ^^,
(Perhaps to new functions?)

Any hints is very much appreciated =)

Files im using
arena_enter.lua
arena_pit.lua
SvargrondArenaQuest.lua (inside Data\lib)
(There are some more, like rewards etc. But since its not possible to get the UID's to get rewards yets its not worth listing them.)
 
Last edited:
Here is the the onKill script

Code:
dofile('data/lib/SvargrondArenaQuest.lua')

function onKill(cid, target)
    local pit = getPlayerStorageValue(cid, STORAGE_PIT)
    local arena = getPlayerStorageValue(cid, STORAGE_ARENA)
    if isPlayer(target) then return true end
    if pit < 1 or pit > 10 then return true end
    if arena < 1 then return true end

    if isInArray(ARENA[arena].creatures, getCreatureName(target):lower()) then
        local pillar = getTopItem(PITS[pit].pillar)
        local tp = getTopItem(PITS[pit].tp)
          local pos = PITS[pit].pillar
        local effectpos = { 
        {x=pos.x-1,y=pos.y,z=pos.z},
        {x=pos.x+1,y=pos.y,z=pos.z},
        {x=pos.x+1,y=pos.y-1,z=pos.z},
        {x=pos.x+1,y=pos.y+1,z=pos.z},
        {x=pos.x,y=pos.y,z=pos.z}}  
        if pillar.itemid == ITEM_STONEPILLAR then
        for i = 1, table.maxn(effectpos) do 
            doSendMagicEffect(effectpos[i],12) 
           end 
            doRemoveItem(pillar.uid)       
            local tpaid = doCreateItem(ITEM_TELEPORT, 1, PITS[pit].tp)
                    doSetItemActionId(tpaid,25200)
        else
            print("[Svargrond Arena::CreatureEvent] Cannot remove stone pillar on position X: " .. PITS[pit].pillar.x .. ", Y: " .. PITS[pit].pillar.y .. ", Z: " .. PITS[pit].pillar.z .. ".")
        end
        setPlayerStorageValue(cid, STORAGE_PIT, pit + 1)
        doCreatureSay(cid, "Victory! Head through the new teleporter into the next room.", TALKTYPE_ORANGE_1)
    end
    return true
end
 
Add this function:
Code:
function doForceSummonCreature(name, pos)
        local creature = doSummonCreature(name, pos)
        if creature == false then
                pos.stackpos = STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE

                local lastUid = nil
                while true do
                        local thing = getTileThingByPos(pos)
                        if thing.uid == 0 or thing.uid == lastUid or not isItem(thing.uid) then
                                break
                        end

                        lastUid = thing.uid
                        doRemoveItem(thing.uid)
                end

                creature = doSummonCreature(name, pos)
        end
        return creature
end
 
Added it to the onKill script.
Nothing really happened.

This is what happens when i try to leave the arena via the portal. (I get tped back into the room and another of the same monster spawn)
Code:
[14/12/2013 14:24:24] Lua Script Error: [MoveEvents Interface]
[14/12/2013 14:24:24] data/movements/scripts/svargrond arena quest/arena_pit.lua:onStepIn
[14/12/2013 14:24:24] data/movements/scripts/svargrond arena quest/arena_pit.lua:72: attempt to index a nil value
[14/12/2013 14:24:24] stack traceback:
[14/12/2013 14:24:24]     [C]: in function '__index'
[14/12/2013 14:24:24]     data/movements/scripts/svargrond arena quest/arena_pit.lua:72: in function <data/movements/scripts/svargrond arena quest/arena_pit.lua:16>

Here is the arena_pit script
http://pastebin.com/RDJPfEHF
 
From the lib file
ITEM_TELEPORT = 1387

Items.xml
<item id="1387" article="a" name="magic forcefield">
<attribute key="description" value="You can see the other side through it." />
<attribute key="type" value="teleport" />
</item>

Should be valid? :/
 
Try add this into global
Code:
function getTopItem(p)
    p.stackpos = 1
    local v = getThingfromPos(p)
    while v.uid ~= 0 do
        if not isCreature(v.uid) then
        return v
    end
    p.stackpos = p.stackpos + 1
    v = getThingfromPos(p)
    end
end
 
Still nothing. No teleport appears when the monster is killed.. :|

Somewhat interesting, if i teleport with a gm character to the next fight and try and exit. I end up in the first fight and it summons the wolf..
 
Back
Top