#include "Client/Session.h" #include #include #include // OFFSET: 0x00DE3C10 // FUNCTION: fn_23486 int CSession::GetRobeAlpha(int robeId) { const RobeAlpha& alpha = this->m_robeAlpha.find(robeId)->second; const int to = alpha.to; const int period = alpha.period; const int range = std::abs(to - alpha.from); if (range == 0) { return to; } const int base = to < alpha.from ? to : alpha.from; const int half = static_cast(static_cast(period) * 0.5f); int phase = timeGetTime() % period; if (phase > half) { phase = period - phase; } const int value = static_cast(static_cast(phase) / static_cast(half) * static_cast(range) + static_cast(base)); int result = 0; if (value >= 0) { result = value; } if (result > 255) { result = 255; } return result; }