Tudo que zipter98 postou
-
(Resolvido)[Pedido] Sistema de Arena.
Testei o sistema aqui, e funcionou perfeitamente. Talvez a causa tenha sido essa mesma que você citou. O erro em si não está no código do NPC, mas no sistema de NPCs. Como corrigir, infelizmente (no momento) não sei. Caso você possua outro servidor, teste o sistema nele. Talvez apareça algum outro erro que passou despercebido.
-
(Resolvido)[Pedido] Sistema de Arena.
Aparentemente, é problema do seu servidor mesmo. Se possível, poste um código funcional de algum NPC (um que não venda items pela 'janelinha') do seu servidor, para que eu possa reescrever o script do meu NPC. PS: O arquivo que me refiro é um de extensão .lua, não XML.
-
(Resolvido)[Pedido] Sistema de Arena.
Se possível, poste o xml do NPC. Vou jantar agora, mais tarde testo o sistema e vejo os possíveis erros.
-
(Resolvido)[Pedido] Sistema de Arena.
Ops, falta de atenção minha hehe. Mude sua lib antiga para a nova corrigida.
-
(Resolvido)[Pedido] Sistema de Arena.
Antes de tudo, sua arena deve ser quadrada/retangular. As posições que devem ser configuradas, são, respectivamente, os cantos superior (cima) esquerdo (<) e inferior (baixo) direito (>). Uma imagem demonstrativa: Os círculos vermelhos representam as posições que mencionei. Imagem retirada do tópico referente ao sistema Blood Castle.
-
(Resolvido)[Pedido] Sistema de Arena.
OK. Eu fiz bem rapidamente o sistema aqui, talvez haja algum(s) erro(s). data/lib, crie um arquivo com extensão .lua e coloque o seguinte conteúdo: ARENA = { WAVES = { [1] = {"monster_name", {x = x, y = y, z = z}}, --{nome_do_monstro, {posição_que_vai_nascer}}, [2] = {"monster_name", {x = x, y = y, z = z}}, [3] = {"monster_name", {x = x, y = y, z = z}}, [4] = {"monster_name", {x = x, y = y, z = z}}, [5] = {"monster_name", {x = x, y = y, z = z}}, [6] = {"monster_name", {x = x, y = y, z = z}}, [7] = {"monster_name", {x = x, y = y, z = z}}, [8] = {"monster_name", {x = x, y = y, z = z}}, }, NPC = { price = 2000, --Preço para entrar na arena. position = {x = x, y = y, z = z}, --Para onde o jogador será teleportado ao falar com o NPC. }, TELEPORT = { tpId = 1387, --ID do teleporte. tpPos = {x = x, y = y, z = z}, --Onde o teleporte será criado, ao matar o último boss. tpToPos = {x = x, y = y, z = z}, --Para onde o teleporte levará. aid = 1307, }, STORAGES = { storage = 90181, wave_sto = 90182, }, fromPos = {x = x, y = y, z = z}, --Coordenadas da posição superior esquerda da arena. toPos = {x = x, y = y, z = z}, --Coordenadas da posição inferior direita da arena. delay = 15, --Segundos para o boss aparecer. level = 100, --Level mínimo. } function doWave(cid, wave) if not isPlayer(cid) then return true elseif not ARENA.WAVES[wave] then return true elseif getPlayerStorageValue(cid, ARENA.STORAGES.storage) > -1 then return true end local monster = ARENA.WAVES[wave][1] local pos = ARENA.WAVES[wave][2] doPlayerSendTextMessage(cid, 27, "In "..ARENA.delay.." seconds, a boss will spawn. [Wave: "..wave.."]") addEvent(function() doCreateMonster(monster, pos) end, ARENA.delay * 1000) end function clearArena() for x = ARENA.fromPos.x, ARENA.toPos.x do for y = ARENA.fromPos.y, ARENA.toPos.y do for z = ARENA.fromPos.z, ARENA.toPos.z do local area = {x = x, y = y, z = z} local creature = getTopCreature(area).uid if isCreature(creature) then doRemoveCreature(creature) end end end end end Código do NPC: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg:lower(), "arena") or msgcontains(msg:lower(), "enter") then if getPlayerLevel(cid) < ARENA.level then selfSay("You do not have enough level ["..ARENA.level.."].", cid) talkState[talkUser] = 0 return true elseif getGlobalStorageValue(1000) > -1 then selfSay("Someone is at the arena right now, please wait.", cid) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, ARENA.STORAGES.storage) > -1 then selfSay("You already completed the arena.", cid) talkState[talkUser] = 0 return true else selfSay("You really want enter in the arena? It will cost you {"..ARENA.NPC.price.."}.", cid) talkState[talkUser] = 1 return true end elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if doPlayerRemoveMoney(cid, ARENA.NPC.price) then selfSay("Good luck! ^.^", cid) doTeleportThing(cid, ARENA.NPC.position) setPlayerStorageValue(cid, ARENA.STORAGES.wave_sto, 1) setGlobalStorageValue(1000, 1) doWave(cid, 1) talkState[talkUser] = 0 return true else selfSay("You do not have enough money.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, then...", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) data/creaturescripts/scripts, crie um arquivo com extensão .lua, nomeie-o killboss.lua, e coloque o seguinte conteúdo: function onKill(cid, target) if isPlayer(cid) and getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) > -1 then local new_wave = getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) + 1 if ARENA.WAVES[new_wave] then setPlayerStorageValue(cid, ARENA.STORAGES.wave_sto, new_wave) doWave(cid, new_wave) else local tp = doCreateTeleport(ARENA.TELEPORT.tpId, ARENA.TELEPORT.tpToPos, ARENA.TELEPORT.tpPos) doItemSetAttribute(tp, "aid", ARENA.TELEPORT.aid) end end return true end function onLogout(cid) if getTileInfo(getThingPos(cid)).protection and getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) > -1 then return setPlayerStorageValue(cid, ARENA.STORAGES.wave_sto, -1) end if getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) > -1 then doPlayerSendCancel(cid, "You can't logout now.") return false end return true end function onPrepareDeath(cid) if getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) > -1 then setPlayerStorageValue(cid, ARENA.STORAGES.wave_sto, -1) setGlobalStorageValue(1000, -1) clearArena() end return true end Tags: <event type="kill" name="killBoss" script="killboss.lua"/> <event type="logout" name="arenaLogout" event="script" value="killboss.lua"/> <event type="preparedeath" name="deathBoss" event="script" value="killboss.lua"/> Não se esqueça de registrar o evento em login.lua: registerCreatureEvent(cid, "killBoss") registerCreatureEvent(cid, "deathBoss") Já em data/movements/scripts, você novamente cria um arquivo com extensão .lua (nome do arquivo: tpremove.lua) e coloca o seguinte código: function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end setPlayerStorageValue(cid, ARENA.STORAGES.storage, 1) setPlayerStorageValue(cid, ARENA.STORAGES.wave_sto, -1) setGlobalStorageValue(1000, -1) addEvent(function() if getTileItemById(position, ARENA.TELEPORT.tpId).uid > 0 then doRemoveItem(getTileItemById(position, ARENA.TELEPORT.tpId).uid, 1) end end, 50) return true end Tag: <movevent type="StepIn" actionid="1307" event="script" value="tpremove.lua"/>
-
Ajuda com script de comando automatico
Posta o código da talkaction. Sem ele, não tem como a gente te ajudar. '_'
-
(Resolvido)[Pedido] Sistema de Arena.
Afinal, vai nascer um monstro por wave ou vários?
-
(Resolvido)[duvida]BordCast message com o nome do player
cid -> creature ID. É quem executa a ação. Neste caso, cid é um parâmetro do callback onSay. PS: Na função doBroadcastMessage, o parâmetro type não é obrigatório. Caso ele não seja especificado, o tipo tomado como padrão é o MESSAGE_STATUS_CONSOLE_RED (mensagem vermelha). Para enviar a mensagem para o servidor todo, você pode usar: doBroadcastMessage("O jogador "..getCreatureName(cid).." obteve a vocação "..getPlayerVocationName(cid)..".")
-
(Resolvido)SetGlobalStorage
Ahã. Sempre que você for fazer algum onStepIn que envolva teleportes, é bom colocar a topos no próprio código, para evitar bugs como esse.
-
(Resolvido)SetGlobalStorage
Você está configurando a topos do teleporte no RME, certo? Ao invés de fazer isso, apenas crie o teleporte e configure o actionid. Depois, substitua seu movement por esse: local pos = {x = x, y = y, z = z} --Para onde o jogador vai ser teleportado. function onStepIn(cid, item, position, fromPosition) if getGlobalStorageValue(1400) == 1 then return doTeleportThing(cid, fromPosition) and doPlayerSendCancel(cid, "Sorry, The quest was beginned.") end doTeleportThing(cid, pos) return true end
-
onkill ganhar storage rep++
Precisa registrar o evento no login.lua. local monster = "nome_do_monstro" local storage = xxx --Storage. function onKill(cid, target) if isMonster(target) and getCreatureName(target):lower() == monster:lower() and getPlayerStorageValue(cid, storage) < 1 then setPlayerStorageValue(cid, storage, 1) doPlayerSendTextMessage(cid, 27, "You killed "..getCreatureName(target).." and received a storage.") end return true end
-
(Resolvido)Drop por chance
Vai dropar automaticamente após matar a quantia x de monstros, ou vai ter chance de dropar? só pra confirmar mesmo
-
(Resolvido)[URGENTE] Wrath emperor script please
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local storages = {2050, 2051, 2052, 2053} --Storages local pos = {x = x, y = y, z = z} --Para onde o jogador será teleportado. if msgcontains(msg:lower(), "help") or msgcontains(msg:lower(), "mission") then selfSay("Do you have the storages from the mission?", cid) talkState[talkUser] = 1 elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then for i = 1, #storages do if getPlayerStorageValue(cid, storages[i]) < 1 then selfSay("You do not have all the storages. Come back when you do.", cid) talkState[talkUser] = 0 return true end end selfSay("OK, you have all the storages. You will be teleported.", cid) for i = 1, #storages do setPlayerStorageValue(cid, storages[i], -1) end doTeleportThing(cid, pos) talkState[talkUser] = 0 return true elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, then come back when you do!", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
[BUG] BUG DE LOGAR
Troque: onPokeHealthChange(cid) por: if getPlayerSlotItem(cid, 8) then onPokeHealthChange(cid) end Se o erro persistir, procure pelo código da função doPlayerChangeModeIcon(cid) em data/lib (provavelmente estará num arquivo relacionado ao Icon System).
-
alguem me ajuda com esse pequeno erro ;x
Se quiser, não precisa me reputar. Não é por isso que estou ajudando. Você fez alguma alteração no order para que este erro acontecesse? Ou seu servidor já veio assim? E acontece com todos os pokémons? Apenas quando é ordenado para que o pokémon se mova?
-
[PEDIDO] Invasão.
Desse jeito, você vai poder escolher a invasão que quer no parâmetro. Modo de utilização: /comando nome_do_pokemon PS: O comando você configura na tag, obviamente. local monsters = { ["charizard"] = { --["parâmetro"] = { name = "Charizard", --Nome do pokémon que vai ser summonado. positions = { {x = x, y = y, z = z}, --Posições que o monstro vai ser summonado. {x = x, y = y, z = z}, --Você pode adicionar mais posições, seguindo este modelo que deixei. {x = x, y = y, z = z}, {x = x, y = y, z = z}, }, }, ["venusaur"] = { name = "Venusaur", positions = { {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, }, }, ["blastoise"] = { name = "Blastoise", positions = { {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, }, }, } function onSay(cid, words, param) if not param or param == "" then return doPlayerSendCancel(cid, "Especify a parameter.") elseif not monsters[param:lower()] then return doPlayerSendCancel(cid, "You can't summon this pokemon.") end local poke = monsters[param:lower()] doPlayerSendTextMessage(cid, 27, "You summoned a "..poke.name.." invasion.") for i = 1, #poke.positions do doCreateMonster(poke.name, poke.positions[i]) end return true end
- getHighscoreString(skillId) OQUE RETORNA
-
alguem me ajuda com esse pequeno erro ;x
Nesse caso, apenas para confirmar, teste o order no outro client. Talvez o erro seja só no OTC mesmo.
-
alguem me ajuda com esse pequeno erro ;x
Hm, estranho esse erro. Tenta trocar: doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["move"][math.random(1, #txt["move"])].."", 1) if isCreature(getCreatureTarget(cid)) then goThere(mysum, topos, "move", isCreature(getCreatureTarget(cid)), maxMoveDist) else addEvent(goThere, 500, mysum, topos, "move", isCreature(getCreatureTarget(cid)), maxMoveDist) end por if isCreature(mysum) then doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["move"][math.random(1, #txt["move"])].."", 1) if isCreature(getCreatureTarget(cid)) then goThere(mysum, topos, "move", isCreature(getCreatureTarget(cid)), maxMoveDist) else addEvent(goThere, 500, mysum, topos, "move", isCreature(getCreatureTarget(cid)), maxMoveDist) end end
-
Limite de level
Sabe fazer a tag? local maxLv = 100 --Level máximo. function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL__LEVEL then if newLevel > maxLv then return false end end return true end PS: Precisa registrar em login.lua.
-
alguem me ajuda com esse pequeno erro ;x
Curioso, esse erro era causado pelo fato do jogador não ter nenhum summon quando tentava utilizar o order. No seu order.lua, já há uma proteção para tal erro não acontecer. Tem certeza que o bug que acontece com você é o mesmo?
-
[PEDIDO] Invasão.
Nesse caso, o valor da variável name deve ser uma string. Ou seja, você tem que colocar esse charizard entre aspas, ficando: local name = "Charizard"
-
Gran Tower com Erro
Troque: for i, 5 do por: for i = 1, #GRANTOWER.GUARDS do e troca: for v, 18 do por: for v = 1, #GRANTOWER.GATES do troque também: addEvent(doCreateItem, 500, GRANTOWER.GATES[i].id, GRANTOWER.GATES[v].pos) por: addEvent(doCreateItem, 500, GRANTOWER.GATES[v].id, GRANTOWER.GATES[v].pos)
-
alguem me ajuda com esse pequeno erro ;x
^ Só trocar: if getMarkedPos(getCreatureSummons(cid)[1]).x == topos.x and getMarkedPos(getCreatureSummons(cid)[1]).y == topos.y then return true end markPos(getCreatureSummons(cid)[1], topos) markOwnerPos(getCreatureSummons(cid)[1], getThingPos(cid)) doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", move!", 1) addEvent(goThere, 500, getCreatureSummons(cid)[1], topos, "move", isCreature(getCreatureTarget(cid))) por: if #getCreatureSummons(cid) > 0 then if getMarkedPos(getCreatureSummons(cid)[1]).x == topos.x and getMarkedPos(getCreatureSummons(cid)[1]).y == topos.y then return true end markPos(getCreatureSummons(cid)[1], topos) markOwnerPos(getCreatureSummons(cid)[1], getThingPos(cid)) doPlayerSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", move!", 1) addEvent(goThere, 500, getCreatureSummons(cid)[1], topos, "move", isCreature(getCreatureTarget(cid))) end