mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
[Rules] Add Rule to allow Headshots on non-Humanoid body types. (#2329)
* [Rules] Add Rule to allow Headshots on non-Humanoid body types. * Formatting.
This commit is contained in:
parent
4002d6a083
commit
cadd29e5d1
@ -487,6 +487,7 @@ RULE_INT(Combat, FrontalStunImmunityClasses, 0, "Bitmask for Classes than have f
|
||||
RULE_BOOL(Combat, NPCsUseFrontalStunImmunityClasses, false, "Enable or disable NPCs using frontal stun immunity Classes from Combat:FrontalStunImmunityClasses, false by default.")
|
||||
RULE_INT(Combat, FrontalStunImmunityRaces, 512, "Bitmask for Races than have frontal stun immunity, Ogre (512) only by default.")
|
||||
RULE_BOOL(Combat, NPCsUseFrontalStunImmunityRaces, true, "Enable or disable NPCs using frontal stun immunity Races from Combat:FrontalStunImmunityRaces, true by default.")
|
||||
RULE_BOOL(Combat, HeadshotOnlyHumanoids, true, "Enable or disable Headshot only being allowed on Humanoids, true by default.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(NPC)
|
||||
|
||||
@ -2154,8 +2154,13 @@ void Mob::InstillDoubt(Mob *who) {
|
||||
int Mob::TryHeadShot(Mob *defender, EQ::skills::SkillType skillInUse)
|
||||
{
|
||||
// Only works on YOUR target.
|
||||
if (defender && defender->GetBodyType() == BT_Humanoid && !defender->IsClient() &&
|
||||
skillInUse == EQ::skills::SkillArchery && GetTarget() == defender) {
|
||||
if (
|
||||
defender &&
|
||||
!defender->IsClient() &&
|
||||
skillInUse == EQ::skills::SkillArchery &&
|
||||
GetTarget() == defender &&
|
||||
(defender->GetBodyType() == BT_Humanoid || !RuleB(Combat, HeadshotOnlyHumanoids))
|
||||
) {
|
||||
uint32 HeadShot_Dmg = aabonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG] + spellbonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG] + itembonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG];
|
||||
uint8 HeadShot_Level = 0; // Get Highest Headshot Level
|
||||
HeadShot_Level = std::max({aabonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX], spellbonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX], itembonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX]});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user