Jump to content
  • 0

help event quest


MORTE

Question

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

3 answers to this question

Recommended Posts

  • 0

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

$ uptime
1:26AM  up 732 days,  8:29, 1 user, load averages: 0.38, 0.31, 0.22

$ uname -srp
FreeBSD 9.1-RELEASE amd64

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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.