@ -293,14 +293,14 @@ public enum NPCManager {
@@ -293,14 +293,14 @@ public enum NPCManager {
float rankModifier = 1 + ( guard . getRank ( ) * 0 . 1f ) ;
int primaryStat = 0 ;
if ( guard . equip = = null ) {
guard . minDamageHandOne = ( int ) ( ( guard . mobBase . getDamageMin ( ) ) * rankModifier ) ;
guard . maxDamageHandOne = ( int ) ( ( guard . mobBase . getDamageMax ( ) ) * rankModifier ) ;
if ( guard . charItemManager . equipped . isEmpty ( ) ) {
guard . minDamageHandOne = ( int ) ( ( guard . mobBase . getDamageMin ( ) ) * rankModifier ) ;
guard . maxDamageHandOne = ( int ) ( ( guard . mobBase . getDamageMax ( ) ) * rankModifier ) ;
guard . speedHandOne = 30 . 0f ;
} else {
if ( guard . equip . containsKey ( Enum . EquipSlotType . RHELD ) ) {
} else {
if ( guard . charItemManager . equipped . containsKey ( Enum . EquipSlotType . RHELD ) ) {
//has main hand weapon
Item weapon = guard . equip . get ( Enum . EquipSlotType . RHELD ) ;
Item weapon = guard . charItemManager . equipped . get ( Enum . EquipSlotType . RHELD ) ;
if ( weapon . template . item_primary_attr . equals ( Enum . AttributeType . Strength ) )
primaryStat = guard . getStatStrCurrent ( ) ;
@ -311,9 +311,9 @@ public enum NPCManager {
@@ -311,9 +311,9 @@ public enum NPCManager {
guard . maxDamageHandOne = ( int ) ( ( guard . mobBase . getDamageMax ( ) + weapon . template . item_weapon_damage . values ( ) . iterator ( ) . next ( ) [ 1 ] ) * rankModifier ) + primaryStat ;
guard . speedHandOne = weapon . template . item_weapon_wepspeed ;
guard . rangeHandOne = weapon . template . item_weapon_max_range ;
} else if ( guard . equip . containsKey ( Enum . EquipSlotType . LHELD ) & & ! ItemTemplate . isShield ( guard . equip . get ( Enum . EquipSlotType . LHELD ) . template ) ) {
} else if ( guard . charItemManager . equipped . containsKey ( Enum . EquipSlotType . LHELD ) & & ! ItemTemplate . isShield ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . LHELD ) . template ) ) {
//has off hand weapon
Item weapon = guard . equip . get ( Enum . EquipSlotType . LHELD ) ;
Item weapon = guard . charItemManager . equipped . get ( Enum . EquipSlotType . LHELD ) ;
if ( weapon . template . item_primary_attr . equals ( Enum . AttributeType . Strength ) )
primaryStat = guard . getStatStrCurrent ( ) ;
else
@ -338,7 +338,7 @@ public enum NPCManager {
@@ -338,7 +338,7 @@ public enum NPCManager {
dexterity = 1 ;
int baseDef = guard . mobBase . getDefenseRating ( ) ;
int armorDefense = 0 ;
for ( Item equipped : guard . equip . values ( ) )
for ( Item equipped : guard . charItemManager . equipped . values ( ) )
if ( equipped . template . item_type . equals ( Enum . ItemType . ARMOR ) | | ItemTemplate . isShield ( equipped . template ) )
armorDefense + = equipped . template . item_defense_rating ;
guard . defenseRating = dexterity + baseDef + armorDefense ;
@ -347,10 +347,10 @@ public enum NPCManager {
@@ -347,10 +347,10 @@ public enum NPCManager {
public static void setAttackRatingForGuard ( Mob guard ) {
int strength = guard . getStatStrCurrent ( ) ;
int baseAtr = guard . mobBase . getAttackRating ( ) ;
if ( guard . equip . get ( 1 ) ! = null )
guard . atrHandOne = baseAtr + ( int ) ( ( strength * 0 . 5f ) + ( guard . equip . get ( Enum . EquipSlotType . RHELD ) . getItemBase ( ) . getPercentRequired ( ) * 4 ) + ( guard . equip . get ( Enum . EquipSlotType . RHELD ) . getItemBase ( ) . getPercentRequired ( ) * 3 ) ) ;
else if ( guard . equip . get ( 2 ) ! = null & & ! ItemTemplate . isShield ( guard . equip . get ( Enum . EquipSlotType . LHELD ) . template ) )
guard . atrHandTwo = baseAtr + ( int ) ( ( strength * 0 . 5f ) + ( guard . equip . get ( Enum . EquipSlotType . LHELD ) . getItemBase ( ) . getPercentRequired ( ) * 4 ) + ( guard . equip . get ( Enum . EquipSlotType . LHELD ) . getItemBase ( ) . getPercentRequired ( ) * 3 ) ) ;
if ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . RHELD ) ! = null )
guard . atrHandOne = baseAtr + ( int ) ( ( strength * 0 . 5f ) + ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . RHELD ) . getItemBase ( ) . getPercentRequired ( ) * 4 ) + ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . RHELD ) . getItemBase ( ) . getPercentRequired ( ) * 3 ) ) ;
else if ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . LHELD ) ! = null & & ! ItemTemplate . isShield ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . LHELD ) . template ) )
guard . atrHandTwo = baseAtr + ( int ) ( ( strength * 0 . 5f ) + ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . LHELD ) . getItemBase ( ) . getPercentRequired ( ) * 4 ) + ( guard . charItemManager . equipped . get ( Enum . EquipSlotType . LHELD ) . getItemBase ( ) . getPercentRequired ( ) * 3 ) ) ;
else
guard . atrHandOne = baseAtr ;
}
@ -424,10 +424,10 @@ public enum NPCManager {
@@ -424,10 +424,10 @@ public enum NPCManager {
public static void applyEquipmentResists ( Mob mob ) {
if ( mob . equip = = null )
if ( mob . charItemManager . equipped . isEmpty ( ) )
return ;
for ( Item equipped : mob . equip . values ( ) ) {
for ( Item equipped : mob . charItemManager . equipped . values ( ) ) {
if ( equipped . template . item_type . equals ( Enum . ItemType . ARMOR ) ) {
mob . resists . setResist ( Enum . SourceType . SLASHING , mob . resists . getResist ( Enum . SourceType . SLASHING , 0 ) + equipped . template . combat_attack_resist . get ( "SLASHING" ) ) ;
mob . resists . setResist ( Enum . SourceType . CRUSHING , mob . resists . getResist ( Enum . SourceType . CRUSHING , 0 ) + equipped . template . combat_attack_resist . get ( "CRUSHING" ) ) ;