diff --git a/Source/Client/Session.h b/Source/Client/Session.h index cf97e3cca..f366c0c85 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -701,6 +701,7 @@ public: const ActionFrame* GetSyncedFrame(CActRes* baseAct, CActRes* act, unsigned action, int baseFrame, std::uint32_t startTime, int* frame); float GetNpcLocationRadius(int job, bool riding); int GetRidingJob(int job); + void InitNpcLocationRadius(); int GetSpriteJob(int job, int costumeJob, bool spriteIndex); bool HasRequiredItems() const; bool IsSlotItemIdentity(std::uint32_t id) const; diff --git a/Source/Contents/NpcLocationRadius.cpp b/Source/Contents/NpcLocationRadius.cpp index 7c24d7c30..d8f02076a 100644 --- a/Source/Contents/NpcLocationRadius.cpp +++ b/Source/Contents/NpcLocationRadius.cpp @@ -436,3 +436,15 @@ int CSession::GetRidingJob(int job) { return job; } + +// OFFSET: 0x00DF31C0 +// FUNCTION: fn_23504 +void CSession::InitNpcLocationRadius() { + this->m_npcLocationRadius.clear(); + for (int job = 0; job < 32003; ++job) { + double factor = 0.0; + if (this->m_hotkeyScript->Call("ReqshadowFactor", "d>l", job, &factor) && factor >= 0.0) { + this->m_npcLocationRadius.try_emplace(job, static_cast(factor)); + } + } +}