forked from MagicBane/Server
Merge remote-tracking branch 'origin/bugfix-safeguard-aggro' into magicbox-1.5.2
This commit is contained in:
@@ -406,7 +406,6 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
|
||||
Mob mobile = new Mob();
|
||||
mobile.dbID = MBServerStatics.NO_DB_ROW_ASSIGNED_YET;
|
||||
//mobile.agentType = AIAgentType.MOBILE; this method is only called to make guard captains and wall archers
|
||||
mobile.agentType = mobType;
|
||||
mobile.behaviourType = MobBehaviourType.None;
|
||||
mobile.loadID = loadID;
|
||||
@@ -418,12 +417,17 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
mobile.guildUUID = guild.getObjectUUID();
|
||||
|
||||
mobile.parentZoneUUID = parent.getObjectUUID();
|
||||
mobile.buildingUUID = building.getObjectUUID();
|
||||
|
||||
if (building == null)
|
||||
mobile.buildingUUID = 0;
|
||||
else
|
||||
mobile.buildingUUID = building.getObjectUUID();
|
||||
|
||||
if (mobile.buildingUUID != 0)
|
||||
mobile.bindLoc = Vector3fImmutable.ZERO;
|
||||
else
|
||||
mobile.bindLoc = spawn;
|
||||
mobile.bindLoc = ZoneManager.worldToLocal(spawn, parent);
|
||||
;
|
||||
|
||||
mobile.firstName = pirateName;
|
||||
|
||||
@@ -1889,6 +1893,19 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean isGuard(){
|
||||
|
||||
switch(this.behaviourType){
|
||||
case GuardMinion:
|
||||
case GuardCaptain:
|
||||
case GuardWallArcher:
|
||||
case HamletGuard:
|
||||
case SimpleStandingGuard:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDelay(@NotNull TimeUnit unit) {
|
||||
long timeRemaining = this.respawnTime - System.currentTimeMillis();
|
||||
|
||||
@@ -461,16 +461,20 @@ public class NPC extends AbstractCharacter {
|
||||
|
||||
NPC newNPC = new NPC();
|
||||
|
||||
newNPC.parentZoneUUID = parent.getObjectUUID();
|
||||
|
||||
newNPC.name = name;
|
||||
newNPC.contractUUID = contractID;
|
||||
|
||||
if (building == null)
|
||||
newNPC.bindLoc = spawn;
|
||||
newNPC.bindLoc = ZoneManager.worldToLocal(spawn, parent);
|
||||
else
|
||||
newNPC.bindLoc = Vector3fImmutable.ZERO;
|
||||
|
||||
newNPC.parentZoneUUID = parent.getObjectUUID();
|
||||
newNPC.guildUUID = guild.getObjectUUID();
|
||||
if (guild == null)
|
||||
newNPC.guildUUID = 0;
|
||||
else
|
||||
newNPC.guildUUID = guild.getObjectUUID();
|
||||
|
||||
if (building == null)
|
||||
newNPC.buildingUUID = 0;
|
||||
|
||||
Reference in New Issue
Block a user