Browse Source

noob island guard aggro

combat-2
FatBoy-DOTC 6 months ago
parent
commit
03f0f3fcf0
  1. 36
      src/engine/mobileAI/MobAI.java
  2. 2
      src/engine/objects/City.java

36
src/engine/mobileAI/MobAI.java

@ -8,6 +8,7 @@
package engine.mobileAI; package engine.mobileAI;
import engine.InterestManagement.RealmMap;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.*; import engine.gameManager.*;
import engine.math.Vector3f; import engine.math.Vector3f;
@ -972,19 +973,34 @@ public class MobAI {
} }
private static void hamletGuardAggro(Mob mob) { private static void hamletGuardAggro(Mob mob) {
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc,MobAIThread.AI_BASE_AGGRO_RANGE,MBServerStatics.MASK_PLAYER); City city = ZoneManager.getCityAtLocation(mob.bindLoc);
for(AbstractWorldObject awo : loadedPlayers){ if(city != null && city.isNoobIsle == 1){
PlayerCharacter pc = (PlayerCharacter) awo; //noob island guards only aggro to mobs
if(!pc.isAlive() || !pc.isActive()) HashSet<AbstractWorldObject> loadedMobs = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_MOB);
continue; for (AbstractWorldObject awo : loadedMobs) {
if(pc.guild.equals(Guild.getErrantGuild())) { Mob targetMob = (Mob) awo;
if (!targetMob.isAlive() || targetMob.despawned)
continue;
if (targetMob.isPet())
continue;
mob.combatTarget = targetMob;
return;
}
} else {
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER);
for (AbstractWorldObject awo : loadedPlayers) {
PlayerCharacter pc = (PlayerCharacter) awo;
if (!pc.isAlive() || !pc.isActive())
continue;
if (pc.guild.equals(Guild.getErrantGuild())) {
mob.combatTarget = pc;
return;
}
if (pc.guild.charter.equals(mob.guild.charter))
continue;
mob.combatTarget = pc; mob.combatTarget = pc;
return; return;
} }
if(pc.guild.charter.equals(mob.guild.charter))
continue;
mob.combatTarget = pc;
return;
} }
} }

2
src/engine/objects/City.java

@ -59,7 +59,7 @@ public class City extends AbstractWorldObject {
private String cityName; private String cityName;
private String motto; private String motto;
private String description; private String description;
private int isNoobIsle; //1: noob, 0: not noob: -1: not noob, no teleport public int isNoobIsle; //1: noob, 0: not noob: -1: not noob, no teleport
private int population = 0; private int population = 0;
private int siegesWithstood = 0; private int siegesWithstood = 0;
private int radiusType; private int radiusType;

Loading…
Cancel
Save