From 16ab1839e887cbe1c63c4452b5e29d1ffb4ad149 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:43:33 -0400 Subject: [PATCH] [Feature] Add Immune to Headshot Special Ability (#3624) # Notes - Allows mobs normally susceptible to Headshot to be made immune to it. --- zone/common.h | 1 + zone/lua_mob.cpp | 3 ++- zone/special_attacks.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/zone/common.h b/zone/common.h index 5698d6c17..395e38c27 100644 --- a/zone/common.h +++ b/zone/common.h @@ -208,6 +208,7 @@ enum { IMMUNE_FADING_MEMORIES = 52, IMMUNE_OPEN = 53, IMMUNE_ASSASSINATE = 54, + IMMUNE_HEADSHOT = 55, MAX_SPECIAL_ATTACK }; diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index d1edff617..34c195911 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -3758,7 +3758,8 @@ luabind::scope lua_register_special_abilities() { luabind::value("immune_aggro_npc", static_cast(IMMUNE_AGGRO_NPC)), luabind::value("modify_avoid_damage", static_cast(MODIFY_AVOID_DAMAGE)), luabind::value("immune_open", static_cast(IMMUNE_OPEN)), - luabind::value("immune_assassinate", static_cast(IMMUNE_ASSASSINATE)) + luabind::value("immune_assassinate", static_cast(IMMUNE_ASSASSINATE)), + luabind::value("immune_headshot", static_cast(IMMUNE_HEADSHOT)) )]; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 422537247..633cf4a73 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -2301,7 +2301,8 @@ int Mob::TryHeadShot(Mob *defender, EQ::skills::SkillType skillInUse) !defender->IsClient() && skillInUse == EQ::skills::SkillArchery && GetTarget() == defender && - (defender->GetBodyType() == BT_Humanoid || !RuleB(Combat, HeadshotOnlyHumanoids)) + (defender->GetBodyType() == BT_Humanoid || !RuleB(Combat, HeadshotOnlyHumanoids)) && + !defender->GetSpecialAbility(IMMUNE_HEADSHOT) ) { 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