Index: E:/L2j Development/workspace/L2_GameServer-clean/java/com/l2jserver/gameserver/model/actor/L2Character.java
===================================================================
--- E:/L2j Development/workspace/L2_GameServer-clean/java/com/l2jserver/gameserver/model/actor/L2Character.java (revision 4014)
+++ E:/L2j Development/workspace/L2_GameServer-clean/java/com/l2jserver/gameserver/model/actor/L2Character.java (working copy)
@@ -2087,7 +2087,20 @@
if (this instanceof L2PcInstance && ((L2PcInstance)this).getAgathionId() != 0)
((L2PcInstance)this).setAgathionId(0);
- calculateRewards(killer);
+
+ DmgInfo dmger = null;
+ double dmg = 0;
+
+ for(DmgInfo dmgs : _agroMap.values())
+ {
+ if(dmgs.dmg > dmg)
+ {
+ dmg = dmgs.dmg;
+ dmger = dmgs;
+ }
+ }
+
+ calculateRewards(dmger.attacker != null ? _agroMap.get(dmg).attacker : killer);
+ _agroMap.clear();
// Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
broadcastStatusUpdate();
@@ -6777,8 +6790,8 @@
public final int getWalkSpeed() { return getStat().getWalkSpeed(); }
public int getWIT() { return getStat().getWIT(); }
// =========================================================
-
-
+ class DmgInfo{ L2Character attacker; double dmg; public DmgInfo(L2Character att) { attacker = att; }}
+ private FastMap<L2Character, DmgInfo> _agroMap;
// =========================================================
// Status - NEED TO REMOVE ONCE L2CHARTATUS IS COMPLETE
// Method - Public
@@ -6791,6 +6804,13 @@
getStatus().reduceHp(i/Config.L2JMOD_CHAMPION_HP, attacker, awake, isDOT, false);
else
getStatus().reduceHp(i, attacker, awake, isDOT, false);
+
+ if(this instanceof L2Attackable && attacker.getActingPlayer() != null) // simple check XD
+ {
+ DmgInfo lastDmg = _agroMap.containsKey(attacker) ? _agroMap.get(attacker) : new DmgInfo(attacker);
+ lastDmg.dmg += i;
+ _agroMap.put(attacker, lastDmg);
+ }
}
public void reduceCurrentMp(double i) { getStatus().reduceMp(i); }
public void removeStatusListener(L2Character object) { getStatus().removeStatusListener(object); }
There u go simple, clean and precise.