Olympiad support for Player onPlayerKill method.
This commit is contained in:
		| @@ -175,6 +175,7 @@ public abstract class Playable extends Creature | ||||
| 				qs.getQuest().notifyDeath((killer == null ? this : killer), this, qs); | ||||
| 			} | ||||
| 		} | ||||
| 		 | ||||
| 		// Notify instance | ||||
| 		if (isPlayer()) | ||||
| 		{ | ||||
| @@ -188,7 +189,7 @@ public abstract class Playable extends Creature | ||||
| 		if (killer != null) | ||||
| 		{ | ||||
| 			final Player killerPlayer = killer.getActingPlayer(); | ||||
| 			if ((killerPlayer != null) && isPlayable()) | ||||
| 			if (killerPlayer != null) | ||||
| 			{ | ||||
| 				killerPlayer.onPlayerKill(this); | ||||
| 			} | ||||
|   | ||||
| @@ -5209,11 +5209,15 @@ public class Player extends Playable | ||||
| 		return droppedItems; | ||||
| 	} | ||||
| 	 | ||||
| 	public void onPlayerKill(Playable killedPlayable) | ||||
| 	public void onPlayerKill(Playable target) | ||||
| 	{ | ||||
| 		final Player killedPlayer = killedPlayable.getActingPlayer(); | ||||
| 		if ((target == null) || !target.isPlayable()) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		 | ||||
| 		// Avoid nulls && check if player != killedPlayer | ||||
| 		final Player killedPlayer = target.getActingPlayer(); | ||||
| 		if ((killedPlayer == null) || (this == killedPlayer)) | ||||
| 		{ | ||||
| 			return; | ||||
| @@ -5226,6 +5230,12 @@ public class Player extends Playable | ||||
| 			return; | ||||
| 		} | ||||
| 		 | ||||
| 		// Olympiad support | ||||
| 		if (isInOlympiadMode() || killedPlayer.isInOlympiadMode()) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		 | ||||
| 		// Duel support | ||||
| 		if (isInDuel() && killedPlayer.isInDuel()) | ||||
| 		{ | ||||
| @@ -5281,14 +5291,14 @@ public class Player extends Playable | ||||
| 			{ | ||||
| 				if ((_isGood && killedPlayer.isGood()) || (_isEvil && killedPlayer.isEvil())) | ||||
| 				{ | ||||
| 					setReputation(getReputation() - Formulas.calculateKarmaGain(getPkKills(), killedPlayable.isSummon())); | ||||
| 					setReputation(getReputation() - Formulas.calculateKarmaGain(getPkKills(), target.isSummon())); | ||||
| 					setPkKills(getPkKills() + 1); | ||||
| 					setTotalKills(getTotalKills() + 1); | ||||
| 				} | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				setReputation(getReputation() - Formulas.calculateKarmaGain(getPkKills(), killedPlayable.isSummon())); | ||||
| 				setReputation(getReputation() - Formulas.calculateKarmaGain(getPkKills(), target.isSummon())); | ||||
| 				setPkKills(getPkKills() + 1); | ||||
| 				setTotalKills(getTotalKills() + 1); | ||||
| 				 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment