An Idea; if possible.

I’m trying to think of an idea where it would be a deterrence to players to kill enemy players of a lower level by 15 levels.

I’m thinking something along the lines of…

public:
DishonorableKill() : PlayerScript(“DishonorableKill”){}

	void OnPVPKill(Player * Killer, Player * Killed)
	{
		if(Killer->GetLEVEL() > Killed->GetLEVEL())
			return;

		QueryResult result = CharacterDatabase.PQuery("SELECT * FROM level WHERE guid='%u'", Killed->GetLEVEL());
		if(!result)
			return;

		Field * fields = result->Fetch();

		switch(fields[2].GetUInt64())
		{
		
			Killer->SetMoney(Killer->GetMoney() - 100 * 10000));
			break;
		
		}

Not really great at C++ but the concept here is to remove the gold from the killers current gold if they are above the one who was killed. What I’m aiming to do is have it more along the lines of

if(Killer->GetLEVEL() >10 Killed->GetLEVEL())
return;

However I know that won’t work, but essentially if the player is 10 levels higher than the one killed then it would then remove the gold. Helpful Criticism is appreciated. Criticism to flex your epeen is not. Thanks in advance.

First of all, this should’ve been posted in the custom code sub-forum.

Anyway, how would you prevent players from depositing all gold in the bank before going on a killing spree? or mailing it to an alt character?

If you don’t want them to kill players 10/15 levels below them, just make it impossible to attack targets X levels below.

I’d go for the following approach:

void JustDied(Unit* killer) { if(killer && killer->GetLevel() - GetPlayer()->GetLevel() < 10) uint32 money = killer->GetMoney(); if(money > 1000000) killer->SetMoney(money - 1000000); else /*Consequences if he does not have enough gold (eg destroy his armor so he gets repcosts?)*/ }