@ -32,6 +32,7 @@ import org.pmw.tinylog.Logger;
@@ -32,6 +32,7 @@ import org.pmw.tinylog.Logger;
import java.sql.ResultSet ;
import java.sql.SQLException ;
import java.util.EnumSet ;
import java.util.HashMap ;
import java.util.LinkedHashMap ;
import java.util.concurrent.ConcurrentHashMap ;
@ -183,7 +184,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -183,7 +184,7 @@ public class Mob extends AbstractIntelligenceAgent {
} else if ( tid = = 100962 | | tid = = 100965 ) { //Spydraxxx the Mighty, Denigo Tantric
writer . putInt ( 2 ) ;
serializeRune ( mob , writer , 5 , GameObjectType . NPCClassRuneTwo . ordinal ( ) , 252621 ) ; //guard rune
} else if ( mob . contract ! = null | | mob . isPlayerGuard ) {
} else if ( mob . contract ! = null | | mob . isPlayerGuard ( ) ) {
writer . putInt ( 3 ) ;
serializeRune ( mob , writer , 3 , GameObjectType . NPCClassRuneTwo . ordinal ( ) , MobBase . GetClassType ( mob . getMobBaseID ( ) ) ) ; //warrior class
serializeRune ( mob , writer , 5 , GameObjectType . NPCClassRuneThree . ordinal ( ) , 252621 ) ; //guard rune
@ -340,7 +341,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -340,7 +341,7 @@ public class Mob extends AbstractIntelligenceAgent {
writer . putInt ( 0 ) ;
writer . putInt ( 0 ) ;
if ( ! mob . isAlive ( ) & & ! mob . isPet ( ) & & ! mob . isNecroPet ( ) & & ! mob . behaviourType . equals ( MobBehaviourType . SiegeEngine ) & & ! mob . isPlayerGuard ) {
if ( ! mob . isAlive ( ) & & ! mob . isPet ( ) & & ! mob . isNecroPet ( ) & & ! mob . behaviourType . equals ( MobBehaviourType . SiegeEngine ) & & ! mob . isPlayerGuard ( ) ) {
writer . putInt ( 0 ) ;
writer . putInt ( 0 ) ;
}
@ -454,7 +455,6 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -454,7 +455,6 @@ public class Mob extends AbstractIntelligenceAgent {
minionMobile . guardCaptain = guardCaptain ;
minionMobile . spawnTime = ( int ) ( - 2 . 500 * guardCaptain . building . getRank ( ) + 22 . 5 ) * 60 ;
minionMobile . behaviourType = Enum . MobBehaviourType . GuardMinion ;
minionMobile . isPlayerGuard = true ;
minionMobile . guardedCity = guardCaptain . guardedCity ;
minionMobile . patrolPoints = guardCaptain . building . patrolPoints ;
@ -545,7 +545,6 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -545,7 +545,6 @@ public class Mob extends AbstractIntelligenceAgent {
petMinion . healthMax = MobBase . getMobBase ( loadID ) . getHealthMax ( ) * ( petMinion . level * 0 . 5f ) ;
petMinion . health . set ( petMinion . healthMax ) ;
petMinion . behaviourType = MobBehaviourType . Pet1 ;
petMinion . agentType = AIAgentType . PET ;
petMinion . firstName = "" ;
petMinion . lastName = "" ;
@ -747,7 +746,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -747,7 +746,7 @@ public class Mob extends AbstractIntelligenceAgent {
// get rune and effect bonuses
bonus * = ( 1 + this . bonuses . getFloatPercentAll ( ModType . Speed , SourceType . None ) ) ;
if ( this . isPlayerGuard )
if ( this . isPlayerGuard ( ) )
switch ( this . mobBase . getLoadID ( ) ) {
case 2111 :
if ( this . isWalk ( ) )
@ -815,7 +814,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -815,7 +814,7 @@ public class Mob extends AbstractIntelligenceAgent {
Group g = GroupManager . getGroup ( ( PlayerCharacter ) attacker ) ;
// Give XP, now handled inside the Experience Object
if ( ! this . isPet ( ) & & ! this . isNecroPet ( ) & & ! ( this . agentType . equals ( AIAgentType . PET ) ) & & ! this . isPlayerGuard )
if ( ! this . isPet ( ) & & ! this . isNecroPet ( ) & & ! ( this . agentType . equals ( AIAgentType . PET ) ) & & ! this . isPlayerGuard ( ) )
Experience . doExperience ( ( PlayerCharacter ) attacker , this , g ) ;
} else if ( attacker . getObjectType ( ) . equals ( GameObjectType . Mob ) ) {
Mob mobAttacker = ( Mob ) attacker ;
@ -826,7 +825,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -826,7 +825,7 @@ public class Mob extends AbstractIntelligenceAgent {
PlayerCharacter owner = ( PlayerCharacter ) mobAttacker . guardCaptain ;
if ( owner ! = null )
if ( ! this . isPet ( ) & & ! this . isNecroPet ( ) & & ! ( this . agentType . equals ( AIAgentType . PET ) ) & & ! this . isPlayerGuard ) {
if ( ! this . isPet ( ) & & ! this . isNecroPet ( ) & & ! ( this . agentType . equals ( AIAgentType . PET ) ) & & ! this . isPlayerGuard ( ) ) {
Group g = GroupManager . getGroup ( owner ) ;
// Give XP, now handled inside the Experience Object
@ -940,7 +939,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -940,7 +939,7 @@ public class Mob extends AbstractIntelligenceAgent {
playerAgroMap . clear ( ) ;
if ( ! this . isPlayerGuard & & this . equip ! = null )
if ( ! this . isPlayerGuard ( ) & & this . equip ! = null )
LootManager . GenerateEquipmentDrop ( this ) ;
}
@ -987,7 +986,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -987,7 +986,7 @@ public class Mob extends AbstractIntelligenceAgent {
else if ( this . building ! = null )
this . region = BuildingManager . GetRegion ( this . building , bindLoc . x , bindLoc . y , bindLoc . z ) ;
if ( ! this . behaviourType . equals ( MobBehaviourType . SiegeEngine ) & & ! this . isPlayerGuard & & contract = = null )
if ( ! this . behaviourType . equals ( MobBehaviourType . SiegeEngine ) & & ! this . isPlayerGuard ( ) & & contract = = null )
loadInventory ( ) ;
this . updateLocation ( ) ;
@ -1026,7 +1025,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1026,7 +1025,7 @@ public class Mob extends AbstractIntelligenceAgent {
this . charItemManager . clearInventory ( ) ;
this . charItemManager . clearEquip ( ) ;
if ( isPlayerGuard )
if ( this . isPlayerGuard ( ) )
return ;
LootManager . GenerateMobLoot ( this ) ;
@ -1539,6 +1538,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1539,6 +1538,7 @@ public class Mob extends AbstractIntelligenceAgent {
if ( this . contract ! = null ) {
// Setup equipset for contract
this . equipmentSetID = this . contract . getEquipmentSet ( ) ;
// Configure AI related values
@ -1550,10 +1550,12 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1550,10 +1550,12 @@ public class Mob extends AbstractIntelligenceAgent {
this . guardedCity = ZoneManager . getCityAtLocation ( this . building . getLoc ( ) ) ;
break ;
case GuardWallArcher :
this . gridObjectType = GridObjectType . DYNAMIC ;
this . agentType = AIAgentType . GUARDWALLARCHER ;
this . spawnTime = 450 ;
this . guardedCity = ZoneManager . getCityAtLocation ( this . building . getLoc ( ) ) ;
case Pet1 :
this . agentType = AIAgentType . PET ;
break ;
}
}
@ -1809,7 +1811,11 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1809,7 +1811,11 @@ public class Mob extends AbstractIntelligenceAgent {
}
public boolean isPlayerGuard ( ) {
return isPlayerGuard ;
if ( EnumSet . of ( AIAgentType . GUARDCAPTAIN , AIAgentType . GUARDMINION , AIAgentType . GUARDWALLARCHER ) . contains ( this . agentType ) )
return true ;
else
return false ;
}
public int getLastMobPowerToken ( ) {