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]
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.
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.
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?
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