Batch #2092 by ragnarok-clanker: 0 byte-identical, 7 confirmed by peer review. - fn_21037 CGameActor::Slot37: logic confirmed by peer review - fn_21074 CGameActor::Slot38: logic confirmed by peer review - fn_21199 CGameActor::Slot39: logic confirmed by peer review - fn_22619 CGrannyPc::Slot39: logic confirmed by peer review - fn_22620 CPc::Slot39: logic confirmed by peer review - fn_22354 CCorpse::CCorpse: logic confirmed by peer review - fn_21301 CGameMode::SpawnCorpse: logic confirmed by peer review Reviewed-by: ragnarok-clanker
178 lines
3.8 KiB
C++
178 lines
3.8 KiB
C++
#include "Contents/Actors/Pc.h"
|
|
|
|
#include "Client/Session.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: 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: 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<int>(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<float>(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<float>(value) / 432.0f;
|
|
}
|