forked from MagicBane/Server
outlaw and hate value moved to modifyHealth
This commit is contained in:
@@ -141,11 +141,6 @@ public enum CombatManager {
|
||||
if (off == null)
|
||||
CombatManager.createTimer(playerCharacter, MBServerStatics.SLOT_OFFHAND, 1, true); // attack in 0.1 of a second
|
||||
}
|
||||
|
||||
City playerCity = ZoneManager.getCityAtLocation(playerCharacter.getLoc());
|
||||
|
||||
if (playerCity != null && playerCity.cityOutlaws.contains(playerCharacter.getObjectUUID()) == false)
|
||||
playerCity.cityOutlaws.add(playerCharacter.getObjectUUID());
|
||||
}
|
||||
|
||||
public static void setAttackTarget(PetAttackMsg msg, ClientConnection origin) throws MsgSendException {
|
||||
@@ -825,12 +820,6 @@ public enum CombatManager {
|
||||
if (tarAc.isSit())
|
||||
damage *= 2.5f; //increase damage if sitting
|
||||
|
||||
if (tarAc.getObjectType() == GameObjectType.Mob) {
|
||||
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
((Mob) tarAc).playerAgroMap.put(ac.getObjectUUID(), ((Mob) tarAc).playerAgroMap.get(ac.getObjectUUID()) + damage);
|
||||
((Mob) tarAc).handleDirectAggro(ac);
|
||||
}
|
||||
|
||||
if (tarAc.getHealth() > 0)
|
||||
d = tarAc.modifyHealth(-damage, ac, false);
|
||||
|
||||
@@ -1323,12 +1312,6 @@ public enum CombatManager {
|
||||
if (attackedMobile.guardCaptain.combatTarget == null)
|
||||
attackedMobile.guardCaptain.setCombatTarget(attacker);
|
||||
|
||||
// Add to city outlaw list
|
||||
|
||||
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) &&
|
||||
attackedMobile.guardedCity.cityOutlaws.contains(attacker.getObjectUUID()) == false)
|
||||
attackedMobile.guardedCity.cityOutlaws.add(attacker.getObjectUUID());
|
||||
|
||||
}
|
||||
|
||||
// Mobile already has a target; don't switch.
|
||||
|
||||
@@ -1244,11 +1244,21 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
CombatManager.handleRetaliate(this, attacker);
|
||||
}
|
||||
|
||||
if(this.getObjectType().equals(GameObjectType.Mob)){
|
||||
//handle hate value addition
|
||||
Mob target = (Mob)this;
|
||||
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
target.playerAgroMap.put(attacker.getObjectUUID(), target.playerAgroMap.get(attacker.getObjectUUID()) + value);
|
||||
if (target.isPlayerGuard()){
|
||||
if(target.guardedCity != null && target.guardedCity.cityOutlaws.contains(attacker.getObjectUUID()) == false)
|
||||
target.guardedCity.cityOutlaws.add(attacker.getObjectUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
return newHealth - oldHealth;
|
||||
} finally {
|
||||
this.healthLock.writeLock().unlock();
|
||||
}
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user