Jump to content

help event quest


Go to solution Solved by ATAG,

Recommended Posts

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

  • Active Member
  • Solution

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.

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.