From a91e03fa4355041c7051e0117fff9fb923e5b408 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Mon, 26 Aug 2024 22:59:06 -0500 Subject: [PATCH] [Code] Add IsCloseToBanker method (#4462) * [Code] Add IsCloseToBanker method * Update mob.cpp --- zone/mob.cpp | 14 +++++++++++++- zone/mob.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/zone/mob.cpp b/zone/mob.cpp index 573425a1a6..25ce4a4860 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -5491,7 +5491,7 @@ int Mob::GetHaste() } } else { - h += spellbonuses.hastetype3; + h += spellbonuses.hastetype3; } h += extra_haste; //GM granted haste. @@ -8611,3 +8611,15 @@ void Mob::SetExtraHaste(int haste, bool need_to_save) } } } + +bool Mob::IsCloseToBanker() +{ + for (auto &e: entity_list.GetCloseMobList(this)) { + auto mob = e.second; + if (mob && mob->IsNPC() && mob->GetClass() == Class::Banker) { + return true; + } + } + + return false; +} diff --git a/zone/mob.h b/zone/mob.h index e8a5c33aa3..6bb442ff51 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -1477,6 +1477,8 @@ class Mob : public Entity { DataBucketKey GetScopedBucketKeys(); + bool IsCloseToBanker(); + protected: void CommonDamage(Mob* other, int64 &damage, const uint16 spell_id, const EQ::skills::SkillType attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks specal = eSpecialAttacks::None); static uint16 GetProcID(uint16 spell_id, uint8 effect_index);