Holyfuture 0 Posted January 23, 2018 Share Posted January 23, 2018 Hi guys, I start to learn questing. I have a problem with my PvP quest. If Player1 kills Player2, Player1 gets one point. If Player1 reaches 5 points, he has solved the quest with a reward. The problem is that if I killed someone, I get 2 points instead of 1 point. Besides, if I score 5 points, the quest gives me the reward, but still exists as an undeleted quest. Can someone help me? quest kill begin state start begin when login or levelup with pc.get_level() >= 15 and pc.getqf("qfset") == 0 begin set_state(killquest) end end state killquest begin when letter begin send_letter("Jäger und Sammler") end when button or info begin say_title("Jäger und Sammler") say("") say("Töte so viele dudes wie nur möglich. Töte einfach... 5!") say("") say("") say_reward("Du hast "..pc.getqf("kills").." von 5 getötet"); end when kill with npc.is_pc() begin pc.setqf("kills", pc.getqf("kills")+1) chat("Jäger und Sammler: Du hast "..pc.getqf("kills").." von 5 Leute getötet") if pc.getqf("kills") == 5 then pc.setqf("qfset", pc.getqf("qfset")+1) say("Du hast 5 Leute getötet, Glückwunsch!") say("Du erhältst jetzt etwas Gold") pc.give_gold(500) end end end end thanks Link to comment Share on other sites More sharing options...
Premium Syreldar 1890 Posted January 23, 2018 Premium Share Posted January 23, 2018 Kills on players count as double, it's a bug on some gamefiles. You can fix source-side: In questmanager.cpp you need to edit this line: m_mapNPC[npc].OnKill(*pPC); to this: if (npc > 0) { m_mapNPC[npc].OnKill(*pPC); } 1 "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Holyfuture 0 Posted January 23, 2018 Author Share Posted January 23, 2018 vor 22 Minuten schrieb Syreldar: Kills on players count as double, it's a bug on some gamefiles. You can fix source-side: In questmanager.cpp you need to edit this line: m_mapNPC[npc].OnKill(*pPC); to this: if (npc > 0) { m_mapNPC[npc].OnKill(*pPC); } Thank you for your quick answer. I edit this line to the new code. But how can I compile it to my server? I really don't know how to do this. Is there a guide or something else? Thank you Link to comment Share on other sites More sharing options...
Premium Syreldar 1890 Posted January 23, 2018 Premium Share Posted January 23, 2018 Just now, Holyfuture said: Thank you for your quick answer. I edit this line to the new code. But how can I compile it to my server? I really don't know how to do this. Is there a guide or something else? Thank you use gmake, it will recompile your gamefile and your db. "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar 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