Jump to content

[QUEST]PvP kills are counted twice


Recommended Posts

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

  • Premium

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);
}
  • Love 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

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

  • Premium
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

Please sign in to comment

You will be able to leave a comment after signing in



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.