Aeglon Posted December 6, 2017 at 05:29 PM Share Posted December 6, 2017 at 05:29 PM (edited) quest drop_event begin state start begin --- desta forma é para todos os moobs, se quiseres moobs certos usa -- when kill with npc.get_race() == 101 begin --- para cães selvagens -- when kill with npc.get_race() == 101 or npc.get_race() == 102 begin --- para 2 moobs para mais, basta ires fazendo or npc.get_race() == vnum do mob when kill with not npc.is_pc() begin --- para activar o evento faz /e drop_event 1 (( Conta gm )) --- para deactivar o evento faz /e drop_event 0 (( Conta gm )) if game.get_event_flag("drop_event") != 1 then ---- desta forma é para TODOS os mapas if game.get_event_flag("drop_event") != 1 and pc.get_map_index() == 41 then ---- desta forma é apenas para o reino Jinno index 41 return elseif pc.get_level() < 50 then --- altera para o nivel minimo de drop return else pc.setqf("drop_event", pc.getqf("drop_event") + 1) if pc.getqf("drop_event") == 10 then --- Altera para o numero de kills a fazer para o drop game.drop_item_with_ownership(189,1) --- 189 = espada venenosa \\\ altera para o teu vnum end end end end end Edited December 6, 2017 at 05:58 PM by Aeglon 2 Link to comment Share on other sites More sharing options...
LuizFernando Posted December 6, 2017 at 05:39 PM Share Posted December 6, 2017 at 05:39 PM Tem alguma forma de não usar get_event_flag? Pra não precisa ativar o evento só chegar e matar? Link to comment Share on other sites More sharing options...
Aeglon Posted December 6, 2017 at 05:47 PM Author Share Posted December 6, 2017 at 05:47 PM (edited) quest drop_event begin state start begin --- desta forma é para todos os moobs, se quiseres moobs certos usa -- when kill with npc.get_race() == 101 begin --- para cães selvagens -- when kill with npc.get_race() == 101 or npc.get_race() == 102 begin --- para 2 moobs para mais, basta ires fazendo or npc.get_race() == vnum do mob when kill with not npc.is_pc() begin if pc.get_level() < 50 then --- altera para o nivel minimo de drop return else pc.setqf("drop_event", pc.getqf("drop_event") + 1) if pc.getqf("drop_event") == 10 then --- Altera para o numero de kills a fazer para o drop game.drop_item_with_ownership(189,1) --- 189 = espada venenosa \\\ altera para o teu vnum end end end end end desta forma não é preciso o GM activar Edited December 6, 2017 at 05:57 PM by Aeglon Link to comment Share on other sites More sharing options...
LuizFernando Posted December 6, 2017 at 05:49 PM Share Posted December 6, 2017 at 05:49 PM 1 minuto atrás, Aeglon disse: quest drop_event begin state start begin --- desta forma é para todos os moobs, se quiseres moobs certos usa -- when kill with npc.get_race() == 101 begin --- para cães selvagens -- when kill with npc.get_race() == 101 or npc.get_race() == 102 begin --- para 2 moobs para mais, basta ires fazendo or npc.get_race() == vnum do mob when kill with not npc.is_pc() begin if pc.get_level() < 50 then --- altera para o nivel minimo de drop return else pc.setqf("drop_event", drop_event + 1) if pc.getqf("drop_event") == 10 then --- Altera para o numero de kills a fazer para o drop game.drop_item_with_ownership(189,1) --- 189 = espada venenosa \\\ altera para o teu vnum end end end end end desta forma não é preciso o GM activar Não está funcionando, você tem discord ou skype para converamos melhor? Link to comment Share on other sites More sharing options...
Aeglon Posted December 6, 2017 at 05:57 PM Author Share Posted December 6, 2017 at 05:57 PM (edited) quest drop_event begin state start begin --- desta forma é para todos os moobs, se quiseres moobs certos usa -- when kill with npc.get_race() == 101 begin --- para cães selvagens -- when kill with npc.get_race() == 101 or npc.get_race() == 102 begin --- para 2 moobs para mais, basta ires fazendo or npc.get_race() == vnum do mob when kill with not npc.is_pc() begin if pc.get_level() < 50 then --- altera para o nivel minimo de drop return else pc.setqf("drop_event", pc.getqf("drop_event") + 1) if pc.getqf("drop_event") == 10 then --- Altera para o numero de kills a fazer para o drop game.drop_item_with_ownership(189,1) --- 189 = espada venenosa \\\ altera para o teu vnum pc.setqf("drop_event",0) --- remove esta linha se não queres que eles dropem sempre de x em x moobs end end end end end agora testei e funciona e corrigi as anteriores Edited December 6, 2017 at 05:58 PM by Aeglon Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted December 6, 2017 at 05:58 PM Share Posted December 6, 2017 at 05:58 PM Dropará uma vez, para dropar a cada 10 mobs mortos, adicionar pc.setqf("drop_event", 0) após: game.drop_item_with_ownership(189,1) Link to comment Share on other sites More sharing options...
Aeglon Posted December 6, 2017 at 05:59 PM Author Share Posted December 6, 2017 at 05:59 PM @Tierri Lopes i win Link to comment Share on other sites More sharing options...
LuizFernando Posted December 6, 2017 at 06:10 PM Share Posted December 6, 2017 at 06:10 PM Uma última coisa, se for possível é claro. Como faço para colocar nível de diferença no máximo 10, exemplo se eu for nível 12 não dropo em mob do nível 1. E se é possível colocar 3 tipos de itens para dropar porém sortidos? Link to comment Share on other sites More sharing options...
PACI Posted December 6, 2017 at 06:35 PM Share Posted December 6, 2017 at 06:35 PM -- Diferença maior que 10 niveis if math.abs(pc.get_level() - npc.get_level()) > 10 then return end -- Drop aleatório local drop = {itemVnum1, itemVnum2, itemVnum3} game.drop_item_with_ownership(drop[number(1, table.getn(drop))]) Link to comment Share on other sites More sharing options...
LuizFernando Posted December 6, 2017 at 06:40 PM Share Posted December 6, 2017 at 06:40 PM Fiz dessa maneira, porém não funcionou. quest drop_especial begin state start begin --- desta forma é para todos os moobs, se quiseres moobs certos usa -- when kill with npc.get_race() == 101 begin --- para cães selvagens -- when kill with npc.get_race() == 101 or npc.get_race() == 102 begin --- para 2 moobs para mais, basta ires fazendo or npc.get_race() == vnum do mob when kill with not npc.is_pc() begin -- Diferença maior que 10 niveis if math.abs(pc.get_level() - npc.get_level()) > 10 then return else pc.setqf("drop_especial", pc.getqf("drop_especial") + 1) if pc.getqf("drop_especial") == 10 then --- Altera para o numero de kills a fazer para o drop -- Drop aleatório local drop = {50135, 50136, 50137} game.drop_item_with_ownership(drop[number(1, table.getn(drop))]) pc.setqf("drop_especial",0) --- remove esta linha se não queres que eles dropem sempre de x em x moobs end end end end end Link to comment Share on other sites More sharing options...
PACI Posted December 6, 2017 at 07:32 PM Share Posted December 6, 2017 at 07:32 PM Usa syschats("texto") antes de cada condição para saber onde é que a função para. Link to comment Share on other sites More sharing options...
Aeglon Posted December 6, 2017 at 07:52 PM Author Share Posted December 6, 2017 at 07:52 PM (edited) 1 hora atrás, PACI disse: -- Diferença maior que 10 niveis if math.abs(pc.get_level() - npc.get_level()) > 10 then return end -- Drop aleatório local drop = {itemVnum1, itemVnum2, itemVnum3} game.drop_item_with_ownership(drop[number(1, table.getn(drop))]) @PACI tu não imaginas, mas eu aprendi bastante a nível de quests contigo. E uma vez mais, acabei de aprender uma nova forma para o drop aleatório. Eu usava outra forma, mas com mais uma linha.... é sempre bom, e tenho imenso orgulho\prazer nisto que te digo: "é delirante ver a "delicadeza" das tuas quests Obrigado por tudo. Edited December 6, 2017 at 07:54 PM by Aeglon Link to comment Share on other sites More sharing options...
Aeglon Posted December 6, 2017 at 08:33 PM Author Share Posted December 6, 2017 at 08:33 PM quest drop_event begin state start begin when kill with not npc.is_pc() begin if math.abs(pc.get_level() - npc.get_level()) > 10 then return end -- Limite de 10 níveis de diferença if pc.get_level() < 10 then return end -- mível mínimo de drop pc.setqf("drop_event", pc.getqf("drop_event") + 1) if pc.getqf("drop_event") == 50 then -- dropa um item a cada 50 monstros local list = { {number(10,19), 1},{number(180,189), 1},{27994, number(5,10)},{27995, number(5,10)} } -- lista dos itens a dropar local give = math.random(1, table.getn(list)) game.drop_item_with_ownership(list[give][1], list[give][2]) pc.setqf("drop_event",0) -- reinicia o loop end end end end @LuizFernando se voltares ao inicio do tópico e se prestares atenção a tudo. Irás perceber que tens muita coisa para meter os drops por quest da forma que quiseres Link to comment Share on other sites More sharing options...
PACI Posted December 6, 2017 at 08:48 PM Share Posted December 6, 2017 at 08:48 PM number() em vez de math.random(). Mas se preferires o segundo, aconselho-te a utilizares: math.randomseed(os.time()) antes. Link to comment Share on other sites More sharing options...
Aeglon Posted December 6, 2017 at 08:57 PM Author Share Posted December 6, 2017 at 08:57 PM (edited) 9 minutos atrás, PACI disse: "..math.randomseed(os.time()).." Desconhecia de todo essa função. Quando puderes e se puderes, explica (com exemplos) qual a diferença entre math.random() e math.randomseed(os.time()) edit: no need! http://lua-users.org/wiki/MathLibraryTutorial Edited December 6, 2017 at 08:58 PM by Aeglon Link to comment Share on other sites More sharing options...
LuizFernando Posted December 6, 2017 at 10:00 PM Share Posted December 6, 2017 at 10:00 PM Estou tendo esse erro aqui. SYSERR: Dec 6 19:58:07 :: RunState: LUA_ERROR: [string "drop_especial"]:1: attempt to call field `get_level' (a nil value) SYSERR: Dec 6 19:58:07 :: WriteRunningStateToSyserr: LUA_ERROR: quest drop_especial.start click Link to comment Share on other sites More sharing options...
PACI Posted December 6, 2017 at 10:25 PM Share Posted December 6, 2017 at 10:25 PM (edited) Não possuis a função npc.get_level(). Coloca a seguinte no teu questlua_npc.cpp e adiciona-o ao array de funções. int npc_get_level(lua_State* L){ LPCHARACTER pNPC = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L, pNPC ? pNPC->GetLevel() : 0); return 1; } Edited December 6, 2017 at 10:25 PM by PACI Link to comment Share on other sites More sharing options...
LuizFernando Posted December 6, 2017 at 10:42 PM Share Posted December 6, 2017 at 10:42 PM (edited) Fiz dessa maneira, está correto? Edited December 6, 2017 at 10:44 PM by LuizFernando Link to comment Share on other sites More sharing options...
CAMBOJA Posted June 2, 2021 at 11:41 AM Share Posted June 2, 2021 at 11:41 AM testar agora Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now