mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-07-30 20:20:49 +03:00
Compare commits
2 Commits
77cb9ed966
...
03cb7e699e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
03cb7e699e | ||
![]() |
b4ff9994e2 |
@ -423,6 +423,10 @@ bool ClientServices::LoadCDKey() {
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t ClientServices::GetExpansionLevel() {
|
||||
return ClientServices::Connection()->GetExpansionLevel();
|
||||
}
|
||||
|
||||
void ClientServices::InitLoginServerCVars(int32_t overwrite, const char* locale) {
|
||||
if ((ClientServices::s_realmListBNVar == nullptr || ClientServices::s_realmListVar == nullptr) || overwrite != 0 ) {
|
||||
ClientServices::s_decorateAccountName = CVar::Register(
|
||||
|
@ -56,6 +56,7 @@ class ClientServices : public LoginResponse {
|
||||
static const char* GetDefaultRealmlistString();
|
||||
static const char* GetDefaultPatchListString();
|
||||
static bool LoadCDKey();
|
||||
static int32_t GetExpansionLevel();
|
||||
|
||||
// Virtual member functions
|
||||
virtual int32_t GetLoginServerType();
|
||||
|
@ -110,6 +110,9 @@ void CCharacterComponent::FreeComponent(CCharacterComponent* component) {
|
||||
// TODO: ObjectFree()
|
||||
}
|
||||
|
||||
void CCharacterComponent::ValidateComponentData(ComponentData* data, COMPONENT_CONTEXT context) {
|
||||
}
|
||||
|
||||
CCharacterComponent::CCharacterComponent() {
|
||||
}
|
||||
|
||||
@ -135,3 +138,7 @@ bool CCharacterComponent::Init(ComponentData* data, const char* a3) {
|
||||
this->m_data = *data;
|
||||
return false;
|
||||
}
|
||||
|
||||
void CCharacterComponent::RenderPrep(int32_t a2) {
|
||||
// TODO
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ class CCharacterComponent {
|
||||
static void Initialize(EGxTexFormat format, uint32_t mipLevels, int32_t useThreads, int32_t useCompression);
|
||||
static CCharacterComponent* AllocComponent();
|
||||
static void FreeComponent(CCharacterComponent* component);
|
||||
static void ValidateComponentData(ComponentData* data, COMPONENT_CONTEXT context = DEFAULT_CONTEXT);
|
||||
|
||||
CCharacterComponent();
|
||||
~CCharacterComponent();
|
||||
@ -53,6 +54,7 @@ class CCharacterComponent {
|
||||
void SetRandomFacialFeature(COMPONENT_CONTEXT context = DEFAULT_CONTEXT);
|
||||
|
||||
bool Init(ComponentData* data, const char* a3);
|
||||
void RenderPrep(int32_t a2);
|
||||
|
||||
public:
|
||||
uint32_t m_handle;
|
||||
|
@ -93,7 +93,9 @@ void CCharacterCreation::ResetCharCustomizeInfo() {
|
||||
CCharacterCreation::CalcClasses(data.m_info.raceID);
|
||||
CCharacterCreation::InitCharacterComponent(&data, 1);
|
||||
|
||||
// TODO
|
||||
CCharacterCreation::SetSelectedClass(CCharacterCreation::GetRandomClassID());
|
||||
|
||||
data.m_info.classID = CCharacterCreation::m_selectedClassID;
|
||||
|
||||
CCharacterCreation::m_raceIndex = -1;
|
||||
for (uint32_t i = 0; i < CCharacterCreation::m_races.Count(); ++i) {
|
||||
@ -103,7 +105,7 @@ void CCharacterCreation::ResetCharCustomizeInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
// TODO: CNameGen::LoadNames
|
||||
}
|
||||
|
||||
void CCharacterCreation::GetRandomRaceAndSex(ComponentData* data) {
|
||||
@ -183,3 +185,73 @@ void CCharacterCreation::RandomizeCharFeatures() {
|
||||
CCharacterCreation::m_prevHairStyleIndex = info.hairStyleID;
|
||||
CCharacterCreation::m_prevFacialFeatureIndex = info.facialFeatureID;
|
||||
}
|
||||
|
||||
void CCharacterCreation::SetSelectedRace(int32_t raceID) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterCreation::SetSelectedSex(int32_t sexID) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterCreation::SetSelectedClass(int32_t classID) {
|
||||
if (!CCharacterCreation::IsClassValid(classID)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CCharacterCreation::m_selectedClassID = classID;
|
||||
ComponentData data;
|
||||
data.m_info = CCharacterCreation::m_character->m_data.m_info;
|
||||
data.m_info.classID = classID;
|
||||
CCharacterComponent::ValidateComponentData(&data);
|
||||
CCharacterCreation::InitCharacterComponent(&data, 0);
|
||||
// TODO: sub_4E0FD0
|
||||
// TODO: sub_4E6AE0((int)CCharacterCreation::m_character, 1);
|
||||
}
|
||||
|
||||
void CCharacterCreation::CycleCharCustomization(CHAR_CUSTOMIZATION_TYPE customization, int32_t delta) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterCreation::RandomizeCharCustomization() {
|
||||
CCharacterCreation::RandomizeCharFeatures();
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterCreation::SetCharFacing(float facing) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterCreation::CreateCharacter(const char* name) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterCreation::SetToExistingCharacter(uint32_t index) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
int32_t CCharacterCreation::IsRaceClassValid(int32_t raceID, int32_t classID) {
|
||||
for (int32_t i = 0; i < g_charBaseInfoDB.GetNumRecords(); ++i) {
|
||||
auto record = g_charBaseInfoDB.GetRecordByIndex(i);
|
||||
if (record && record->m_raceID == raceID && record->m_classID == classID) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t CCharacterCreation::IsClassValid(int32_t classID) {
|
||||
for (uint32_t i = 0; i < CCharacterCreation::m_classes.Count(); i) {
|
||||
auto record = CCharacterCreation::m_classes[i];
|
||||
if (record && record->m_ID == classID) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t CCharacterCreation::GetRandomClassID() {
|
||||
return 1;
|
||||
}
|
||||
|
@ -13,6 +13,15 @@ class ChrClassesRec;
|
||||
|
||||
|
||||
class CCharacterCreation {
|
||||
public:
|
||||
enum CHAR_CUSTOMIZATION_TYPE {
|
||||
CHAR_CUSTOMIZATION_SKIN = 0,
|
||||
CHAR_CUSTOMIZATION_FACE = 1,
|
||||
CHAR_CUSTOMIZATION_HAIR_STYLE = 2,
|
||||
CHAR_CUSTOMIZATION_HAIR_COLOR = 3,
|
||||
CHAR_CUSTOMIZATION_FACIAL_FEATURE = 4
|
||||
};
|
||||
|
||||
public:
|
||||
// Static variables
|
||||
static int32_t m_selectedClassID;
|
||||
@ -38,6 +47,17 @@ class CCharacterCreation {
|
||||
static void CalcClasses(uint32_t raceID);
|
||||
static void InitCharacterComponent(ComponentData* data, int32_t randomize);
|
||||
static void RandomizeCharFeatures();
|
||||
static void SetSelectedRace(int32_t raceID);
|
||||
static void SetSelectedSex(int32_t sexID);
|
||||
static void SetSelectedClass(int32_t classID);
|
||||
static void CycleCharCustomization(CHAR_CUSTOMIZATION_TYPE customization, int32_t delta);
|
||||
static void RandomizeCharCustomization();
|
||||
static void SetCharFacing(float facing);
|
||||
static void CreateCharacter(const char* name);
|
||||
static void SetToExistingCharacter(uint32_t index);
|
||||
static int32_t IsRaceClassValid(int32_t raceID, int32_t classID);
|
||||
static int32_t IsClassValid(int32_t classID);
|
||||
static int32_t GetRandomClassID();
|
||||
};
|
||||
|
||||
#endif // GLUE_C_CHARACTER_CREATION_HPP
|
||||
|
@ -297,3 +297,7 @@ void RealmConnection::RequestCharacterLogin(uint64_t id) {
|
||||
msg.Finalize();
|
||||
this->Send(&msg);
|
||||
}
|
||||
|
||||
int32_t RealmConnection::GetExpansionLevel() const {
|
||||
return this->m_accountExpansion;
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ class RealmConnection : public NetClient {
|
||||
void SetSelectedRealm(uint32_t a2, uint32_t a3, uint32_t a4);
|
||||
void RequestCharacterEnum();
|
||||
void RequestCharacterLogin(uint64_t id);
|
||||
int32_t GetExpansionLevel() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
const char* g_glueScriptEvents[41];
|
||||
const char* g_scriptEvents[722];
|
||||
int32_t g_glueFrameScriptGenders[3] = { 2, 3, 1 };
|
||||
|
||||
void* FrameScript::s_mempool;
|
||||
lua_State* FrameScript::s_context;
|
||||
|
@ -42,6 +42,7 @@ class FrameScript_EventObject : public TSHashObject<FrameScript_EventObject, HAS
|
||||
|
||||
extern const char* g_glueScriptEvents[41];
|
||||
extern const char* g_scriptEvents[722];
|
||||
extern int32_t g_glueFrameScriptGenders[3];
|
||||
|
||||
namespace FrameScript {
|
||||
extern void* s_mempool;
|
||||
|
@ -1,12 +1,16 @@
|
||||
#include "ui/ScriptFunctions.hpp"
|
||||
#include "ui/CSimpleModelFFX.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "ui/Types.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "clientobject/Unit_C.hpp"
|
||||
#include "glue/CCharacterCreation.hpp"
|
||||
#include "glue/CCharacterComponent.hpp"
|
||||
#include "glue/CCharacterSelection.hpp"
|
||||
#include "client/ClientServices.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
int32_t Script_SetCharCustomizeFrame(lua_State* L) {
|
||||
@ -93,31 +97,37 @@ int32_t Script_GetFactionForRace(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_GetAvailableRaces(lua_State* L) {
|
||||
auto sexID = CCharacterCreation::m_character->m_data.m_info.sexID;
|
||||
|
||||
for (uint32_t i = 0; i < CCharacterCreation::m_races.Count(); ++i) {
|
||||
auto raceRecord = g_chrRacesDB.GetRecord(CCharacterCreation::m_races[i]);
|
||||
auto raceName = CGUnit_C::GetDisplayRaceNameFromRecord(
|
||||
raceRecord,
|
||||
CCharacterCreation::m_character->m_data.m_info.sexID);
|
||||
auto raceName = CGUnit_C::GetDisplayRaceNameFromRecord(raceRecord, sexID);
|
||||
|
||||
lua_pushstring(L, raceName);
|
||||
lua_pushstring(L, raceRecord ? raceRecord->m_clientFileString : nullptr);
|
||||
// TODO: Expansion Check
|
||||
lua_pushnumber(L, 1.0);
|
||||
if (raceRecord) {
|
||||
lua_pushstring(L, raceRecord->m_clientFileString);
|
||||
bool available = ClientServices::GetExpansionLevel() >= raceRecord->m_requiredExpansion;
|
||||
lua_pushnumber(L, available ? 1.0 : 0.0);
|
||||
} else {
|
||||
lua_pushstring(L, nullptr);
|
||||
lua_pushnumber(L, 0.0);
|
||||
}
|
||||
}
|
||||
return CCharacterCreation::m_races.Count() * 3;
|
||||
}
|
||||
|
||||
int32_t Script_GetAvailableClasses(lua_State* L) {
|
||||
auto sexID = CCharacterCreation::m_character->m_data.m_info.sexID;
|
||||
|
||||
for (int32_t i = 0; i < g_chrClassesDB.GetNumRecords(); ++i) {
|
||||
auto record = g_chrClassesDB.GetRecordByIndex(i);
|
||||
auto className = CGUnit_C::GetDisplayClassNameFromRecord(
|
||||
record,
|
||||
CCharacterCreation::m_character->m_data.m_info.sexID);
|
||||
auto className = CGUnit_C::GetDisplayClassNameFromRecord(record, sexID);
|
||||
|
||||
if (className) {
|
||||
lua_pushstring(L, className);
|
||||
lua_pushstring(L, record->m_filename);
|
||||
// TODO: Expansion Check
|
||||
lua_pushnumber(L, 1.0);
|
||||
bool available = ClientServices::GetExpansionLevel() >= record->m_requiredExpansion;
|
||||
lua_pushnumber(L, available ? 1.0 : 0.0);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
@ -128,16 +138,17 @@ int32_t Script_GetAvailableClasses(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_GetClassesForRace(lua_State* L) {
|
||||
auto sexID = CCharacterCreation::m_character->m_data.m_info.sexID;
|
||||
|
||||
for (uint32_t i = 0; i < CCharacterCreation::m_classes.Count(); ++i) {
|
||||
auto record = CCharacterCreation::m_classes[i];
|
||||
auto className = CGUnit_C::GetDisplayClassNameFromRecord(
|
||||
record,
|
||||
CCharacterCreation::m_character->m_data.m_info.sexID);
|
||||
auto className = CGUnit_C::GetDisplayClassNameFromRecord(record, sexID);
|
||||
|
||||
if (className) {
|
||||
lua_pushstring(L, className);
|
||||
lua_pushstring(L, record->m_filename);
|
||||
// TODO: Expansion Check
|
||||
lua_pushnumber(L, 1.0);
|
||||
bool available = ClientServices::GetExpansionLevel() >= record->m_requiredExpansion;
|
||||
lua_pushnumber(L, available ? 1.0 : 0.0);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
@ -182,8 +193,8 @@ int32_t Script_GetSelectedRace(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_GetSelectedSex(lua_State* L) {
|
||||
// TODO: g_glueFrameScriptGenders[CCharacterCreation::m_character->m_data.m_info.sexID]
|
||||
lua_pushnumber(L, 2.0);
|
||||
auto sexID = CCharacterCreation::m_character->m_data.m_info.sexID;
|
||||
lua_pushnumber(L, g_glueFrameScriptGenders[sexID]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -218,51 +229,111 @@ int32_t Script_GetSelectedClass(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_SetSelectedRace(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
return luaL_error(L, "Usage: SetSelectedRace(index)");
|
||||
}
|
||||
|
||||
int32_t raceID = static_cast<int32_t>(lua_tonumber(L, 1)) - 1;
|
||||
CCharacterCreation::SetSelectedRace(raceID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_SetSelectedSex(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
return luaL_error(L, "Usage: SetSelectedSex(index)");
|
||||
}
|
||||
|
||||
int32_t sexID = static_cast<int32_t>(lua_tonumber(L, 1));
|
||||
for (int32_t i = 0; i < 3; ++i) {
|
||||
if (g_glueFrameScriptGenders[i] == sexID) {
|
||||
CCharacterCreation::SetSelectedSex(i);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_SetSelectedClass(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
return luaL_error(L, "Usage: SetSelectedSex(index)");
|
||||
}
|
||||
|
||||
int32_t index = static_cast<int32_t>(lua_tonumber(L, 1)) - 1;
|
||||
|
||||
// NOTICE: Original client has access violation issue in this method
|
||||
auto record = g_chrClassesDB.GetRecordByIndex(index);
|
||||
CCharacterCreation::SetSelectedClass(record ? record->m_ID : 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_UpdateCustomizationBackground(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
int32_t Script_UpdateCustomizationBackground(lua_State*) {
|
||||
CCharacterCreation::SetSelectedRace(CCharacterCreation::m_raceIndex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_UpdateCustomizationScene(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
int32_t Script_UpdateCustomizationScene(lua_State*) {
|
||||
CCharacterCreation::m_character->RenderPrep(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_CycleCharCustomization(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) {
|
||||
return luaL_error(L, "Usage: CycleCharCustomization(index, delta)");
|
||||
}
|
||||
|
||||
using CHAR_CUSTOMIZATION_TYPE = CCharacterCreation::CHAR_CUSTOMIZATION_TYPE;
|
||||
|
||||
auto customization = static_cast<CHAR_CUSTOMIZATION_TYPE>(lua_tonumber(L, 1) - 1.0);
|
||||
int32_t delta = static_cast<int32_t>(lua_tonumber(L, 2));
|
||||
|
||||
CCharacterCreation::CycleCharCustomization(customization, delta);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_RandomizeCharCustomization(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
int32_t Script_RandomizeCharCustomization(lua_State*) {
|
||||
CCharacterCreation::RandomizeCharCustomization();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_GetCharacterCreateFacing(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
lua_pushnumber(L, CCharacterCreation::m_charFacing * 57.29578);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Script_SetCharacterCreateFacing(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
return luaL_error(L, "Usage: SetCharacterCreateFacing(degrees)");
|
||||
}
|
||||
|
||||
// Degree to Radian
|
||||
float facing = lua_tonumber(L, 1) * 0.017453292;
|
||||
CCharacterCreation::SetCharFacing(facing);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Script_GetRandomName(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO: Proper implementation
|
||||
// WORKAROUND:
|
||||
lua_pushstring(L, "RandomName");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Script_CreateCharacter(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (lua_isstring(L, 1)) {
|
||||
lua_tolstring(L, 1, nullptr);
|
||||
}
|
||||
|
||||
CCharacterCreation::CreateCharacter(lua_tolstring(L, 1, nullptr));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_CustomizeExistingCharacter(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
return luaL_error(L, "Usage: CustomizeExistingCharacter(index)");
|
||||
}
|
||||
|
||||
uint32_t index = static_cast<uint32_t>(lua_tonumber(L, 1)) - 1;
|
||||
CCharacterCreation::SetToExistingCharacter(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_PaidChange_GetPreviousRaceIndex(lua_State* L) {
|
||||
@ -282,16 +353,84 @@ int32_t Script_PaidChange_GetName(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_IsRaceClassValid(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) {
|
||||
return luaL_error(L, "Usage: IsRaceClassValid(raceIndex, classIndex)");
|
||||
}
|
||||
|
||||
uint32_t raceIndex = static_cast<uint32_t>(lua_tonumber(L, 1)) - 1;
|
||||
int32_t classIndex = static_cast<int32_t>(lua_tonumber(L, 2)) - 1;
|
||||
|
||||
auto classRecord = g_chrClassesDB.GetRecordByIndex(classIndex);
|
||||
if (!classRecord) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t raceID = 0;
|
||||
if (raceIndex < CCharacterCreation::m_races.Count()) {
|
||||
raceID = CCharacterCreation::m_races[raceIndex];
|
||||
}
|
||||
|
||||
if (CCharacterCreation::IsRaceClassValid(raceID, classRecord->m_ID)) {
|
||||
lua_pushnumber(L, 1.0);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Script_IsRaceClassRestricted(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) {
|
||||
return luaL_error(L, "Usage: Script_IsRaceClassRestricted(raceID, classID)");
|
||||
}
|
||||
|
||||
int32_t raceID = static_cast<int32_t>(lua_tonumber(L, 1));
|
||||
int32_t classID = static_cast<int32_t>(lua_tonumber(L, 2));
|
||||
|
||||
classID = (1 << classID);
|
||||
|
||||
bool restricted = false;
|
||||
switch (raceID) {
|
||||
case 1:
|
||||
restricted = (CCharacterSelection::m_restrictHuman & classID) != 0;
|
||||
break;
|
||||
case 2:
|
||||
restricted = (CCharacterSelection::m_restrictOrc & classID) != 0;
|
||||
break;
|
||||
case 3:
|
||||
restricted = (CCharacterSelection::m_restrictDwarf & classID) != 0;
|
||||
break;
|
||||
case 4:
|
||||
restricted = (CCharacterSelection::m_restrictNightElf & classID) != 0;
|
||||
break;
|
||||
case 5:
|
||||
restricted = (CCharacterSelection::m_restrictUndead & classID) != 0;
|
||||
break;
|
||||
case 6:
|
||||
restricted = (CCharacterSelection::m_restrictTauren & classID) != 0;
|
||||
break;
|
||||
case 7:
|
||||
restricted = (CCharacterSelection::m_restrictGnome & classID) != 0;
|
||||
break;
|
||||
case 8:
|
||||
restricted = (CCharacterSelection::m_restrictTroll & classID) != 0;
|
||||
break;
|
||||
case 10:
|
||||
restricted = (CCharacterSelection::m_restrictBloodElf & classID) != 0;
|
||||
break;
|
||||
case 11:
|
||||
restricted = (CCharacterSelection::m_restrictDraenei & classID) != 0;
|
||||
break;
|
||||
default:
|
||||
luaL_error(L, "Script_IsRaceClassRestricted: unsupported race ID(%d)", raceID);
|
||||
break;
|
||||
}
|
||||
|
||||
lua_pushnumber(L, restricted ? 1.0 : 0.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Script_GetCreateBackgroundModel(lua_State* L) {
|
||||
// TODO
|
||||
if (false /* SFile::IsTrial() */) {
|
||||
if (SFile::IsTrial()) {
|
||||
lua_pushstring(L, "CharacterSelect");
|
||||
return 1;
|
||||
}
|
||||
|
@ -307,3 +307,8 @@ int32_t SFile::RebuildHash() {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t SFile::IsTrial() {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ class SFile {
|
||||
static int32_t GetDataPath(char* path, size_t capacity);
|
||||
static int32_t SetDataPathAlternate(const char* path);
|
||||
static int32_t RebuildHash();
|
||||
static int32_t IsTrial();
|
||||
|
||||
// Member variables
|
||||
SFILE_TYPE m_type;
|
||||
|
Loading…
Reference in New Issue
Block a user