Addition of getMainDamageDealer method.
This commit is contained in:
@@ -726,6 +726,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -722,6 +722,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -722,6 +722,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -722,6 +722,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -708,6 +708,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -708,6 +708,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -708,6 +708,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -719,6 +719,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -719,6 +719,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -719,6 +719,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -920,6 +920,27 @@ public class Attackable extends NpcInstance
|
||||
}
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info._damage > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info._attacker, true))
|
||||
{
|
||||
damage = info._damage;
|
||||
damageDealer = info._attacker;
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+6
-18
@@ -1774,6 +1774,11 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
|
||||
setKilledAlready(true);
|
||||
}
|
||||
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -1842,28 +1847,11 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
stopAllEffects();
|
||||
}
|
||||
}
|
||||
else
|
||||
// this means all other characters, including Summons
|
||||
else // this means all other characters, including Summons
|
||||
{
|
||||
stopAllEffects();
|
||||
}
|
||||
|
||||
// if killer is the same then the most damager/hated
|
||||
Creature mostHated = null;
|
||||
if (this instanceof Attackable)
|
||||
{
|
||||
mostHated = ((Attackable) this)._mostHated;
|
||||
}
|
||||
|
||||
if ((mostHated != null) && isInsideRadius2D(mostHated, 200))
|
||||
{
|
||||
calculateRewards(mostHated);
|
||||
}
|
||||
else
|
||||
{
|
||||
calculateRewards(killer);
|
||||
}
|
||||
|
||||
// Send the Server->Client packet StatusUpdate with current HP and MP to all other PlayerInstance to inform
|
||||
broadcastStatusUpdate();
|
||||
|
||||
|
||||
@@ -921,6 +921,27 @@ public class Attackable extends NpcInstance
|
||||
}
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info._damage > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info._attacker, true))
|
||||
{
|
||||
damage = info._damage;
|
||||
damageDealer = info._attacker;
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -1817,6 +1817,11 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
|
||||
setKilledAlready(true);
|
||||
}
|
||||
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -1885,28 +1890,11 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
stopAllEffects();
|
||||
}
|
||||
}
|
||||
else
|
||||
// this means all other characters, including Summons
|
||||
else // this means all other characters, including Summons
|
||||
{
|
||||
stopAllEffects();
|
||||
}
|
||||
|
||||
// if killer is the same then the most damager/hated
|
||||
Creature mostHated = null;
|
||||
if (this instanceof Attackable)
|
||||
{
|
||||
mostHated = ((Attackable) this)._mostHated;
|
||||
}
|
||||
|
||||
if ((mostHated != null) && isInsideRadius2D(mostHated, 200))
|
||||
{
|
||||
calculateRewards(mostHated);
|
||||
}
|
||||
else
|
||||
{
|
||||
calculateRewards(killer);
|
||||
}
|
||||
|
||||
// Send the Server->Client packet StatusUpdate with current HP and MP to all other PlayerInstance to inform
|
||||
broadcastStatusUpdate();
|
||||
|
||||
|
||||
@@ -679,6 +679,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(creature);
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -73,6 +73,7 @@ import org.l2jmobius.gameserver.model.TimeStamp;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.WorldRegion;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.QuestGuardInstance;
|
||||
@@ -2432,6 +2433,10 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
setDead(true);
|
||||
}
|
||||
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -2458,8 +2463,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
}
|
||||
|
||||
calculateRewards(killer);
|
||||
|
||||
// Send the Server->Client packet StatusUpdate with current HP and MP to all other PlayerInstance to inform
|
||||
broadcastStatusUpdate();
|
||||
|
||||
|
||||
@@ -679,6 +679,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(creature);
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
@@ -73,6 +73,7 @@ import org.l2jmobius.gameserver.model.TimeStamp;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.WorldRegion;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.QuestGuardInstance;
|
||||
@@ -2434,6 +2435,10 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
setDead(true);
|
||||
}
|
||||
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
@@ -2460,8 +2465,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
}
|
||||
|
||||
calculateRewards(killer);
|
||||
|
||||
// Send the Server->Client packet StatusUpdate with current HP and MP to all other PlayerInstance to inform
|
||||
broadcastStatusUpdate();
|
||||
|
||||
|
||||
+21
@@ -722,6 +722,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -722,6 +722,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -722,6 +722,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -743,6 +743,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1693,7 +1693,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -743,6 +743,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1693,7 +1693,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -743,6 +743,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1693,7 +1693,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -726,6 +726,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1692,7 +1692,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -748,6 +748,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1696,7 +1696,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
+21
@@ -753,6 +753,27 @@ public class Attackable extends Npc
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
public Creature getMainDamageDealer()
|
||||
{
|
||||
if (_aggroList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
Creature damageDealer = null;
|
||||
for (AggroInfo info : _aggroList.values())
|
||||
{
|
||||
if ((info != null) && (info.getDamage() > damage) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, info.getAttacker(), true))
|
||||
{
|
||||
damage = info.getDamage();
|
||||
damageDealer = info.getAttacker();
|
||||
}
|
||||
}
|
||||
|
||||
return damageDealer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add damage and hate to the attacker AggroInfo of the Attackable _aggroList.
|
||||
* @param attacker The Creature that gave damages to this Attackable
|
||||
|
||||
+3
-1
@@ -1703,7 +1703,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
calculateRewards(killer);
|
||||
// Calculate rewards for main damage dealer.
|
||||
final Creature mainDamageDealer = isMonster() ? ((MonsterInstance) this).getMainDamageDealer() : null;
|
||||
calculateRewards(mainDamageDealer != null ? mainDamageDealer : killer);
|
||||
|
||||
// Set target to null and cancel Attack or Cast
|
||||
setTarget(null);
|
||||
|
||||
Reference in New Issue
Block a user