MORTE 78 Posted August 1, 2014 Share Posted August 1, 2014 when login begin local boss = {101, 102, 103, 104} local escolha = math.random(1,1) if escolha == 1 then pc.setqf("state", 20) q.set_counter("eventkill:", 20) say("kill mob"..boss[math.random(1,4)].."") end end when "..boss[math.randam(1,4)]..".kill begin local count = pc.getqf("state") - 1 if count <= 20 then pc.setqf("state", count) q.set_counter("eventkill", -count) end if count == 0 then local itens = {27005, 200},{27002, 200},{27006, 100},{27003, 100} pc.give_item2(itens[math.random(1,4)][1], itens[1][2]) end end end help ? Link to comment Share on other sites More sharing options...
metin2team 766 Posted August 1, 2014 Share Posted August 1, 2014 when "..boss[math.randam(1,4)]..".kill begin the number should be specified. when 101.kill or 102.kill or 103.kill or 104.kill begin. vnum = mob_vnum() xxxx end 1 Link to comment Share on other sites More sharing options...
Active Member Solution ATAG 310 Posted August 1, 2014 Active Member Solution Share Posted August 1, 2014 The quest is totally wrong. Try this one: quest yourquest begin when login begin local boss = {101, 102, 103, 104} local escolha = math.random(1,1) -- math.random(1,1) is always 1... dou you really want this?? if escolha == 1 then local mob = boss[number(1,table.getn(boss)] pc.setqf("mob", mob) pc.setqf("state", 20) q.set_counter("eventkill:", 20) say("kill mob"..mob_name(mob).."") end end when kill with not npc.is_pc() begin local mob = pc.getqf("mob") if mob == 0 or npc.get_race() ~= mob then return end local count = pc.getqf("state") - 1 if count <= 20 then pc.setqf("state", count) q.set_counter("eventkill", -count) end if count == 0 then local itens = {{27005, 200},{27002, 200},{27006, 100},{27003, 100}} local reward = number(1,table.getn(itens)) pc.give_item2(itens[reward][1], itens[reward][2]) pc.delqf("mob") pc.delqf("state") end end end I've just fixed the errors, but this quest is still a sh!t. Look at a hunting quest and modify to your needs. 1 Link to comment Share on other sites More sharing options...
MORTE 78 Posted August 1, 2014 Author Share Posted August 1, 2014 thanks error : local mob = boss[number(1,table.getn(boss)] fix : local mob = boss[number(1,table.getn(boss))] Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now