@ -5,14 +5,17 @@ import engine.InterestManagement.WorldGrid;
@@ -5,14 +5,17 @@ import engine.InterestManagement.WorldGrid;
import engine.math.Quaternion ;
import engine.math.Vector3f ;
import engine.math.Vector3fImmutable ;
import engine.mobileAI.MobAI ;
import engine.net.Dispatch ;
import engine.net.DispatchMessage ;
import engine.net.client.msg.PetMsg ;
import engine.objects.* ;
import engine.powers.EffectsBase ;
import engine.powers.PowersBase ;
import engine.powers.RuneSkillAdjustEntry ;
import org.pmw.tinylog.Logger ;
import javax.smartcardio.ATR ;
import java.util.ArrayList ;
import java.util.HashMap ;
import java.util.concurrent.ThreadLocalRandom ;
@ -274,6 +277,91 @@ public enum NPCManager {
@@ -274,6 +277,91 @@ public enum NPCManager {
}
}
public static void setDamageAndSpeedForGuard ( Mob guard ) {
//handle stance for guard mob
String stancePowerName = "" ;
if ( guard . agentType . equals ( Enum . AIAgentType . GUARDWALLARCHER ) ) {
//apply rogue offensive stance
stancePowerName = "STC-R-O" ;
} else {
Integer contractID ;
if ( guard . agentType . equals ( Enum . AIAgentType . GUARDMINION ) ) {
contractID = guard . guardCaptain . contract . getContractID ( ) ;
} else {
contractID = guard . contract . getContractID ( ) ;
}
if ( Enum . MinionType . ContractToMinionMap . get ( contractID ) ! = null & & Enum . MinionType . ContractToMinionMap . get ( contractID ) . isMage ( ) ) {
//apply mage offensive Stance
stancePowerName = "STC-M-O" ;
} else {
//apply fighter offensive stance
stancePowerName = "STC-F-O" ;
}
}
int stancePowerRank = MobAI . getGuardPowerRank ( guard ) ;
PowersBase stancePower = PowersManager . getPowerByIDString ( stancePowerName ) ;
PowersManager . useMobPower ( guard , guard , stancePower , stancePowerRank ) ;
if ( guard . equip = = null ) {
guard . minDamageHandOne = ( int ) ( guard . mobBase . getDamageMin ( ) ) ;
guard . maxDamageHandOne = ( int ) ( guard . mobBase . getDamageMax ( ) ) ;
guard . speedHandOne = 30 . 0f ;
} else {
if ( guard . equip . containsKey ( 1 ) ) {
//has main hand weapon
ItemBase weapon = guard . equip . get ( 1 ) . getItemBase ( ) ;
guard . minDamageHandOne = ( int ) ( guard . mobBase . getDamageMin ( ) + weapon . getMinDamage ( ) ) ;
guard . maxDamageHandOne = ( int ) ( guard . mobBase . getDamageMax ( ) + weapon . getMaxDamage ( ) ) ;
guard . speedHandOne = weapon . getSpeed ( ) ;
} else if ( guard . equip . containsKey ( 2 ) & & ! guard . equip . get ( 2 ) . getItemBase ( ) . isShield ( ) ) {
//has off hand weapon
ItemBase weapon = guard . equip . get ( 2 ) . getItemBase ( ) ;
guard . minDamageHandTwo = ( int ) ( guard . mobBase . getDamageMin ( ) + weapon . getMinDamage ( ) ) ;
guard . maxDamageHandTwo = ( int ) ( guard . mobBase . getDamageMax ( ) + weapon . getMaxDamage ( ) ) ;
guard . speedHandTwo = weapon . getSpeed ( ) ;
} else {
guard . minDamageHandOne = ( int ) ( guard . mobBase . getDamageMin ( ) ) ;
guard . maxDamageHandOne = ( int ) ( guard . mobBase . getDamageMax ( ) ) ;
guard . speedHandOne = 30 . 0f ;
}
}
}
public static void setDefenseForGuard ( Mob guard ) {
}
public static void setAttackRatingForGuard ( Mob guard ) {
}
public static void setMaxHealthForGuard ( Mob guard ) {
//values derived fom reading memory address for health on client when selecting player guards
switch ( guard . getRank ( ) ) {
default :
guard . healthMax = 750 ; //rank 1
break ;
case 2 :
guard . healthMax = 2082 ;
break ;
case 3 :
guard . healthMax = 2740 ;
break ;
case 4 :
guard . healthMax = 3414 ;
break ;
case 5 :
guard . healthMax = 4080 ;
break ;
case 6 :
guard . healthMax = 4746 ;
break ;
case 7 :
guard . healthMax = 5412 ;
break ;
}
}
public static void applyMobbaseEffects ( Mob mob ) {
EffectsBase effectsBase ;
for ( MobBaseEffects mbe : mob . mobBase . effectsList ) {