Anti - token/kills farmer?

So, recently we’ve been noticing that a lot of players are token/kills farming.

Farming, meaning that the player creates two accounts and then gears up a toon on one, whilst not getting any gear on the other account.

Then the player kills “himself” with his geared toon.

So. I’ve been planning on how it could work and I’m just wondering if it’s even possible?

This is what I want to happen.


If Player X kills player Y within the timespan of Z C amount of times, the player gets kicked.

I could even imagine that you can check the IP and if it’s the same give him a 3 days ban (Just an example)

If this is possible, could someone please add either my skype = cyphric

Or post in this thread, how it could be done. Because I can not for the love of god figure out how to do it.

Love, cyphric.

This is your best option - else you’ll get a shitload of ‘unfair’ bans, plus there’ll be an easy way to get around it (pausing every X seconds/minutes).

Go into Unit.cpp, line ~15700, hook Unit::Kill, and add this code:

if (GetTypeId() == TYPEID_PLAYER && victim->GetTypeId() == TYPEID_PLAYER) { if (ToPlayer()->GetSession()->GetRemoteAddress() == victim->ToPlayer()->GetSession()->GetRemoteAddress()) { // We call this before kicking them so their name and IP aren't returning NULL. sLog->outError("Player '%s' (IP %s) killed player '%s' who uses the same IP address. Possible honor farm, both players have been kicked.", ToPlayer()->GetName(), ToPlayer()->GetSession()->GetRemoteAddress(), victim->ToPlayer()->GetName()); ToPlayer()->GetSession()->KickPlayer(); victim->ToPlayer()->GetSession()->KickPlayer(); return; } }
[/CODE]

Moving to Custom Code section, this is not something we would want in Trinity.

There’s already a 2 minute timer when you die after a couple of times if I recall correctly. You would get more kills in 2 minutes in a BG.

Is that the enire code? Seems rather simple /emoticons/default_tongue.png

But, the simpler the better /emoticons/default_smile.png

!NOOB QUESTION!

How do you hook Unit::kill?

Or what do you meen with hook?

“hook Unit::Kill” just determites in which hook the code should be added.

Ok thank you

Why would you kick/ban the player? Just fix the problem so that they are no longer awarded honor/tokens/kills once they have killed someone enough times or that they are no longer awarded honor/tokens/kills from killing anyone at their own IP.

Every player you ban removes someone from the community. If your goal is to stop farming, then stop farming. If your goal is to get rid of the community, get rid of the community. Don’t mix those up.

People will stop killing them self when they will get extra reward for it - a 3 day ban.

That’s true, but you can instant respawn under level 10 without the resurrection sickness by talking to the spirit guardian. That’s for twinks tho, as ofc level 80 players wont get a hk on level < 11 players.

It’s a instant 80 pvp server…

But anyways. Is there a way for like LAN players that wants to play against each other on different factions that has the same external IP that they don’t get banned?

No. Also, you can allow only 1 connection per IP if i remember correctly.

Why would you kick/ban the player? Just fix the problem so that they are no longer awarded honor/tokens/kills once they have killed someone enough times or that they are no longer awarded honor/tokens/kills from killing anyone at their own IP.

How about a limit of X pvp rewards per day or only allow 1 token per victims IP.


bool Player::HandlePvPAntifarm(Player* victim)

{

bool sendInfo = true;

if (!isGameMaster() && !victim->isGameMaster())

{

	 if (this == victim)

	 {

		 if (sendInfo)

			 ChatHandler(this).PSendSysMessage("%s[PvP System]%s Suicide!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);

		 return false;

	 }

	 else if (victim->HasAura(2479))

	 {

		 if (sendInfo)

			 ChatHandler(this).PSendSysMessage("%s[PvP System]%s Hes not worth money or honor yet!",MSG_COLOR_MAGENTA,MSG_COLOR_WHITE);

		 return false;

	 }

	 else if (GetSession()->GetRemoteAddress() == victim->GetSession()->GetRemoteAddress())

	 {

		 if (sendInfo)

		 {

			 ChatHandler(this).PSendSysMessage("%s[Anti Farming System]%s You have same ip as your victim", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);

			 ChatHandler(this).PSendSysMessage("%sthis means you are on same network and could farm money together.", MSG_COLOR_WHITE);

		 }

		 return false;

	 }

	 else if (victim->GetObjectGuid() == ALastGuid || GetObjectGuid() == victim->VLastGuid)

	 {

		 ALastGuidCount += 1;

		 victim->VLastGuidCount += 1;

		 // Check if same attacker have killed same victim 5 times in a row, or victim dies from same guy 3 times in a row.

		 if (ALastGuidCount >= 5 || victim->VLastGuidCount >= 5)

		 {

			 if (sendInfo)

				 ChatHandler(this).PSendSysMessage("%s[Anti Farming System]%s You don't get awarded for killing a player more than 5 times in a row!.", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);

			 return false;

		 }

	 }

	 else

		 ALastGuidCount = 0; // Killed a new target, set "last killed guid count" to 0

}

ALastGuid = victim->GetObjectGuid(); // Set attackers last kill guid to victim's guid

victim->VLastGuid = GetObjectGuid(); // Set victims last killed guid to attacker's guid

return true;

}

Should be a bit more advanced and making it “impossible” for players to farm

EDIT: You might need to rewrite the function names on some of the functions, but the names are self explaining so you shouldnt have any problems with that as soon as you are inside VS

[B]LilleCarl[/B] Looks legit, where exactly should I place this code?


[B]Discover[/B] megabrain! /emoticons/default_smile.png

uhh wouldnt this cause issues with people who live in the same house or people who play at an internet cafe?

Yes it would. Good luck getting around that… /emoticons/default_smile.png

Its a function that should be placed in player.cpp for example and declared in player.h

When you call it it will return true if its not a “farmer” and false if it is a farmer =)