[Feature] Add Immune to Assassinate Special Ability (#3622)

# Notes
- Allows mobs normally susceptible to Assassinate to be made immune to it.
This commit is contained in:
Alex King 2023-10-13 21:01:06 -04:00 committed by GitHub
parent 2fb72e5729
commit b82b32e1d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -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
};

View File

@ -3757,7 +3757,8 @@ luabind::scope lua_register_special_abilities() {
luabind::value("immune_aggro_client", static_cast<int>(IMMUNE_AGGRO_CLIENT)),
luabind::value("immune_aggro_npc", static_cast<int>(IMMUNE_AGGRO_NPC)),
luabind::value("modify_avoid_damage", static_cast<int>(MODIFY_AVOID_DAMAGE)),
luabind::value("immune_open", static_cast<int>(IMMUNE_OPEN))
luabind::value("immune_open", static_cast<int>(IMMUNE_OPEN)),
luabind::value("immune_assassinate", static_cast<int>(IMMUNE_ASSASSINATE))
)];
}

View File

@ -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) {