Ir para conteúdo
  • Cadastre-se

Posts Recomendados

meu problema eu acho que é simples.... quando vc vai falar com o npc halvar ele só te da uma opção para arena e quando vc vai fazer a arena na opção que ele te fornece, vc mata o bixu e vai passar no portal ele não ta liberado ainda, é como se não reconhece-se que vc matou o bixu já .. vlw !
Olha eu procurei muito para achar minha duvida em todos forum da net, mais não encontrei...eu já achei também aqui no fórum as scripts para a arena mais não deu certo e tinha comentários falando que também não deu certo e o autor não solucionou, intão eu decidi recorrer a criar um novo tópico sou novo no fórum se postei no lugar errado ou fiz algu errado me desculpe...certamente se ou ver criticas construtivas será útil !


God SkumBruttuz [500]: hi
Halvar: Hello God SkumBruttuz! Do you want to make arena?

God SkumBruttuz [500] : yes

Halvar: You test will be greenshore level. If you want enter you must pay 1000 gp and have 30 level. Wanna try?
God SkumBruttuz [500] : yes
Halvar: Now you can go to test.

Já tentei de varias formas, falei os níveis que tem para a arena e o npc não responde nada...vou postar os scripts meus...

 

------------------------------------------------------------------------------------------------------------------------------

 

NPC Halvar.xml

 
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Halvar" script="data/npc/scripts/Halvar.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="143" head="3" body="77" legs="78" feet="39" addons="1"/>

</npc>

 

------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------
 

NPC Halvar.lua
 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
 
function enterArena(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local cost = 0
local levelname = ''
if getPlayerStorageValue(cid, 42355) < 1 then
cost = 1000
levelname = 'greenshore'
levelneeded = 30
elseif getPlayerStorageValue(cid, 42355) == 1 then
cost = 5000
levelname = 'scrapper'
levelneeded = 50
elseif getPlayerStorageValue(cid, 42355) == 2 then
cost = 10000
levelname = 'warlord'
levelneeded = 80
end
if string.lower(keywords[1]) == 'yes' and parameters.prepare ~= 1 then
if(getPlayerLevel(cid) >= levelneeded) then
if(getPlayerMoney(cid) >= cost) then
doPlayerRemoveMoney(cid, cost)
npcHandler:say('Now you can go to test.', cid)
setPlayerStorageValue(cid, 42351, 1)
else
npcHandler:say('You don\'t have ' .. cost .. ' gp! Come back when you will be ready!', cid)
   end
else
npcHandler:say('You don\'t have ' .. levelneeded .. ' level! Come back when you will be ready!', cid)
end
npcHandler:resetNpc()
elseif string.lower(keywords[1]) == 'no' then
npcHandler:say('Come back later then!', cid)
npcHandler:resetNpc()
else
if getPlayerStorageValue(cid, 42355) < 3 then
npcHandler:say('You test will be ' .. levelname .. ' level. If you want enter you must pay ' .. cost .. ' gp and have ' .. levelneeded .. ' level. Wanna try?', cid)
else
npcHandler:say('You did all arena levels.',cid)
end
end
return true
end
 
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|! Do you want to make arena?')
 
local yesNode = KeywordNode:new({'yes'}, enterArena, {})
local noNode = KeywordNode:new({'no'}, enterArena, {})
 
local node1 = keywordHandler:addKeyword({'arena'}, enterArena, {prepare=1})
node1:addChildKeywordNode(yesNode)
node1:addChildKeywordNode(noNode)
 
local node1 = keywordHandler:addKeyword({'fight'}, enterArena, {prepare=1})
node1:addChildKeywordNode(yesNode)
node1:addChildKeywordNode(noNode)
local node1 = keywordHandler:addKeyword({'yes'}, enterArena, {prepare=1})
node1:addChildKeywordNode(yesNode)
node1:addChildKeywordNode(noNode)

npcHandler:addModule(FocusModule:new())

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Actions/script/arena.lua
 

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

Actions/script/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 = 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
 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

creaturescripts/scripts/arena

function onPrepareDeath(cid)
 
-- INICIO CONFIG --
local a = {
l = {x=944,y=963,z=7}, -- canto superior esquerdo da arena
r = {x=952,y=957,z=7}, -- canto inferior direito da arena
e = {x=948,y=959,z=7} -- saida/local a ser teleportado quando "morre"
}
-- FINAL CONFIG --
local p = getCreaturePosition(cid) -- nao mexa
 
if isInRange(p, a.l, a.r) then
doSendMagicEffect(p, CONST_ME_STUN)
doTeleportThing(cid, a.e)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
return FALSE
end
return true
end

​------------------------​------------------------​------------------------​------------------------​------------------------​------------------------​------------------------
 
creaturescripts/scripts/arenakill

local t = {

 
newPos = {x=33062, y=31029, z=7},
 
msg = "You have won! As new champion take the ancient armor as reward before you leave.",
 
area = {
 
fromX = 33054, toX = 33073,
 
fromY = 31026, toY = 32356,
 
z = 3
}
}
local 
spheres = {
 
['energy overlord'] = 8568,
 
['fire overlord'] = 8569,
 
['ice overlord'] = 8570,
 
['earth overlord'] = 8578
}
 
 
 
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
 
local creaturesList = {}
 
for x = -radiusx, radiusx do
 
for y = -radiusy, radiusy do
 
if not (x == 0 and y == 0) then
 
creature = getTopCreature({x = position.x+x, y = position.y+y, 
z = position.z, stackpos = 253})
 
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
 
table.insert(creaturesList, creature.uid)
 
end
 
end
 
end
 
end
 
 
local creature = getTopCreature(position)
 
if(creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
              
if not(table.find(creaturesList, creature.uid)) then
 
table.insert(creaturesList, creature.uid)
 
end
 
end
 
return creaturesList
end
function onKill(cid, target, damage, flags)
 
if isPlayer(target) or not isInArray({1, 3}, flags) or getCreatureMaster(target) then
 
return true
 
end
 
 
local name = getCreatureName(target):lower()
 
if name == 'tirecz' then
 
local players = getCreaturesInRange({x=33063, y=31035,z=3}, 10, 9, FALSE, TRUE)
 
for i = 1, #players do
 
doTeleportThing(players, t.newPos)
 
doCreatureSay(players, t.msg, TALKTYPE_ORANGE_1, false, players, getCreaturePosition(players))
 
end
 
return true
 
end
 
 
if spheres[name] then
 
setGlobalStorageValue(spheres[name], -1)
 
return true
 
end
 
 
local now = tasks[name]
if (now) then
 
if isInArray({-1, now.amount}, getPlayerStorageValue(cid, now.storage)) or (not isInArray({14003, 14004, 14005}, now.storage) and getPlayerStorageValue(cid, 14500) ~= now.storage) then
 
return true
 
end
 
 
local newValue = getPlayerStorageValue(cid, now.storage) + 1
 
setPlayerStorageValue(cid, now.storage, newValue)
 
end
 
 
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

------------------------------------------------------------------------------------------------------------------------------------------------------------------

data/lib/arena

-- arena script by 5mok3
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) == name then
            return i
        end
    end
    return 0
end

--------------------------------------------------------------------------------------------------------------------------------------------------------------

movements/scripts/arenagoblet

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

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
movements/scripts/arenaroom

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

-------------------------------------------------------------------------------------

e é isso galera ... eu não achei como os cara faz a e no fórum para fazer aquela caixa com os script dentro da e eu postei desse modo.....Obrigado desde Já !!!!!!

 

Link para o post
Compartilhar em outros sites
  • 3 years later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo