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

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

Status
Not open for further replies.
Any update here? I've applied Kaskitin's "fix", but the problem begin here

Talk to arener, he allows you to enter the teleport, then you get teleported to the arena first room, but the monster which appear there, first, doesnt have a name/hp bar, and the monster doesnt move, just change face position (moving from north, south, east, west. etc

And of course i cannot enter to the next pit/teleport because i cannot kill the monster.

Any suggestion? Thanks.

Using TFS 0.3.5pl 1
 
Last edited:
Hello,

my arena working with 0.3.5pl1. You can fight and win. Also you can take all rewards. After rewards the teleport back to the begin works too.

Ofc all credits goes to gesior the wonderful man. IDK what I changed but it works!

Tested on tfs 0.3.5pl1 distro.



actions.xml
PHP:
	<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"/>

arenadoors
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
	if item.actionid ~= 42357 then
		if (item.actionid == 42366 and getPlayerStorageValue(cid,42355) >= 1) or (item.actionid == 42376 and getPlayerStorageValue(cid,42355) >= 2) or (item.actionid == 42386 and getPlayerStorageValue(cid,42355) == 3) then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
			else
				doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
			end
			return TRUE
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not enter room.")
			return TRUE
		end
	elseif (item.actionid == 42357 and getPlayerStorageValue(cid,42351) == 1) then
		if cidPosition.x < toPosition.x then
			doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
		else
			doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
		end
		return TRUE
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must pay first.")
		return TRUE
	end
	return FALSE
end
arenareward
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
		local reward = 0
		if item.actionid == 42361 then
			reward = doCreateItemEx(1990,1)
			doAddContainerItem(reward, 7372, 1)
			doAddContainerItem(reward, 6569, 10)
			doAddContainerItem(reward, 6574, 1)
			doAddContainerItem(reward, 2114, 1)
		elseif item.actionid == 42362 then
			reward = doCreateItemEx(7406,1)
		elseif item.actionid == 42363 then
			reward = doCreateItemEx(7380,1)
		elseif item.actionid == 42364 then
			reward = doCreateItemEx(7392,1)
		elseif item.actionid == 42365 then
			reward = doCreateItemEx(7342,1)
			doAddContainerItem(reward, 7365, 100)
			doAddContainerItem(reward, 7364, 100)
		end
		if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
			setPlayerStorageValue(cid, 42361, 1)
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
		end
	elseif item.actionid >= 42371 and item.actionid <= 42375 and getPlayerStorageValue(cid, 42371) ~= 1 then
		local reward = 0
		if item.actionid == 42371 then
			reward = doCreateItemEx(1990,1)
			doAddContainerItem(reward, 7372, 1)
			doAddContainerItem(reward, 6569, 10)
			doAddContainerItem(reward, 6574, 1)
			doAddContainerItem(reward, 7183, 1)
		elseif item.actionid == 42372 then
			reward = doCreateItemEx(7384,1)
		elseif item.actionid == 42373 then
			reward = doCreateItemEx(7389,1)
		elseif item.actionid == 42374 then
			reward = doCreateItemEx(7415,1)
		elseif item.actionid == 42375 then
			reward = doCreateItemEx(7342,1)
			doAddContainerItem(reward, 7365, 100)
			doAddContainerItem(reward, 2547, 100)
			doAddContainerItem(reward, 2547, 100)
			doAddContainerItem(reward, 2311, 50)
			doAddContainerItem(reward, 2304, 50)
		end
		if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
			setPlayerStorageValue(cid, 42371, 1)
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
		end
	elseif item.actionid >= 42381 and item.actionid <= 42385 and getPlayerStorageValue(cid, 42381) ~= 1 then
		local reward = 0
		if item.actionid == 42381 then
			reward = doCreateItemEx(1990,1)
			doAddContainerItem(reward, 7372, 1)
			doAddContainerItem(reward, 6569, 10)
			doAddContainerItem(reward, 6574, 1)
			doAddContainerItem(reward, 6568, 1)
		elseif item.actionid == 42382 then
			reward = doCreateItemEx(7429,1)
		elseif item.actionid == 42383 then
			reward = doCreateItemEx(7434,1)
		elseif item.actionid == 42384 then
			reward = doCreateItemEx(7390,1)
		elseif item.actionid == 42385 then
			reward = doCreateItemEx(7342,1)
			doAddContainerItem(reward, 2273, 50)
			doAddContainerItem(reward, 2268, 50)
			doAddContainerItem(reward, 7443, 1)
			doAddContainerItem(reward, 7440, 1)
			doAddContainerItem(reward, 6529, 100)
		end
		if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
			setPlayerStorageValue(cid, 42381, 1)
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
		end
	end
	return TRUE
end
movements.xml
PHP:
	<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"/>
arenagoblet
PHP:
function onStepIn(cid, item, position, fromPosition)
	local gobletPos = getThingPos(item.uid)
	if item.actionid == 42360 then
		if getPlayerStorageValue(cid, 42360) ~= 1 then
			setPlayerStorageValue(cid, 42360, 1)
			local goblet = doCreateItemEx(5807, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena greenhorn difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	elseif item.actionid == 42370 then
		if getPlayerStorageValue(cid, 42370) ~= 1 then
			setPlayerStorageValue(cid, 42370, 1)
			local goblet = doCreateItemEx(5806, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena scrapper difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	elseif item.actionid == 42380 then
		if getPlayerStorageValue(cid, 42380) ~= 1 then
			setPlayerStorageValue(cid, 42380, 1)
			local goblet = doCreateItemEx(5805, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena warlord difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	end
	doTransformItem(item.uid, item.itemid - 1)
	return TRUE
end

function onStepOut(cid, item, pos)
	doTransformItem(item.uid, item.itemid + 1)
	return TRUE
end
arenaroom
PHP:
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,'Masz ' .. player_storage - os.time() .. ' sekund, zeby przejsc do kolejnego pokoju!')
			end
		else
			setGlobalStorageValue(i, 0)
		end
	end
end
didarenalevel
PHP:
function onStepIn(cid, item, pos, fromPosition)
	if getPlayerStorageValue(cid, item.actionid+getPlayerStorageValue(cid, 42355)*10-1) == 1 then
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'You did arena at level '.. getPlayerStorageValue(cid, 42355)+1 ..'! Now you can take your reward.')
		setPlayerStorageValue(cid, 42355, getPlayerStorageValue(cid, 42355)+1) --did arena level X
		setPlayerStorageValue(cid, item.actionid+getPlayerStorageValue(cid, 42355)*10, 1) --did arena level X
		setGlobalStorageValue(item.actionid-1, 0) -- room free
		setPlayerStorageValue(cid, 42350, os.time()+5) -- time to kick 0
		setPlayerStorageValue(cid, 42352, 0) -- is not in arena
		doTeleportThing(cid, arenaKickPosition, TRUE)
	else
		doTeleportThing(cid, fromPosition, TRUE)
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')
	end
	return TRUE
end
leavearena
PHP:
function onStepIn(cid, item, pos, fromPosition)
	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
	doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'You left arena!')
	doTeleportThing(cid, arenaKickPosition, TRUE)
	setGlobalStorageValue(item.actionid-21, 0) -- free room
	setPlayerStorageValue(cid, 42350, os.time()+5) -- time to kick 0
	setPlayerStorageValue(cid, 42352, 0) -- is not in arena
	return TRUE
end
data.lua
PHP:
dofile(getDataDir() .. "lib/arena.lua")
arena.lua
PHP:
arena.lua
[PHP]-- arena script
InitArenaScript = 0
arena_room_max_time = 240 -- time in seconds for one arena room
arenaKickPosition = {x=32222, y=31080, z=6} -- 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
[/PHP]
creatures.xml
PHP:
	<event type="kill" name="ArenaKill" event="script" value="arenakill.lua"/>
arenakill
PHP:
function onKill(cid, target)
	local room = getArenaMonsterIdByName(getCreatureName(target))
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'You can enter next room!')
	end
	return TRUE
end
login.lua
PHP:
 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  
	return true
end
monster.xml
PHP:
	 <!-- Arena -->
        <!-- Greenhorn -->
    <monster name="Achad" file="gesiorarena/greenhorn/achad.xml"/>
    <monster name="Axeitus Headbanger" file="gesiorarena/greenhorn/axeitus headbanger.xml"/>
    <monster name="Bloodpaw" file="gesiorarena/greenhorn/bloodpaw.xml"/>
    <monster name="Bovinus" file="gesiorarena/greenhorn/bovinus.xml"/>
    <monster name="Colerian The Barbarian" file="gesiorarena/greenhorn/colerian the barbarian.xml"/>
    <monster name="Cursed Gladiator" file="gesiorarena/greenhorn/cursed gladiator.xml"/>
    <monster name="Frostfur" file="gesiorarena/greenhorn/frostfur.xml"/>
    <monster name="Orcus the Cruel" file="gesiorarena/greenhorn/orcus the cruel.xml"/>
    <monster name="Rocky" file="gesiorarena/greenhorn/rocky.xml"/>
    <monster name="The Hairy One" file="gesiorarena/greenhorn/the hairy one.xml"/>

        <!-- Scrapper -->
    <monster name="Avalanche" file="gesiorarena/scrapper/avalanche.xml"/>
    <monster name="Drasilla" file="gesiorarena/scrapper/drasilla.xml"/>
    <monster name="Grimgor Guteater" file="gesiorarena/scrapper/grimgor guteater.xml"/>
    <monster name="Kreebosh the Exile" file="gesiorarena/scrapper/kreebosh the exile.xml"/>
    <monster name="Slim" file="gesiorarena/scrapper/slim.xml"/>
    <monster name="Spirit of Earth" file="gesiorarena/scrapper/spirit of earth.xml"/>
    <monster name="Spirit of Fire" file="gesiorarena/scrapper/spirit of fire.xml"/>
    <monster name="Spirit of Water" file="gesiorarena/scrapper/spirit of water.xml"/>
    <monster name="The Dark Dancer" file="gesiorarena/scrapper/the dark dancer.xml"/>
    <monster name="The Hag" file="gesiorarena/scrapper/the hag.xml"/>

        <!-- Warlord -->
    <monster name="Darakan the Executioner" file="gesiorarena/warlord/darakan the executioner.xml"/>
    <monster name="Deathbringer" file="gesiorarena/warlord/deathbringer.xml"/>
    <monster name="Fallen Mooh'tah Master Ghar" file="gesiorarena/warlord/fallen mooh'tah master ghar.xml"/>
    <monster name="Gnorre Chyllson" file="gesiorarena/warlord/gnorre chyllson.xml"/>
    <monster name="Norgle Glacierbeard" file="gesiorarena/warlord/norgle glacierbeard.xml"/>
    <monster name="Svoren the Mad" file="gesiorarena/warlord/svoren the mad.xml"/>
    <monster name="The Masked Marauder" file="gesiorarena/warlord/the masked marauder.xml"/>
    <monster name="The Obliverator" file="gesiorarena/warlord/the obliverator.xml"/>
    <monster name="The Pit Lord" file="gesiorarena/warlord/the pit lord.xml"/>
    <monster name="Webster" file="gesiorarena/warlord/webster.xml"/>


best regards

Pepsi
 
Last edited:
Hello, and thanks for replying. But i get some errors.

Code:
[09/10/2009 08:50:22] Lua Script Error: [Weapon Interface] 
[09/10/2009 08:50:22] data/lib/data.lua

[09/10/2009 08:50:22] data/lib/arena.lua:43: 'end' expected (to close 'function' at line 37) near '<eof>'
[09/10/2009 08:50:22] Warning: [LuaScriptInterface::initState] Cannot load data/lib/data.lua.

[09/10/2009 08:50:22] Lua Script Error: [Spell Interface] 
[09/10/2009 08:50:22] data/lib/data.lua

[09/10/2009 08:50:22] data/lib/arena.lua:43: 'end' expected (to close 'function' at line 37) near '<eof>'
[09/10/2009 08:50:22] Warning: [LuaScriptInterface::initState] Cannot load data/lib/data.lua.

Here is my data.lua

Code:
dofile(getDataDir() .. "lib/constant.lua")
dofile(getDataDir() .. "lib/class.lua")

dofile(getDataDir() .. "lib/string.lua")
dofile(getDataDir() .. "lib/table.lua")

dofile(getDataDir() .. "lib/database.lua")
dofile(getDataDir() .. "lib/wait.lua")

dofile(getDataDir() .. "lib/vocations.lua")
dofile(getDataDir() .. "lib/position.lua")
dofile(getDataDir() .. "lib/ip.lua")
dofile(getDataDir() .. "lib/exhaustion.lua")

dofile(getDataDir() .. "lib/function.lua")
dofile(getDataDir() .. "lib/compat.lua")
dofile(getDataDir() .. "lib/arena.lua")

I guess there wont be a problem..

My arena.lua

PHP:
-- arena script
InitArenaScript = 0
arena_room_max_time = 240 -- time in seconds for one arena room
arenaKickPosition = {x=32222, y=31080, z=6} -- 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'

Tried
PHP:
function getArenaMonsterIdByName(name)
    name = string.lower(tostring(name))
    for i = 42300, 42329 do
        if tostring(arena_monsters[i]) == name then
            return i
    end
end

And
PHP:
function getArenaMonsterIdByName(name)
    name = string.lower(tostring(name))
    for i = 42300, 42329 do
        if tostring(arena_monsters[i]) == name then
            return i
		end
	end
end
 
CreatureScripts for a 0.3.5pl1
PHP:
local config = {
	loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "Stages")
	registerCreatureEvent(cid, "deathBroadcast")
	registerCreatureEvent(cid, "levelUp")
	registerCreatureEvent(cid, "WarAttack")
	registerCreatureEvent(cid, "WarKill")
	registerCreatureEvent(cid, "ArenaKill")
 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  
    return true
end
 
[22/08/2009 23:49:08] data/creaturescripts/scripts/arenakill.lua:2: attempt to call global 'getArenaMonsterIdByName' (a nil value)
[22/08/2009 23:49:08] stack traceback:
[22/08/2009 23:49:08] data/creaturescripts/scripts/arenakill.lua:2: in function <data/creaturescripts/scripts/arenakill.lua:1>

... spams my console :/

I get the same ;s
 
i can only come to the first arena and after that i go in to the tP but that dont work "Kill Monster First" ? reprep
 
it error'ed for me but turns out its my global.lua.. WHAT TEH FAK
 
I used the script posted by Pepsi and it works fine 100%, it just need to be 100% configured without missing files.

srry 4my bad english :), "Im not using google translator D:"
 
@TFS 0.3.6 problem

all work but it dont give me a goblet in prize room;/

PHP:
[15/12/2009 16:13:42] [Error - MoveEvents Interface] 
[15/12/2009 16:13:42] data/movements/scripts/arenagoblet.lua:onStepIn
[15/12/2009 16:13:42] Description: 
[15/12/2009 16:13:42] data/movements/scripts/arenagoblet.lua:21: attempt to call global 'doSetItemSpecialDescription' (a nil value)
[15/12/2009 16:13:42] stack traceback:
[15/12/2009 16:13:42] 	data/movements/scripts/arenagoblet.lua:21: in function <data/movements/scripts/arenagoblet.lua:1>

arenagoblet.lua

PHP:
function onStepIn(cid, item, position, fromPosition)
	local gobletPos = getThingPos(item.uid)
	if item.actionid == 42360 then
		if getPlayerStorageValue(cid, 42360) ~= 1 then
			setPlayerStorageValue(cid, 42360, 1)
			local goblet = doCreateItemEx(5807, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena greenhorn difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	elseif item.actionid == 42370 then
		if getPlayerStorageValue(cid, 42370) ~= 1 then
			setPlayerStorageValue(cid, 42370, 1)
			local goblet = doCreateItemEx(5806, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena scrapper difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	elseif item.actionid == 42380 then
		if getPlayerStorageValue(cid, 42380) ~= 1 then
			setPlayerStorageValue(cid, 42380, 1)
			local goblet = doCreateItemEx(5805, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena warlord difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	end
	doTransformItem(item.uid, item.itemid - 1)
	return TRUE
end

function onStepOut(cid, item, pos)
	doTransformItem(item.uid, item.itemid + 1)
	return TRUE
end

i know the problem is with doSetItemSpecialDescription but i dont know what function need to replace. plz help
 
@TFS 0.3.6 problem

all work but it dont give me a goblet in prize room;/

PHP:
[15/12/2009 16:13:42] [Error - MoveEvents Interface] 
[15/12/2009 16:13:42] data/movements/scripts/arenagoblet.lua:onStepIn
[15/12/2009 16:13:42] Description: 
[15/12/2009 16:13:42] data/movements/scripts/arenagoblet.lua:21: attempt to call global 'doSetItemSpecialDescription' (a nil value)
[15/12/2009 16:13:42] stack traceback:
[15/12/2009 16:13:42] 	data/movements/scripts/arenagoblet.lua:21: in function <data/movements/scripts/arenagoblet.lua:1>

arenagoblet.lua

PHP:
function onStepIn(cid, item, position, fromPosition)
	local gobletPos = getThingPos(item.uid)
	if item.actionid == 42360 then
		if getPlayerStorageValue(cid, 42360) ~= 1 then
			setPlayerStorageValue(cid, 42360, 1)
			local goblet = doCreateItemEx(5807, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena greenhorn difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	elseif item.actionid == 42370 then
		if getPlayerStorageValue(cid, 42370) ~= 1 then
			setPlayerStorageValue(cid, 42370, 1)
			local goblet = doCreateItemEx(5806, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena scrapper difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	elseif item.actionid == 42380 then
		if getPlayerStorageValue(cid, 42380) ~= 1 then
			setPlayerStorageValue(cid, 42380, 1)
			local goblet = doCreateItemEx(5805, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the barbarian arena warlord difficulty.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	end
	doTransformItem(item.uid, item.itemid - 1)
	return TRUE
end

function onStepOut(cid, item, pos)
	doTransformItem(item.uid, item.itemid + 1)
	return TRUE
end

i know the problem is with doSetItemSpecialDescription but i dont know what function need to replace. plz help

I have the same problem...
I also know that there isn't any fuction (in data/lib/050-function.lua) called "doSetItemSpecialDescription" like the old version of TFS.

Maybe this fuction has been configured wrong during the compilation of TFS 0.3.6?
 
Code:
function onStepIn(cid, item, position, fromPosition) 
	local gobletPos = getThingPos(item.uid)
	if item.actionid == 42360 then 
		if getPlayerStorageValue(cid, 42360) ~= 1 then 
			setPlayerStorageValue(cid, 42360, 1) 
			local goblet = doCreateItemEx(5807, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena greenhorn difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	elseif item.actionid == 42370 then 
		if getPlayerStorageValue(cid, 42370) ~= 1 then 
			setPlayerStorageValue(cid, 42370, 1) 
			local goblet = doCreateItemEx(5806, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena scrapper difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	elseif item.actionid == 42380 then 
		if getPlayerStorageValue(cid, 42380) ~= 1 then 
			setPlayerStorageValue(cid, 42380, 1) 
			local goblet = doCreateItemEx(5805, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena warlord difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	end 
	doTransformItem(item.uid, item.itemid - 1) 
	return TRUE 
end 

function onStepOut(cid, item, pos) 
	doTransformItem(item.uid, item.itemid + 1) 
	return TRUE 
end
 
Code:
function onStepIn(cid, item, position, fromPosition) 
	local gobletPos = getThingPos(item.uid)
	if item.actionid == 42360 then 
		if getPlayerStorageValue(cid, 42360) ~= 1 then 
			setPlayerStorageValue(cid, 42360, 1) 
			local goblet = doCreateItemEx(5807, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena greenhorn difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	elseif item.actionid == 42370 then 
		if getPlayerStorageValue(cid, 42370) ~= 1 then 
			setPlayerStorageValue(cid, 42370, 1) 
			local goblet = doCreateItemEx(5806, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena scrapper difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	elseif item.actionid == 42380 then 
		if getPlayerStorageValue(cid, 42380) ~= 1 then 
			setPlayerStorageValue(cid, 42380, 1) 
			local goblet = doCreateItemEx(5805, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena warlord difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	end 
	doTransformItem(item.uid, item.itemid - 1) 
	return TRUE 
end 

function onStepOut(cid, item, pos) 
	doTransformItem(item.uid, item.itemid + 1) 
	return TRUE 
end

Cykotitan, Perhaps you could make a "fix" so the arena works with TFS 0.3.5? :wub::wub:
 
Code:
function onStepIn(cid, item, position, fromPosition) 
	local gobletPos = getThingPos(item.uid)
	if item.actionid == 42360 then 
		if getPlayerStorageValue(cid, 42360) ~= 1 then 
			setPlayerStorageValue(cid, 42360, 1) 
			local goblet = doCreateItemEx(5807, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena greenhorn difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	elseif item.actionid == 42370 then 
		if getPlayerStorageValue(cid, 42370) ~= 1 then 
			setPlayerStorageValue(cid, 42370, 1) 
			local goblet = doCreateItemEx(5806, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena scrapper difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	elseif item.actionid == 42380 then 
		if getPlayerStorageValue(cid, 42380) ~= 1 then 
			setPlayerStorageValue(cid, 42380, 1) 
			local goblet = doCreateItemEx(5805, 1) 
			doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the barbarian arena warlord difficulty.\nAwarded to " .. getCreatureName(cid) .. ".") 
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet) 
		end 
	end 
	doTransformItem(item.uid, item.itemid - 1) 
	return TRUE 
end 

function onStepOut(cid, item, pos) 
	doTransformItem(item.uid, item.itemid + 1) 
	return TRUE 
end
:wub::wub::wub::wub::wub::wub::wub::wub: thank you!:)
 
Status
Not open for further replies.
Back
Top