forked from MagicBane/Server
characters that attack city friendly buildings are added to cityOutlaws
This commit is contained in:
@@ -605,13 +605,6 @@ public enum CombatManager {
|
|||||||
|
|
||||||
defense = 0;
|
defense = 0;
|
||||||
|
|
||||||
Building building = (Building) target;
|
|
||||||
|
|
||||||
City playerCity = ZoneManager.getCityAtLocation(building.getLoc());
|
|
||||||
if(playerCity != null){
|
|
||||||
if(!playerCity.cityOutlaws.contains(attacker.getObjectUUID()))
|
|
||||||
playerCity.cityOutlaws.add(attacker.getObjectUUID());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
AbstractCharacter tar = (AbstractCharacter) target;
|
AbstractCharacter tar = (AbstractCharacter) target;
|
||||||
defense = tar.getDefenseRating();
|
defense = tar.getDefenseRating();
|
||||||
|
|||||||
@@ -537,6 +537,15 @@ public class Building extends AbstractWorldObject {
|
|||||||
if (value < 0)
|
if (value < 0)
|
||||||
Mine.SendMineAttackMessage(this);
|
Mine.SendMineAttackMessage(this);
|
||||||
|
|
||||||
|
City playerCity = ZoneManager.getCityAtLocation(this.loc);
|
||||||
|
if(playerCity != null){
|
||||||
|
if(this.getGuild().getNation().equals(playerCity.getTOL().getGuild().getNation())){
|
||||||
|
//friendly building has been attacked, add attacker to city outlaw list
|
||||||
|
if(!playerCity.cityOutlaws.contains(attacker.getObjectUUID()))
|
||||||
|
playerCity.cityOutlaws.add(attacker.getObjectUUID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return newHealth - oldHealth;
|
return newHealth - oldHealth;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user