Former Staff Shisui 491 Posted March 22, 2015 Former Staff Share Posted March 22, 2015 (edited) Hey I could use a litle help. This is the quest quest daily begin state start begin when login or levelup with pc.get_level() > 74 begin if get_global_time()> pc.getqf(tempo) then set_state(info) end end end state info begin -- info about the mission when letter begin send_letter("") end -- letter sent when button or info begin say_title("") say("") say("") say("") say("") say("") local risp = select("","") if risp==2 then -- Cancel return elseif risp == 1 then -- Easy pc.setqf("dif",0) -- difficulty FLAG (0=pedra sangue) set_state(running) end end -- when closed end -- INFO closed state running begin pc.setqf("done",0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf(dif)==0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward",30190) end when letter begin if pc.getqf(dif) == 0 then send_letter("") end end when button or info begin -- info about the quest if pc.getqf(done) == 0 then -- if he didn't complete the quest if pc.getqf(dif) == 0 then say_title("") say("") say("") say("") say("") say_reward("" .. qta_to_kill .. mob_name(pc.getqf(mob_to_kill))) if pc.getqf(dif) == 0 then say_reward("" .. pc.getqf(reward) .. "") end else say_title("") say("" ..pc.get_name() .. "") say("") wait() if pc.getqf(dif)==0 then say_reward("" .. pc.getqf(reward) .. "") pc.give_item2(30190, 1) end -- timer FLAG, this quest is repeatable once per day (24h) pc.setqf("tempo", get_global_time()+86400) -- 60*60*24 -- deleting FLAGS pc.delqf(mob_to_kill) pc.delqf(reward) pc.delqf(qta_to_kill) pc.delqf(dif) pc.delqf(done) set_state(__COMPLETE__) end end when pc.getqf(mob_to_kill).kill begin pc.setqf("qta_to_kill",(pc.getqf(qta_to_kill))-1) if pc.getqf(qta_to_kill) == 0 then pc.setqf("done",1) send_letter("") end end end -- closed RUNNING state __COMPLETE__ begin when enter begin q.done() end end -- closed __COMPLETE__ end -- closed QUEST And this is the error Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 24, 2015 Author Former Staff Share Posted March 24, 2015 Any1? Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted March 24, 2015 Premium Share Posted March 24, 2015 state running begin When login begin -- quest completed FLAG pc.setqf("done",0) 1 Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 24, 2015 Author Former Staff Share Posted March 24, 2015 (edited) quest daily begin state start begin when login or levelup with pc.get_level() > 74 begin if get_global_time()> pc.getqf(tempo) then set_state(info) end end end state info begin -- info about the mission when letter begin send_letter("") end -- letter sent when button or info begin say_title("") say("") say("") say("") say("") say("") local risp = select("","") if risp==2 then -- Cancel return elseif risp == 1 then -- Easy pc.setqf("dif",0) -- difficulty FLAG (0=pedra sangue) set_state(running) end end -- when closed end -- INFO closed state running begin when login begin pc.setqf("done",0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf(dif)==0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward",30190) end when letter begin if pc.getqf(dif) == 0 then send_letter("") end end when button or info begin -- info about the quest if pc.getqf(done) == 0 then -- if he didn't complete the quest if pc.getqf(dif) == 0 then say_title("") say("") say("") say("") say("") say_reward("" .. qta_to_kill .. mob_name(pc.getqf(mob_to_kill))) if pc.getqf(dif) == 0 then say_reward("" .. pc.getqf(reward) .. "") end else say_title("") say("" ..pc.get_name() .. "") say("") wait() if pc.getqf(dif)==0 then say_reward("" .. pc.getqf(reward) .. "") pc.give_item2(30190, 1) end -- timer FLAG, this quest is repeatable once per day (24h) pc.setqf("tempo", get_global_time()+86400) -- 60*60*24 -- deleting FLAGS pc.delqf(mob_to_kill) pc.delqf(reward) pc.delqf(qta_to_kill) pc.delqf(dif) pc.delqf(done) set_state(__COMPLETE__) end end when pc.getqf(mob_to_kill).kill begin pc.setqf("qta_to_kill",(pc.getqf(qta_to_kill))-1) if pc.getqf(qta_to_kill) == 0 then pc.setqf("done",1) send_letter("") end end end -- closed RUNNING state __COMPLETE__ begin when enter begin q.done() end end -- closed __COMPLETE__ end -- closed QUEST Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted March 24, 2015 Premium Share Posted March 24, 2015 Add end before when letter begin in state runing Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 24, 2015 Author Former Staff Share Posted March 24, 2015 (edited) Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted March 24, 2015 Premium Share Posted March 24, 2015 pc.setqf("reward",30190) end -- end if end-- end when login when letter begin if pc.getqf(dif) == 0 then send_letter("") end end Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 24, 2015 Author Former Staff Share Posted March 24, 2015 (edited) It's already like that. quest daily begin state start begin when login or levelup with pc.get_level() > 74 begin if get_global_time()> pc.getqf(tempo) then set_state(info) end end end state info begin -- info about the mission when letter begin send_letter("") end -- letter sent when button or info begin say_title("") say("" .. pc.get_name() .. ".") say("") say("") say("") say("") local risp = select("","") if risp==2 then -- Cancel return elseif risp == 1 then -- Easy pc.setqf("dif",0) -- difficulty FLAG (0=pedra sangue) set_state(running) end end -- when closed end -- INFO closed state running begin when login begin pc.setqf("done",0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf(dif)==0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward",30190) end end when letter begin if pc.getqf(dif) == 0 then send_letter("") end end when button or info begin -- info about the quest if pc.getqf(done) == 0 then -- if he didn't complete the quest if pc.getqf(dif) == 0 then say_title("") say("") say("") say("") say("") say_reward("" .. qta_to_kill .. mob_name(pc.getqf(mob_to_kill))) if pc.getqf(dif) == 0 then say_reward("" .. pc.getqf(reward) .. "") end else say_title("") say("" ..pc.get_name() .. "") say("") wait() if pc.getqf(dif)==0 then say_reward("" .. pc.getqf(reward) .. "") pc.give_item2(30190, 1) end -- timer FLAG, this quest is repeatable once per day (24h) pc.setqf("tempo", get_global_time()+86400) -- 60*60*24 -- deleting FLAGS pc.delqf(mob_to_kill) pc.delqf(reward) pc.delqf(qta_to_kill) pc.delqf(dif) pc.delqf(done) set_state(__COMPLETE__) end end when pc.getqf(mob_to_kill).kill begin pc.setqf("qta_to_kill",(pc.getqf(qta_to_kill))-1) if pc.getqf(qta_to_kill) == 0 then pc.setqf("done",1) send_letter("") end end end -- closed RUNNING state __COMPLETE__ begin when enter begin q.done() end end -- closed __COMPLETE__ end -- closed QUEST Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 24, 2015 Share Posted March 24, 2015 add a function before when running begin when xxxxxxxxxx begin I recommend you rewrite quest carefully. Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted March 24, 2015 Premium Share Posted March 24, 2015 Delete when login begin and end ftom state running and add these function in when letter begin pc.setqf("done",0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf(dif)==0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward",30190) end Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 24, 2015 Author Former Staff Share Posted March 24, 2015 Delete when login begin and end ftom state running and add these function in when letter begin Can you remake this sentence please? Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted March 24, 2015 Premium Share Posted March 24, 2015 quest daily begin state start begin when login or levelup with pc.get_level() > 74 begin if get_global_time()> pc.getqf(tempo) then set_state(info) end end end state info begin -- info about the mission when letter begin send_letter("") end -- letter sent when button or info begin say_title("") say("") say("") say("") say("") say("") local risp = select("","") if risp==2 then -- Cancel return elseif risp == 1 then -- Easy pc.setqf("dif",0) -- difficulty FLAG (0=pedra sangue) set_state(running) end end -- when closed end -- INFO closed state running begin when letter begin if pc.getqf(dif) == 0 then send_letter("") end pc.setqf("done",0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf(dif)==0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward",30190) end end when button or info begin -- info about the quest if pc.getqf(done) == 0 then -- if he didn't complete the quest if pc.getqf(dif) == 0 then say_title("") say("") say("") say("") say("") say_reward("" .. qta_to_kill .. mob_name(pc.getqf(mob_to_kill))) if pc.getqf(dif) == 0 then say_reward("" .. pc.getqf(reward) .. "") end else say_title("") say("" ..pc.get_name() .. "") say("") wait() if pc.getqf(dif)==0 then say_reward("" .. pc.getqf(reward) .. "") pc.give_item2(30190, 1) end -- timer FLAG, this quest is repeatable once per day (24h) pc.setqf("tempo", get_global_time()+86400) -- 60*60*24 -- deleting FLAGS pc.delqf(mob_to_kill) pc.delqf(reward) pc.delqf(qta_to_kill) pc.delqf(dif) pc.delqf(done) set_state(__COMPLETE__) end end when pc.getqf(mob_to_kill).kill begin pc.setqf("qta_to_kill",(pc.getqf(qta_to_kill))-1) if pc.getqf(qta_to_kill) == 0 then pc.setqf("done",1) send_letter("") end end end -- closed RUNNING state __COMPLETE__ begin when enter begin q.done() end end -- closed __COMPLETE__ end -- closed QUEST Sorry i am on mobile Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 24, 2015 Author Former Staff Share Posted March 24, 2015 (edited) Still the same problem. Thanks so far. Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Dash 81 Posted March 24, 2015 Premium Share Posted March 24, 2015 (edited) Still the same problem. Thanks so far. I dont't where is the problem...sorry Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 24, 2015 Author Former Staff Share Posted March 24, 2015 It's ok, maybe some1 knows. Thanks. Link to comment Share on other sites More sharing options...
Developer PACI 921 Posted March 24, 2015 Developer Share Posted March 24, 2015 (edited) You can't do this without being at a when-statement. Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted March 24, 2015 Premium Share Posted March 24, 2015 Try : quest daily begin state start begin when login or levelup with pc.get_level() > 74 begin if get_global_time() > pc.getqf(tempo) then set_state(info) end end end state info begin -- info about the mission when letter begin send_letter("") end -- letter sent when button or info begin say_title("") say("") say("") say("") say("") say("") local risp = select("","") if risp == 2 then return end -- Cancel pc.setqf("dif", 0) -- difficulty FLAG (0=pedra sangue) set_state(running) end -- when closed end -- INFO closed state running begin pc.setqf("done", 0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf("dif") == 0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward", 30190) end when letter begin if pc.getqf("dif") == 0 then send_letter("") end end when button or info begin -- info about the quest if pc.getqf("done") == 0 then -- if he didn't complete the quest if pc.getqf("dif") == 0 then say_title("") say("") say("") say("") say("") say_reward("" .. qta_to_kill .. mob_name(pc.getqf(mob_to_kill))) say_reward("" .. pc.getqf(reward) .. "") end else say_title("") say("" ..pc.get_name() .. "") say("") wait() if pc.getqf("dif") == 0 then say_reward("" .. pc.getqf(reward) .. "") pc.give_item2(30190, 1) end -- timer FLAG, this quest is repeatable once per day (24h) pc.setqf("tempo", get_global_time()+86400) -- 60*60*24 -- deleting FLAGS pc.delqf("mob_to_kill") pc.delqf("reward") pc.delqf("qta_to_kill") pc.delqf("dif") pc.delqf("done") set_state(__COMPLETE__) end end when pc.getqf(mob_to_kill).kill begin pc.setqf("qta_to_kill",(pc.getqf(qta_to_kill))-1) if pc.getqf(qta_to_kill) == 0 then pc.setqf("done", 1) send_letter("") end end end -- closed RUNNING state __COMPLETE__ begin when enter begin q.done() end end -- closed __COMPLETE__ end -- closed QUEST If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 25, 2015 Author Former Staff Share Posted March 25, 2015 (edited) Try : quest daily begin state start begin when login or levelup with pc.get_level() > 74 begin if get_global_time() > pc.getqf(tempo) then set_state(info) end end end state info begin -- info about the mission when letter begin send_letter("") end -- letter sent when button or info begin say_title("") say("") say("") say("") say("") say("") local risp = select("","") if risp == 2 then return end -- Cancel pc.setqf("dif", 0) -- difficulty FLAG (0=pedra sangue) set_state(running) end -- when closed end -- INFO closed state running begin pc.setqf("done", 0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf("dif") == 0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward", 30190) end when letter begin if pc.getqf("dif") == 0 then send_letter("") end end when button or info begin -- info about the quest if pc.getqf("done") == 0 then -- if he didn't complete the quest if pc.getqf("dif") == 0 then say_title("") say("") say("") say("") say("") say_reward("" .. qta_to_kill .. mob_name(pc.getqf(mob_to_kill))) say_reward("" .. pc.getqf(reward) .. "") end else say_title("") say("" ..pc.get_name() .. "") say("") wait() if pc.getqf("dif") == 0 then say_reward("" .. pc.getqf(reward) .. "") pc.give_item2(30190, 1) end -- timer FLAG, this quest is repeatable once per day (24h) pc.setqf("tempo", get_global_time()+86400) -- 60*60*24 -- deleting FLAGS pc.delqf("mob_to_kill") pc.delqf("reward") pc.delqf("qta_to_kill") pc.delqf("dif") pc.delqf("done") set_state(__COMPLETE__) end end when pc.getqf(mob_to_kill).kill begin pc.setqf("qta_to_kill",(pc.getqf(qta_to_kill))-1) if pc.getqf(qta_to_kill) == 0 then pc.setqf("done", 1) send_letter("") end end end -- closed RUNNING state __COMPLETE__ begin when enter begin q.done() end end -- closed __COMPLETE__ end -- closed QUEST Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted March 25, 2015 Premium Share Posted March 25, 2015 ah right right try this : quest daily begin state start begin when login or levelup with pc.get_level() > 74 begin if get_global_time() > pc.getqf(tempo) then set_state(info) end end end state info begin -- info about the mission when letter begin send_letter("") end -- letter sent when button or info begin say_title("") say("") say("") say("") say("") say("") local risp = select("","") if risp == 2 then return end -- Cancel pc.setqf("dif", 0) -- difficulty FLAG (0=pedra sangue) set_state(running) end -- when closed end -- INFO closed state running begin when login or enter begin pc.setqf("done", 0) -- quest completed FLAG (0=not completed, 1=completed) if pc.getqf("dif") == 0 then pc.setqf("mob_to_kill",math.random(691, 1901, 791, 1304, 2206, 1093, 2091)) -- how many kills local qta = { 3, 4, 5, 6 } pc.setqf("qta_to_kill",qta[math.random(1, 4)]) -- recompensa pedra sangue pc.setqf("reward", 30190) end end when letter begin if pc.getqf("dif") == 0 then send_letter("") end end when button or info begin -- info about the quest if pc.getqf("done") == 0 then -- if he didn't complete the quest if pc.getqf("dif") == 0 then say_title("") say("") say("") say("") say("") say_reward("" .. qta_to_kill .. mob_name(pc.getqf(mob_to_kill))) say_reward("" .. pc.getqf(reward) .. "") end else say_title("") say("" ..pc.get_name() .. "") say("") wait() if pc.getqf("dif") == 0 then say_reward("" .. pc.getqf(reward) .. "") pc.give_item2(30190, 1) end -- timer FLAG, this quest is repeatable once per day (24h) pc.setqf("tempo", get_global_time()+86400) -- 60*60*24 -- deleting FLAGS pc.delqf("mob_to_kill") pc.delqf("reward") pc.delqf("qta_to_kill") pc.delqf("dif") pc.delqf("done") set_state(__COMPLETE__) end end when pc.getqf(mob_to_kill).kill begin pc.setqf("qta_to_kill",(pc.getqf(qta_to_kill))-1) if pc.getqf(qta_to_kill) == 0 then pc.setqf("done", 1) send_letter("") end end end -- closed RUNNING state __COMPLETE__ begin when enter begin q.done() end end -- closed __COMPLETE__ end -- closed QUEST If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 25, 2015 Author Former Staff Share Posted March 25, 2015 (edited) Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted March 25, 2015 Premium Share Posted March 25, 2015 the problem now in this line : when pc.getqf(mob_to_kill).kill begin i dont have server now to test which way it can work but try ; when pc.getqf("mob_to_kill").kill begin pc.setqf("qta_to_kill",(pc.getqf("qta_to_kill"))-1) if pc.getqf("qta_to_kill") == 0 then pc.setqf("done", 1) send_letter("") end end end -- closed RUNNING If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 25, 2015 Author Former Staff Share Posted March 25, 2015 Thanks so far btw. Gives the same error. Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted March 25, 2015 Premium Share Posted March 25, 2015 try to use function to send the pc.getqf monster number ! If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
Former Staff Shisui 491 Posted March 26, 2015 Author Former Staff Share Posted March 26, 2015 try to use function to send the pc.getqf monster number ! Hum, sorry I did not understand that. Link to comment Share on other sites More sharing options...
Think 117 Posted March 26, 2015 Share Posted March 26, 2015 when kill with npc.get_race() == pc.getf("quest_name", "mob_to_kill") begin -- all the kill code end This is more or less what you want, I suppose. Make sure to use pc.getf and not getqf, because getqf does not work properly in when conditions (Due to how they are evaluated). Ah, and replace "quest_name" with your quest name 2 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