|
|
@ -821,25 +821,25 @@ public enum CombatManager { |
|
|
|
//Subtract Damage from target's health
|
|
|
|
//Subtract Damage from target's health
|
|
|
|
|
|
|
|
|
|
|
|
if (tarAc != null) { |
|
|
|
if (tarAc != null) { |
|
|
|
|
|
|
|
if (tarAc.isSit()) |
|
|
|
|
|
|
|
damage *= 2.5f; //increase damage if sitting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tarAc.getObjectType() == GameObjectType.Mob) { |
|
|
|
|
|
|
|
Mob mobTarget = (Mob) tarAc; |
|
|
|
|
|
|
|
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) { |
|
|
|
|
|
|
|
if (mobTarget.playerAgroMap.containsKey(ac.getObjectUUID())) { |
|
|
|
|
|
|
|
float hateValue = damage + mobTarget.playerAgroMap.get(ac.getObjectUUID()); |
|
|
|
|
|
|
|
mobTarget.playerAgroMap.put(ac.getObjectUUID(), hateValue); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
mobTarget.playerAgroMap.put(ac.getObjectUUID(), damage); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (tarAc.isSit()) |
|
|
|
|
|
|
|
damage *= 2.5f; //increase damage if sitting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tarAc.getObjectType() == GameObjectType.Mob) { |
|
|
|
|
|
|
|
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)) { |
|
|
|
|
|
|
|
if(((Mob) tarAc).playerAgroMap.containsKey(ac.getObjectUUID())) { |
|
|
|
|
|
|
|
((Mob) tarAc).playerAgroMap.put(ac.getObjectUUID(), ((Mob) tarAc).playerAgroMap.get(ac.getObjectUUID()) + damage); |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
((Mob) tarAc).playerAgroMap.put(ac.getObjectUUID(), damage); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
mobTarget.handleDirectAggro(ac); |
|
|
|
} |
|
|
|
} |
|
|
|
((Mob) tarAc).handleDirectAggro(ac); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tarAc.getHealth() > 0) |
|
|
|
|
|
|
|
d = tarAc.modifyHealth(-damage, ac, false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tarAc.getHealth() > 0) |
|
|
|
|
|
|
|
d = tarAc.modifyHealth(-damage, ac, false); |
|
|
|
} else if (target.getObjectType().equals(GameObjectType.Building)) { |
|
|
|
} else if (target.getObjectType().equals(GameObjectType.Building)) { |
|
|
|
|
|
|
|
|
|
|
|
if (BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) { |
|
|
|
if (BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) { |
|
|
@ -950,7 +950,7 @@ public enum CombatManager { |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(ac.getName() + ' ' + errorTrack + ' ' + e); |
|
|
|
Logger.error(ac.getName() + ' ' + errorTrack + ' ' + e); |
|
|
|
e.printStackTrace(); |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|