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

MOD perfect Svargrond Arena System!

when people die in arena, the monster still in arena

try to use this:

PHP:
        <event type="kill" name="PlayerArena" event="script"><![CDATA[
        domodlib('arenaFunctions')
function onKill(cid, target, lastHit)
	if getPlayerStorageValue(cid, isIN) == 1 then
		I = 0		
		for i = 45300, 45329 do
			if getPlayerStorageValue(cid, i) == 1 then
				I = i
			end
		end
		GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
		setGlobalStorageValue(GlobalStor, 0)
		setPlayerStorageValue(cid, isIN, 0)
		if isCreature(lastHit) == true then
			doRemoveCreature(lastHit)
		end
	end
        return true
end]]></event

instead:
PHP:
        <event type="death" name="PlayerArena" event="script"><![CDATA[
        domodlib('arenaFunctions')
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if getPlayerStorageValue(cid, isIN) == 1 then
		I = 0		
		for i = 45300, 45329 do
			if getPlayerStorageValue(cid, i) == 1 then
				I = i
			end
		end
		GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
		setGlobalStorageValue(GlobalStor, 0)
		setPlayerStorageValue(cid, isIN, 0)
		if isCreature(lastHitKiller) == true then
			doRemoveCreature(lastHitKiller)
		end
	end
        return true
end]]></event>
not tezted!
 
try to use this:

PHP:
        <event type="kill" name="PlayerArena" event="script"><![CDATA[
        domodlib('arenaFunctions')
function onKill(cid, target, lastHit)
	if getPlayerStorageValue(cid, isIN) == 1 then
		I = 0		
		for i = 45300, 45329 do
			if getPlayerStorageValue(cid, i) == 1 then
				I = i
			end
		end
		GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
		setGlobalStorageValue(GlobalStor, 0)
		setPlayerStorageValue(cid, isIN, 0)
		if isCreature(lastHit) == true then
			doRemoveCreature(lastHit)
		end
	end
        return true
end]]></event

instead:
PHP:
        <event type="death" name="PlayerArena" event="script"><![CDATA[
        domodlib('arenaFunctions')
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if getPlayerStorageValue(cid, isIN) == 1 then
		I = 0		
		for i = 45300, 45329 do
			if getPlayerStorageValue(cid, i) == 1 then
				I = i
			end
		end
		GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
		setGlobalStorageValue(GlobalStor, 0)
		setPlayerStorageValue(cid, isIN, 0)
		if isCreature(lastHitKiller) == true then
			doRemoveCreature(lastHitKiller)
		end
	end
        return true
end]]></event>
not tezted!

Haven't tested it either but im 100% sure it wont work.
 
Okay..
-I can enter the door when I paid the NPC
-I can access the teleport
-The first monster "frostfur" is there..
*When I kill Frostfur and try to enter the teleport to next room it says "22:19 First kill monster!"
*When I try to leave the arena it says "22:19 You left arena!" and bothing happends

halp? :D
 
try to use this:

PHP:
        <event type="kill" name="PlayerArena" event="script"><![CDATA[
        domodlib('arenaFunctions')
function onKill(cid, target, lastHit)
    if getPlayerStorageValue(cid, isIN) == 1 then
        I = 0        
        for i = 45300, 45329 do
            if getPlayerStorageValue(cid, i) == 1 then
                I = i
            end
        end
        GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
        setGlobalStorageValue(GlobalStor, 0)
        setPlayerStorageValue(cid, isIN, 0)
        if isCreature(lastHit) == true then
            doRemoveCreature(lastHit)
        end
    end
        return true
end]]></event
instead:
PHP:
        <event type="death" name="PlayerArena" event="script"><![CDATA[
        domodlib('arenaFunctions')
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    if getPlayerStorageValue(cid, isIN) == 1 then
        I = 0        
        for i = 45300, 45329 do
            if getPlayerStorageValue(cid, i) == 1 then
                I = i
            end
        end
        GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
        setGlobalStorageValue(GlobalStor, 0)
        setPlayerStorageValue(cid, isIN, 0)
        if isCreature(lastHitKiller) == true then
            doRemoveCreature(lastHitKiller)
        end
    end
        return true
end]]></event>
not tezted!

this should work
PHP:
<event type="death" name="PlayerArena" event="script"><![CDATA[
    domodlib('arenaFunctions')
    function onDeath(cid, corpse, deathList)
        if getPlayerStorageValue(cid, isIN) == 1 then
            I = 0        
            for i = 45300, 45329 do
                if getPlayerStorageValue(cid, i) == 1 then
                    I = i
                end
            end
            GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
            setGlobalStorageValue(GlobalStor, 0)
            setPlayerStorageValue(cid, isIN, 0)
            if isCreature(getPlayerStorageValue(cid, MonStor)) then
                doRemoveCreature(getPlayerStorageValue(cid, MonStor))
            end
        end
        return true
    end
]]></event>
 
[14/03/2010 18:54:32] Lua Script Error: [MoveEvents Interface]
[14/03/2010 18:54:32] buffer:eek:nStepIn

[14/03/2010 18:54:32] [string "loadBuffer"]:19: attempt to call global 'doItemSetAttribute' (a nil value)
[14/03/2010 18:54:32] stack traceback:
[14/03/2010 18:54:32] [string "loadBuffer"]:19: in function <[string "loadBuffer"]:2>

[14/03/2010 18:54:46] Lua Script Error: [Action Interface]
[14/03/2010 18:54:46] buffer:eek:nUse


help plx i dont take goblet :(
 
[Error - MoveEvents Inferface]
data/movements/scripts/arenaroom.lua:eek:nStepIn
Description:
<LuaDoCreateMonster> Monster with name '' not found

And here is my arenaroom.lua

Code:
function onStepIn(cid, item, position, fromPosition)
    if InitArenaScript == 0 then
        InitArenaScript = 1
        -- make arena rooms free
        for i = 0,9 do
            setGlobalStorageValue(42300+i, 0)
            setGlobalStorageValue(42400+i, 0)
        end
        checkArenaRooms({})
    end
    local arena_room = item.actionid
    local player_arena = getPlayerStorageValue(cid, 42355)
    if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then
        if getGlobalStorageValue(cid, arena_room) == 0 then
            local monster_uid = getGlobalStorageValue(arena_room+100)
            if monster_uid > 0 then
                if isCreature(monster_uid) == TRUE then
                    doRemoveCreature(monster_uid)
                end
            end
            local spawn_pos = getThingPos(arena_room)
            local monster = doCreateMonster(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})
            setGlobalStorageValue(arena_room+100, monster)
            doTeleportThing(cid, spawn_pos, TRUE)
            setGlobalStorageValue(arena_room, cid)
            setGlobalStorageValue(arena_room-1, 0)
            setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)
        else
            doTeleportThing(cid, fromPosition, TRUE)
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' is now in next room. Wait a moment and try again.')
        end
    else
        doTeleportThing(cid, fromPosition, TRUE)
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')
    end
    if arena_room == 42300 then
        setPlayerStorageValue(cid, 42351, 0)
        setPlayerStorageValue(cid, 42352, 1)
    end
    return TRUE
end

function checkArenaRooms(param)
    addEvent(checkArenaRooms, 1000, {})
    for i = 42300, 42309 do
        local player = getGlobalStorageValue(i)
        if isPlayer(player) == TRUE then
            local player_storage = getPlayerStorageValue(player, 42350)
            if player_storage <= os.time() then
                doTeleportThing(player, arenaKickPosition, TRUE)
                setPlayerStorageValue(player, 42350, 0)
                setGlobalStorageValue(i, 0)
                doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You have been kicked from arena! You have only ' .. arena_room_max_time .. ' seconds for one room.')
            elseif player_storage - 10 <= os.time() then
                doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'You have' .. player_storage - os.time() .. ' seconds to go to next room!')
            end
        else
            setGlobalStorageValue(i, 0)
        end
    end
end
 
2x@up wchitch version of tfs do you have?
@up are you sure so you have monsters into functions.lua? And this is not from my posted script than I cannot help you wihout post your all files here, than I think if is not MOD you should have some functions into /lib/050-functions.lua and positions of monsters.
 
19:11 Halvar: As you wish! You can pass the door now and enter the teleporter to the pits.






and when I using the door
19:11 You have not paid NPC yet



and also teleport into arena monsters dont working
19:12 You have been kicked.!
 
Back
Top