Ir para conteúdo

[Dúvida] Arena Script (Svargrond)


Kaelthas341

Posts Recomendados

Estou com um problema na arena de svargrond, quando um player começa a quest e mata o primeiro monster e vai pegar o tp para o proximo ele recebe a mensagem: First Kill Monster!, porém o monstro ja foi morto, vou postar os scripts se alguem souber resolver por favor me ajude.

 

C:\Users\cliente55\Desktop\Tectw original\data\actions\scripts

local config = {

oldpos = {

{x=947,y=961,z=7}, --pos em que o player 1 tem que estar para a alavanca funcionar

{x=949,y=961,z=7} --pos em que o player 2 tem que estar para a alavanca funcionar

},

newpos = {

{x=944,y=966,z=7}, --pos para aonde o player 1 vai ser teleportado (dentro da arena)

{x=952,y=966,z=7} --pos para aonde o player 2 vai ser teleportado (dentro da arena)

}

}

 

function onUse(cid, item, pos)

if item.itemid == 1946 then

doTransformItem(item.uid, 1945)

else

doTransformItem(item.uid, 1946)

end

local p = {}

for i,v in ipairs(config.oldpos) do

local pid = getTopCreature(v).uid

if pid == 0 or not isPlayer(pid) then

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)

return true

end

table.insert(p, pid)

end

for i,v in ipairs(p) do

doSendMagicEffect(config.oldpos, CONST_ME_POFF)

doTeleportThing(v, config.newpos, false)

end

return true

end

 

 

C:\Users\cliente55\Desktop\Tectw original\data\movements\scripts

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

 

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 = type(getStorage(arena_room+100)) == 'string' and 0 or getStorage(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 the next room!')

end

else

setGlobalStorageValue(i, 0)

end

end

end

 

Acredito que sejam esses os scripts se faltar algum avisem

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

ola SkyDangerous, primeiramente quero agradecer a ajuda mas tenho outra duvida!

voce pediu se eu declarei um evento para cada monstro n sei lhe dar uma resposta, talvez esse seja o problema, mas onde eu procuro para saber se há eventos declarados para cada monstro?

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...