Skip to content

Commit

Permalink
[Code] Add IsCloseToBanker method (#4462)
Browse files Browse the repository at this point in the history
* [Code] Add IsCloseToBanker method

* Update mob.cpp
  • Loading branch information
Akkadius authored Aug 27, 2024
1 parent 4531064 commit a91e03f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion zone/mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5491,7 +5491,7 @@ int Mob::GetHaste()
}
}
else {
h += spellbonuses.hastetype3;
h += spellbonuses.hastetype3;
}

h += extra_haste; //GM granted haste.
Expand Down Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions zone/mob.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a91e03f

Please sign in to comment.