#include "Contents/Actors/Pc.h" #include "Client/Session.h" #include "Contents/CashEmotionMgr.h" #include "Contents/Jobs/JobInheritance.h" #include "Resource/Models/GrannyModelResource.h" // GLOBAL: gl_24753 extern const int g_maxMoveSpeed = 432; // OFFSET: 0x00DAFE50 // FUNCTION: fn_22606 void CGrannyPc::SetAnimation(unsigned animation, int, int repeat) { if (!this->model) { return; } this->render.unknown_0070 = 0; switch (animation) { case 8: this->render.unknown_0070 = 1; break; case 16: this->render.unknown_0070 = 6; break; case 24: this->render.unknown_0070 = 5; break; case 32: this->render.unknown_0070 = 11; break; case 40: this->render.unknown_0070 = 12; break; case 48: this->render.unknown_0070 = 4; break; case 64: this->render.unknown_0070 = 3; break; case 80: case 88: this->render.unknown_0070 = 2; break; } this->PlayMotion(repeat); } // OFFSET: 0x00DB01F0 // FUNCTION: fn_22611 void CGrannyPc::PlayMotion(int repeat) { this->motion = this->render.unknown_0070; for (int i = 0; i < 20; ++i) { this->model->FreeControl(this->controls[i]); this->controls[i] = nullptr; } this->unknown_0F24 = 0; const int loopCount = (repeat == 1 && this->render.unknown_0070 != 6) ? 1 : 0; this->controls[this->motion] = this->model->PlayAnimation(this->motion, this->instance, this->controls[this->motion], loopCount); } // OFFSET: 0x00DB0280 // FUNCTION: fn_22612 void CPc::Slot34(int value) { this->unknown_0444 = value; this->Slot31(); } // OFFSET: 0x00DB0400 // FUNCTION: fn_22615 void CGrannyPc::Slot40(int value) { if (value < 0) { const std::int64_t emotion = g_cashEmotionMgr->GetSpecialEmotion(CashEmotionSpecial::ChatProhibit); this->SendObjectMessage(nullptr, 160, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } else { this->SendObjectMessage(nullptr, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->unknown_0428 = value; } // OFFSET: 0x00DB0480 // FUNCTION: fn_22616 void CPc::Slot40(int value) { if (value < 0) { const std::int64_t emotion = g_cashEmotionMgr->GetSpecialEmotion(CashEmotionSpecial::ChatProhibit); this->SendObjectMessage(nullptr, 160, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } else { this->SendObjectMessage(nullptr, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->unknown_0430 = value; } // OFFSET: 0x00DB0760 // FUNCTION: fn_22621 void CGrannyPc::Slot41(int first, int second) { this->Slot40(first); this->unknown_042C = second; } // OFFSET: 0x00DB0780 // FUNCTION: fn_22622 void CPc::Slot41(int first, int second) { this->Slot40(first); this->unknown_0434 = second; } // OFFSET: 0x00DB07C0 // FUNCTION: fn_22625 void CPc::Slot47(unsigned char value) { this->unknown_02CC = value; this->Slot28(this->unknown_045C); } // OFFSET: 0x00DB07E0 // FUNCTION: fn_22626 void CGrannyPc::Slot26(int value) { this->unknown_044C = value; } // OFFSET: 0x00DB09D0 // FUNCTION: fn_22628 void CGrannyPc::Slot27(int value) { this->unknown_0450 = value; } // OFFSET: 0x00DB0B40 // FUNCTION: fn_22630 void CGrannyPc::Slot25(int value) { this->unknown_0448 = value; } // OFFSET: 0x00DB0CB0 // FUNCTION: fn_22632 void CGrannyPc::Slot20(int first, int second, int third, int fourth, int fifth, int sixth, int seventh, int eighth, int ninth, int tenth, int) { this->Slot19(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, this->unknown_0454, tenth); } // OFFSET: 0x00DB1960 // FUNCTION: fn_22636 void CPc::Slot60() { if (this->unknown_0458 == 185) { this->Slot27(185); } } // OFFSET: 0x00DB1980 // FUNCTION: fn_22637 void CGrannyPc::Slot22(int value) { this->unknown_0434 = value; } // OFFSET: 0x00DB1AC0 // FUNCTION: fn_22639 void CGrannyPc::Slot21(int value) { this->render.unknown_0054 = g_session.GetNpcLocationRadius(value, false); } // OFFSET: 0x00DB2830 // FUNCTION: fn_22646 void CGrannyPc::Slot24(int, int) { } // OFFSET: 0x00DB3720 // FUNCTION: fn_22648 void CGrannyPc::Slot23(int first, int second) { this->unknown_0440 = first; this->unknown_0444 = second; } // OFFSET: 0x00DB51E0 // FUNCTION: fn_22662 int CPlayer::AngleToDirection(float angle) { return (static_cast(angle) + 180) / 45 % 8; } // OFFSET: 0x00DB52B0 // FUNCTION: fn_22663 bool CPlayer::IsSpecialState(int state) const { switch (state) { case 2: case 5: case 6: case 62: case 63: case 64: case 65: case 67: case 68: case 69: case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: case 78: case 79: case 80: return true; default: return false; } } // OFFSET: 0x00DB06C0 // FUNCTION: fn_22619 void CGrannyPc::Slot39(int value) { if (this->unknown_0440 != 11 || this->unknown_0444 != 0) { value = std::min(value, g_maxMoveSpeed); } this->render.unknown_0054 = static_cast(value) / 432.0f; } // OFFSET: 0x00DB0710 // FUNCTION: fn_22620 void CPc::Slot39(int value) { const int weapon = this->weapon; if (weapon > 105) { GetWeaponViewValue(weapon); } if (weapon != 11) { value = std::min(value, g_maxMoveSpeed); } this->render.unknown_0054 = static_cast(value) / 432.0f; }