Decompile 7 functions in Source/Contents/Jobs/JobId.h, Source/Contents/Jobs/JobInheritance.cpp, ...
Batch #921 by ragnarok-clanker: 0 byte-identical, 7 confirmed by peer review. - fn_23461 GetRealWeaponId: logic confirmed by peer review - fn_23585 ?IsTreeGroupTwo@?A0x66373c89@@YA_NH@Z: logic confirmed by peer review - fn_23586 ?IsTreeGroupThree@?A0x66373c89@@YA_NH@Z: logic confirmed by peer review - fn_23587 IsPlayerJob: logic confirmed by peer review - fn_23907 JobInheritance::InitializeSkillTree: logic confirmed by peer review - fn_23495 JobNames::Initialize: logic confirmed by peer review - fn_23444 AttackMotionLength: logic confirmed by peer review Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
ab4f30f7b0
commit
1122aa7c98
4 changed files with 4047 additions and 303 deletions
|
|
@ -6,11 +6,11 @@
|
|||
// FUNCTION: fn_23444
|
||||
float AttackMotionLength(int job, int appearance, int equipment, int attackMode) {
|
||||
if (attackMode == 0) {
|
||||
if (job == JOB_MERCHANT) {
|
||||
if (job == JT_MERCHANT) {
|
||||
return 5.85f;
|
||||
}
|
||||
|
||||
if (job == JOB_THIEF) {
|
||||
if (job == JT_THIEF) {
|
||||
return 5.75f;
|
||||
}
|
||||
|
||||
|
|
@ -22,19 +22,19 @@ float AttackMotionLength(int job, int appearance, int equipment, int attackMode)
|
|||
}
|
||||
|
||||
switch (job) {
|
||||
case JOB_NOVICE:
|
||||
case JOB_SUPER_NOVICE:
|
||||
case JOB_SUPER_BABY:
|
||||
case JOB_SUPER_NOVICE_E:
|
||||
case JOB_SUPER_BABY_E:
|
||||
case JT_NOVICE:
|
||||
case JT_SUPERNOVICE:
|
||||
case JT_SUPERNOVICE_B:
|
||||
case JT_SUPERNOVICE2:
|
||||
case JT_SUPERNOVICE2_B:
|
||||
return appearance == 1 ? 5.85f : 6.0f;
|
||||
case JOB_ASSASSIN:
|
||||
case JOB_ASSASSIN_CROSS:
|
||||
case JOB_BABY_ASSASSIN:
|
||||
case JOB_GUILLOTINE_CROSS:
|
||||
case JOB_GUILLOTINE_CROSS_T:
|
||||
case JOB_BABY_GUILLOTINE_CROSS:
|
||||
case JOB_SHADOW_CROSS:
|
||||
case JT_ASSASSIN:
|
||||
case JT_ASSASSIN_H:
|
||||
case JT_ASSASSIN_B:
|
||||
case JT_GUILLOTINE_CROSS:
|
||||
case JT_GUILLOTINE_CROSS_H:
|
||||
case JT_GUILLOTINE_CROSS_B:
|
||||
case JT_SHADOW_CROSS:
|
||||
if (equipment == W_KATAR || (equipment >= W_DOUBLE_DD && equipment <= W_DOUBLE_SA)) {
|
||||
return 3.0f;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,44 +1,44 @@
|
|||
#include "Client/Session.h"
|
||||
#include "Contents/Jobs/JobInheritance.h"
|
||||
#include "Contents/Jobs/JobId.h"
|
||||
#include "Contents/Skills/PlayerSkillBundle.h"
|
||||
#include "Script/LuaScript.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace {
|
||||
// OFFSET: 0x00DFBC00
|
||||
// FUNCTION: fn_23585
|
||||
bool IsTreeGroupTwo(int job) {
|
||||
if (static_cast<std::uint32_t>(job) - 4054u <= 58u) {
|
||||
if (job >= JT_RUNE_KNIGHT && job <= JT_MADOGEAR_B) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (job) {
|
||||
case 4120:
|
||||
case 4127:
|
||||
case 4129:
|
||||
case 4132:
|
||||
case 4133:
|
||||
case 4140:
|
||||
case 4143:
|
||||
case 4148:
|
||||
case 4151:
|
||||
case 4173:
|
||||
case 4174:
|
||||
case 4175:
|
||||
case 4176:
|
||||
case 4177:
|
||||
case 4178:
|
||||
case 4179:
|
||||
case 4180:
|
||||
case 4182:
|
||||
case 4197:
|
||||
case 4198:
|
||||
case 4201:
|
||||
case 4202:
|
||||
case 4205:
|
||||
case 4206:
|
||||
case 4208:
|
||||
case 4209:
|
||||
case JT_PIG_GENETIC:
|
||||
case JT_SHEEP_SURA:
|
||||
case JT_SHEEP_ARCB:
|
||||
case JT_FOX_SORCERER:
|
||||
case JT_FOX_WARLOCK:
|
||||
case JT_DOG_G_CROSS:
|
||||
case JT_DOG_CHASER:
|
||||
case JT_OSTRICH_MINSTREL:
|
||||
case JT_OSTRICH_WANDER:
|
||||
case JT_FOX_WARLOCK_B:
|
||||
case JT_SHEEP_ARCB_B:
|
||||
case JT_DOG_G_CROSS_B:
|
||||
case JT_FOX_SORCERER_B:
|
||||
case JT_OSTRICH_MINSTREL_B:
|
||||
case JT_OSTRICH_WANDER_B:
|
||||
case JT_SHEEP_SURA_B:
|
||||
case JT_PIG_GENETIC_B:
|
||||
case JT_DOG_CHASER_B:
|
||||
case JT_PIG_MECHANIC:
|
||||
case JT_OSTRICH_RANGER:
|
||||
case JT_LION_ROYAL_GUARD:
|
||||
case JT_LION_RUNE_KNIGHT:
|
||||
case JT_PIG_MECHANIC_B:
|
||||
case JT_OSTRICH_RANGER_B:
|
||||
case JT_LION_ROYAL_GUARD_B:
|
||||
case JT_LION_RUNE_KNIGHT_B:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
@ -48,16 +48,17 @@ namespace {
|
|||
// OFFSET: 0x00DFBCA0
|
||||
// FUNCTION: fn_23586
|
||||
bool IsTreeGroupThree(int job) {
|
||||
const auto value = static_cast<std::uint32_t>(job);
|
||||
return value - 4252u <= 47u || value - 4302u <= 27u || job == 4355 || job == 4360;
|
||||
const auto value = static_cast<unsigned>(job);
|
||||
return value - JT_DRAGON_KNIGHT <= unsigned(JT_FOURTH_JOB_END - JT_DRAGON_KNIGHT) ||
|
||||
value - JT_SKY_EMPEROR <= unsigned(JT_UPPER_EXTENDED_JOB2_END - 1 - JT_SKY_EMPEROR) || job == JT_ALITEA || job == JT_ALITEA_RIDING;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00DFBCE0
|
||||
// FUNCTION: fn_23587
|
||||
bool __stdcall IsPlayerJob(int job) {
|
||||
const auto value = static_cast<std::uint32_t>(job);
|
||||
return value - 4001u <= 0x7CEu || value <= 30u;
|
||||
const auto value = static_cast<unsigned>(job);
|
||||
return value - JT_NOVICE_H <= unsigned(JT_MER_BEGIN - 1 - JT_NOVICE_H) || value <= unsigned(JT_SUMMER2);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00E19110
|
||||
|
|
@ -83,27 +84,28 @@ void JobInheritance::InitializeSkillTree(CPlayerSkillBundle& bundle, int job) {
|
|||
for (int index = count; index > 0; --index) {
|
||||
const int inherited = this->Lookup(index);
|
||||
int group = 1;
|
||||
if (inherited == 0 || this->Lookup(index + 1) == 0 || inherited == 4218 || inherited == 4220) {
|
||||
if (inherited == JT_NOVICE || this->Lookup(index + 1) == JT_NOVICE || inherited == JT_DO_SUMMONER || inherited == JT_DO_SUMMONER_B) {
|
||||
group = 0;
|
||||
} else if (IsTreeGroupTwo(inherited) || inherited == 4239 || inherited == 4240 || inherited == 4241 || inherited == 4242) {
|
||||
} else if (IsTreeGroupTwo(inherited) || inherited == JT_STAR_EMPEROR || inherited == JT_SOUL_REAPER || inherited == JT_STAR_EMPEROR_B ||
|
||||
inherited == JT_SOUL_REAPER_B) {
|
||||
group = 2;
|
||||
} else if (IsTreeGroupThree(inherited)) {
|
||||
group = 3;
|
||||
}
|
||||
|
||||
switch (inherited) {
|
||||
case 4302:
|
||||
case 4303:
|
||||
case JT_SKY_EMPEROR:
|
||||
case JT_SOUL_ASCETIC:
|
||||
group = 3;
|
||||
break;
|
||||
case 4304:
|
||||
case 4305:
|
||||
case 4306:
|
||||
case 4307:
|
||||
case 4355:
|
||||
case JT_SHINKIRO:
|
||||
case JT_SHIRANUI:
|
||||
case JT_NIGHT_WATCH:
|
||||
case JT_HYPER_NOVICE:
|
||||
case JT_ALITEA:
|
||||
group = 2;
|
||||
break;
|
||||
case 4308:
|
||||
case JT_SPIRIT_HANDLER:
|
||||
group = 1;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -113,3 +115,12 @@ void JobInheritance::InitializeSkillTree(CPlayerSkillBundle& bundle, int job) {
|
|||
this->script.Call("InitSkillTreeView", "dd", inherited, group);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: fn_23461
|
||||
int __stdcall GetRealWeaponId(int weapon) {
|
||||
int real = 0;
|
||||
if (g_session.m_hotkeyScript->Call("GetRealWeaponId", "d>d", weapon, &real)) {
|
||||
return real;
|
||||
}
|
||||
return weapon;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
#include "Contents/Jobs/JobNames.h"
|
||||
#include "Contents/Jobs/JobId.h"
|
||||
#include "Script/LuaScript.h"
|
||||
|
||||
|
||||
// OFFSET: 0x00DE67E0
|
||||
// FUNCTION: fn_23495
|
||||
void JobNames::Initialize(JobNameInitialization& context) {
|
||||
this->names.resize(32003, "Poring");
|
||||
const char* name = nullptr;
|
||||
const auto player = [&](int first, int last) {
|
||||
for (int id = first; id <= last; ++id) {
|
||||
|
||||
const auto player = [&](int first, int end) {
|
||||
for (int id = first; id < end; ++id) {
|
||||
if (context.playerScript.Call("ReqPCJobName", "d>s", id, &name) && *name != '\0') {
|
||||
this->names[id] = name;
|
||||
}
|
||||
|
|
@ -21,43 +24,46 @@ void JobNames::Initialize(JobNameInitialization& context) {
|
|||
}
|
||||
}
|
||||
};
|
||||
player(0, 30);
|
||||
player(4001, 4329);
|
||||
player(4332, 4349);
|
||||
player(4351, 4360);
|
||||
const auto other = [&](int first, int last) {
|
||||
for (int id = first; id <= last; ++id) {
|
||||
|
||||
player(JT_NOVICE, JT_MAX_BASIC);
|
||||
player(JT_NOVICE_H, JT_UPPER_EXTENDED_JOB2_END);
|
||||
player(JT_RUNE_KNIGHT_2ND, JT_SECOND_JOB_END);
|
||||
player(JT_DRUID, JT_2004_JOB_LAST);
|
||||
|
||||
const auto other = [&](int first, int end) {
|
||||
for (int id = first; id < end; ++id) {
|
||||
context.otherScript.Call("ReqJobName", "d>s", id, &this->names[id]);
|
||||
}
|
||||
};
|
||||
other(45, 125);
|
||||
other(400, 999);
|
||||
other(1001, 3998);
|
||||
other(10000, 19998);
|
||||
other(20021, 31999);
|
||||
|
||||
other(JT_WARPNPC, JT_SAFETYWALL);
|
||||
other(JT_NEW_NPC_START, JT_MON_BEGIN);
|
||||
other(JT_SCORPION, JT_MONSTER_LAST);
|
||||
other(JT_NPC_START, JT_NPC_NAME_END);
|
||||
other(JT_EXTENDED_JOB_NAME_START, JT_EXTENDED_JOB_NAME_END);
|
||||
|
||||
const char* const homunculi[] = {"LIF", "AMISTR", "FILIR", "VANILMIRTH", "LIF2", "AMISTR2", "FILIR2", "VANILMIRTH2",
|
||||
"LIF_H", "AMISTR_H", "FILIR_H", "VANILMIRTH_H", "LIF_H2", "AMISTR_H2", "FILIR_H2", "VANILMIRTH_H2"};
|
||||
|
||||
for (unsigned index = 0; index < 16; ++index) {
|
||||
this->names[6001 + index] = homunculi[index];
|
||||
this->names[JT_MER_LIF + index] = homunculi[index];
|
||||
}
|
||||
|
||||
this->names[6048] = "MER_EIRA";
|
||||
this->names[6051] = "MER_DIETER";
|
||||
this->names[6049] = "MER_BAYERI";
|
||||
this->names[6052] = "MER_ELEANOR";
|
||||
this->names[6050] = "MER_SERA";
|
||||
this->names[JT_MER_EIRA] = "MER_EIRA";
|
||||
this->names[JT_MER_DIETER] = "MER_DIETER";
|
||||
this->names[JT_MER_BAYERI] = "MER_BAYERI";
|
||||
this->names[JT_MER_ELEANOR] = "MER_ELEANOR";
|
||||
this->names[JT_MER_SERA] = "MER_SERA";
|
||||
|
||||
for (unsigned id = 6017; id <= 6026; ++id) {
|
||||
for (unsigned id = JT_MER_ARCHER01; id <= JT_MER_ARCHER10; ++id) {
|
||||
this->names[id] = "\xBF\xA9\\\xC8\xB0\xBF\xEB\xBA\xB4";
|
||||
}
|
||||
|
||||
for (unsigned id = 6027; id <= 6036; ++id) {
|
||||
for (unsigned id = JT_MER_LANCER01; id <= JT_MER_LANCER10; ++id) {
|
||||
this->names[id] = "\xB3\xB2\\\xC3\xA2\xBF\xEB\xBA\xB4";
|
||||
}
|
||||
|
||||
for (unsigned id = 6037; id <= 6046; ++id) {
|
||||
for (unsigned id = JT_MER_SWORDMAN01; id <= JT_MER_SWORDMAN10; ++id) {
|
||||
this->names[id] = "\xB3\xB2\\\xB0\xCB\xBF\xEB\xBA\xB4";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue