diff --git a/common/ruletypes.h b/common/ruletypes.h index 40682abcd..c432455e3 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -392,7 +392,8 @@ RULE_INT(Combat, ArcheryCritDifficulty, 3400, "Value against which is rolled to RULE_INT(Combat, ThrowingCritDifficulty, 1100, "Value against which is rolled to check if a throwing crit is triggered. Lower is easier") RULE_BOOL(Combat, NPCCanCrit, false, "Setting whether an NPC can land critical hits") RULE_BOOL(Combat, UseIntervalAC, true, "Switch whether bonuses, armour class, multipliers, classes and caps should be considered in the calculation of damage values") -RULE_INT(Combat, PetAttackMagicLevel, 30, "Level at which pets can cause magic damage") +RULE_INT(Combat, PetAttackMagicLevel, 10, "Level at which pets can cause magic damage, no longer used") +RULE_INT(Combat, NPCAttackMagicLevel, 10, "Level at which NPC and pets can cause magic damage") RULE_BOOL(Combat, EnableFearPathing, true, "Setting whether to use pathing during fear") RULE_BOOL(Combat, FleeGray, true, "If true FleeGrayHPRatio will be used") RULE_INT(Combat, FleeGrayHPRatio, 50, "HP percentage when a Gray NPC begins to flee") diff --git a/zone/attack.cpp b/zone/attack.cpp index 9b835afb3..f70bb6f1d 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -993,18 +993,22 @@ int Mob::GetWeaponDamage(Mob *against, const EQ::ItemData *weapon_item) { if (GetSpecialAbility(SPECATK_MAGICAL)) { dmg = 1; } - //On live this occurs for pets and charmed pet >= level 10 - else if (GetOwner() && GetLevel() >= RuleI(Combat, PetAttackMagicLevel)) { - //pets wouldn't actually use this but... - //it gives us an idea if we can hit due to the dual nature of this function + //On live this occurs for ALL NPC's >= 10 + else if (IsNPC() && GetLevel() >= RuleI(Combat, NPCAttackMagicLevel)) { dmg = 1; } else if (weapon_item) { if (weapon_item->Magic) { - dmg = weapon_item->Damage; - //this is more for non weapon items, ex: boots for kick - //they don't have a dmg but we should be able to hit magical - dmg = dmg <= 0 ? 1 : dmg; + if (weapon_item->Damage && (weapon_item->IsType1HWeapon() || weapon_item->IsType2HWeapon())) { + dmg = weapon_item->Damage; + } + //Non weapon items, ie. boots for kick. + else if (weapon_item->ItemType == EQ::item::ItemTypeArmor) { + dmg = 1; + } + else { + return 0; + } } else { return 0;