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

Need little help with Gesior's arena.

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hi there,

many ppl are saying that this arena doesn't work in 0.3. Lol? I am using 0.3b2 and it's working.. erm.. almost. When player kills the monster, monster doesn't die, and it keeps attacking but it's not moving. Player is spammed with "Succeeded! Go ahead, warrior...". When the next player is going to the arena room with monster "killed" by previous player, this monster dissapears, and the right monster is spawned. Just everything is alright except removing killed monster.So maybe someone will know how to make the monster dissapear immediately after killing it by the right person.


Movement script:
Code:
function onStepIn(cid, item, position, fromPosition)
	if InitArenaScript == 0 then
		InitArenaScript = 1
		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 = doSummonCreature(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))..' was fighting above. Please wait, mortal!')
		end
	else
		doTeleportThing(cid, fromPosition, TRUE)
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill the 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 are doomed!')
			elseif player_storage - 10 <= os.time() then
				doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'You have ' .. player_storage - os.time() .. ' seconds left to advance to the next room!')
			end
		else
			setGlobalStorageValue(i, 0)
		end
	end
end

onKill from creaturescripts
Code:
function onKill(cid, target)
	local monster = getCreatureName(target)
	local room = getArenaMonsterIdByName(monster)
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Succeeded! Go ahead, warrior...')
	end
end

Additional things to login.lua
Code:
    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

And I think it's all of important parts of this arena.

Thanks,
Hermes
 
Last edited:
onKill from creaturescripts
Code:
function onKill(cid, target)
	local monster = getCreatureName(target)
	local room = getArenaMonsterIdByName(monster)
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Succeeded! Go ahead, warrior...')
	end
end

And I think it's all of important parts of this arena.

Thanks,
Hermes

Try changing the code with this one:

PHP:
function onKill(cid, target)
	local monster = getCreatureName(target)
	local room = getArenaMonsterIdByName(monster)
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Succeeded! Go ahead, warrior...')
	end
	return TRUE
end
 
Okay, I will try but not now :f, I am now far away from home and I will return in two days.

Thanks!
 
what is it people?
Code:
[10/01/2009  00:31:46] Lua Script Error: [MoveEvents Interface] 
[10/01/2009  00:31:46] data/movements/scripts/arenaroom.lua:onStepIn

[10/01/2009  00:31:46] luaGetThingPos(). Thing not found

[10/01/2009  00:31:46] Lua Script Error: [MoveEvents Interface] 
[10/01/2009  00:31:46] data/movements/scripts/arenaroom.lua:onStepIn

[10/01/2009  00:31:46] luaDoSummonCreature(). Can not summon monster: frostfur
 
Everything should work fine, the only problem is the fact that it doesn't recognize that you did the arena, so it won't tp you to the reward room.
 
All set and it worked with previous version of 0.3beta. But I don't know why there is alot of problems with this arena.
 
All set and it worked with previous version of 0.3beta. But I don't know why there is alot of problems with this arena.

so you did set cordinates to the tps? but it is four rooms but only 3 tps?
i have never did svargrond arena so i dont know how its work
 
Back
Top