Ir para conteúdo

Problema Com Arena Svargrond


caronluca

Posts Recomendados

o negocio e o seguinte:

eu estava com um ot 8.52 funcionando arena, passei para 8.54 a arena parou de funcionar,vc fala com o npc, paga, passa pela porta, mas na hora de entra no TP para matar o 1º monstro da a seguinte mensagem: First kill monster! sendo os scripts:

 

actions:

 

   <action actionid="42366" event="script" value="svararena/arenadoors.lua"/>
  	<action actionid="42376" event="script" value="svararena/arenadoors.lua"/>
  	<action actionid="42386" event="script" value="svararena/arenadoors.lua"/>
  	<action actionid="42357" event="script" value="svararena/arenadoors.lua"/>

 

arenadoors.lua:

 

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

 

movements:

 

    	<movement type="StepIn" fromaid="42300" toaid="42309" event="script" value="arenaroom.lua"/>

 

arenaroom.lua:

 

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

 

isso esta igual como estava em 8.52, porem tem um arquivo chamado arena.lua que no 8.52 se localiza em data\lib mas no 8.54 nao tem e nao consigo adiciona-lo pois axo que eh esse o problema, ja tentei joga-lo direto na pasta lib, coloca-lo em function mas nao adiantou

 

segue o arquivo arena.lua citado acima:

-- arena script
InitArenaScript = 0
arena_room_max_time = 240 -- time in seconds for one arena room
arenaKickPosition = {x=32312, y=31134, 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

 

qual pode ser o problema e a soluçao?

Link para o comentário
Compartilhar em outros sites

passei o mapa que era 8.52 para 8.54 e joguei o mapa junto com actions, movements, npc, dentro de um ot 8.54, mas esse eh praticamente o unico problema que deu

Editado por caronluca
Link para o comentário
Compartilhar em outros sites

Ae manim troca o nome do arena.lua para 101-arena.lua na pasta lib.

 

Voce precisa tambem usar o creayurscript arenakill.lua

 

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

 

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

 

Pracisa tambem registrar o evento no login.lua

 

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "ArenaKill")

registerCreatureEvent(cid, "KillingInTheNameOf")

registerCreatureEvent(cid, "skull amulet")

registerCreatureEvent(cid, "charge amulet")

registerCreatureEvent(cid, "PlayerDeath")

 

 

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

 

Espero ter ajudado, qualquer coisa posta ae.

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

Opa cara, o meu tava dando o mesmo problema do que o do autor do topico...

o arena.lua funciona normal aqui ;D...

so que eu fiz o que vc falou, e realmente ele paroude falar first kill monster, mas mesmo assim ele nao passa pelo portal =X... tem algum lugar que devo colocar as coordenadas da arena?

 

No console aparece isso :

 

[27/04/2010 23:51:41] [Error - MoveEvents Interface]

[27/04/2010 23:51:41] data/movements/scripts/arenaroom.lua:onStepIn

[27/04/2010 23:51:41] Description:

[27/04/2010 23:51:41] (luaGetCreatureName) Creature not found

 

[27/04/2010 23:51:41] [Error - MoveEvents Interface]

[27/04/2010 23:51:41] data/movements/scripts/arenaroom.lua:onStepIn

[27/04/2010 23:51:41] Description:

[27/04/2010 23:51:41] data/movements/scripts/arenaroom.lua:30: attempt to concatenate a boolean value

[27/04/2010 23:51:41] stack traceback:

[27/04/2010 23:51:41] data/movements/scripts/arenaroom.lua:30: in function <data/movements/scripts/arenaroom.lua:1>

 

Cara, consegui resolver, tinha 2 arenas.. uma tava na pasta arena, e outra fora, eu exclui a da pasta arena e pegou! *-*

 

Vlw

Editado por Bigulitto
Link para o comentário
Compartilhar em outros sites

  • 4 months later...
  • 8 months later...

ai to encontrando o msm ploblema

com 1 ot q baixei

tipo ele tem os arquivos arenadoors,arenareward,arenagoblet e arenaroom

so q nao tem nem 1 arena.lua eu tb so inciante no ramo de otserv por favor se algem pode me explicar onde q coloco estes scripts pra resolver o problema tb agradeço

 

to com 1 ot realmap

Editado por xexeu
Link para o comentário
Compartilhar em outros sites

  • 1 month later...
  • 2 weeks later...
×
×
  • Criar Novo...