From b2e4e91fbd728ca6137ef0ba3762038934f4cfb1 Mon Sep 17 00:00:00 2001 From: Noudess Date: Tue, 9 Feb 2021 08:31:35 -0500 Subject: [PATCH] Very simple implementation of Sneak Pull --- common/ruletypes.h | 1 + zone/npc.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 48e78187d..391179f58 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -501,6 +501,7 @@ RULE_INT(Combat, LevelToStopACTwinkControl, 50, "Level to stop armorclass twink RULE_BOOL(Combat, ClassicNPCBackstab, false, "True disables NPC facestab - NPC get normal attack if not behind") RULE_BOOL(Combat, UseNPCDamageClassLevelMods, true, "Uses GetClassLevelDamageMod calc in npc_scale_manager") RULE_BOOL(Combat, UseExtendedPoisonProcs, false, "Allow old school poisons to last until characrer zones, at a lower proc rate") +RULE_BOOL(Combat, EnableSneakPull, false, "Enable implementation of Sneak Pull") RULE_CATEGORY_END() RULE_CATEGORY(NPC) diff --git a/zone/npc.cpp b/zone/npc.cpp index 7a0f4f411..4549f1f54 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -3239,6 +3239,18 @@ void NPC::AIYellForHelp(Mob *sender, Mob *attacker) } float assist_range = (mob->GetAssistRange() * mob->GetAssistRange()); + + if (RuleB(Combat, EnableSneakPull) && attacker->sneaking) { + assist_range=(20*20); + if (attacker->IsClient()) { + float clientx=attacker->GetX(); + float clienty=attacker->GetY(); + if (attacker->CastToClient()->BehindMob(mob, clientx, clienty)) { + assist_range = 0; + } + } + } + if (distance > assist_range) { continue; } @@ -3336,4 +3348,4 @@ void NPC::ScaleNPC(uint8 npc_level) { } npc_scale_manager->ResetNPCScaling(this); npc_scale_manager->ScaleNPC(this); -} \ No newline at end of file +}