From b82b32e1d2d39f3365a655e67b3237ef5498ae21 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Fri, 13 Oct 2023 21:01:06 -0400 Subject: [PATCH] [Feature] Add Immune to Assassinate Special Ability (#3622) # Notes - Allows mobs normally susceptible to Assassinate 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 420d71c9b..5698d6c17 100644 --- a/zone/common.h +++ b/zone/common.h @@ -207,6 +207,7 @@ enum { MODIFY_AVOID_DAMAGE = 51, //Modify by percent the NPCs chance to riposte, block, parry or dodge individually, or for all skills IMMUNE_FADING_MEMORIES = 52, IMMUNE_OPEN = 53, + IMMUNE_ASSASSINATE = 54, MAX_SPECIAL_ATTACK }; diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 8ceaef72f..d1edff617 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -3757,7 +3757,8 @@ luabind::scope lua_register_special_abilities() { luabind::value("immune_aggro_client", static_cast(IMMUNE_AGGRO_CLIENT)), 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_open", static_cast(IMMUNE_OPEN)), + luabind::value("immune_assassinate", static_cast(IMMUNE_ASSASSINATE)) )]; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index bcfe43c15..422537247 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -2337,7 +2337,8 @@ int Mob::TryAssassinate(Mob *defender, EQ::skills::SkillType skillInUse) !defender->IsClient() && GetLevel() >= 60 && (skillInUse == EQ::skills::SkillBackstab || skillInUse == EQ::skills::SkillThrowing) && - (defender->GetBodyType() == BT_Humanoid || !RuleB(Combat, AssassinateOnlyHumanoids)) + (defender->GetBodyType() == BT_Humanoid || !RuleB(Combat, AssassinateOnlyHumanoids)) && + !defender->GetSpecialAbility(IMMUNE_ASSASSINATE) ) { int chance = GetDEX(); if (skillInUse == EQ::skills::SkillBackstab) {