Port run-83 hit stand-ins and fix phantom terrain walls blocking movement
- Fix CMap::GetChunkFacets: impassable test uses the chunk MapObjFlag (MAPOBJ_FLAG_IMPASSABLE at +0xC) like 12340, not MCNK header flag 0x40 (vertex colours). Most chunks got 32000-high wall facets, so the player could jump but not walk. - Ship paths: GetPosition, path time, accel/decel distance, roll/pitch. - Transports: Transport::UpdateMovement, CollideWithTransport, owner matrix. - Map objects: IsAllLoaded, footprints, TriData query chain (QueryTris, GetTrisTerrain/Chunk, GetTriSubchunk, QueryTrisMapObjDefs), QueryIntersectingModels. - Water ripples, projected-texture shadow drawing (shadow.cpp). - World states, LFG best random dungeon, quest POI, ComSat session lookup, blood record, virtual items, guild roster query. - Logout path: tradeskill close, LCD, DBCache_ClearPending, chat/macro/ saved-variable/account-data saving, tracked quests/achievements/ tutorials, UnloadAddOns, SaveAddOnEnableState, ~CGWorldFrame, SmartScreenRectShutdown. - Fixes: TriData batch heights stored as float* (was truncating uint32 on x64), TimeInRange is a ShipPath member, ComSat lookup takes the session type, roll/pitch names swapped in MapObjTransport::UpdateMovement, removed windows.h from Object/Passenger.h. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -517,3 +517,12 @@ void* CDataStore::ReAlloc(void* ptr, uint32_t bytes, const char* fileName, int32
|
||||
|
||||
return SMemReAlloc(ptr, bytes, __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
// VERIFY: 8b1ed662 auto
|
||||
// OFFSET: 0x00401140
|
||||
CDataStore& CDataStore::GetInt8(uint32_t& val) {
|
||||
uint8_t value = 0;
|
||||
this->Get(value);
|
||||
val = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ class CDataStore {
|
||||
CDataStore& Get(uint32_t& val);
|
||||
CDataStore& Get(uint64_t& val);
|
||||
CDataStore& Get(float& val);
|
||||
CDataStore& GetInt8(uint32_t& val);
|
||||
CDataStore& GetArray(uint8_t* pval, uint32_t count);
|
||||
CDataStore& GetArray(uint32_t* pval, uint32_t count);
|
||||
CDataStore& GetData(void* data, uint32_t bytes);
|
||||
|
||||
@@ -210,7 +210,7 @@ void SSignatureVerifyStream_ProvideData(SSignatureData* token, const uint8_t* da
|
||||
|
||||
const char* STORMAPI SStrAdvanceCharsUTF8(const char* string, size_t chars);
|
||||
char* SStrChr(const char* string, char search);
|
||||
char* SStrChrR(char* string, char search);
|
||||
char* SStrChrR(const char* string, char search);
|
||||
int32_t STORMAPI SStrCmp(const char* string1, const char* string2, size_t maxchars);
|
||||
int32_t STORMAPI SStrCmpI(const char* string1, const char* string2, size_t maxchars);
|
||||
int32_t STORMAPI SStrCmpUTF8I(const char* string1, const char* string2, size_t maxchars);
|
||||
|
||||
@@ -61,15 +61,15 @@ char* SStrChr(const char* string, char search) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: 263abdbd auto
|
||||
// VERIFY: c2203f65 auto
|
||||
// OFFSET: 0x0076E720
|
||||
char* SStrChrR(char* string, char search) {
|
||||
char* SStrChrR(const char* string, char search) {
|
||||
if (!string) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
char* result = nullptr;
|
||||
const char* result = nullptr;
|
||||
|
||||
for (; *string; string++) {
|
||||
if (*string == search) {
|
||||
@@ -77,7 +77,7 @@ char* SStrChrR(char* string, char search) {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return const_cast<char*>(result);
|
||||
}
|
||||
|
||||
// VERIFY: 8e9003dc auto
|
||||
|
||||
@@ -695,3 +695,24 @@ C44Matrix::C44Matrix(const C34Matrix& m) {
|
||||
this->d2 = m.d2;
|
||||
this->d3 = 1.0f;
|
||||
}
|
||||
|
||||
// VERIFY: d0f80fc6 auto
|
||||
// OFFSET: 0x0078FBD0
|
||||
C44Matrix::C44Matrix(const C3Vector& x, const C3Vector& y, const C3Vector& z, const C3Vector& w) {
|
||||
this->a0 = x.x;
|
||||
this->a1 = x.y;
|
||||
this->a2 = x.z;
|
||||
this->a3 = 0.0f;
|
||||
this->b0 = y.x;
|
||||
this->b1 = y.y;
|
||||
this->b2 = y.z;
|
||||
this->b3 = 0.0f;
|
||||
this->c0 = z.x;
|
||||
this->c1 = z.y;
|
||||
this->c2 = z.z;
|
||||
this->c3 = 0.0f;
|
||||
this->d0 = w.x;
|
||||
this->d1 = w.y;
|
||||
this->d2 = w.z;
|
||||
this->d3 = 1.0f;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ class C44Matrix {
|
||||
C44Matrix(float a0, float a1, float a2, float a3, float b0, float b1, float b2, float b3, float c0, float c1, float c2, float c3, float d0, float d1, float d2, float d3);
|
||||
C44Matrix(const C33Matrix& m);
|
||||
C44Matrix(const C34Matrix& m);
|
||||
C44Matrix(const C3Vector& x, const C3Vector& y, const C3Vector& z, const C3Vector& w);
|
||||
C44Matrix(const C4Quaternion& q);
|
||||
C44Matrix Adjoint() const;
|
||||
C44Matrix AffineInverse() const;
|
||||
|
||||
@@ -12,6 +12,7 @@ class CiRect {
|
||||
/* 000C */ int32_t maxX;
|
||||
|
||||
CiRect();
|
||||
CiRect(int32_t minY, int32_t minX, int32_t maxY, int32_t maxX);
|
||||
CiRect operator&=(const CiRect& r);
|
||||
};
|
||||
|
||||
@@ -25,4 +26,12 @@ inline CiRect::CiRect() {
|
||||
this->maxX = 0;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
inline CiRect::CiRect(int32_t minY, int32_t minX, int32_t maxY, int32_t maxX) {
|
||||
this->minY = minY;
|
||||
this->minX = minX;
|
||||
this->maxY = maxY;
|
||||
this->maxX = maxX;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1194,9 +1194,9 @@ void CCharacterComponent::PasteOpaqueScale(void* texture, MipBits* dstMips, C2iV
|
||||
CCharacterComponent::PasteOpaque(texture, pal, dstMips, dstPos, dstStride >> 1, srcPos, srcSize, srcInfo, 0, 1);
|
||||
}
|
||||
|
||||
// VERIFY: 6b5f02b6 auto
|
||||
// VERIFY: 049c43f4 auto
|
||||
// OFFSET: 0x004E8D30
|
||||
static CTexture* CreateTexture(const char* fileName, CStatus* status) {
|
||||
CTexture* CreateTexture(const char* fileName, CStatus* status) {
|
||||
CGxTexFlags flags(GxTex_LinearMipNearest, 0, 0, 0, 0, 0, 1);
|
||||
|
||||
return TextureCreate(fileName, flags, status, 0);
|
||||
|
||||
@@ -66,6 +66,7 @@ class CComponentRequest {
|
||||
void DestroyCachedTextures();
|
||||
};
|
||||
|
||||
class CStatus;
|
||||
class CCharacterComponent {
|
||||
public:
|
||||
static CVar* g_componentCompressVar;
|
||||
@@ -266,4 +267,6 @@ class CCharacterComponent {
|
||||
|
||||
bool ComponentVarHandler(CVar* var, const char* oldValue, const char* value, void* arg);
|
||||
|
||||
CTexture* CreateTexture(const char* fileName, CStatus* status);
|
||||
|
||||
#endif
|
||||
|
||||
+27
-2
@@ -306,13 +306,16 @@ static uint32_t s_clientTaxiBenchDelayTime;
|
||||
static uint64_t s_clientTaxiTimestamp;
|
||||
|
||||
// STATIC: 0x00B2F9E0
|
||||
static uint8_t s_botCheckEnabled;
|
||||
uint8_t s_botCheckEnabled;
|
||||
|
||||
// STATIC: 0x00B2F9E4
|
||||
static uint32_t s_botCheckStartTime;
|
||||
|
||||
// STATIC: 0x00B2F9E8
|
||||
static int32_t s_botCheckDelay;
|
||||
int32_t s_botCheckDelay;
|
||||
|
||||
// STATIC: 0x00B2FA0C
|
||||
volatile long s_additionalCheckArmed;
|
||||
|
||||
// STATIC: 0x00B2FA1C
|
||||
static C3Vector s_spawnPosition;
|
||||
@@ -2116,3 +2119,25 @@ int32_t Packet_SMSG_PLAYED_TIME(void* param, NETMESSAGE msgId, uint32_t time, CD
|
||||
void ClientKillTimer(uint32_t id, EVENTHANDLERFUNC handler, const char* name) {
|
||||
EventKillTimer(id, handler, name);
|
||||
}
|
||||
|
||||
// VERIFY: ba8cfe2c manual
|
||||
// OFFSET: 0x00402720
|
||||
void* Client_MemAlloc(uint32_t bytes) {
|
||||
return SMemAlloc(bytes, __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
// VERIFY: 8c344a50 manual
|
||||
// OFFSET: 0x00402740
|
||||
void Client_MemFree(void* ptr) {
|
||||
SMemFree(ptr, __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
// VERIFY: af0e97c3 manual
|
||||
// OFFSET: 0x00404610
|
||||
void SendBotDetected2(uint32_t msgId, uint32_t code) {
|
||||
WDataStore msg;
|
||||
msg.Put(msgId);
|
||||
msg.Put(code);
|
||||
msg.Finalize();
|
||||
ClientServices::Send2(&msg);
|
||||
}
|
||||
|
||||
@@ -112,8 +112,24 @@ struct ARCHIVELISTPARAMS {
|
||||
/* 000C */ void* m_param;
|
||||
};
|
||||
|
||||
struct AdditionalCheckInterface {
|
||||
/* 0000 */ void* (*m_memAlloc)(uint32_t bytes);
|
||||
/* 0004 */ void (*m_memFree)(void* ptr);
|
||||
/* 0008 */ void* (*m_loadLibrary)(const char* fileName);
|
||||
/* 000C */ void* (*m_getLibraryEntryPoint)(void* module, const char* name);
|
||||
/* 0010 */ void (*m_freeLibrary)(void* module);
|
||||
};
|
||||
|
||||
extern uint8_t s_botCheckEnabled;
|
||||
extern int32_t s_botCheckDelay;
|
||||
extern volatile long s_additionalCheckArmed;
|
||||
|
||||
void CheckAndSendBotDetected();
|
||||
void AdditionalCheck1();
|
||||
uint8_t AdditionalCheck1Scan(const AdditionalCheckInterface* iface, int32_t a2);
|
||||
void* Client_MemAlloc(uint32_t bytes);
|
||||
void Client_MemFree(void* ptr);
|
||||
void SendBotDetected2(uint32_t msgId, uint32_t code);
|
||||
int32_t GatherAdditionalChecks(uint8_t* check1, uint8_t* check2, uint8_t* check3);
|
||||
void ClientUpdateTaxiBenchmarkMode();
|
||||
void ClientKillTimer(uint32_t id, EVENTHANDLERFUNC handler, const char* name);
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
#include "CreatureStats_C.h"
|
||||
|
||||
// VERIFY: 54ac2c6d manual
|
||||
// OFFSET: 0x00667F40
|
||||
CreatureStats_C::~CreatureStats_C() {
|
||||
}
|
||||
|
||||
@@ -644,3 +644,22 @@ void DBCache_Idle() {
|
||||
g_wardenCache.Idle();
|
||||
g_arenaTeamCache.Idle();
|
||||
}
|
||||
|
||||
// VERIFY: 2a9b337b auto
|
||||
// OFFSET: 0x00635680
|
||||
void DBCache_ClearPending() {
|
||||
g_creatureDBCache.ClearPending();
|
||||
g_gameObjectDBCache.ClearPending();
|
||||
g_itemDBCache.ClearPending();
|
||||
g_itemNameDBCache.ClearPending();
|
||||
g_npcTextDBCache.ClearPending();
|
||||
g_nameDBCache.ClearPending();
|
||||
g_guildInfoCache.ClearPending();
|
||||
g_questDBCache.ClearPending();
|
||||
g_pageTextCache.ClearPending();
|
||||
g_petNameCache.ClearPending();
|
||||
g_petitionCache.ClearPending();
|
||||
g_itemTextDBCache.ClearPending();
|
||||
g_arenaTeamCache.ClearPending();
|
||||
g_danceCache.ClearPending();
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ template <>
|
||||
void DBCache<NameCache, uint64_t, CHashKeyGUID>::AddItem(NameCache* item, uint64_t key);
|
||||
|
||||
void DBCache_ClearHandlers();
|
||||
void DBCache_ClearPending();
|
||||
void DBCache_Destroy();
|
||||
void DBCache_Idle();
|
||||
void DBCache_Initialize();
|
||||
|
||||
@@ -94,6 +94,9 @@ int32_t s_comsatDisabledByClient;
|
||||
// STATIC: 0x00D37D5C
|
||||
SCritSect s_comsatDeviceLock;
|
||||
|
||||
// STATIC: 0x00D37DD8
|
||||
static int32_t s_lastFoundSession;
|
||||
|
||||
// STATIC: 0x00AF29B4
|
||||
int32_t s_currentSession = -1;
|
||||
|
||||
@@ -447,3 +450,40 @@ const char* ComSatClient_GetCurrentSessionName() {
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: b9f375ed manual
|
||||
// OFFSET: 0x007DB560
|
||||
int32_t ComSatClient_HasSession(int32_t type, const char* name) {
|
||||
return ComSatClient_FindSessionByTypeAndName(type, name) >= 0;
|
||||
}
|
||||
|
||||
// VERIFY: 1f2e0bf3 manual
|
||||
// OFFSET: 0x007DB400
|
||||
int32_t ComSatClient_FindSessionByTypeAndName(int32_t type, const char* name) {
|
||||
int32_t cached = s_lastFoundSession;
|
||||
|
||||
if (s_comsatData[cached].m_type == type) {
|
||||
if (type) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
if (!SStrCmpUTF8I(s_comsatData[cached].m_name, name, 0x7FFFFFFF)) {
|
||||
return s_lastFoundSession;
|
||||
}
|
||||
}
|
||||
|
||||
if (!type && !name) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < 32; i++) {
|
||||
COMSATDATA* data = &s_comsatData[i];
|
||||
|
||||
if (data->m_sessionID && data->m_type == type && (type || !SStrCmpUTF8I(data->m_name, name, 0x7FFFFFFF))) {
|
||||
s_lastFoundSession = i;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "WoW/Source/Object/WGUID.h"
|
||||
#include "Engine/Source/ComSat/ComSatInterface.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "WoW/Source/Object/ObjectClient/Object_C.h"
|
||||
@@ -41,6 +42,11 @@ class ComSatClientAllocator : public ComSat::Allocator {
|
||||
};
|
||||
|
||||
int32_t ComSatClient_HasSession(int32_t type, const char* name);
|
||||
int32_t ComSatClient_FindSessionByTypeAndName(int32_t type, const char* name);
|
||||
int32_t ComSatClient_IsMemberInVoiceSession(WOWGUID guid, int32_t type, const char* name);
|
||||
int32_t ComSatClient_Unk7DB830(WOWGUID guid, int32_t type, const char* name);
|
||||
bool ComSatClient_IsPlayerMuted(WOWGUID guid);
|
||||
int32_t ComSatClient_IsTalkerSquelchedInChannel(WOWGUID guid, int32_t type, const char* name);
|
||||
int32_t ComSatClient_GetCurrentSessionType();
|
||||
const char* ComSatClient_GetCurrentSessionName();
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace ProjectTex {
|
||||
}
|
||||
|
||||
CGxTex* ProjectTex2dGetAddFadeTex();
|
||||
void ProjectTex2dDrawShaderEffect(const CAaBox& box, const CImVector& color, uint32_t triFlags, uint32_t flags, float polygonOffset);
|
||||
void ProjectTex2dMakeMatrices(C44Matrix& texMatrix, C44Matrix& fadeMatrix, const CAaBox& box, const C44Matrix* rotation, float fade, int32_t local);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +1,15 @@
|
||||
#include "WTOBJECT.h"
|
||||
#include "Engine/Source/Base/CDataAllocator.h"
|
||||
|
||||
// STATIC: 0x00D38078
|
||||
static CDataAllocator s_freeSwings(sizeof(SWING), 8);
|
||||
|
||||
// STATIC: 0x00D3808C
|
||||
static CDataAllocator s_freeTrails(sizeof(WTOBJECT), 128);
|
||||
|
||||
// VERIFY: c3c7b136 auto
|
||||
// OFFSET: 0x007E4BC0
|
||||
void WeaponTrailsShutdown() {
|
||||
s_freeTrails.Clear(typeid(WTOBJECT).raw_name(), SLOG_OBJECT, 1);
|
||||
s_freeSwings.Clear(typeid(SWING).raw_name(), SLOG_OBJECT, 1);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
#include <cstdint>
|
||||
|
||||
class CM2Model;
|
||||
struct SWING;
|
||||
struct SWING {
|
||||
/* 0000 */ uint8_t unk_0000[1560];
|
||||
};
|
||||
|
||||
class WTOBJECT {
|
||||
public:
|
||||
@@ -15,6 +17,7 @@ class WTOBJECT {
|
||||
|
||||
WTOBJECT* WeaponTrailCreate(CM2Model* model);
|
||||
void WeaponTrailClose(WTOBJECT* trail);
|
||||
void WeaponTrailsShutdown();
|
||||
void WeaponTrailSetDrawTrail(WTOBJECT* trail, const uint32_t* a2, uint32_t a3);
|
||||
|
||||
void WorldTextInitialize();
|
||||
|
||||
+675
-17
@@ -1,23 +1,681 @@
|
||||
#include "ShipPath.h"
|
||||
#include <malloc.h>
|
||||
#include <new>
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
#include "WoW/Source/DB/DBClient/DBClient.h"
|
||||
#include "WoW/Source/DB/Rec/TaxiPathNodeRec.h"
|
||||
#include <cmath>
|
||||
#include "Engine/Source/Tempest/C44Matrix.h"
|
||||
#include "WoW/Source/DB/Rec/TransportPhysicsRec.h"
|
||||
#include "WoW/Source/Object/ObjectClient/Types.h"
|
||||
|
||||
// INLINED
|
||||
ShipPath::ShipPath() {
|
||||
this->unk_0000 = 0;
|
||||
this->unk_0004 = 0xFFFFFFFF;
|
||||
this->unk_0008 = 0;
|
||||
this->unk_000C = 0;
|
||||
this->unk_0010 = 0;
|
||||
this->unk_0014 = 0;
|
||||
this->unk_0018 = 0;
|
||||
this->unk_001C = 0;
|
||||
this->unk_0020 = 0;
|
||||
this->unk_0024 = 0;
|
||||
this->unk_0028 = 0.0f;
|
||||
this->unk_002C = 0;
|
||||
this->unk_0030 = 0.0f;
|
||||
this->unk_0034 = 0;
|
||||
this->unk_0038 = 0;
|
||||
this->unk_003C = 0;
|
||||
this->unk_003D = 0;
|
||||
this->m_physics = nullptr;
|
||||
this->m_taxiPathId = 0xFFFFFFFF;
|
||||
this->m_moveSpeed = 0.0f;
|
||||
this->m_totalPathTime = 0;
|
||||
this->m_accelRate = 0.0f;
|
||||
this->m_waitTime = 0;
|
||||
this->m_timeOffset = 0;
|
||||
this->m_waiting = 0;
|
||||
this->m_waitReached = 0;
|
||||
this->unk_003E = 0;
|
||||
}
|
||||
|
||||
// VERIFY: 09b64bdb auto
|
||||
// OFFSET: 0x007F92F0
|
||||
void ShipPath::Init(uint32_t taxiPathId, float moveSpeed, float accelRate, const TransportPhysicsRec* physics) {
|
||||
this->m_moveSpeed = moveSpeed;
|
||||
this->m_taxiPathId = taxiPathId;
|
||||
this->m_totalPathTime = 0;
|
||||
this->m_accelRate = accelRate;
|
||||
this->BuildLegs();
|
||||
this->m_physics = physics;
|
||||
}
|
||||
|
||||
// VERIFY: 41a1523f manual
|
||||
// OFFSET: 0x007F7FC0
|
||||
void ShipPath::SetTotalPathTime(uint32_t time) {
|
||||
this->m_totalPathTime = time;
|
||||
|
||||
if (this->m_legs.Count() > 0) {
|
||||
this->m_legs.Top()->m_endTime = time;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: b2be9152 auto
|
||||
// OFFSET: 0x007F7AD0
|
||||
static int32_t FindFirstPathNode(uint32_t pathId) {
|
||||
int32_t high = g_taxiPathNodeDB.m_numRecords;
|
||||
int32_t low = 0;
|
||||
|
||||
if (high <= 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
do {
|
||||
int32_t mid = (high + low) / 2;
|
||||
TaxiPathNodeRec* records = g_taxiPathNodeDB.m_numRecords <= 0 ? nullptr : g_taxiPathNodeDB.m_records;
|
||||
|
||||
if (records[mid].m_pathID >= static_cast<int32_t>(pathId)) {
|
||||
high = mid;
|
||||
} else {
|
||||
low = mid + 1;
|
||||
}
|
||||
} while (low < high);
|
||||
|
||||
if (low < g_taxiPathNodeDB.m_numRecords) {
|
||||
TaxiPathNodeRec* records = g_taxiPathNodeDB.m_numRecords <= 0 ? nullptr : g_taxiPathNodeDB.m_records;
|
||||
|
||||
if (records[low].m_pathID == static_cast<int32_t>(pathId)) {
|
||||
return low;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// VERIFY: 3e217ff8 manual
|
||||
// OFFSET: 0x007F8180
|
||||
template <>
|
||||
void ShipPathArray<C3Vector>::SetCount(uint32_t count) {
|
||||
if (count == this->m_count) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint32_t i = this->m_count; i < count; i++) {
|
||||
new (&this->m_data[i]) C3Vector();
|
||||
}
|
||||
|
||||
this->m_count = count;
|
||||
}
|
||||
|
||||
// VERIFY: 7897cce3 manual
|
||||
// OFFSET: 0x007F90F0
|
||||
void ShipPath::BuildLegs() {
|
||||
ShipPathArray<C3Vector> points;
|
||||
points.m_data = static_cast<C3Vector*>(alloca(0x3000));
|
||||
points.m_count = 0;
|
||||
ShipPathArray<ShipPathPause> pauses;
|
||||
pauses.m_data = static_cast<ShipPathPause*>(alloca(0x2000));
|
||||
pauses.m_count = 0;
|
||||
ShipPathArray<ShipPathEvent> events;
|
||||
events.m_data = static_cast<ShipPathEvent*>(alloca(0x3000));
|
||||
this->m_totalPathTime = 0;
|
||||
this->m_events.m_count = 0;
|
||||
events.m_count = 0;
|
||||
int32_t leg = -1;
|
||||
int32_t index = FindFirstPathNode(this->m_taxiPathId);
|
||||
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
TaxiPathNodeRec* node = nullptr;
|
||||
|
||||
if (index >= 0 && index < g_taxiPathNodeDB.m_numRecords) {
|
||||
node = &g_taxiPathNodeDB.m_records[index];
|
||||
}
|
||||
|
||||
int32_t teleport = 0;
|
||||
|
||||
while (true) {
|
||||
if (leg < 0 || node->m_continentID != this->m_legs.m_data[leg].m_mapId || teleport) {
|
||||
if (leg >= 0) {
|
||||
this->BuildLeg(&points, &pauses, &events, leg);
|
||||
}
|
||||
|
||||
leg++;
|
||||
this->m_legs.SetCount(leg + 1);
|
||||
this->m_legs.m_data[leg].m_mapId = node->m_continentID;
|
||||
points.SetCount(0);
|
||||
|
||||
if (pauses.m_count) {
|
||||
pauses.m_count = 0;
|
||||
}
|
||||
|
||||
if (events.m_count) {
|
||||
events.m_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((node->m_flags & 0x2) && points.m_count) {
|
||||
ShipPathPause* pause = &pauses.m_data[pauses.m_count++];
|
||||
|
||||
if (pause) {
|
||||
pause->m_point = points.m_count;
|
||||
pause->m_delay = node->m_delay * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
if (node->m_arrivalEventID || node->m_departureEventID) {
|
||||
ShipPathEvent* event = &events.m_data[events.m_count++];
|
||||
|
||||
if (event) {
|
||||
event->m_point = points.m_count;
|
||||
event->m_arrivalEvent = node->m_arrivalEventID;
|
||||
event->m_departureEvent = node->m_departureEventID;
|
||||
}
|
||||
}
|
||||
|
||||
C3Vector* point = &points.m_data[points.m_count++];
|
||||
|
||||
if (point) {
|
||||
point->x = node->m_loc[0];
|
||||
point->y = node->m_loc[1];
|
||||
point->z = node->m_loc[2];
|
||||
}
|
||||
|
||||
teleport = node->m_flags & 0x1;
|
||||
index++;
|
||||
|
||||
if (index < 0 || index >= g_taxiPathNodeDB.m_numRecords) {
|
||||
break;
|
||||
}
|
||||
|
||||
node = &g_taxiPathNodeDB.m_records[index];
|
||||
|
||||
if (node->m_pathID != static_cast<int32_t>(this->m_taxiPathId)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (points.m_count) {
|
||||
this->BuildLeg(&points, &pauses, &events, leg);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: b35e3ee1 manual
|
||||
// OFFSET: 0x007F7A60
|
||||
uint32_t ShipPath::LegTimeAccel(float distance) {
|
||||
float invAccel = 1.0f / this->m_accelRate;
|
||||
float accelTime = invAccel * this->m_moveSpeed;
|
||||
float accelDistance = this->m_moveSpeed * 0.5f * accelTime;
|
||||
float time;
|
||||
|
||||
if (0.5f * distance <= accelDistance) {
|
||||
float root = sqrtf(invAccel * distance);
|
||||
time = root + root;
|
||||
} else {
|
||||
time = 2.0f * accelTime + (distance - accelDistance * 2.0f) / this->m_moveSpeed;
|
||||
}
|
||||
|
||||
return static_cast<uint32_t>(time * 1000.0f);
|
||||
}
|
||||
|
||||
// VERIFY: db975c72 manual
|
||||
// OFFSET: 0x007F8660
|
||||
void ShipPath::BuildLeg(ShipPathArray<C3Vector>* points, ShipPathArray<ShipPathPause>* pauses, ShipPathArray<ShipPathEvent>* events, int32_t legIndex) {
|
||||
ShipPathLeg* leg = &this->m_legs.m_data[legIndex];
|
||||
leg->m_spline.SetPoints(points->m_data, points->m_count);
|
||||
leg = &this->m_legs.m_data[legIndex];
|
||||
leg->m_segments.SetCount(pauses->m_count + 1);
|
||||
float prevDistance = 0.0f;
|
||||
this->m_legs.m_data[legIndex].m_duration = 0;
|
||||
uint32_t eventCount = this->m_events.m_count;
|
||||
uint32_t accumDelay = 0;
|
||||
uint32_t eventIndex = 0;
|
||||
this->m_events.SetCount(eventCount + 2 * events->m_count);
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < pauses->m_count; i++) {
|
||||
if (pauses->m_data[i].m_point >= points->m_count - 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (; eventIndex < events->m_count; eventIndex++) {
|
||||
ShipPathEvent* event = &events->m_data[eventIndex];
|
||||
|
||||
if (event->m_point > pauses->m_data[i].m_point) {
|
||||
break;
|
||||
}
|
||||
|
||||
float distance = this->m_legs.m_data[legIndex].m_spline.LengthBeforePoint(event->m_point) - prevDistance;
|
||||
float invAccel = 1.0f / this->m_accelRate;
|
||||
float accelTime = this->m_moveSpeed * invAccel;
|
||||
float time;
|
||||
|
||||
if (i) {
|
||||
float accelDistance = this->m_moveSpeed * 0.5f * accelTime;
|
||||
|
||||
if (accelDistance >= 0.5f * distance) {
|
||||
float root = sqrtf(distance * invAccel);
|
||||
time = root + root;
|
||||
} else {
|
||||
time = 2.0f * accelTime + (distance - accelDistance * 2.0f) / this->m_moveSpeed;
|
||||
}
|
||||
} else {
|
||||
float accelDistance = this->m_moveSpeed * 0.5f * accelTime;
|
||||
|
||||
if (accelDistance >= distance) {
|
||||
time = sqrtf(distance * invAccel + distance * invAccel);
|
||||
} else {
|
||||
time = accelTime + (distance - accelDistance) / this->m_moveSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t eventTime = static_cast<uint32_t>(time * 1000.0f);
|
||||
uint32_t delay = event->m_point == pauses->m_data[i].m_point ? pauses->m_data[i].m_delay : 0;
|
||||
uint32_t base = accumDelay + eventTime + this->m_legs.m_data[legIndex].m_duration;
|
||||
|
||||
if (event->m_arrivalEvent) {
|
||||
this->m_events.m_data[eventCount].m_time = base + this->m_totalPathTime;
|
||||
this->m_events.m_data[eventCount].m_eventId = event->m_arrivalEvent;
|
||||
eventCount++;
|
||||
}
|
||||
|
||||
if (event->m_departureEvent) {
|
||||
this->m_events.m_data[eventCount].m_time = delay + base + this->m_totalPathTime;
|
||||
this->m_events.m_data[eventCount].m_eventId = event->m_departureEvent;
|
||||
eventCount++;
|
||||
}
|
||||
}
|
||||
|
||||
float pauseDistance = this->m_legs.m_data[legIndex].m_spline.LengthBeforePoint(pauses->m_data[i].m_point);
|
||||
float distance = pauseDistance - prevDistance;
|
||||
uint32_t segmentTime;
|
||||
|
||||
if (i) {
|
||||
segmentTime = this->LegTimeAccel(distance);
|
||||
} else {
|
||||
float invAccel = 1.0f / this->m_accelRate;
|
||||
float accelTime = this->m_moveSpeed * invAccel;
|
||||
float accelDistance = this->m_moveSpeed * 0.5f * accelTime;
|
||||
float time = accelDistance >= distance ? sqrtf(distance * invAccel + distance * invAccel) : accelTime + (distance - accelDistance) / this->m_moveSpeed;
|
||||
segmentTime = static_cast<uint32_t>(time * 1000.0f);
|
||||
}
|
||||
|
||||
this->m_legs.m_data[legIndex].m_duration += segmentTime;
|
||||
prevDistance = pauseDistance;
|
||||
ShipPathSegment* segment = &this->m_legs.m_data[legIndex].m_segments.m_data[i];
|
||||
segment->m_time = accumDelay + this->m_legs.m_data[legIndex].m_duration;
|
||||
segment->m_distance = pauseDistance;
|
||||
segment->m_delay = pauses->m_data[i].m_delay;
|
||||
accumDelay += pauses->m_data[i].m_delay;
|
||||
}
|
||||
|
||||
for (; eventIndex < events->m_count; eventIndex++) {
|
||||
ShipPathEvent* event = &events->m_data[eventIndex];
|
||||
float distance = this->m_legs.m_data[legIndex].m_spline.LengthBeforePoint(event->m_point) - prevDistance;
|
||||
uint32_t eventTime;
|
||||
|
||||
if (i) {
|
||||
float invAccel = 1.0f / this->m_accelRate;
|
||||
float accelTime = this->m_moveSpeed * invAccel;
|
||||
float accelDistance = this->m_moveSpeed * 0.5f * accelTime;
|
||||
float time = accelDistance >= distance ? sqrtf(distance * invAccel + distance * invAccel) : accelTime + (distance - accelDistance) / this->m_moveSpeed;
|
||||
eventTime = static_cast<uint32_t>(time * 1000.0f);
|
||||
} else {
|
||||
eventTime = static_cast<uint32_t>(distance / this->m_moveSpeed * 1000.0f);
|
||||
}
|
||||
|
||||
uint32_t base = accumDelay + eventTime + this->m_legs.m_data[legIndex].m_duration;
|
||||
|
||||
if (event->m_arrivalEvent) {
|
||||
this->m_events.m_data[eventCount].m_time = base + this->m_totalPathTime;
|
||||
this->m_events.m_data[eventCount].m_eventId = event->m_arrivalEvent;
|
||||
eventCount++;
|
||||
}
|
||||
|
||||
if (event->m_departureEvent) {
|
||||
this->m_events.m_data[eventCount].m_time = base + this->m_totalPathTime;
|
||||
this->m_events.m_data[eventCount].m_eventId = event->m_departureEvent;
|
||||
eventCount++;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_events.SetCount(eventCount);
|
||||
float length = this->m_legs.m_data[legIndex].m_spline.m_length;
|
||||
float distance = length - prevDistance;
|
||||
uint32_t lastTime;
|
||||
|
||||
if (i) {
|
||||
float invAccel = 1.0f / this->m_accelRate;
|
||||
float accelTime = this->m_moveSpeed * invAccel;
|
||||
float accelDistance = this->m_moveSpeed * 0.5f * accelTime;
|
||||
float time = accelDistance >= distance ? sqrtf(distance * invAccel + distance * invAccel) : accelTime + (distance - accelDistance) / this->m_moveSpeed;
|
||||
lastTime = static_cast<uint32_t>(time * 1000.0f);
|
||||
} else {
|
||||
lastTime = static_cast<uint32_t>(distance / this->m_moveSpeed * 1000.0f);
|
||||
}
|
||||
|
||||
leg = &this->m_legs.m_data[legIndex];
|
||||
leg->m_duration += lastTime;
|
||||
ShipPathSegment* last = &leg->m_segments.m_data[i];
|
||||
last->m_time = accumDelay + leg->m_duration;
|
||||
last->m_distance = length;
|
||||
last->m_delay = 0;
|
||||
leg->m_startTime = this->m_totalPathTime;
|
||||
this->m_totalPathTime += leg->m_segments.m_data[i].m_time;
|
||||
|
||||
for (uint32_t j = 0; j < leg->m_segments.m_count; j++) {
|
||||
leg->m_segments.m_data[j].m_time += leg->m_startTime;
|
||||
}
|
||||
|
||||
leg->m_endTime = this->m_totalPathTime;
|
||||
}
|
||||
|
||||
// VERIFY: c8996cba manual
|
||||
// OFFSET: 0x007F77D0
|
||||
bool ShipPath::TimeInRange(uint32_t start, uint32_t end, uint32_t time) {
|
||||
if (end == start) {
|
||||
return end == time;
|
||||
}
|
||||
|
||||
if (end <= start) {
|
||||
if (time > end && time <= start) {
|
||||
return false;
|
||||
}
|
||||
} else if (time <= start || time > end) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// VERIFY: 0ba77058 auto
|
||||
// OFFSET: 0x007F7840
|
||||
uint32_t ShipPath::GetPathTime(uint32_t time, uint32_t elapsed, int32_t absolute) {
|
||||
uint32_t total = this->m_totalPathTime;
|
||||
|
||||
if (!total) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (absolute) {
|
||||
return time % total;
|
||||
}
|
||||
|
||||
uint32_t pathTime = (time + this->m_timeOffset) % total;
|
||||
|
||||
if (this->m_waiting) {
|
||||
if (this->m_waitReached) {
|
||||
return this->m_waitTime;
|
||||
}
|
||||
|
||||
uint32_t waitTime = this->m_waitTime;
|
||||
|
||||
if (this->TimeInRange(waitTime, (waitTime + elapsed) % total, pathTime)) {
|
||||
pathTime = waitTime;
|
||||
this->m_waitReached = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return pathTime;
|
||||
}
|
||||
|
||||
// VERIFY: 316a0013 manual
|
||||
// OFFSET: 0x007F7660
|
||||
float ShipPath::GetDecelDistance(float t, float segTime, uint32_t* sequence, float* speed) {
|
||||
float accelTime = this->m_moveSpeed / this->m_accelRate;
|
||||
float decelTime = segTime >= accelTime ? accelTime : segTime;
|
||||
float cruiseTime = segTime - decelTime;
|
||||
|
||||
if (t <= cruiseTime) {
|
||||
*sequence = ANIM_SHIP_MOVING;
|
||||
*speed = this->m_moveSpeed;
|
||||
return t * this->m_moveSpeed;
|
||||
}
|
||||
|
||||
float startSpeed = decelTime * this->m_accelRate;
|
||||
float dt = t - cruiseTime;
|
||||
*speed = startSpeed - this->m_accelRate * dt;
|
||||
*sequence = ANIM_SHIP_STOP;
|
||||
return dt * ((startSpeed + startSpeed - this->m_accelRate * dt) * 0.5f) + cruiseTime * this->m_moveSpeed;
|
||||
}
|
||||
|
||||
// VERIFY: b5ad35a3 manual
|
||||
// OFFSET: 0x007F76F0
|
||||
float ShipPath::GetAccelDecelDistance(float t, float segTime, uint32_t* sequence, float* speed) {
|
||||
float accelTime = this->m_moveSpeed / this->m_accelRate;
|
||||
float rampTime = segTime * 0.5f;
|
||||
|
||||
if (rampTime >= accelTime) {
|
||||
rampTime = accelTime;
|
||||
}
|
||||
|
||||
if (t <= segTime - rampTime) {
|
||||
if (rampTime >= t) {
|
||||
float current = this->m_accelRate * t;
|
||||
*speed = current;
|
||||
*sequence = ANIM_SHIP_START;
|
||||
return 0.5f * current * t;
|
||||
}
|
||||
|
||||
*sequence = ANIM_SHIP_MOVING;
|
||||
*speed = this->m_moveSpeed;
|
||||
return accelTime * (0.5f * this->m_moveSpeed) + (t - accelTime) * this->m_moveSpeed;
|
||||
}
|
||||
|
||||
float peak = this->m_accelRate * rampTime;
|
||||
float dt = t - (segTime - rampTime);
|
||||
*speed = peak - this->m_accelRate * dt;
|
||||
*sequence = ANIM_SHIP_STOP;
|
||||
return rampTime * (0.5f * peak) + dt * ((peak * 2.0f - this->m_accelRate * dt) * 0.5f) + (segTime - 2.0f * rampTime) * this->m_moveSpeed;
|
||||
}
|
||||
|
||||
// VERIFY: 5639ad48 manual
|
||||
// OFFSET: 0x007F7B30
|
||||
void ShipPath::GetRollAndPitch(uint32_t time, float speed, float turn, C3Vector* position, float* roll, float* pitch) {
|
||||
const TransportPhysicsRec* physics = this->m_physics;
|
||||
float damp;
|
||||
|
||||
if (speed >= physics->m_speedDampThresh) {
|
||||
damp = 1.0f;
|
||||
} else {
|
||||
float scale = sqrtf(speed * (1.0f / physics->m_speedDampThresh));
|
||||
damp = scale * ((1.0f - physics->m_speedDamp) * scale) + physics->m_speedDamp;
|
||||
}
|
||||
|
||||
if (fabsf(physics->m_waveTimeScale) >= 0.00000023841858f) {
|
||||
uint32_t period = static_cast<uint32_t>(6283.1855f / physics->m_waveTimeScale);
|
||||
position->z = sinf(static_cast<float>(time % period) * 6.2831855f / static_cast<float>(period)) * physics->m_waveAmp * damp + position->z;
|
||||
}
|
||||
|
||||
float bankTurn;
|
||||
|
||||
if (physics->m_maxBankTurnSpeed >= turn) {
|
||||
bankTurn = -physics->m_maxBankTurnSpeed <= turn ? turn : -physics->m_maxBankTurnSpeed;
|
||||
} else {
|
||||
bankTurn = physics->m_maxBankTurnSpeed;
|
||||
}
|
||||
|
||||
float bank = bankTurn * (physics->m_maxBank / physics->m_maxBankTurnSpeed);
|
||||
|
||||
if (fabsf(physics->m_rollTimeScale) < 0.00000023841858f) {
|
||||
*roll = 0.0f;
|
||||
} else {
|
||||
uint32_t period = static_cast<uint32_t>(6283.1855f / physics->m_rollTimeScale);
|
||||
*roll = (bank + sinf(static_cast<float>(time % period) * 6.2831855f / static_cast<float>(period) + 0.5f) * physics->m_rollAmp) * damp;
|
||||
}
|
||||
|
||||
if (fabsf(physics->m_pitchTimeScale) < 0.00000023841858f) {
|
||||
*pitch = 0.0f;
|
||||
} else {
|
||||
uint32_t period = static_cast<uint32_t>(6283.1855f / physics->m_pitchTimeScale);
|
||||
*pitch = damp * (sinf(6.2831855f * static_cast<float>(time % period) / static_cast<float>(period) + 0.2f) * physics->m_pitchAmp);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 0f888a8c auto
|
||||
// OFFSET: 0x007F7DD0
|
||||
void ShipPath::ComputeRollAndPitch(float speed, float facing, float distance, uint32_t leg, float turn, uint32_t time, C3Vector* position, float* roll, float* pitch) {
|
||||
if (speed > 0.0f) {
|
||||
float low = this->m_physics->m_speedDampThresh * 0.15000001f;
|
||||
float high = this->m_physics->m_speedDampThresh * 0.30000001f;
|
||||
|
||||
if (speed < low) {
|
||||
speed = 0.0f;
|
||||
} else if (speed < high) {
|
||||
float scale = (speed - low) / (high - low);
|
||||
speed = speed * (scale * scale);
|
||||
}
|
||||
|
||||
C3Vector vel(0.0f, 0.0f, 0.0f);
|
||||
|
||||
for (int32_t i = 1; i < 5; i++) {
|
||||
float ahead = distance - speed * static_cast<float>(i) * 0.44999999f;
|
||||
|
||||
if (ahead < 0.0f) {
|
||||
ahead = 0.0f;
|
||||
}
|
||||
|
||||
ShipPathLeg* pathLeg = &this->m_legs.m_data[leg];
|
||||
float u = ahead / pathLeg->m_spline.m_length;
|
||||
|
||||
if (u < 0.0f) {
|
||||
u = 0.0f;
|
||||
} else if (u >= 1.0f) {
|
||||
u = 1.0f;
|
||||
}
|
||||
|
||||
pathLeg->m_spline.Vel(u, vel, C3Spline::EVAL_ARCLENGTH);
|
||||
float lengthSq = vel.z * vel.z + vel.y * vel.y + vel.x * vel.x;
|
||||
|
||||
if (lengthSq > 0.00000023841858f) {
|
||||
float inv = 1.0f / sqrtf(lengthSq);
|
||||
vel.x *= inv;
|
||||
vel.y *= inv;
|
||||
vel.z *= inv;
|
||||
}
|
||||
|
||||
float heading = atan2f(-vel.y, -vel.x);
|
||||
float delta = facing - heading;
|
||||
|
||||
if (delta > 3.1415927f) {
|
||||
delta -= 6.2831855f;
|
||||
} else if (delta < -3.1415927f) {
|
||||
delta += 6.2831855f;
|
||||
}
|
||||
|
||||
turn = delta * 2.2222223f + turn;
|
||||
facing = heading;
|
||||
}
|
||||
|
||||
turn *= 0.2f;
|
||||
}
|
||||
|
||||
this->GetRollAndPitch(time, speed, turn, position, roll, pitch);
|
||||
}
|
||||
|
||||
// VERIFY: 6b846269 manual
|
||||
// OFFSET: 0x007F82B0
|
||||
void ShipPath::GetPosition(uint32_t time, uint32_t elapsed, int32_t* mapId, uint32_t* sequence, C3Vector* position, float* facing, uint32_t* leg, float* roll, float* pitch, int32_t absolute) {
|
||||
C44Matrix frame;
|
||||
uint32_t pathTime = this->GetPathTime(time, elapsed, absolute);
|
||||
*sequence = ANIM_STAND;
|
||||
float speed = 0.0f;
|
||||
position->x = 0.0f;
|
||||
position->y = 0.0f;
|
||||
position->z = 0.0f;
|
||||
*facing = 0.0f;
|
||||
|
||||
if (roll && pitch) {
|
||||
*pitch = 0.0f;
|
||||
*roll = 0.0f;
|
||||
}
|
||||
|
||||
*leg = 0;
|
||||
|
||||
if (!this->m_legs.m_count) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (pathTime >= this->m_legs.m_data[*leg].m_endTime) {
|
||||
if (++*leg >= this->m_legs.m_count) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
float prevDistance = 0.0f;
|
||||
ShipPathLeg* pathLeg = &this->m_legs.m_data[*leg];
|
||||
uint32_t startTime = pathLeg->m_startTime;
|
||||
uint32_t seg = 0;
|
||||
float distance;
|
||||
|
||||
if (pathLeg->m_segments.m_count != 1) {
|
||||
ShipPathSegment* segments = pathLeg->m_segments.m_data;
|
||||
|
||||
while (pathTime >= segments[seg].m_time) {
|
||||
if (pathTime - segments[seg].m_time < segments[seg].m_delay) {
|
||||
distance = segments[seg].m_distance;
|
||||
*sequence = ANIM_STAND;
|
||||
goto frame;
|
||||
}
|
||||
|
||||
prevDistance = segments[seg].m_distance;
|
||||
startTime = segments[seg].m_time + segments[seg].m_delay;
|
||||
|
||||
if (++seg >= this->m_legs.m_data[*leg].m_segments.m_count - 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
float t = static_cast<float>(pathTime - startTime) * 0.001f;
|
||||
float segTime = 0.001f * static_cast<float>(pathLeg->m_segments.m_data[seg].m_time - startTime);
|
||||
bool last = seg == pathLeg->m_segments.m_count - 1;
|
||||
float moved;
|
||||
|
||||
if (seg == 0) {
|
||||
if (!last) {
|
||||
moved = this->GetDecelDistance(t, segTime, sequence, &speed);
|
||||
} else {
|
||||
*sequence = ANIM_SHIP_MOVING;
|
||||
speed = this->m_moveSpeed;
|
||||
moved = t * this->m_moveSpeed;
|
||||
}
|
||||
} else if (!last) {
|
||||
moved = this->GetAccelDecelDistance(t, segTime, sequence, &speed);
|
||||
} else {
|
||||
float accelTime = this->m_moveSpeed / this->m_accelRate;
|
||||
float rampTime = accelTime <= segTime ? accelTime : segTime;
|
||||
|
||||
if (rampTime >= t) {
|
||||
*sequence = ANIM_SHIP_START;
|
||||
speed = this->m_accelRate * t;
|
||||
moved = t * (speed * 0.5f);
|
||||
} else {
|
||||
*sequence = ANIM_SHIP_MOVING;
|
||||
moved = accelTime * (this->m_moveSpeed * 0.5f) + (t - accelTime) * this->m_moveSpeed;
|
||||
speed = this->m_moveSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
distance = moved + prevDistance;
|
||||
}
|
||||
|
||||
frame:
|
||||
pathLeg = &this->m_legs.m_data[*leg];
|
||||
float u = distance / pathLeg->m_spline.m_length;
|
||||
|
||||
if (u < 0.0f) {
|
||||
u = 0.0f;
|
||||
} else if (u >= 1.0f) {
|
||||
u = 1.0f;
|
||||
}
|
||||
|
||||
pathLeg->m_spline.Frame(u, frame, C3Spline::EVAL_ARCLENGTH);
|
||||
float x = -frame.a0;
|
||||
float y = -frame.a1;
|
||||
float lengthSq = y * y + x * x;
|
||||
|
||||
if (lengthSq > 0.00000023841858f) {
|
||||
float inv = 1.0f / sqrtf(lengthSq);
|
||||
x *= inv;
|
||||
y *= inv;
|
||||
}
|
||||
|
||||
*facing = atan2f(y, x);
|
||||
position->x = frame.d0;
|
||||
position->y = frame.d1;
|
||||
position->z = frame.d2;
|
||||
|
||||
if (this->m_physics && roll && pitch) {
|
||||
this->ComputeRollAndPitch(speed, *facing, distance, *leg, 0.0f, pathTime, position, roll, pitch);
|
||||
}
|
||||
|
||||
*mapId = this->m_legs.m_data[*leg].m_mapId;
|
||||
}
|
||||
|
||||
+66
-17
@@ -3,34 +3,83 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "Engine/Source/Tempest/C3Spline_CatmullRom.h"
|
||||
|
||||
class C3Vector;
|
||||
class TransportPhysicsRec;
|
||||
|
||||
struct ShipPathSegment {
|
||||
/* 0000 */ uint32_t m_time;
|
||||
/* 0004 */ float m_distance;
|
||||
/* 0008 */ uint32_t m_delay;
|
||||
};
|
||||
|
||||
struct ShipPathTimeEvent {
|
||||
/* 0000 */ uint32_t m_time;
|
||||
/* 0004 */ int32_t m_eventId;
|
||||
};
|
||||
|
||||
struct ShipPathLeg {
|
||||
/* 0000 */ int32_t m_mapId;
|
||||
/* 0004 */ C3Spline_CatmullRom m_spline;
|
||||
/* 01C8 */ uint32_t m_startTime;
|
||||
/* 01CC */ uint32_t m_duration;
|
||||
/* 01D0 */ uint32_t m_endTime;
|
||||
/* 01D4 */ TSGrowableArray<ShipPathSegment> m_segments;
|
||||
};
|
||||
|
||||
struct ShipPathPause {
|
||||
/* 0000 */ uint32_t m_point;
|
||||
/* 0004 */ uint32_t m_delay;
|
||||
};
|
||||
|
||||
struct ShipPathEvent {
|
||||
/* 0000 */ uint32_t m_point;
|
||||
/* 0004 */ int32_t m_arrivalEvent;
|
||||
/* 0008 */ int32_t m_departureEvent;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class ShipPathArray {
|
||||
public:
|
||||
/* 0000 */ uint32_t m_count;
|
||||
/* 0004 */ T* m_data;
|
||||
|
||||
void SetCount(uint32_t count);
|
||||
};
|
||||
|
||||
class ShipPath {
|
||||
public:
|
||||
/* 0000 */ uint32_t unk_0000;
|
||||
/* 0004 */ uint32_t unk_0004;
|
||||
/* 0008 */ uint32_t unk_0008;
|
||||
/* 000C */ uint32_t unk_000C;
|
||||
/* 0010 */ uint32_t unk_0010;
|
||||
/* 0014 */ uint32_t unk_0014;
|
||||
/* 0018 */ uint32_t unk_0018;
|
||||
/* 001C */ uint32_t unk_001C;
|
||||
/* 0020 */ uint32_t unk_0020;
|
||||
/* 0024 */ uint32_t unk_0024;
|
||||
/* 0028 */ float unk_0028;
|
||||
/* 002C */ uint32_t unk_002C;
|
||||
/* 0030 */ float unk_0030;
|
||||
/* 0034 */ uint32_t unk_0034;
|
||||
/* 0038 */ uint32_t unk_0038;
|
||||
/* 003C */ uint8_t unk_003C;
|
||||
/* 003D */ uint8_t unk_003D;
|
||||
/* 0000 */ const TransportPhysicsRec* m_physics;
|
||||
/* 0004 */ uint32_t m_taxiPathId;
|
||||
/* 0008 */ TSGrowableArray<ShipPathLeg> m_legs;
|
||||
/* 0018 */ TSGrowableArray<ShipPathTimeEvent> m_events;
|
||||
/* 0028 */ float m_moveSpeed;
|
||||
/* 002C */ uint32_t m_totalPathTime;
|
||||
/* 0030 */ float m_accelRate;
|
||||
/* 0034 */ uint32_t m_waitTime;
|
||||
/* 0038 */ uint32_t m_timeOffset;
|
||||
/* 003C */ uint8_t m_waiting;
|
||||
/* 003D */ uint8_t m_waitReached;
|
||||
/* 003E */ uint8_t unk_003E;
|
||||
|
||||
ShipPath();
|
||||
void WaitAtNextPausePoint(uint32_t time, bool pause);
|
||||
void Init(uint32_t taxiPathId, float moveSpeed, float accelRate, const TransportPhysicsRec* physics);
|
||||
void SetTotalPathTime(uint32_t time);
|
||||
void BuildLegs();
|
||||
uint32_t LegTimeAccel(float distance);
|
||||
void BuildLeg(ShipPathArray<C3Vector>* points, ShipPathArray<ShipPathPause>* pauses, ShipPathArray<ShipPathEvent>* events, int32_t leg);
|
||||
void SetTimeOffset(uint32_t time, float progress);
|
||||
void WaitAtCurrentLocation(uint32_t time);
|
||||
bool TimeInRange(uint32_t start, uint32_t end, uint32_t time);
|
||||
uint32_t GetPathTime(uint32_t time, uint32_t elapsed, int32_t absolute);
|
||||
float GetDecelDistance(float t, float segTime, uint32_t* sequence, float* speed);
|
||||
float GetAccelDecelDistance(float t, float segTime, uint32_t* sequence, float* speed);
|
||||
void GetRollAndPitch(uint32_t time, float speed, float turn, C3Vector* position, float* roll, float* pitch);
|
||||
void ComputeRollAndPitch(float speed, float facing, float distance, uint32_t leg, float turn, uint32_t time, C3Vector* position, float* roll, float* pitch);
|
||||
void GetPosition(uint32_t time, uint32_t elapsed, int32_t* mapId, uint32_t* sequence, C3Vector* position, float* facing, uint32_t* leg, float* roll, float* pitch, int32_t absolute);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -768,3 +768,77 @@ bool StripHyperlinks(const char* text, char* buffer, uint32_t size) {
|
||||
*dest = 0;
|
||||
return stripped;
|
||||
}
|
||||
|
||||
// VERIFY: ab213c53 auto
|
||||
// OFFSET: 0x0076DD20
|
||||
int32_t NameNeedsDeclensions(int32_t locale, const char* name) {
|
||||
return locale == 8 && RussianNameNeedsDeclensions(name);
|
||||
}
|
||||
|
||||
// VERIFY: a66e9458 auto
|
||||
// OFFSET: 0x0076E270
|
||||
int32_t RussianNameNeedsDeclensions(const char* name) {
|
||||
uint16_t c = 0;
|
||||
SUniConvertUTF8to16(&c, 1, name, 0x7FFFFFFF, nullptr, nullptr);
|
||||
return IsRussian(c);
|
||||
}
|
||||
|
||||
// VERIFY: febf9d45 auto
|
||||
// OFFSET: 0x007E1030
|
||||
bool IsRussian(uint16_t c) {
|
||||
return static_cast<uint16_t>(c - 0x400) <= 0xFF;
|
||||
}
|
||||
|
||||
// VERIFY: 52f9f8af manual
|
||||
// OFFSET: 0x007E17F0
|
||||
static void StripPipes(const char* source, char* dest, uint32_t destSize) {
|
||||
char* out = dest;
|
||||
|
||||
for (; *source; source++) {
|
||||
if (out >= &dest[destSize - 1]) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (*source != '|') {
|
||||
*out++ = *source;
|
||||
}
|
||||
}
|
||||
|
||||
*out = '\0';
|
||||
}
|
||||
|
||||
// VERIFY: d19b42ca manual
|
||||
// OFFSET: 0x007E1830
|
||||
bool ScrubString(const char* source, char* dest, int32_t maxChars, uint32_t destSize, int32_t flags) {
|
||||
if (!dest) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*dest = '\0';
|
||||
|
||||
if (!source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool valid = ValidateStringIsUTF8(source);
|
||||
StripPipes(source, dest, destSize);
|
||||
|
||||
if ((flags & 1) && TruncateNewLines(dest)) {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
int32_t chars = 0;
|
||||
|
||||
for (char* c = dest; *c; c++) {
|
||||
if ((*c & 0xC0) != 0x80) {
|
||||
chars++;
|
||||
}
|
||||
|
||||
if (chars == maxChars) {
|
||||
*c = '\0';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ bool IsAlphaRussian(uint16_t c);
|
||||
int32_t ValidateCharacterNameConst(uint32_t language, const char* name, bool profanity, bool chatProfanity, bool reserved, bool english, int32_t extraLength);
|
||||
int32_t ValidateName(uint32_t language, const uint16_t* allowed, const char* name, uint32_t* length, int32_t* charset, bool profanity, bool chatProfanity, bool reserved, bool relaxed, bool english, int32_t charsetMask);
|
||||
int32_t NameNeedsDeclensions(int32_t locale, const char* name);
|
||||
int32_t RussianNameNeedsDeclensions(const char* name);
|
||||
bool IsRussian(uint16_t c);
|
||||
void ValidateNameDestroy();
|
||||
void ValidateNameInitialize(int32_t localeMask, int32_t charsetMask);
|
||||
|
||||
@@ -31,4 +33,6 @@ uint16_t ToUpper(uint16_t c);
|
||||
uint16_t ToLower(uint16_t c);
|
||||
bool StripHyperlinks(const char* text, char* buffer, uint32_t size);
|
||||
|
||||
bool ScrubString(const char* source, char* dest, int32_t maxChars, uint32_t destSize, int32_t flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,6 +39,14 @@ Liquid::IEnvironment::~IEnvironment() {
|
||||
Liquid::IGeomFactory::~IGeomFactory() {
|
||||
}
|
||||
|
||||
// INLINED
|
||||
Liquid::IWaveManager::~IWaveManager() {
|
||||
}
|
||||
|
||||
// INLINED
|
||||
Liquid::IMaterial::~IMaterial() {
|
||||
}
|
||||
|
||||
// VERIFY: 4b95827e auto
|
||||
// OFFSET: 0x008A1770
|
||||
int32_t Liquid::Initialize(int32_t a1, float a2, int32_t a3, const char* a4, IDatabase<LiquidTypeRec>* liquidTypeDB, IDatabase<LiquidMaterialRec>* liquidMaterialDB) {
|
||||
|
||||
@@ -49,6 +49,7 @@ int32_t IsStillLoading();
|
||||
void LoadingScreenAsyncCallback(float progress, void* param);
|
||||
bool LoadingScreenDrawing();
|
||||
void LoadingScreenDisable();
|
||||
void LoadingScreenEnableShipLeg(int32_t entryId, uint32_t leg);
|
||||
void LoadingScreenEnable(int32_t mapID, bool loadingWorld);
|
||||
void LoadingScreenEnableShip(uint32_t transportEntry, int32_t transportMap, int32_t mapID);
|
||||
void LoadingScreenInitialize();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "WoW/Source/Object/ObjectClient/Player_C.h"
|
||||
#include "WoW/Source/Object/Types.h"
|
||||
#include "WoW/Source/ObjectMgrClient/ObjectMgrClient.h"
|
||||
#include "Engine/Source/Base/CDataAllocator.h"
|
||||
|
||||
// STATIC: 0x00D3F60C
|
||||
static bool s_skillLineLinkInfoDirty;
|
||||
@@ -19,6 +20,9 @@ static TSHashTable<SKILLLINEREC, HASHKEY_SKILLLINE> s_skillLineRecs;
|
||||
// STATIC: 0x00D3F688
|
||||
static TSGrowableArray<SkillLineLinkInfo> s_skillLineLinkInfo;
|
||||
|
||||
// STATIC: 0x00D3F698
|
||||
static CDataAllocator s_skillLineRecAllocator(sizeof(SKILLLINEREC), 0x1000);
|
||||
|
||||
// VERIFY: 87b0816a manual
|
||||
// OFFSET: 0x00810320
|
||||
bool SpellTableMatchRaceClass(int32_t race, int32_t classId, int32_t raceMask, int32_t classMask, int32_t excludeRace, int32_t excludeClass) {
|
||||
@@ -250,3 +254,14 @@ int32_t GetSkillTierCost(const SkillRaceClassInfoRec* info, uint32_t step) {
|
||||
|
||||
return tier->m_cost[step];
|
||||
}
|
||||
|
||||
// VERIFY: e9c3aee4 auto
|
||||
// OFFSET: 0x00810920
|
||||
void SpellTableDestroy() {
|
||||
s_skillLineRecs.Clear();
|
||||
s_skillLineLinkInfoDirty = true;
|
||||
s_raceClassInfo.Clear();
|
||||
s_skillCostsInfo.Clear();
|
||||
s_skillLineRecAllocator.Clear(typeid(SKILLLINEREC).raw_name(), SLOG_OBJECT, 1);
|
||||
s_skillLineLinkInfo.m_count = 0;
|
||||
}
|
||||
|
||||
@@ -306,3 +306,58 @@ void SpellVisualsGetMountTransitionTransform(const MountTransitionObject* transi
|
||||
*up = transition->m_groundNormal;
|
||||
*facing = transition->m_facing;
|
||||
}
|
||||
|
||||
// VERIFY: 77642498 manual
|
||||
// OFFSET: 0x007FCA30
|
||||
void SpellVisualsTick() {
|
||||
uint32_t time = OsGetAsyncTimeMs();
|
||||
LightningObject* lightning = s_lightningObjects.Head();
|
||||
|
||||
while (!s_lightningObjects.IsEnd(lightning)) {
|
||||
LightningObject* next = s_lightningObjects.RawNext(lightning);
|
||||
|
||||
if (!lightning->Tick(time)) {
|
||||
s_lightningObjects.UnlinkNode(lightning);
|
||||
|
||||
if (--lightning->m_refCount == 0) {
|
||||
delete lightning;
|
||||
}
|
||||
}
|
||||
|
||||
lightning = next;
|
||||
}
|
||||
|
||||
float elapsed = 0.0f;
|
||||
|
||||
if (s_unk_AF5090 != -1) {
|
||||
elapsed = static_cast<float>((time - s_unk_AF5090) * 0.001);
|
||||
}
|
||||
|
||||
s_unk_AF5090 = time;
|
||||
s_lightningManager->Update(elapsed);
|
||||
s_eclipse.Update(time);
|
||||
BlizzardObject* blizzard = s_blizzardObjects.Head();
|
||||
|
||||
while (!s_blizzardObjects.IsEnd(blizzard)) {
|
||||
BlizzardObject* next = s_blizzardObjects.RawNext(blizzard);
|
||||
|
||||
if (!blizzard->Update()) {
|
||||
blizzard->~BlizzardObject();
|
||||
s_blizzardObjectHeap.PutData(blizzard, nullptr, 0);
|
||||
}
|
||||
|
||||
blizzard = next;
|
||||
}
|
||||
|
||||
MountTransitionObject* transition = s_mountTransitions.Head();
|
||||
|
||||
while (!s_mountTransitions.IsEnd(transition)) {
|
||||
MountTransitionObject* next = s_mountTransitions.RawNext(transition);
|
||||
|
||||
if (!transition->Tick()) {
|
||||
s_mountTransitions.DeleteNode(transition);
|
||||
}
|
||||
|
||||
transition = next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class BlizzardObject : public TSLinkedNode<BlizzardObject> {
|
||||
|
||||
~BlizzardObject();
|
||||
void SetFrameOfReference(const C44Matrix* matrix);
|
||||
bool Update();
|
||||
};
|
||||
|
||||
class EclipseState {
|
||||
@@ -77,8 +78,10 @@ class LightningObject : public TSLinkedNode<LightningObject> {
|
||||
/* 0050 */ uint32_t unk_0050;
|
||||
/* 0054 */ uint8_t unk_0054[4];
|
||||
/* 0058 */ uint32_t unk_0058;
|
||||
/* 005C */ int32_t m_refCount;
|
||||
|
||||
~LightningObject();
|
||||
bool Tick(uint32_t time);
|
||||
};
|
||||
|
||||
void LightningObjectReleaseRef(LightningObject* object);
|
||||
@@ -109,6 +112,8 @@ class MountTransitionObject : public TSLinkedNode<MountTransitionObject> {
|
||||
/* 0078 */ uint32_t unk_0078;
|
||||
/* 007C */ float m_alpha;
|
||||
/* 0080 */ uint32_t unk_0080;
|
||||
|
||||
bool Tick();
|
||||
};
|
||||
|
||||
extern CVar* s_spellEffectLevelVar;
|
||||
|
||||
@@ -293,7 +293,6 @@ void Spell_C_SpellFailed(PendingSpellCast* cast, const SpellRec* spell, int32_t
|
||||
bool Spell_C_CastSpell(CGUnit_C* caster, int32_t spellId, const CGItem_C* item, WOWGUID target, PendingSpellCast* cast, bool confirmed);
|
||||
void UnitCombatLogCastStart(const WOWGUID& caster, const WOWGUID& target, int32_t spellId);
|
||||
void Spell_C_StopTargeting();
|
||||
void SpellTableDestroy();
|
||||
void SpellTableInitialize();
|
||||
|
||||
int32_t Script_CancelUnitBuff(lua_State* L);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
|
||||
class CDataStore;
|
||||
|
||||
@@ -30,4 +31,21 @@ class CreatureStats {
|
||||
void Unpack(CDataStore* msg);
|
||||
};
|
||||
|
||||
// INLINED
|
||||
inline CreatureStats::~CreatureStats() {
|
||||
for (uint32_t i = 0; i < 4; i++) {
|
||||
if (this->m_name[i]) {
|
||||
SMemFree(this->m_name[i], __FILE__, __LINE__, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->m_subName) {
|
||||
SMemFree(this->m_subName, __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
if (this->m_iconName) {
|
||||
SMemFree(this->m_iconName, __FILE__, __LINE__, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6684,3 +6684,79 @@ void CMovement_C::OnSetRawFacingLocal(uint32_t eventTime, float facing) {
|
||||
int32_t CMovement_C::UpdateTransportStatus(const CClientObjCreate& create) {
|
||||
return this->UpdateTransportStatus(WOWGUID{ CMovementShared::UpdateTransportStatus(create.m_move.m_status) }, create.m_move.m_status.m_transportSeat);
|
||||
}
|
||||
|
||||
// VERIFY: 81c65e19 auto
|
||||
// OFFSET: 0x006EC390
|
||||
void CMovement_C::Disable() {
|
||||
CMovementShared::Disable();
|
||||
this->m_moveQueue.FreeAll();
|
||||
}
|
||||
|
||||
// VERIFY: ba2b58d3 manual
|
||||
// OFFSET: 0x00760720
|
||||
void CMovement_C::CollideWithTransport(uint32_t time, uint32_t elapsed, float distance, const C3Vector& direction, const C44Matrix& transportMatrix) {
|
||||
C3Vector position = this->m_position * transportMatrix;
|
||||
World::IsValidPosition(position.x, position.y, position.z, 0.0f);
|
||||
CAaBox box;
|
||||
box.b = C3Vector(0.0f, 0.0f, 0.0f);
|
||||
box.t = C3Vector(0.0f, 0.0f, 0.0f);
|
||||
this->BuildCollisionBox(position, box);
|
||||
s_queryBox = box;
|
||||
CAaBox moved;
|
||||
moved.b.x = box.b.x + direction.x * distance;
|
||||
moved.b.y = box.b.y + direction.y * distance;
|
||||
moved.b.z = box.b.z + direction.z * distance;
|
||||
moved.t.x = box.t.x + direction.x * distance;
|
||||
moved.t.y = box.t.y + direction.y * distance;
|
||||
moved.t.z = box.t.z + direction.z * distance;
|
||||
s_queryBox |= moved;
|
||||
uint32_t flags = this->m_unit->IsClientControlled() ? 0x111 : 0x2111;
|
||||
CGUnit_C* unit = this->m_unit;
|
||||
|
||||
if ((unit->m_obj->m_type & TYPEMASK_PLAYER) && (static_cast<CGPlayer_C*>(unit)->m_player->m_playerFlags & 0x10)) {
|
||||
flags |= 0x8000;
|
||||
}
|
||||
|
||||
if (!World::GetFacets(&box, &s_queryBox, &s_moveFacets, flags, nullptr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
C4Plane planes[7];
|
||||
|
||||
for (uint32_t i = 0; i < 7; i++) {
|
||||
planes[i].n = C3Vector(0.0f, 0.0f, 1.0f);
|
||||
planes[i].d = 0.0f;
|
||||
}
|
||||
|
||||
uint32_t facetIndex;
|
||||
uint32_t planeCount;
|
||||
float moveDist;
|
||||
this->DistanceToMove(&s_moveFacets, direction, distance, &facetIndex, planes, &planeCount, &moveDist, &position);
|
||||
|
||||
if (facetIndex == s_moveFacets.facets.m_count) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->m_spline && !(this->m_spline->m_flags & SPLINEFLAG_NO_SPLINE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGGameObject_C* transport = static_cast<CGGameObject_C*>(ClntObjMgrObjectPtr(this->m_transportGuid, TYPEMASK_GAMEOBJECT, __FILE__, __LINE__));
|
||||
uint32_t eventTime = static_cast<uint32_t>(static_cast<int64_t>(moveDist / distance * static_cast<float>(elapsed) + 0.5f)) + transport->unk_0200 - elapsed + time;
|
||||
uint32_t transportTime = transport->m_typeData->GetSequenceTimeFromRealTime(eventTime);
|
||||
CMovementGlobals* globals = MovementGetGlobals();
|
||||
uint32_t savedTime = globals->m_transportTime;
|
||||
globals->m_transportTime2 = savedTime;
|
||||
globals->m_transportTime = transportTime;
|
||||
C44Matrix inverse = transportMatrix.AffineInverse();
|
||||
C3Vector localDir = TransformDirection(direction, inverse);
|
||||
C3Vector move(localDir.x * moveDist, localDir.y * moveDist, localDir.z * moveDist);
|
||||
this->m_position.x = move.x + this->m_position.x;
|
||||
this->m_position.y = move.y + this->m_position.y;
|
||||
this->m_position.z = move.z + this->m_position.z;
|
||||
this->m_fallStartZ = move.z + this->m_fallStartZ;
|
||||
this->ForceSetTransport(WOWGUID(), 0xFF, 0);
|
||||
this->QueueFallEvent(eventTime);
|
||||
globals->m_transportTime2 = globals->m_transportTime;
|
||||
globals->m_transportTime = savedTime;
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ class CMovement_C : public CMovementShared {
|
||||
void SendTimeSyncResp(uint32_t clientTime, uint32_t counter);
|
||||
void SetCollisionBox(float width, float height, float scale, float referenceScale, int32_t force);
|
||||
int32_t CollisionBoxDoesntFit(float width, float height, float scale);
|
||||
int32_t CollisionBoxDoesntFit(const CAaBox& box);
|
||||
void SetInterpolation(uint32_t time);
|
||||
void SetSplineFaceAngle(float facing);
|
||||
void SetSplineFacePoint(const C3Vector& point);
|
||||
@@ -258,6 +259,7 @@ class CMovement_C : public CMovementShared {
|
||||
void MoveSplineMoverWithoutCollision(const C3Vector& position, uint32_t time, uint32_t elapsed);
|
||||
int32_t ValidateTestVsFacetQuery(C3Vector move) const;
|
||||
int32_t GetCurrentHoverHeight(float* height, int32_t* noGround, uint64_t* facetId) const;
|
||||
void CollideWithTransport(uint32_t time, uint32_t elapsed, float distance, const C3Vector& direction, const C44Matrix& transportMatrix);
|
||||
int32_t DistanceToMove(World::FacetData* facets, const C3Vector& direction, float distance, uint32_t* facetIndex, C4Plane* planes, uint32_t* planeCount, float* moveDistance, const C3Vector* position) const;
|
||||
void CallMoveEventHandlers(uint32_t time, uint32_t remaining, uint32_t oldFlags, uint32_t oldFlags2, int32_t jumping, int32_t transportChanged);
|
||||
int32_t GetMoveFacets(float distance, uint32_t elapsed, C3Vector direction);
|
||||
|
||||
@@ -2287,3 +2287,29 @@ void CMovementShared::ResetFallOnControlLoss() {
|
||||
this->m_currentSpeed = this->GetBaseSpeed(0);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 6c0feab8 manual
|
||||
// OFFSET: 0x0098C670
|
||||
void CMovementShared::Disable() {
|
||||
this->m_flags2 &= ~0x80;
|
||||
|
||||
if (this->m_spline) {
|
||||
MovementDelSpline(this->m_spline);
|
||||
this->m_spline = nullptr;
|
||||
|
||||
if (!(this->m_flags & 0x1000)) {
|
||||
this->m_currentSpeed = this->GetBaseSpeed(0);
|
||||
}
|
||||
}
|
||||
|
||||
this->m_globalUnitsLink.Unlink();
|
||||
WOWGUID transport = this->m_link.m_next ? this->m_transportGuid : WOWGUID();
|
||||
this->m_link.Unlink();
|
||||
this->m_transportGuid = WOWGUID();
|
||||
|
||||
if (transport != WOWGUID()) {
|
||||
MovementNotifyTransportUnitRemoved(*this->m_ownerGuid, transport, this->m_transportSeat);
|
||||
}
|
||||
|
||||
this->m_flags &= 0x77FFFFFF;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ class CMovementStatus;
|
||||
class CMovementShared : public CPassenger {
|
||||
public:
|
||||
void ResetFallOnControlLoss();
|
||||
void Disable();
|
||||
using CPassenger::GetPosition;
|
||||
|
||||
static float s_terminalVelocity;
|
||||
|
||||
@@ -69,3 +69,18 @@ bool CGGameObject_C_Type_Chair::CanUse() const {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// VERIFY: 9259c9d2 manual
|
||||
// OFFSET: 0x004F55F0
|
||||
void GenerateChairPoints(const C44Matrix& matrix, uint32_t count, C3Vector* points, float offset) {
|
||||
C3Vector point;
|
||||
point.x = 0.0f;
|
||||
point.y = -((static_cast<float>(count) - 1.0f) * 0.5f);
|
||||
point.z = offset;
|
||||
|
||||
for (; count; count--) {
|
||||
*points = point * matrix;
|
||||
point.y += 1.0f;
|
||||
points++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <cstdint>
|
||||
#include "WoW/Source/Object/ObjectClient/GameObject_C.h"
|
||||
|
||||
int32_t GenerateChairPoints(const C44Matrix& matrix, uint32_t count, C3Vector* points, float offset);
|
||||
void GenerateChairPoints(const C44Matrix& matrix, uint32_t count, C3Vector* points, float offset);
|
||||
|
||||
class CGGameObject_C_Type_Chair : public CGGameObject_C_TypeBase {
|
||||
public:
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
#include "WoW/Source/DB/DBClient/DBClient.h"
|
||||
#include "WoW/Source/DB/Rec/TransportAnimationRec.h"
|
||||
#include "WoW/Source/DB/Rec/TransportRotationRec.h"
|
||||
#include "Engine/Source/Tempest/C4Quaternion.h"
|
||||
#include "Engine/Source/Tempest/C44Matrix.h"
|
||||
#include "Engine/Source/Os/TimeManager.h"
|
||||
#include "Engine/Source/Tempest/C33Matrix.h"
|
||||
#include "WoW/Source/Object/Movement.h"
|
||||
#include "WoW/Source/Object/GameObject.h"
|
||||
#include <cmath>
|
||||
#include "WoW/Source/WorldClient/MapEntity.h"
|
||||
|
||||
// VERIFY: 0bbb79ee manual
|
||||
// OFFSET: 0x0070C8C0
|
||||
@@ -187,3 +195,295 @@ void CGGameObject_C_Type_Transport::PostReenable() {
|
||||
World::ObjectSetSequenceFinishedCallback(this->m_worldObject, &CGGameObject_C_Type_WorldObj::SequenceFinishedHandler, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: f1474ba1 manual
|
||||
// OFFSET: 0x00711F20
|
||||
void CGGameObject_C_Type_Transport::InitializeMovement() {
|
||||
CGGameObject_C* owner = this->m_owner;
|
||||
this->unk_0038 = owner->m_gameObject->m_state;
|
||||
uint32_t time = owner->unk_0200 + OsGetAsyncTimeMs();
|
||||
this->InitializeStateChangeTime(time);
|
||||
C3Vector offset(0.0f, 0.0f, 0.0f);
|
||||
C4Quaternion rotation;
|
||||
rotation.x = 0.0f;
|
||||
rotation.y = 0.0f;
|
||||
rotation.z = 0.0f;
|
||||
rotation.w = 1.0f;
|
||||
this->unk_0030 = time;
|
||||
this->Interpolate(time, &offset, &rotation);
|
||||
C3Vector position = this->m_owner->m_passenger.GetPosition(this->m_owner->m_passenger.m_position);
|
||||
this->m_position.x = position.x + offset.x;
|
||||
this->m_position.y = position.y + offset.y;
|
||||
this->m_position.z = position.z + offset.z;
|
||||
CPassenger& passenger = this->m_owner->m_passenger;
|
||||
reinterpret_cast<C4QuaternionCompressed&>(passenger.m_facing) = rotation;
|
||||
passenger.unk_002C |= 0x2;
|
||||
C44Matrix& matrix = this->m_owner->m_matrix;
|
||||
matrix = this->m_owner->GetRotation();
|
||||
matrix.d0 = this->m_position.x;
|
||||
matrix.d1 = this->m_position.y;
|
||||
matrix.d2 = this->m_position.z;
|
||||
}
|
||||
|
||||
// VERIFY: 89bf86e6 auto
|
||||
// OFFSET: 0x00710570
|
||||
uint32_t CGGameObject_C_Type_Transport::GetStateDuration(int32_t state) {
|
||||
uint32_t count = this->m_frameCount;
|
||||
|
||||
if (!count) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t period = this->m_owner->m_gameObject->m_level;
|
||||
|
||||
if (!period) {
|
||||
return this->m_frames[count - 1].m_time;
|
||||
}
|
||||
|
||||
if (state) {
|
||||
return this->m_frames[count - 1].m_time - period;
|
||||
}
|
||||
|
||||
return period;
|
||||
}
|
||||
|
||||
// VERIFY: 5df80093 manual
|
||||
// OFFSET: 0x007105D0
|
||||
void CGGameObject_C_Type_Transport::InitializeStateChangeTime(uint32_t time) {
|
||||
CGGameObjectData* gameObject = this->m_owner->m_gameObject;
|
||||
|
||||
if (gameObject->m_level && this->m_frameCount) {
|
||||
float elapsed = this->GetStateDuration(gameObject->m_state) * (gameObject->m_pathProgress * 0.000015259022f);
|
||||
this->m_stateChangeTime = time - static_cast<uint32_t>(elapsed);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 823a6baf manual
|
||||
// OFFSET: 0x0070DA40
|
||||
uint32_t CGGameObject_C_Type_Transport::ResetStateChange(uint32_t time) {
|
||||
CGGameObjectData* gameObject = this->m_owner->m_gameObject;
|
||||
int32_t state = gameObject->m_state;
|
||||
this->unk_0038 = state;
|
||||
this->m_stateChangeSequenceTime = 0;
|
||||
uint32_t period = gameObject->m_level;
|
||||
|
||||
if (state) {
|
||||
this->m_stateChangeTime = time + period - this->m_frames[this->m_frameCount - 1].m_time;
|
||||
return 0;
|
||||
}
|
||||
|
||||
this->m_stateChangeTime = time - period;
|
||||
return period;
|
||||
}
|
||||
|
||||
// VERIFY: 0fdff1cd manual
|
||||
// OFFSET: 0x0070DAA0
|
||||
C3Vector CGGameObject_C_Type_Transport::GetMovement(uint32_t time) {
|
||||
if (this->m_frameCount <= 1) {
|
||||
return C3Vector(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
uint32_t next = this->m_frameCount != this->unk_0048 + 1 ? this->unk_0048 + 1 : 0;
|
||||
TransportFrame* current;
|
||||
TransportFrame* following;
|
||||
|
||||
while (true) {
|
||||
following = &this->m_frames[next];
|
||||
current = &this->m_frames[this->unk_0048];
|
||||
|
||||
if (time >= current->m_time && time < following->m_time) {
|
||||
break;
|
||||
}
|
||||
|
||||
this->unk_0048 = next;
|
||||
next = this->m_frameCount != next + 1 ? next + 1 : 0;
|
||||
}
|
||||
|
||||
float t = static_cast<float>(time - current->m_time) / static_cast<float>(following->m_time - current->m_time);
|
||||
|
||||
if (this->m_worldObject) {
|
||||
uint32_t sequence = current->m_sequenceId;
|
||||
|
||||
if (sequence != this->unk_0058) {
|
||||
CGGameObject_C* owner = this->m_owner;
|
||||
this->unk_0058 = sequence;
|
||||
World::ObjectSetSequence(this->m_worldObject, sequence, 0, 0);
|
||||
owner->UpdateObjectEffectAnimationStates(sequence);
|
||||
}
|
||||
}
|
||||
|
||||
C33Matrix rotation(reinterpret_cast<const C4Quaternion&>(this->m_owner->m_gameObject->m_parentRotation));
|
||||
float inverse = 1.0f - t;
|
||||
float x = t * following->m_pos[0] + current->m_pos[0] * inverse;
|
||||
float y = following->m_pos[1] * t + current->m_pos[1] * inverse;
|
||||
float z = inverse * current->m_pos[2] + following->m_pos[2] * t;
|
||||
C3Vector result;
|
||||
result.x = rotation.c0 * z + rotation.b0 * y + x * rotation.a0;
|
||||
result.y = rotation.c1 * z + rotation.b1 * y + rotation.a1 * x;
|
||||
result.z = z * rotation.c2 + y * rotation.b2 + x * rotation.a2;
|
||||
return result;
|
||||
}
|
||||
|
||||
// VERIFY: 06adb4af manual
|
||||
// OFFSET: 0x0070DC10
|
||||
C4Quaternion CGGameObject_C_Type_Transport::GetRotation(uint32_t time) {
|
||||
uint32_t count = this->m_rotationCount;
|
||||
|
||||
if (count <= 1) {
|
||||
return this->m_owner->GetRotation();
|
||||
}
|
||||
|
||||
uint32_t next = this->unk_0054 + 1 != count ? this->unk_0054 + 1 : 0;
|
||||
TransportRotationRec* current = &this->m_rotations[this->unk_0054];
|
||||
TransportRotationRec* following = &this->m_rotations[next];
|
||||
uint32_t endTime = following->m_timeIndex;
|
||||
|
||||
if (!endTime && this->m_frames) {
|
||||
endTime = this->m_frames[this->m_frameCount - 1].m_time;
|
||||
}
|
||||
|
||||
while (!(time >= static_cast<uint32_t>(current->m_timeIndex) && time < endTime)) {
|
||||
this->unk_0054 = next;
|
||||
next = this->m_rotationCount != next + 1 ? next + 1 : 0;
|
||||
current = &this->m_rotations[this->unk_0054];
|
||||
following = &this->m_rotations[next];
|
||||
endTime = following->m_timeIndex;
|
||||
|
||||
if (!endTime && this->m_frames) {
|
||||
endTime = this->m_frames[this->m_frameCount - 1].m_time;
|
||||
}
|
||||
}
|
||||
|
||||
float t = static_cast<float>(time - current->m_timeIndex) / static_cast<float>(following->m_timeIndex - current->m_timeIndex);
|
||||
C4Quaternion rotation = C4Quaternion::Slerp(t, reinterpret_cast<const C4Quaternion&>(current->m_rot), reinterpret_cast<const C4Quaternion&>(following->m_rot));
|
||||
return rotation * reinterpret_cast<const C4Quaternion&>(this->m_owner->m_gameObject->m_parentRotation);
|
||||
}
|
||||
|
||||
// VERIFY: 007eb5fe auto
|
||||
// OFFSET: 0x007106D0
|
||||
void CGGameObject_C_Type_Transport::Interpolate(uint32_t time, C3Vector* offset, C4Quaternion* rotation) {
|
||||
int32_t state = this->m_owner->m_gameObject->m_state;
|
||||
uint32_t sequenceTime = this->GetSequenceTimeFromRealTime(state, time);
|
||||
|
||||
if (this->m_stateChangeSequenceTime) {
|
||||
int32_t current = this->unk_0038;
|
||||
|
||||
if (current != state || current) {
|
||||
if (!sequenceTime) {
|
||||
sequenceTime = this->ResetStateChange(time);
|
||||
}
|
||||
} else if (sequenceTime == this->m_owner->m_gameObject->m_level) {
|
||||
sequenceTime = this->ResetStateChange(time);
|
||||
}
|
||||
}
|
||||
|
||||
*offset = this->GetMovement(sequenceTime);
|
||||
*rotation = this->GetRotation(sequenceTime);
|
||||
}
|
||||
|
||||
// VERIFY: 6f1084da manual
|
||||
// OFFSET: 0x0070C650
|
||||
C44Matrix& CGGameObject_C_Type_Transport::UpdateOwnerMatrix() {
|
||||
C44Matrix& matrix = this->m_owner->m_matrix;
|
||||
matrix = this->m_owner->GetRotation();
|
||||
matrix.d0 = this->m_position.x;
|
||||
matrix.d1 = this->m_position.y;
|
||||
matrix.d2 = this->m_position.z;
|
||||
return matrix;
|
||||
}
|
||||
|
||||
// VERIFY: fc8ecef3 manual
|
||||
// OFFSET: 0x007139E0
|
||||
void CGGameObject_C_Type_Transport::UpdateMovement(uint32_t time, uint32_t elapsed) {
|
||||
if (!this->unk_0034 && this->m_worldObject && World::ObjectIsLoaded(this->m_worldObject)) {
|
||||
this->unk_0034 = 1;
|
||||
|
||||
if (!this->m_frameCount && !this->m_rotationCount) {
|
||||
World::ObjectUpdate(this->m_worldObject, this->m_owner->GetMatrix());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t step = elapsed;
|
||||
|
||||
if (elapsed > 250) {
|
||||
CGGameObject_C* owner = this->m_owner;
|
||||
uint32_t pathTime = owner->unk_0200 + time - 250;
|
||||
this->unk_0030 = pathTime;
|
||||
|
||||
if (owner->m_gameObject->m_level && static_cast<int32_t>(this->m_stateChangeTime - pathTime) >= 0) {
|
||||
this->unk_0030 = this->m_stateChangeTime;
|
||||
}
|
||||
|
||||
C3Vector offset(0.0f, 0.0f, 0.0f);
|
||||
C4Quaternion rotation;
|
||||
rotation.x = 0.0f;
|
||||
rotation.y = 0.0f;
|
||||
rotation.z = 0.0f;
|
||||
rotation.w = 1.0f;
|
||||
this->Interpolate(this->unk_0030, &offset, &rotation);
|
||||
CPassenger& passenger = this->m_owner->m_passenger;
|
||||
reinterpret_cast<C4QuaternionCompressed&>(passenger.m_facing) = rotation;
|
||||
passenger.unk_002C |= 0x2;
|
||||
C3Vector position = this->m_owner->m_passenger.GetPosition(this->m_owner->m_passenger.m_position);
|
||||
step = 250;
|
||||
this->m_position.x = position.x + offset.x;
|
||||
this->m_position.y = position.y + offset.y;
|
||||
this->m_position.z = position.z + offset.z;
|
||||
}
|
||||
|
||||
this->unk_0030 = this->m_owner->unk_0200 + time;
|
||||
this->m_transportUpdateTime = this->GetSequenceTimeFromRealTime(this->unk_0038, this->unk_0030);
|
||||
C3Vector offset(0.0f, 0.0f, 0.0f);
|
||||
C4Quaternion rotation;
|
||||
rotation.x = 0.0f;
|
||||
rotation.y = 0.0f;
|
||||
rotation.z = 0.0f;
|
||||
rotation.w = 1.0f;
|
||||
this->Interpolate(this->unk_0030, &offset, &rotation);
|
||||
C3Vector base = this->m_owner->m_passenger.GetPosition(this->m_owner->m_passenger.m_position);
|
||||
C3Vector position(base.x + offset.x, base.y + offset.y, base.z + offset.z);
|
||||
C3Vector direction(0.0f, 0.0f, 0.0f);
|
||||
float speed = this->UpdateCurrentVelocity(step, position, &direction);
|
||||
|
||||
if (this->m_passengers.Head()) {
|
||||
if (fabs(speed) >= 0.00000095367432f) {
|
||||
if (this->m_worldObject && !World::ObjectIsWMO(this->m_worldObject)) {
|
||||
C44Matrix& matrix = this->UpdateOwnerMatrix();
|
||||
|
||||
for (CPassenger* passenger = this->m_passengers.Head(); passenger; passenger = this->m_passengers.Next(passenger)) {
|
||||
if (passenger->unk_002C & 0x1) {
|
||||
static_cast<CMovement_C*>(passenger)->CollideWithTransport(time, step, speed, direction, matrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this->m_position = position;
|
||||
}
|
||||
|
||||
CPassenger& passenger = this->m_owner->m_passenger;
|
||||
reinterpret_cast<C4QuaternionCompressed&>(passenger.m_facing) = rotation;
|
||||
passenger.unk_002C |= 0x2;
|
||||
C44Matrix& matrix = this->m_owner->m_matrix;
|
||||
matrix = this->m_owner->GetRotation();
|
||||
matrix.d0 = this->m_position.x;
|
||||
matrix.d1 = this->m_position.y;
|
||||
matrix.d2 = this->m_position.z;
|
||||
int32_t moved = time;
|
||||
this->MovePassengers(&moved);
|
||||
} else {
|
||||
this->m_position = position;
|
||||
CPassenger& passenger = this->m_owner->m_passenger;
|
||||
reinterpret_cast<C4QuaternionCompressed&>(passenger.m_facing) = rotation;
|
||||
passenger.unk_002C |= 0x2;
|
||||
C44Matrix& matrix = this->m_owner->m_matrix;
|
||||
matrix = this->m_owner->GetRotation();
|
||||
matrix.d0 = this->m_position.x;
|
||||
matrix.d1 = this->m_position.y;
|
||||
matrix.d2 = this->m_position.z;
|
||||
|
||||
if (this->m_worldObject) {
|
||||
World::ObjectUpdate(this->m_worldObject, matrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,8 @@ struct TransportFrame {
|
||||
/* 0000 */ uint32_t unk_0000;
|
||||
/* 0004 */ uint32_t unk_0004;
|
||||
/* 0008 */ uint32_t m_time;
|
||||
/* 000C */ uint32_t unk_000C;
|
||||
/* 0010 */ uint32_t unk_0010;
|
||||
/* 0014 */ uint32_t unk_0014;
|
||||
/* 0018 */ uint32_t unk_0018;
|
||||
/* 000C */ float m_pos[3];
|
||||
/* 0018 */ uint32_t m_sequenceId;
|
||||
};
|
||||
|
||||
class CGGameObject_C_Type_Transport : public CGGameObject_C_Type_TransportBase {
|
||||
@@ -39,6 +37,13 @@ class CGGameObject_C_Type_Transport : public CGGameObject_C_Type_TransportBase {
|
||||
CGGameObject_C_Type_Transport(CGGameObject_C* owner);
|
||||
uint32_t GetSequenceTimeFromRealTime(int32_t state, uint32_t time) const;
|
||||
void InitializeMovement();
|
||||
void InitializeStateChangeTime(uint32_t time);
|
||||
void Interpolate(uint32_t time, C3Vector* offset, C4Quaternion* rotation);
|
||||
uint32_t GetStateDuration(int32_t state);
|
||||
uint32_t ResetStateChange(uint32_t time);
|
||||
C3Vector GetMovement(uint32_t time);
|
||||
C4Quaternion GetRotation(uint32_t time);
|
||||
C44Matrix& UpdateOwnerMatrix();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -73,6 +73,13 @@
|
||||
#include "Engine/Source/ConsoleBase/ConsoleVar.h"
|
||||
#include "WoW/Source/DB/Rec/GameObjectDisplayInfoRec.h"
|
||||
#include "WoW/Source/Ui/PartyFrame.h"
|
||||
#include "WoW/Source/DB/Rec/SpellEffectCameraShakesRec.h"
|
||||
#include "WoW/Source/Ui/WorldFrame.h"
|
||||
#include "WoW/Source/UIUtil/Camera.h"
|
||||
#include "Engine/Source/Os/TimeManager.h"
|
||||
#include "WoW/Source/LoadingScreen.h"
|
||||
#include "Engine/Source/Services/AsyncFile.h"
|
||||
#include "Engine/Source/Tempest/C4Quaternion.h"
|
||||
|
||||
// STATIC: 0x00A335E8
|
||||
static const uint32_t s_oneShotAnims[7] = { 0xFFFFFFFF, 0, 8, 9, 10, 11, 12 };
|
||||
@@ -2443,3 +2450,327 @@ bool CGGameObject_C_TypeBase::CanUse() const {
|
||||
void CGGameObject_C_TypeAnimated::HandleAnimEvent(uint32_t eventId, uint32_t data, const C3Vector& position, uint32_t time) {
|
||||
GameObject_C_ProcessAnimEvent(eventId, this->m_owner->m_gameObject->m_displayID, data, position, &this->m_sound);
|
||||
}
|
||||
|
||||
// VERIFY: c5be7d0b manual
|
||||
// OFFSET: 0x007110B0
|
||||
CMapEntity* CGGameObject_C::CreateWorldObject(uint64_t guid, int32_t a4, uint32_t doodadSetCount, const int16_t* doodadSets) {
|
||||
const char* name = this->GetModelFileNameInternal();
|
||||
|
||||
if (!name) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
C3Vector position = this->m_passenger.GetPosition(this->m_passenger.m_position);
|
||||
CMapBaseObj* object = CWorld::ObjectCreate(name, position, this->GetFacing(), a4, 0, guid, doodadSetCount, doodadSets, nullptr, 0);
|
||||
|
||||
if (!object) {
|
||||
SysMsgPrintf(STATUS_ERROR, 2, "Game object (%d): failed to load: \"%s\"", this->m_obj->m_entryID, name);
|
||||
}
|
||||
|
||||
return static_cast<CMapEntity*>(object);
|
||||
}
|
||||
|
||||
// VERIFY: b54abd63 auto
|
||||
// OFFSET: 0x00711A10
|
||||
void CGGameObject_C_Type_WorldObj::CreateWorldObj() {
|
||||
switch (this->m_owner->m_gameObject->m_typeID) {
|
||||
case 11:
|
||||
case 15:
|
||||
case 35:
|
||||
this->m_worldObject = this->m_owner->CreateWorldObject(this->m_owner->m_obj->m_guid.m_guid, 0, 0, nullptr);
|
||||
|
||||
if (this->m_worldObject && this->m_owner->m_gameObject->m_typeID == 11) {
|
||||
World::ObjectSetMoveable(this->m_worldObject, 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 33:
|
||||
return;
|
||||
|
||||
default:
|
||||
this->m_worldObject = this->m_owner->CreateWorldObject(0, 0, 0, nullptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 9c0b3858 auto
|
||||
// OFFSET: 0x007100D0
|
||||
void CGGameObject_C_Type_MapObjTransport::InitializeMovement() {
|
||||
uint32_t time = OsGetAsyncTimeMs();
|
||||
CGGameObject_C* owner = this->m_owner;
|
||||
uint32_t index = CGameObjectDef::GetPropNum(owner->m_gameObject->m_typeID, 128);
|
||||
GameObjectStats* stats = owner->m_stats;
|
||||
|
||||
if (stats && index < 24 && stats->m_propValue[index]) {
|
||||
uint32_t offsetTime = time + this->m_owner->unk_0200;
|
||||
this->m_shipPath.SetTimeOffset(offsetTime, this->m_owner->m_gameObject->m_pathProgress * 0.000015259022f);
|
||||
CGGameObjectData* gameObject = this->m_owner->m_gameObject;
|
||||
|
||||
if (gameObject->m_dynamicFlags & 0x10) {
|
||||
this->m_shipPath.WaitAtCurrentLocation(offsetTime);
|
||||
} else {
|
||||
this->m_shipPath.WaitAtNextPausePoint(offsetTime, gameObject->m_state == 1);
|
||||
}
|
||||
}
|
||||
|
||||
this->UpdateMovement(time, 0);
|
||||
}
|
||||
|
||||
// VERIFY: ccfc2763 manual
|
||||
// OFFSET: 0x0070D7E0
|
||||
void CGGameObject_C_TypeAnimated::HandleAnimFinished() {
|
||||
int32_t state = this->m_animState;
|
||||
int32_t pending = this->unk_0014;
|
||||
this->unk_0014 = -1;
|
||||
|
||||
switch (state) {
|
||||
case 0:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
if (!(this->m_owner->m_modelFlags & 0x100000)) {
|
||||
this->UpdateState(this->m_owner->m_displayState, this->m_owner->m_displayState);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 3:
|
||||
case 6:
|
||||
this->SetSequence(this->m_owner->m_worldModel);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this->UpdateAnimState(3);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 7:
|
||||
this->UpdateAnimState(1);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
this->UpdateAnimState(6);
|
||||
break;
|
||||
}
|
||||
|
||||
if (pending != -1 && pending != 3 && pending != 1 && pending != 6) {
|
||||
ClntObjMgrUnlockObject(this->m_owner->m_obj->m_guid, __FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 96d91adb auto
|
||||
// OFFSET: 0x0070BF70
|
||||
static void GameObject_C_PlayAnimatedSound(uint32_t displayId, int32_t index, const C3Vector& position, SE2SoundKitObject* sound) {
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
GameObjectDisplayInfoRec* displayInfo = g_gameObjectDisplayInfoDB.GetRecord(displayId);
|
||||
|
||||
if (!displayInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t soundKitId = displayInfo->m_sound[index];
|
||||
SE2SoundKitProperties properties;
|
||||
|
||||
if (!SI2::IsSoundKitLooping(soundKitId)) {
|
||||
properties.ResetToDefaults();
|
||||
properties.m_maxAudibleBehavior = 0;
|
||||
SI2::PlaySoundKit(soundKitId, &position, nullptr, &properties, 0, nullptr, 1, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sound || SI2::IsPlaying(sound) || SI2::IsTooCloseToExistingSoundKit(soundKitId, &position)) {
|
||||
return;
|
||||
}
|
||||
|
||||
properties.ResetToDefaults();
|
||||
properties.m_loopMode = 1;
|
||||
properties.m_streaming = true;
|
||||
properties.m_software = 1;
|
||||
properties.m_maxAudibleBehavior = 0;
|
||||
SI2::PlaySoundKit(soundKitId, &position, sound, &properties, 0, nullptr, 1, 0);
|
||||
}
|
||||
|
||||
// VERIFY: cfabb88c auto
|
||||
// OFFSET: 0x0070C050
|
||||
void GameObject_C_ProcessAnimEvent(uint32_t eventId, uint32_t displayId, uint32_t data, const C3Vector& position, SE2SoundKitObject* sound) {
|
||||
switch (eventId) {
|
||||
case '0OG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 0, position, sound);
|
||||
break;
|
||||
|
||||
case '1OG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 1, position, sound);
|
||||
break;
|
||||
|
||||
case '2OG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 2, position, sound);
|
||||
break;
|
||||
|
||||
case '3OG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 3, position, sound);
|
||||
break;
|
||||
|
||||
case '4OG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 4, position, sound);
|
||||
break;
|
||||
|
||||
case '5OG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 5, position, sound);
|
||||
break;
|
||||
|
||||
case '0CG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 6, position, sound);
|
||||
break;
|
||||
|
||||
case '1CG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 7, position, sound);
|
||||
break;
|
||||
|
||||
case '2CG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 8, position, sound);
|
||||
break;
|
||||
|
||||
case '3CG$':
|
||||
GameObject_C_PlayAnimatedSound(displayId, 9, position, sound);
|
||||
break;
|
||||
|
||||
case 'DNS$':
|
||||
case 'OSD$':
|
||||
SI2::PlaySoundKit(data, &position, nullptr, nullptr, 0, nullptr, 1, 0);
|
||||
break;
|
||||
|
||||
case 'LSD$':
|
||||
if (sound && !SI2::IsPlaying(sound) && !SI2::IsTooCloseToExistingSoundKit(data, &position)) {
|
||||
SE2SoundKitProperties properties;
|
||||
properties.ResetToDefaults();
|
||||
properties.m_fadeInTime = 1.0f;
|
||||
properties.m_fadeOutTime = 1.0f;
|
||||
properties.m_loopMode = 1;
|
||||
properties.m_maxAudibleBehavior = 0;
|
||||
properties.m_streaming = true;
|
||||
properties.m_software = 1;
|
||||
SI2::PlaySoundKit(data, &position, sound, &properties, 0, nullptr, 1, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'KHS$': {
|
||||
SpellEffectCameraShakesRec* shakes = g_spellEffectCameraShakesDB.GetRecord(data);
|
||||
|
||||
if (shakes) {
|
||||
for (int32_t i = 0; i < 3; i++) {
|
||||
CGWorldFrame::GetActiveCamera()->AddShakeById(shakes->m_cameraShake[i], &position);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 11b423bd manual
|
||||
// OFFSET: 0x007134A0
|
||||
void CGGameObject_C_Type_MapObjTransport::UpdateMovement(uint32_t time, uint32_t elapsed) {
|
||||
C3Vector position(0.0f, 0.0f, 0.0f);
|
||||
int32_t mapId = -1;
|
||||
int32_t initial = this->unk_0038 == -1;
|
||||
uint32_t pathTime = this->m_owner->unk_0200 + time;
|
||||
uint32_t sequence;
|
||||
float facing;
|
||||
uint32_t leg;
|
||||
float roll;
|
||||
float pitch;
|
||||
this->m_shipPath.GetPosition(pathTime, elapsed, &mapId, &sequence, &position, &facing, &leg, &roll, &pitch, 0);
|
||||
|
||||
if (mapId != static_cast<int32_t>(ClntObjMgrGetMapID())) {
|
||||
CGUnit_C* mover = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(CGUnit_C::s_activeMover, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (mover && mover->GetTransportGUID() == this->m_owner->m_obj->m_guid.m_guid) {
|
||||
MovementSetTransportUpdateTime(this->m_transportUpdateTime);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this->unk_0030 = pathTime;
|
||||
this->m_transportUpdateTime = this->GetSequenceTimeFromRealTime(pathTime);
|
||||
this->UpdateCurrentVelocity(elapsed, position, nullptr);
|
||||
this->m_position = position;
|
||||
C44Matrix& matrix = this->m_owner->m_matrix;
|
||||
matrix.d3 = 1.0f;
|
||||
matrix.c2 = 1.0f;
|
||||
matrix.b1 = 1.0f;
|
||||
matrix.a0 = 1.0f;
|
||||
matrix.d2 = 0.0f;
|
||||
matrix.d1 = 0.0f;
|
||||
matrix.d0 = 0.0f;
|
||||
matrix.c3 = 0.0f;
|
||||
matrix.c1 = 0.0f;
|
||||
matrix.c0 = 0.0f;
|
||||
matrix.b3 = 0.0f;
|
||||
matrix.b2 = 0.0f;
|
||||
matrix.b0 = 0.0f;
|
||||
matrix.a3 = 0.0f;
|
||||
matrix.a2 = 0.0f;
|
||||
matrix.a1 = 0.0f;
|
||||
matrix.d0 = this->m_position.x;
|
||||
matrix.d1 = this->m_position.y;
|
||||
matrix.d2 = this->m_position.z;
|
||||
matrix.RotateAroundZ(facing);
|
||||
matrix.RotateAroundY(pitch);
|
||||
matrix.RotateAroundX(roll);
|
||||
CGGameObject_C* owner = this->m_owner;
|
||||
C4Quaternion rotation;
|
||||
rotation.x = 0.0f;
|
||||
rotation.y = 0.0f;
|
||||
rotation.z = 0.0f;
|
||||
rotation.w = 0.0f;
|
||||
rotation.FromRotationMatrix(owner->m_matrix);
|
||||
reinterpret_cast<C4QuaternionCompressed&>(owner->m_passenger.m_facing) = rotation;
|
||||
owner->m_passenger.unk_002C |= 0x2;
|
||||
|
||||
if (this->m_worldObject) {
|
||||
World::ObjectUpdate(this->m_worldObject, matrix);
|
||||
|
||||
if (!this->unk_0034 && World::ObjectIsLoaded(this->m_worldObject)) {
|
||||
World::ObjectSetSequenceFinishedCallback(this->m_worldObject, CGGameObject_C_Type_WorldObj::SequenceFinishedHandler, 0, 0);
|
||||
this->unk_0034 = 1;
|
||||
}
|
||||
|
||||
if (this->unk_0034 && this->unk_0038 != static_cast<int32_t>(sequence)) {
|
||||
World::ObjectSetSequence(this->m_worldObject, sequence, 0, 0);
|
||||
this->unk_0038 = sequence;
|
||||
this->UpdateObjectEffectState(sequence);
|
||||
}
|
||||
}
|
||||
|
||||
int32_t moved;
|
||||
this->MovePassengers(&moved);
|
||||
uint32_t previousLeg = this->unk_0080;
|
||||
|
||||
if (previousLeg == leg) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->unk_0080 = leg;
|
||||
|
||||
if (!moved || initial) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGUnit_C* target = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(CGWorldFrame::GetActiveCamera()->m_targetGUID, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
AsyncFileReadSetProgressCallback(LoadingScreenAsyncCallback, nullptr);
|
||||
World::SetLoadProgressCallback(LoadingScreenWorldCallback, nullptr);
|
||||
LoadingScreenEnableShipLeg(this->m_owner->m_obj->m_entryID, previousLeg);
|
||||
World::Preload(target->GetPosition(), 0);
|
||||
CGObject_C::UpdateAllWorldObjects();
|
||||
LoadingScreenDisable();
|
||||
AsyncFileReadSetProgressCallback(nullptr, nullptr);
|
||||
World::SetLoadProgressCallback(nullptr, nullptr);
|
||||
}
|
||||
|
||||
@@ -323,6 +323,8 @@ class CGGameObject_C : public CGObject_C, public CGGameObject {
|
||||
int32_t CanUseNow() const;
|
||||
int32_t CheckRange() const;
|
||||
void CloseInteraction();
|
||||
void UseObject();
|
||||
CMapEntity* CreateWorldObject(uint64_t guid, int32_t a4, uint32_t doodadSetCount, const int16_t* doodadSets);
|
||||
void AddWorldDamageText(int32_t amount);
|
||||
void AddWorldHealingText(int32_t amount, int32_t overheal);
|
||||
const char* GetCloseText() const;
|
||||
|
||||
@@ -1844,3 +1844,21 @@ int32_t CGItem_C::CanGoInSlot(int32_t itemId, uint32_t slot, int32_t bypass) {
|
||||
int32_t CGItem_C::CanGoInSlot(uint32_t slot, int32_t bypass) {
|
||||
return CGItem_C::CanGoInSlot(this->m_obj->m_entryID, slot, bypass);
|
||||
}
|
||||
|
||||
// VERIFY: f2b21d47 auto
|
||||
// OFFSET: 0x00709DE0
|
||||
int32_t GetItemIDByName(const char* name) {
|
||||
const char* link = SStrStr(name, "item:");
|
||||
|
||||
if (link) {
|
||||
return SStrToInt(link + 5);
|
||||
}
|
||||
|
||||
ITEMBYNAME* entry = s_itemByName.Ptr(name);
|
||||
|
||||
if (entry) {
|
||||
return entry->m_itemId;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,11 @@ CMissile* CMissile::s_inFlightMissileList;
|
||||
// STATIC: 0x00CA0B5C
|
||||
CMissile* CMissile::s_missileDestroyList;
|
||||
|
||||
// STATIC: 0x00CA0AF8
|
||||
static double s_msfNumbers[12];
|
||||
|
||||
// STATIC: 0x00ADA828
|
||||
static SimpleScriptIO s_msfIO;
|
||||
static SimpleScriptIO s_msfIO(s_msfNumbers, 12);
|
||||
|
||||
// STATIC: 0x00ADA7C0
|
||||
static const char* s_msfArgs[] = { "progress", "time", "missileIndex", "missileCount", "distanceToFirePos", "distanceToImpactPos", "startDistance", "totalDistance", "rand1", "rand2", "rand3", "spellID", nullptr };
|
||||
|
||||
@@ -112,6 +112,11 @@
|
||||
#include "WoW/Source/Client.h"
|
||||
#include <cmath>
|
||||
#include "WoW/Source/Ui/ScriptEvents.h"
|
||||
#include "WoW/Source/Game/GameClient/CDrawBowString.h"
|
||||
#include "WoW/Source/DB/Rec/ItemDisplayInfoRec.h"
|
||||
#include "WoW/Source/Game/ValidateName.h"
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
struct GUILDUPDATETIMESTAMP {
|
||||
/* 0000 */ uint32_t m_guildId;
|
||||
@@ -9177,6 +9182,42 @@ int32_t AreaTriggerCheck(const void* data, void* param) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 6fcd5d9e auto
|
||||
// OFFSET: 0x006D7720
|
||||
int32_t CGPlayer_C::UpdateMountedCollisionBox(float mountHeight, int32_t force) {
|
||||
CreatureDisplayInfoRec* displayInfo = g_creatureDisplayInfoDB.GetRecord(this->m_unit->m_unitFieldNativedisplayid);
|
||||
CreatureModelDataRec* modelData = displayInfo ? g_creatureModelDataDB.GetRecord(displayInfo->m_modelID) : nullptr;
|
||||
|
||||
if (!modelData) {
|
||||
SErrDisplayAppFatalMessage("", "", 0);
|
||||
}
|
||||
|
||||
float modelScale;
|
||||
float scale = this->GetScaledModelScale(displayInfo, modelData, &modelScale);
|
||||
float height = this->m_mountScale * mountHeight + modelData->m_collisionHeight * 0.5f;
|
||||
|
||||
if (height <= modelData->m_collisionHeight) {
|
||||
height = modelData->m_collisionHeight;
|
||||
} else if (!force && this->IsActivePlayer()) {
|
||||
C3Vector position = this->GetPosition();
|
||||
CAaBox box(position, position);
|
||||
box.b.z = this->m_movementData.m_collisionHeight + box.b.z;
|
||||
box.t.z = height * scale + box.t.z;
|
||||
box.b.x = box.b.x - this->m_movementData.m_collisionRadius;
|
||||
box.t.x = box.t.x + this->m_movementData.m_collisionRadius;
|
||||
box.b.y = box.b.y - this->m_movementData.m_collisionRadius;
|
||||
box.t.y = box.t.y + this->m_movementData.m_collisionRadius;
|
||||
|
||||
if (this->m_movementData.CollisionBoxDoesntFit(box)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_movementData.SetCollisionBox(this->m_movementData.m_collisionRadius + this->m_movementData.m_collisionRadius, height, scale, modelScale, force);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 5cad3e09 auto
|
||||
// OFFSET: 0x006D78C0
|
||||
int32_t CGPlayer_C::UpdateUnitCollisionBox(int32_t a2, int32_t a3) {
|
||||
@@ -9262,3 +9303,438 @@ uint32_t GetVisibleAuraEffectDisplay() {
|
||||
uint32_t GetVisibleAuraEffectFlags() {
|
||||
return s_unk_C9EAB4;
|
||||
}
|
||||
|
||||
// VERIFY: 07b73796 auto
|
||||
// OFFSET: 0x005EEB70
|
||||
void PlayerShutdownSounds() {
|
||||
}
|
||||
|
||||
// VERIFY: 71adbe9a auto
|
||||
// OFFSET: 0x006E0300
|
||||
void PlayerClientShutdown() {
|
||||
CGPlayer_C::PlayerShutdownMessageHandlers();
|
||||
PlayerShutdownSounds();
|
||||
|
||||
if (s_areaTriggerTimer) {
|
||||
ClientKillTimer(s_areaTriggerTimer, AreaTriggerCheck, "AreaTriggerCheck");
|
||||
s_areaTriggerTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 8cf14677 auto
|
||||
// OFFSET: 0x006CE480
|
||||
void CGPlayer_C::PlayerShutdownMessageHandlers() {
|
||||
ClientServices::ClearMessageHandler(SMSG_MOUNT_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_DISMOUNT_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_INVENTORY_CHANGE_FAILURE);
|
||||
ClientServices::ClearMessageHandler(SMSG_OPEN_CONTAINER);
|
||||
ClientServices::ClearMessageHandler(SMSG_ITEM_PUSH_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_VENDOR_INVENTORY);
|
||||
ClientServices::ClearMessageHandler(SMSG_BUY_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_BUY_SUCCEEDED);
|
||||
ClientServices::ClearMessageHandler(SMSG_SELL_ITEM);
|
||||
ClientServices::ClearMessageHandler(SMSG_ITEM_REFUND_INFO_RESPONSE);
|
||||
ClientServices::ClearMessageHandler(SMSG_ITEM_PURCHASE_REFUND_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_RESPONSE);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_RELEASE);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_REMOVED);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_SLOT_CHANGED);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_MONEY_NOTIFY);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_ITEM_NOTIFY);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_CLEAR_MONEY);
|
||||
ClientServices::ClearMessageHandler(SMSG_LEARNED_SPELL);
|
||||
ClientServices::ClearMessageHandler(SMSG_UNLEARNED_SPELLS);
|
||||
ClientServices::ClearMessageHandler(SMSG_SUPERCEDED_SPELLS);
|
||||
ClientServices::ClearMessageHandler(SMSG_SEND_KNOWN_SPELLS);
|
||||
ClientServices::ClearMessageHandler(SMSG_UPDATE_ACTION_BUTTONS);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_INVITE);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_CANCEL);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_DECLINE);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_UNINVITE);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_SET_LEADER);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_DESTROYED);
|
||||
ClientServices::ClearMessageHandler(SMSG_PARTY_COMMAND_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_LIST);
|
||||
ClientServices::ClearMessageHandler(SMSG_REAL_GROUP_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_INVALID_QUEST);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_QUEST_DETAILS);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_REQUEST_ITEMS);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_QUEST_COMPLETE);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_QUEST_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_STATUS);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_GIVER_STATUS_MULTIPLE);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_LOG_FULL);
|
||||
ClientServices::ClearMessageHandler(SMSG_TRAINER_LIST);
|
||||
ClientServices::ClearMessageHandler(SMSG_TRAINER_BUY_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_SET_PROFICIENCY);
|
||||
ClientServices::ClearMessageHandler(SMSG_RESURRECT_REQUEST);
|
||||
ClientServices::ClearMessageHandler(SMSG_PLAYER_SKINNED);
|
||||
ClientServices::ClearMessageHandler(SMSG_INSPECT_RESULTS_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_INSPECT_TALENT);
|
||||
ClientServices::ClearMessageHandler(SMSG_READ_ITEM_RESULT_OK);
|
||||
ClientServices::ClearMessageHandler(SMSG_READ_ITEM_RESULT_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CANCEL_COMBAT);
|
||||
ClientServices::ClearMessageHandler(SMSG_TAXI_NODE_STATUS);
|
||||
ClientServices::ClearMessageHandler(SMSG_SHOW_TAXI_NODES);
|
||||
ClientServices::ClearMessageHandler(SMSG_ACTIVATE_TAXI_REPLY);
|
||||
ClientServices::ClearMessageHandler(SMSG_GUILD_INVITE);
|
||||
ClientServices::ClearMessageHandler(SMSG_GUILD_DECLINE);
|
||||
ClientServices::ClearMessageHandler(SMSG_GUILD_INFO);
|
||||
ClientServices::ClearMessageHandler(SMSG_GUILD_EVENT);
|
||||
ClientServices::ClearMessageHandler(SMSG_GUILD_COMMAND_RESULT);
|
||||
ClientServices::ClearMessageHandler(MSG_SAVE_GUILD_EMBLEM);
|
||||
ClientServices::ClearMessageHandler(MSG_TABARDVENDOR_ACTIVATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_PETITION_SHOW_LIST);
|
||||
ClientServices::ClearMessageHandler(SMSG_PETITION_SHOW_SIGNATURES);
|
||||
ClientServices::ClearMessageHandler(SMSG_PETITION_SIGN_RESULTS);
|
||||
ClientServices::ClearMessageHandler(MSG_PETITION_DECLINE);
|
||||
ClientServices::ClearMessageHandler(SMSG_TURN_IN_PETITION_RESULT);
|
||||
ClientServices::ClearMessageHandler(MSG_PETITION_RENAME);
|
||||
ClientServices::ClearMessageHandler(SMSG_BIND_POINT_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_BINDZONEREPLY);
|
||||
ClientServices::ClearMessageHandler(SMSG_EMOTE);
|
||||
ClientServices::ClearMessageHandler(SMSG_PLAYER_BOUND);
|
||||
ClientServices::ClearMessageHandler(SMSG_PLAYERBINDERROR);
|
||||
ClientServices::ClearMessageHandler(SMSG_NEW_TAXI_PATH);
|
||||
ClientServices::ClearMessageHandler(SMSG_PET_NAME_INVALID);
|
||||
ClientServices::ClearMessageHandler(SMSG_EXPLORATION_EXPERIENCE);
|
||||
ClientServices::ClearMessageHandler(SMSG_PARTY_MEMBER_STATS);
|
||||
ClientServices::ClearMessageHandler(SMSG_PARTY_MEMBER_STATS_FULL);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_UPDATE_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_UPDATE_FAILED_TIMER);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_UPDATE_COMPLETE);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_UPDATE_ADD_KILL);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_UPDATE_ADD_PVP_CREDIT);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_CONFIRM_ACCEPT);
|
||||
ClientServices::ClearMessageHandler(SMSG_SHOW_BANK);
|
||||
ClientServices::ClearMessageHandler(SMSG_BUY_BANK_SLOT_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_LEVEL_UP_INFO);
|
||||
ClientServices::ClearMessageHandler(MSG_MINIMAP_PING);
|
||||
ClientServices::ClearMessageHandler(SMSG_TRIGGER_CINEMATIC);
|
||||
ClientServices::ClearMessageHandler(SMSG_ITEM_TIME_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_ITEM_ENCHANT_TIME_UPDATE);
|
||||
ClientServices::ClearMessageHandler(MSG_RANDOM_ROLL);
|
||||
ClientServices::ClearMessageHandler(SMSG_FISH_NOT_HOOKED);
|
||||
ClientServices::ClearMessageHandler(SMSG_FISH_ESCAPED);
|
||||
ClientServices::ClearMessageHandler(SMSG_FORCEACTIONSHOW);
|
||||
ClientServices::ClearMessageHandler(SMSG_GOD_MODE);
|
||||
ClientServices::ClearMessageHandler(SMSG_PETGODMODE);
|
||||
ClientServices::ClearMessageHandler(SMSG_IGNORE_REQUIREMENTS_CHEAT);
|
||||
ClientServices::ClearMessageHandler(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHAT_WRONG_FACTION);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHAT_PLAYER_NOTFOUND);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHAT_RESTRICTED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHAT_NOT_IN_PARTY);
|
||||
ClientServices::ClearMessageHandler(SMSG_GM_TICKET_GET_SYSTEM_STATUS);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPIRIT_HEALER_CONFIRM);
|
||||
ClientServices::ClearMessageHandler(MSG_TALENT_WIPE_CONFIRM);
|
||||
ClientServices::ClearMessageHandler(SMSG_BINDER_CONFIRM);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_EXECUTE_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_MISS_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_DAMAGE_SHIELD);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_INSTAKILL_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_NON_MELEE_DAMAGE_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_HEAL_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_ENERGIZE_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_DISPELL_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_STEAL_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_BREAK_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_RESURRECT_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_OR_DAMAGE_IMMUNE);
|
||||
ClientServices::ClearMessageHandler(MSG_QUEST_PUSH_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_DAMAGE_CALC_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_RAID_GROUP_ONLY);
|
||||
ClientServices::ClearMessageHandler(SMSG_INSTANCE_LOCK_WARNING_QUERY);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_START_ROLL);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_ALL_PASSED);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_ROLL_WON);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_ROLL);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOOT_MASTER_LIST);
|
||||
ClientServices::ClearMessageHandler(SMSG_TEST_DROP_RATE_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_SUMMON_REQUEST);
|
||||
ClientServices::ClearMessageHandler(SMSG_SUMMON_CANCEL);
|
||||
ClientServices::ClearMessageHandler(SMSG_PLAY_TIME_WARNING);
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_TEAM_INVITE);
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_TEAM_EVENT);
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_TEAM_COMMAND_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_ERROR);
|
||||
ClientServices::ClearMessageHandler(SMSG_DEATH_RELEASE_LOC);
|
||||
ClientServices::ClearMessageHandler(SMSG_FORCED_DEATH_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_TIME_SYNC_REQUEST);
|
||||
ClientServices::ClearMessageHandler(SMSG_VOICE_SESSION_ROSTER_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_VOICE_SESSION_LEAVE);
|
||||
ClientServices::ClearMessageHandler(SMSG_VOICE_SET_TALKER_MUTED);
|
||||
ClientServices::ClearMessageHandler(SMSG_VOICE_PARENTAL_CONTROLS);
|
||||
ClientServices::ClearMessageHandler(SMSG_CROSSED_INEBRIATION_THRESHOLD);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMPLAINT_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_FEATURE_SYSTEM_STATUS);
|
||||
ClientServices::ClearMessageHandler(SMSG_AVAILABLE_VOICE_CHANNEL);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_COMMAND_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_REPORT_PVP_AFK_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_GROUP_ACTION_THROTTLED);
|
||||
ClientServices::ClearMessageHandler(SMSG_SEND_UNLEARN_SPELLS);
|
||||
ClientServices::ClearMessageHandler(SMSG_CONVERT_RUNE);
|
||||
ClientServices::ClearMessageHandler(SMSG_RESYNC_RUNES);
|
||||
ClientServices::ClearMessageHandler(SMSG_ADD_RUNE_POWER);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEGROUND_INFO_THROTTLED);
|
||||
ClientServices::ClearMessageHandler(SMSG_UPDATE_TALENT_DATA);
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_POI_QUERY_RESPONSE);
|
||||
ClientServices::ClearMessageHandler(SMSG_TOGGLE_XP_GAIN);
|
||||
ClientServices::ClearMessageHandler(SMSG_DEBUG_SERVER_GEO);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUEST_FORCE_REMOVED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CAMERA_SHAKE);
|
||||
ClientServices::ClearMessageHandler(SMSG_SOCKET_GEMS);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMBAT_LOG_MULTIPLE);
|
||||
}
|
||||
|
||||
// VERIFY: d10a2943 auto
|
||||
// OFFSET: 0x006DB510
|
||||
bool CGPlayer_C::LoadGuildTextures(int32_t displayId) {
|
||||
ItemDisplayInfoRec rec;
|
||||
|
||||
if (!this->m_characterComponent || !g_itemDisplayInfoDB.GetRecordByIndex(displayId, &rec) || (this->m_characterComponent->m_flags & 0x40)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->m_characterComponent->AddItemBySlot(INVSLOT_TABARD, displayId, 0);
|
||||
|
||||
if (rec.m_flags & 0x1) {
|
||||
int32_t emblemStyle;
|
||||
int32_t emblemColor;
|
||||
int32_t borderStyle;
|
||||
int32_t borderColor;
|
||||
int32_t background;
|
||||
|
||||
if (!GuildGetGuildTabard(this->m_obj->m_guid, this->m_player->m_playerGuildid, CGPlayer_C::TabardDrawCallback, this, emblemStyle, emblemColor, borderStyle, borderColor, background)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->m_characterComponent->ApplyGuildColor(emblemStyle, emblemColor, borderStyle, borderColor, background);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// VERIFY: e750e015 manual
|
||||
// OFFSET: 0x006D92D0
|
||||
int32_t Packet_SMSG_GUILD_EVENT(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
||||
uint8_t event = 0;
|
||||
uint8_t numStrings;
|
||||
char strings[3][1024];
|
||||
msg->Get(event);
|
||||
msg->Get(numStrings);
|
||||
|
||||
for (uint8_t i = 0; i < numStrings; i++) {
|
||||
msg->GetString(strings[i], sizeof(strings[i]));
|
||||
TruncateNewLines(strings[i]);
|
||||
}
|
||||
|
||||
UIErrors error;
|
||||
WOWGUID guid;
|
||||
|
||||
switch (event) {
|
||||
case 0:
|
||||
error = ERR_GUILD_PROMOTE_SSS;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
error = ERR_GUILD_DEMOTE_SSS;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_GUILD_MOTD, "%s", strings[0]);
|
||||
CGGuildInfo::SetMOTD(strings[0]);
|
||||
UpdateGuildRoster(1);
|
||||
return 1;
|
||||
|
||||
case 3:
|
||||
error = ERR_GUILD_JOIN_S;
|
||||
msg->Get(guid.m_guid);
|
||||
CGAutoCompleteName::AddFlags(guid, 34, 0, strings[0]);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
error = ERR_GUILD_LEAVE_S;
|
||||
msg->Get(guid.m_guid);
|
||||
CGAutoCompleteName::RemoveFlags(guid, 2);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
error = ERR_GUILD_REMOVE_SS;
|
||||
CGAutoCompleteName::RemoveFlagsByName(strings[0], 2, 1, 0);
|
||||
|
||||
if (!SStrCmpUTF8I(ClientServices::GetCharacterName(), strings[0], STORM_MAX_STR)) {
|
||||
CGAutoCompleteName::RemoveFlagsFromAllNodes(2);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
error = ERR_GUILD_LEADER_IS_S;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
error = ERR_GUILD_LEADER_CHANGED_SS;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
error = ERR_GUILD_DISBANDED;
|
||||
CGAutoCompleteName::RemoveFlagsFromAllNodes(2);
|
||||
CGGuildBankInfo::SetGuildBanker(WOWGUID());
|
||||
memset(CGGuildBankInfo::m_guildBankTabInfo, 0, sizeof(CGGuildBankInfo::m_guildBankTabInfo));
|
||||
break;
|
||||
|
||||
case 10: {
|
||||
CGPlayer_C* player = static_cast<CGPlayer_C*>(ClntObjMgrObjectPtr(ClntObjMgrGetActivePlayer(), TYPEMASK_PLAYER, __FILE__, __LINE__));
|
||||
|
||||
if (!player) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
WOWGUID none = WOWGUID();
|
||||
GuildStats_C* stats = g_guildInfoCache.GetRecord(player->m_player->m_playerGuildid, none, nullptr, nullptr, false);
|
||||
|
||||
if (!stats) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t rank = SStrToInt(strings[0]);
|
||||
char name[64];
|
||||
SStrCopy(name, strings[1], sizeof(name));
|
||||
ScrubString(name, stats->m_rankNames[rank], 16, sizeof(stats->m_rankNames[rank]), 1);
|
||||
stats->m_numRanks = SStrToInt(strings[2]);
|
||||
UpdateGuildRoster(1);
|
||||
|
||||
if (player->m_player->m_playerGuildrank != rank) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
CGGuildInfo::QueryPermissions();
|
||||
|
||||
if (CGGuildBankInfo::m_banker == WOWGUID()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
SendGuildBankQueryTabOpcode(CGGuildBankInfo::m_currentTab);
|
||||
return 1;
|
||||
}
|
||||
|
||||
case 11: {
|
||||
CGPlayer_C* player = static_cast<CGPlayer_C*>(ClntObjMgrObjectPtr(ClntObjMgrGetActivePlayer(), TYPEMASK_PLAYER, __FILE__, __LINE__));
|
||||
|
||||
if (!player) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
WOWGUID none = WOWGUID();
|
||||
GuildStats_C* stats = g_guildInfoCache.GetRecord(player->m_player->m_playerGuildid, none, nullptr, nullptr, false);
|
||||
|
||||
if (!stats) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
stats->m_numRanks = SStrToInt(strings[0]);
|
||||
UpdateGuildRoster(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
case 12:
|
||||
msg->Get(guid.m_guid);
|
||||
CGAutoCompleteName::AddFlags(guid, 32, 0, strings[0]);
|
||||
|
||||
if (!g_guildMemberNotifyCVar->m_intValue || !SStrCmp(ClientServices::GetCharacterName(), strings[0], STORM_MAX_STR) || FriendList::s_friendList->IsFriend(guid)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
CGGameUI::DisplayError(ERR_FRIEND_ONLINE_SS, strings[0], strings[0]);
|
||||
return 1;
|
||||
|
||||
case 13:
|
||||
msg->Get(guid.m_guid);
|
||||
CGAutoCompleteName::RemoveFlags(guid, 32);
|
||||
|
||||
if (!g_guildMemberNotifyCVar->m_intValue || !SStrCmp(ClientServices::GetCharacterName(), strings[0], STORM_MAX_STR) || FriendList::s_friendList->IsFriend(guid)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
CGGameUI::DisplayError(ERR_FRIEND_OFFLINE_S, strings[0]);
|
||||
return 1;
|
||||
|
||||
case 14:
|
||||
SendGuildBankQueryTabOpcode(CGGuildBankInfo::m_currentTab);
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_GUILDBANKBAGSLOTS_CHANGED, nullptr);
|
||||
return 1;
|
||||
|
||||
case 15:
|
||||
CGGuildBankInfo::m_numTabs++;
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_GUILDBANK_UPDATE_TABS, nullptr);
|
||||
return 1;
|
||||
|
||||
case 16:
|
||||
CGGuildBankInfo::UpdateTabInfo(static_cast<uint8_t>(SStrToInt(strings[0])), strings[1], strings[2]);
|
||||
return 1;
|
||||
|
||||
case 17: {
|
||||
uint64_t money;
|
||||
sscanf(strings[0], "%016I64X", &money);
|
||||
CGGuildBankInfo::m_money = money;
|
||||
CDataStore query;
|
||||
query.Put(static_cast<uint32_t>(MSG_GUILD_BANK_MONEY_WITHDRAWN));
|
||||
query.Finalize();
|
||||
ClientServices::Send2(&query);
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_GUILDBANK_UPDATE_MONEY, nullptr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
case 18: {
|
||||
SendGuildBankQueryTabOpcode(CGGuildBankInfo::m_currentTab);
|
||||
CDataStore query;
|
||||
query.Put(static_cast<uint32_t>(MSG_GUILD_BANK_MONEY_WITHDRAWN));
|
||||
query.Finalize();
|
||||
ClientServices::Send2(&query);
|
||||
return 1;
|
||||
}
|
||||
|
||||
case 19: {
|
||||
int32_t tab = atol(strings[0]);
|
||||
CGGuildBankInfo::SetTextUpdate(tab, 1);
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_GUILDBANK_TEXT_CHANGED, "%d", tab + 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
default:
|
||||
error = ERR_GUILD_INTERNAL;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (numStrings) {
|
||||
case 1:
|
||||
CGGameUI::DisplayError(error, strings[0]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
CGGameUI::DisplayError(error, strings[0], strings[1]);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
CGGameUI::DisplayError(error, strings[0], strings[1], strings[2]);
|
||||
break;
|
||||
|
||||
default:
|
||||
CGGameUI::DisplayError(error);
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateGuildRoster(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 4f7b81f9 manual
|
||||
// OFFSET: 0x007261B0
|
||||
bool CGPlayer_C::IsInFlyableZone(int32_t checkContinent) {
|
||||
return IsInFlyableArea() && (!(this->m_obj->m_type & TYPEMASK_PLAYER) || !checkContinent || CGGameUI::m_iCurrentMapID != 571 || HasSpell(static_cast<uint32_t>(54197)));
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
|
||||
static void __stdcall StartTaxiExpress(WOWGUID guid, const uint32_t* nodes, int32_t count);
|
||||
static void TalkToMailbox(WOWGUID guid);
|
||||
static void PlayerInitializeMessageHandlers();
|
||||
static void PlayerShutdownMessageHandlers();
|
||||
static void __stdcall TalkToAuctioneer(const WOWGUID& guid);
|
||||
static void __stdcall TalkToBanker(const WOWGUID& guid);
|
||||
static void __stdcall TalkToBattleMaster(const WOWGUID& guid);
|
||||
@@ -287,6 +288,7 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
|
||||
const CGItem_C* EquippedItemMeetSpellRequirements(const SpellRec* spell, uint32_t slotMask);
|
||||
int32_t HasZoneExplored(int32_t zone);
|
||||
int32_t UpdateUnitCollisionBox(int32_t a2, int32_t a3);
|
||||
int32_t UpdateMountedCollisionBox(float mountHeight, int32_t force);
|
||||
int32_t IsCommentatorUberOrInArena() const;
|
||||
int32_t IsInMelee() const;
|
||||
void OnLootGameObject(const WOWGUID& guid);
|
||||
@@ -355,7 +357,7 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
|
||||
void ExitAutoCombatMode();
|
||||
void OnLevelChange();
|
||||
void CTMClickTerrain(const C3Vector& position);
|
||||
bool IsInFlyableZone(int32_t a1);
|
||||
bool IsInFlyableZone(int32_t checkContinent);
|
||||
int32_t SpellUsesWeaponSkill(const SpellRec* spell);
|
||||
CGPlayer_C(uint32_t time, const CClientObjCreate& create);
|
||||
void PostInit(uint32_t time, const CClientObjCreate& create, bool reenable);
|
||||
@@ -373,7 +375,8 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
|
||||
uint32_t GetEquippedItemDisplayId();
|
||||
int32_t GetAttackPowerContributionFromStat(int32_t stat, int32_t value);
|
||||
float GetCombatRatingPct(int32_t rating);
|
||||
void LoadGuildTextures(int32_t displayId);
|
||||
bool LoadGuildTextures(int32_t displayId);
|
||||
static void TabardDrawCallback(int32_t guildID, const WOWGUID& guid, void* param, bool success);
|
||||
void UpdateHandItemVisual(GEOCOMPONENTLINKS link, int32_t hand);
|
||||
void UpdateObjComponentVisuals(const VisibleItem_C* item, GEOCOMPONENTLINKS link);
|
||||
void UpdateObjComponentVisualsSlot(const VisibleItem_C* item, int32_t slot);
|
||||
@@ -531,6 +534,7 @@ void PlayerInitializeSounds();
|
||||
void AreaTriggersInitialize(uint32_t mapId);
|
||||
int32_t AreaTriggerCheck(const void* data, void* param);
|
||||
void PlayerClientShutdown();
|
||||
void PlayerShutdownSounds();
|
||||
int32_t Player_C_ZoneUpdateHandler(const void* data, void* param);
|
||||
int32_t GetModalNextSpell();
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ struct SimpleScriptIO {
|
||||
/* 0010 */ uint32_t m_stringSize;
|
||||
/* 0014 */ uint32_t m_stringCount;
|
||||
/* 0018 */ char* m_strings;
|
||||
|
||||
SimpleScriptIO(double* numbers, uint32_t count);
|
||||
};
|
||||
|
||||
class CSimpleScriptManager {
|
||||
@@ -56,4 +58,13 @@ class CSimpleScriptManager {
|
||||
void Uninit();
|
||||
};
|
||||
|
||||
// INLINED
|
||||
inline SimpleScriptIO::SimpleScriptIO(double* numbers, uint32_t count) {
|
||||
this->m_numbers.m_alloc = count;
|
||||
this->m_numbers.m_data = numbers;
|
||||
this->m_stringSize = 0;
|
||||
this->m_stringCount = 0;
|
||||
this->m_strings = nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2782,3 +2782,90 @@ void UnitCombatLogUnitDead(CGUnit_C* unit) {
|
||||
CombatLogEntry* entry = GetCombatLogEntry(source, dest, event, nullptr);
|
||||
QueueCombatLogEntry(entry, 0);
|
||||
}
|
||||
|
||||
// VERIFY: a10e0f3b manual
|
||||
// OFFSET: 0x0074D1A0
|
||||
static bool CombatLogFlagsMatch(uint32_t filterFlags, uint32_t flags) {
|
||||
uint32_t matched = filterFlags & flags;
|
||||
|
||||
if (matched & 0xFFFF0000) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(matched & 0xF) || !(matched & 0xF0) || !(matched & 0x300)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (matched & 0xFC00) != 0;
|
||||
}
|
||||
|
||||
// VERIFY: e3b2fb68 manual
|
||||
// OFFSET: 0x0074E1A0
|
||||
bool CombatLogFilter::MatchesFilter(int32_t event, const WOWGUID& sourceGuid, uint32_t sourceFlags, const WOWGUID& destGuid, uint32_t destFlags, int32_t spellId, const char* spellName) {
|
||||
uint32_t index = static_cast<uint32_t>(event);
|
||||
|
||||
if (!(this->m_events.m_bits.m_data[index >> 5] & (1 << (index & 0x1F)))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->m_sourceGuid) {
|
||||
if (sourceGuid != this->m_sourceGuid) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
uint32_t matched = this->m_sourceFlags & sourceFlags;
|
||||
|
||||
if (!(matched & 0xFFFF0000) && (!(matched & 0xF) || !(matched & 0xF0) || !(matched & 0x300) || !(matched & 0xFC00))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->m_destGuid) {
|
||||
if (destGuid != this->m_destGuid) {
|
||||
return false;
|
||||
}
|
||||
} else if (!CombatLogFlagsMatch(this->m_destFlags, destFlags)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->m_spellId) {
|
||||
return spellId == this->m_spellId;
|
||||
}
|
||||
|
||||
const char* name = this->m_spellName.m_str;
|
||||
return !name || (spellName && !SStrCmpUTF8I(spellName, name, 0x7FFFFFFF));
|
||||
}
|
||||
|
||||
// OFFSET: 0x00753980
|
||||
static void UnitCombatLogShutdown() {
|
||||
s_entries.Clear();
|
||||
s_freeEntries.Clear();
|
||||
s_pendingEntries = nullptr;
|
||||
s_currentEntry = nullptr;
|
||||
s_filters.Clear();
|
||||
s_pendingData.Clear();
|
||||
s_freePendingData.Clear();
|
||||
s_invalidatedNames.Clear();
|
||||
ClientServices::ClearMessageHandler(SMSG_SPELL_PERIODIC_AURA_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_ENCHANTMENT_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_PARTY_KILL_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_PROC_RESIST);
|
||||
ClientServices::ClearMessageHandler(SMSG_DISPEL_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE);
|
||||
}
|
||||
|
||||
// VERIFY: 5d930252 auto
|
||||
// OFFSET: 0x00754F60
|
||||
void UnitCombatClientShutdown() {
|
||||
ClientServices::ClearMessageHandler(SMSG_ATTACK_START);
|
||||
ClientServices::ClearMessageHandler(SMSG_ATTACK_STOP);
|
||||
ClientServices::ClearMessageHandler(SMSG_ATTACKER_STATE_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_ATTACKSWING_NOTINRANGE);
|
||||
ClientServices::ClearMessageHandler(SMSG_ATTACKSWING_BADFACING);
|
||||
ClientServices::ClearMessageHandler(SMSG_ATTACKSWING_DEADTARGET);
|
||||
ClientServices::ClearMessageHandler(SMSG_ATTACKSWING_CANT_ATTACK);
|
||||
ClientServices::ClearMessageHandler(SMSG_ENVIRONMENTAL_DAMAGE_LOG);
|
||||
ClientServices::ClearMessageHandler(SMSG_CLEAR_TARGET);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMBAT_EVENT_FAILED);
|
||||
UnitCombatLogShutdown();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,15 @@
|
||||
#include "Engine/Source/Tempest/CMath.h"
|
||||
#include "Engine/Source/Tempest/CAaSphere.h"
|
||||
#include "WoW/Source/ObjectMgrClient/ObjectMgrClient.h"
|
||||
#include <malloc.h>
|
||||
#include <cmath>
|
||||
#include "Engine/Source/Gx/Gx.h"
|
||||
#include "Engine/Source/Gx/CGxMatrixStack.h"
|
||||
#include "Engine/Source/Tempest/CAaBox.h"
|
||||
#include "WoW/Source/Game/GameClient/ProjectTex.h"
|
||||
#include "WoW/Source/Ui/WorldFrame.h"
|
||||
#include "WoW/Source/UIUtil/Camera.h"
|
||||
#include "Engine/Source/Gx/CGxDevice/CGxDevice.h"
|
||||
|
||||
// STATIC: 0x00CA0A98
|
||||
CMapEntity* CGUnit_C::s_trajectoryWorldObjects[2];
|
||||
@@ -34,6 +43,9 @@ static WOWGUID s_trajectoryTargetGuid;
|
||||
// STATIC: 0x00CA0AB8
|
||||
static float s_trajectoryAlpha;
|
||||
|
||||
// STATIC: 0x00CA0ABC
|
||||
static uint32_t s_trajectoryStartTime;
|
||||
|
||||
// STATIC: 0x00CA0AC0
|
||||
static uint32_t s_trajectoryFadeStart;
|
||||
|
||||
@@ -53,7 +65,7 @@ static CTexture* s_trajectoryTexture0;
|
||||
static CTexture* s_trajectoryTexture1;
|
||||
|
||||
// STATIC: 0x00CA0AEC
|
||||
static float s_trajectoryPitch;
|
||||
static C3Vector s_trajectoryLaunchPosition;
|
||||
|
||||
// STATIC: 0x00CA0AD8
|
||||
CMissileCollisionHeap* CMissileCollision::s_pool;
|
||||
@@ -268,7 +280,7 @@ void CGUnit_C::UpdateMissileTrajectory() {
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 6a558a39 manual
|
||||
// VERIFY: 890fca3b manual
|
||||
// OFFSET: 0x006FDA20
|
||||
void CGUnit_C::UpdateMissileTrajectoryTargeting() {
|
||||
s_trajectoryAlpha = 0.0f;
|
||||
@@ -455,7 +467,7 @@ void CGUnit_C::UpdateMissileTrajectoryTargeting() {
|
||||
CGUnit_C* target = unit;
|
||||
float facing;
|
||||
|
||||
if (!unit->ComputeMissileTrajectory(&spell, &pitchArg, &target, &s_trajectoryPitch, &position, &facing, CGUnit_C::s_trajectoryPoints, &s_trajectoryPointCount, 1)) {
|
||||
if (!unit->ComputeMissileTrajectory(&spell, &pitchArg, &target, &s_trajectoryLaunchPosition, &position, &facing, CGUnit_C::s_trajectoryPoints, &s_trajectoryPointCount, 1)) {
|
||||
s_trajectoryAlpha = 0.0f;
|
||||
return;
|
||||
}
|
||||
@@ -489,3 +501,167 @@ void CGUnit_C::UpdateMissileTrajectoryTargeting() {
|
||||
|
||||
CGUnit_C::s_missileTrajectoryTargetingSpell = spellId;
|
||||
}
|
||||
|
||||
// OFFSET: 0x006FC190
|
||||
void CGUnit_C::ShutdownMissileTrajectorySystem() {
|
||||
SMemFree(CGUnit_C::s_trajectoryPoints, __FILE__, __LINE__, 0);
|
||||
CGUnit_C::StopMissileTrajectoryTargeting();
|
||||
delete CMissileCollision::s_pool;
|
||||
CMissileCollision::s_pool = nullptr;
|
||||
CMissileCollision::s_tail = nullptr;
|
||||
CMissileCollision::s_head = nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: 2d5a7665 manual
|
||||
// OFFSET: 0x006FDFB0
|
||||
void CGUnit_C::RenderMissileTrajectoryTargetingTexture() {
|
||||
if (!(s_trajectoryAlpha > 0.0f) || !s_trajectoryTargetGuid) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(s_trajectoryTargetGuid, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (!unit) {
|
||||
s_trajectoryTargetGuid = WOWGUID();
|
||||
return;
|
||||
}
|
||||
|
||||
float facing = unit->GetFacing();
|
||||
VehicleRec* vehicle = unit->m_vehicle ? unit->m_vehicle->m_vehicleRec : nullptr;
|
||||
|
||||
if (!vehicle) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGxTex* arcTex;
|
||||
|
||||
if (s_trajectoryTexture0 && (arcTex = TextureGetGxTex(s_trajectoryTexture0, 0, nullptr)) != nullptr) {
|
||||
g_theGxDevicePtr->RsPush();
|
||||
GxXformPush(GxXform_World);
|
||||
GxXformPush(GxXform_Tex0);
|
||||
GxXformTranslate(GxXform_World, -CGWorldFrame::GetActiveCamera()->m_position);
|
||||
GxRsSet(GxRs_Culling, 0);
|
||||
GxRsSet(GxRs_Fog, 0);
|
||||
GxRsSet(GxRs_ColorOp0, 0);
|
||||
GxRsSet(GxRs_AlphaOp0, 0);
|
||||
GxRsSet(GxRs_ColorWrite, 15);
|
||||
GxRsSet(GxRs_Lighting, 0);
|
||||
GxRsSet(GxRs_DepthWrite, 0);
|
||||
GxRsSet(GxRs_BlendingMode, 3);
|
||||
int32_t vertexCount = 2 * s_trajectoryPointCount + 2;
|
||||
C3Vector* positions = static_cast<C3Vector*>(alloca(sizeof(C3Vector) * vertexCount));
|
||||
CImVector* colors = static_cast<CImVector*>(alloca(sizeof(CImVector) * vertexCount));
|
||||
C2Vector* texCoords = static_cast<C2Vector*>(alloca(sizeof(C2Vector) * vertexCount));
|
||||
uint16_t* indices = static_cast<uint16_t*>(alloca(sizeof(uint16_t) * vertexCount));
|
||||
|
||||
for (int32_t i = 0; i < vertexCount; i++) {
|
||||
indices[i] = i;
|
||||
}
|
||||
|
||||
float halfWidth = vehicle->m_msslTrgtArcWidth * 0.5f;
|
||||
C3Vector side;
|
||||
side.x = -(CMath::sin_(facing) * halfWidth);
|
||||
side.y = CMath::cos_(facing) * halfWidth;
|
||||
uint32_t elapsed = FrameTime::s_curTimeMs - s_trajectoryStartTime;
|
||||
float alpha = s_trajectoryAlpha * 255.0f;
|
||||
float alphaStep = (255.0f * (s_trajectoryAlpha * vehicle->m_msslTrgtEndOpacity) - alpha) * (1.0f / s_trajectoryPointCount);
|
||||
float texStart = 1.0f - fmodf(static_cast<float>(elapsed) * 0.001f * vehicle->m_msslTrgtArcSpeed, 1.0f);
|
||||
positions[0].x = s_trajectoryLaunchPosition.x + side.x;
|
||||
positions[0].y = s_trajectoryLaunchPosition.y + side.y;
|
||||
positions[0].z = s_trajectoryLaunchPosition.z;
|
||||
positions[1].x = s_trajectoryLaunchPosition.x - side.x;
|
||||
positions[1].y = s_trajectoryLaunchPosition.y - side.y;
|
||||
positions[1].z = s_trajectoryLaunchPosition.z;
|
||||
colors[0].a = 0;
|
||||
colors[0].r = 0xFF;
|
||||
colors[0].g = 0xFF;
|
||||
colors[0].b = 0xFF;
|
||||
colors[1] = colors[0];
|
||||
texCoords[0].x = texStart;
|
||||
texCoords[0].y = 0.0f;
|
||||
texCoords[1].x = texStart;
|
||||
texCoords[1].y = 1.0f;
|
||||
float pointAlpha = alphaStep + alpha;
|
||||
float texCoord = texStart + vehicle->m_msslTrgtArcRepeat;
|
||||
|
||||
for (uint32_t i = 0; i < s_trajectoryPointCount; i++) {
|
||||
const C3Vector& point = CGUnit_C::s_trajectoryPoints[i];
|
||||
positions[2 * i + 2].x = point.x + side.x;
|
||||
positions[2 * i + 2].y = point.y + side.y;
|
||||
positions[2 * i + 2].z = point.z;
|
||||
positions[2 * i + 3].x = point.x - side.x;
|
||||
positions[2 * i + 3].y = point.y - side.y;
|
||||
positions[2 * i + 3].z = point.z;
|
||||
|
||||
if (pointAlpha < 0.0f) {
|
||||
pointAlpha = 0.0f;
|
||||
}
|
||||
|
||||
colors[2 * i + 2].b = 0xFF;
|
||||
colors[2 * i + 2].g = 0xFF;
|
||||
colors[2 * i + 2].r = 0xFF;
|
||||
colors[2 * i + 2].a = static_cast<uint8_t>(pointAlpha + 0.5f);
|
||||
colors[2 * i + 3] = colors[2 * i + 2];
|
||||
pointAlpha += alphaStep;
|
||||
texCoords[2 * i + 2].x = texCoord;
|
||||
texCoords[2 * i + 2].y = 0.0f;
|
||||
texCoords[2 * i + 3].x = texCoord;
|
||||
texCoords[2 * i + 3].y = 1.0f;
|
||||
texCoord += vehicle->m_msslTrgtArcRepeat;
|
||||
}
|
||||
|
||||
CGxMatrixStack& texStack = g_theGxDevicePtr->m_xforms[GxXform_Tex0];
|
||||
texStack.m_dirty = 1;
|
||||
texStack.m_flags[texStack.m_level] &= ~CGxMatrixStack::F_Identity;
|
||||
texStack.m_mtx[texStack.m_level] = C44Matrix();
|
||||
g_theGxDevicePtr->RsSet(GxRs_Texture0, arcTex);
|
||||
C3Vector normal(0.0f, 0.0f, 1.0f);
|
||||
GxRsSet(GxRs_TextureShader0, 1);
|
||||
GxPrimLockVertexPtrs(vertexCount, positions, sizeof(C3Vector), &normal, 0, colors, sizeof(CImVector), nullptr, 0, texCoords, sizeof(C2Vector), nullptr, 0);
|
||||
GxDrawLockedElements(GxPrim_TriangleStrip, vertexCount, indices);
|
||||
GxPrimUnlockVertexPtrs();
|
||||
GxXformPop(GxXform_World);
|
||||
GxXformPop(GxXform_Tex0);
|
||||
g_theGxDevicePtr->RsPop();
|
||||
}
|
||||
|
||||
if (!s_trajectoryTexture1) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGxTex* impactTex = TextureGetGxTex(s_trajectoryTexture1, 0, nullptr);
|
||||
|
||||
if (!impactTex) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_theGxDevicePtr->RsPush();
|
||||
GxRsSet(GxRs_BlendingMode, 3);
|
||||
GxRsSet(GxRs_Culling, 0);
|
||||
GxRsSet(GxRs_Lighting, 0);
|
||||
GxRsSet(GxRs_DepthWrite, 0);
|
||||
g_theGxDevicePtr->RsSet(GxRs_Texture0, impactTex);
|
||||
g_theGxDevicePtr->RsSet(GxRs_Texture1, ProjectTex2dGetAddFadeTex());
|
||||
GxRsSet(GxRs_ColorOp0, 0);
|
||||
GxRsSet(GxRs_AlphaOp0, 0);
|
||||
GxRsSet(GxRs_ColorOp1, 0);
|
||||
GxRsSet(GxRs_AlphaOp1, 0);
|
||||
const C3Vector& impact = CGUnit_C::s_trajectoryPoints[s_trajectoryPointCount - 1];
|
||||
float radius = vehicle->m_msslTrgtImpactTexRadius;
|
||||
CAaBox box;
|
||||
box.b.x = impact.x - radius;
|
||||
box.b.y = impact.y - radius;
|
||||
box.b.z = impact.z - radius;
|
||||
box.t.x = radius + impact.x;
|
||||
box.t.y = radius + impact.y;
|
||||
box.t.z = radius + impact.z;
|
||||
CImVector color;
|
||||
color.b = 0xFF;
|
||||
color.g = 0xFF;
|
||||
color.r = 0xFF;
|
||||
color.a = static_cast<uint8_t>(s_trajectoryAlpha * 255.0f + 0.5f);
|
||||
C44Matrix rotation;
|
||||
rotation.RotateAroundZ(-facing);
|
||||
ProjectTex::Render2d(box, color, &rotation, 0.5f, 0x200122, 5, 0.039999999f);
|
||||
g_theGxDevicePtr->RsPop();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "WoW/Source/UIUtil/InputControl.h"
|
||||
#include "Engine/Source/FrameScript/FrameScript.h"
|
||||
#include "WoW/Source/Ui/Types.h"
|
||||
#include "WoW/Source/Ui/WorldFrame.h"
|
||||
#include "WoW/Source/UIUtil/Camera.h"
|
||||
|
||||
// VERIFY: bc21d620 manual
|
||||
// OFFSET: 0x0074C650
|
||||
@@ -313,3 +315,25 @@ int32_t CGUnit_C::VehiclePassengerStartWaitingForVehicleTransitionAnim(uint64_t
|
||||
this->m_vehiclePassenger->StartWaitingForVehicleTransitionAnim(WOWGUID{ transport }, seat, seatRec, entering, animVehicle);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 65e43ba1 manual
|
||||
// OFFSET: 0x0074CD60
|
||||
void CGUnit_C::DestroyVehicleCamera() {
|
||||
if (!this->m_vehicleCamera) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(this->m_vehicleCamera->m_nextCameraGuid, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
CVehicleCamera_C* camera = this->m_vehicleCamera;
|
||||
camera->Destroy();
|
||||
this->m_vehicleCamera = nullptr;
|
||||
CGCamera* activeCamera = CGWorldFrame::GetActiveCamera();
|
||||
|
||||
if (activeCamera && activeCamera->m_vehicleCamera == camera) {
|
||||
activeCamera->OnVehicleCameraDestroyed();
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit->OnVehicleCameraPossiblyUnneeded();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,11 @@
|
||||
#include "WoW/Source/DB/Rec/MapRec.h"
|
||||
#include "Engine/Source/Frame/CLayoutFrame.h"
|
||||
#include "WoW/Source/DB/Rec/VehicleRec.h"
|
||||
#include "WoW/Source/DB/Rec/TerrainTypeRec.h"
|
||||
#include "WoW/Source/DB/Rec/UnitBloodRec.h"
|
||||
|
||||
// STATIC: 0x00ADAC04
|
||||
static INVENTORY_SLOTS s_virtualItemInvSlots[2] = { INVSLOT_MAINHAND, INVSLOT_OFFHAND };
|
||||
|
||||
// STATIC: 0x00CA1398
|
||||
static char s_objectNameBuffers[2][305];
|
||||
@@ -141,6 +146,9 @@ static uint32_t s_objectNameIndex;
|
||||
// STATIC: 0x00ADAA10
|
||||
static int32_t s_baseSpiritRegenCap = 50;
|
||||
|
||||
// STATIC: 0x00ADAA14
|
||||
static const char* s_genderSuffix[2] = { "M", "F" };
|
||||
|
||||
// STATIC: 0x00CA11A8
|
||||
static WOWGUID s_unk_CA11A8;
|
||||
|
||||
@@ -5809,6 +5817,43 @@ void CGUnit_C::RemoveMountModel() {
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 472acfa3 auto
|
||||
// OFFSET: 0x00717910
|
||||
void CGUnit_C::SetMountModel(CM2Model* model) {
|
||||
if (model == this->m_mountModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->CleanUpVehicleBoneAnimsBeforeObjectModelChange();
|
||||
|
||||
if (model) {
|
||||
model->m_refCount++;
|
||||
}
|
||||
|
||||
if (this->m_mountModel) {
|
||||
if (this->m_mountModel->m_attachParent) {
|
||||
this->m_mountModel->DetachFromParent();
|
||||
}
|
||||
|
||||
this->m_mountModel->SetLoadedCallback(nullptr, nullptr);
|
||||
this->m_mountModel->Release();
|
||||
}
|
||||
|
||||
this->m_mountModel = model;
|
||||
|
||||
if (model) {
|
||||
model->SetLoadedCallback(CGObject_C::ModelLoadedCallback, this);
|
||||
} else if (this->GetObjectModel()->IsLoaded(0, 0)) {
|
||||
this->ModelChanged();
|
||||
} else {
|
||||
this->SetBoundsDirty();
|
||||
}
|
||||
|
||||
if (this->m_worldObject) {
|
||||
World::ObjectSetModel(this->m_worldObject, this->GetObjectModel());
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 615d1384 auto
|
||||
// OFFSET: 0x00715270
|
||||
void CGUnit_C::RotateFacing(float delta) {
|
||||
@@ -22190,3 +22235,743 @@ float CreatureSoundDataGetFidgetDelayMax(const CreatureSoundDataRec* rec) {
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
// VERIFY: b7b739bd manual
|
||||
// OFFSET: 0x0071D450
|
||||
static int32_t IsWeaponAnimBehavior(uint32_t animId) {
|
||||
AnimationDataRec* animation = g_animationDataDB.GetRecord(animId);
|
||||
int32_t behavior = animation ? animation->m_behaviorID : 506;
|
||||
|
||||
switch (behavior) {
|
||||
case 16:
|
||||
case 20:
|
||||
case 25:
|
||||
case 117:
|
||||
case 118:
|
||||
return 1;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 8ff14a38 auto
|
||||
// OFFSET: 0x00721ED0
|
||||
bool CGUnit_C::IsPlayingWeaponAnim() const {
|
||||
uint32_t sequence;
|
||||
|
||||
if (this->m_worldModel && this->m_worldModel->IsLoaded(0, 0)) {
|
||||
if (this->m_torsoKeyBone == -1 || (sequence = this->m_worldModel->GetBoneSequenceId(this->m_torsoKeyBone)) == 0xFFFFFFFF) {
|
||||
sequence = this->m_worldModel->GetBoneSequenceId(0xFFFFFFFF);
|
||||
}
|
||||
} else {
|
||||
sequence = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
if (IsWeaponAnimBehavior(sequence)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return IsMeleeAttackAnim(sequence) && !this->GetVirtualItem(0, false);
|
||||
}
|
||||
|
||||
// VERIFY: 697b8b23 manual
|
||||
// OFFSET: 0x0071EE70
|
||||
void CGUnit_C::Unk71EE70() {
|
||||
if (this->m_obj->m_guid != CGGameUI::m_lockedTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGPlayer_C* player = static_cast<CGPlayer_C*>(ClntObjMgrObjectPtr(ClntObjMgrGetActivePlayer(), TYPEMASK_PLAYER, __FILE__, __LINE__));
|
||||
|
||||
if (player && player->m_combat.m_attacking) {
|
||||
player->SetCombatMode();
|
||||
}
|
||||
|
||||
Spell_C_CancelAutoRepeat(true);
|
||||
|
||||
if (this->m_unit->m_unitDynamicFlags & 0x20) {
|
||||
WOWGUID guid = this->m_obj->m_guid;
|
||||
|
||||
if (CGGameUI::IsRaidMemberOrPet(guid)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CGGameUI::Target(WOWGUID());
|
||||
}
|
||||
|
||||
// VERIFY: bed80791 manual
|
||||
// OFFSET: 0x0071B1E0
|
||||
void CGUnit_C::HandlePendingTrackEvents() {
|
||||
if (s_unk_CA11C8) {
|
||||
if (ClntObjMgrObjectPtr(s_unk_CA11C8, TYPEMASK_UNIT, __FILE__, __LINE__) && this->m_obj->m_guid == ClntObjMgrGetActivePlayer()) {
|
||||
static_cast<CGPlayer_C*>(this)->CombatModeEnter(s_unk_CA11C8, 0, 0);
|
||||
}
|
||||
|
||||
s_unk_CA11C8 = WOWGUID();
|
||||
} else if (s_unk_CA11C0) {
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(s_unk_CA11C0, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (unit && this->m_obj->m_guid == ClntObjMgrGetActivePlayer()) {
|
||||
static_cast<CGPlayer_C*>(this)->LootUnit(unit, false);
|
||||
}
|
||||
|
||||
s_unk_CA11C0 = WOWGUID();
|
||||
} else if (s_unk_CA11B8) {
|
||||
CGGameObject_C* gameObject = static_cast<CGGameObject_C*>(ClntObjMgrObjectPtr(s_unk_CA11B8, TYPEMASK_GAMEOBJECT, __FILE__, __LINE__));
|
||||
|
||||
if (gameObject) {
|
||||
gameObject->UseObject();
|
||||
}
|
||||
|
||||
s_unk_CA11B8 = WOWGUID();
|
||||
} else if (s_unk_CA11B0) {
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(s_unk_CA11B0, TYPEMASK_OBJECT, __FILE__, __LINE__));
|
||||
|
||||
if (unit && this->IsActivePlayer()) {
|
||||
static_cast<CGPlayer_C*>(this)->HandleSkinning(unit, false, false);
|
||||
}
|
||||
|
||||
s_unk_CA11B0 = WOWGUID();
|
||||
} else if (s_unk_CA11A8) {
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(s_unk_CA11A8, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (unit && this->IsActivePlayer()) {
|
||||
static_cast<CGPlayer_C*>(this)->HandleOnRightClick(unit, false);
|
||||
}
|
||||
|
||||
s_unk_CA11A8 = WOWGUID();
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: ca6629ea manual
|
||||
// OFFSET: 0x0073D940
|
||||
void CGUnit_C::DestroyUnitMount(int32_t a2) {
|
||||
if (!this->m_mountModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
CM2Model* parent = this->m_worldModel->m_attachParent;
|
||||
|
||||
if (parent) {
|
||||
CM2Model* grandParent = parent->m_attachParent;
|
||||
uint32_t attachmentId = parent->m_attachmentId;
|
||||
this->m_worldModel->m_fFlags ^= (this->m_worldModel->m_fFlags ^ parent->m_fFlags) & 0x80000;
|
||||
this->m_worldModel->DetachFromParent();
|
||||
|
||||
if (grandParent) {
|
||||
this->m_worldModel->AttachToParent(grandParent, attachmentId, nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
CM2Model* mount = this->m_mountModel;
|
||||
this->m_worldModel->unk_0180 = mount->unk_0180;
|
||||
this->m_worldModel->unk_0184 = mount->unk_0184;
|
||||
this->m_worldModel->unk_0188 = mount->unk_0188;
|
||||
this->SetMountModel(nullptr);
|
||||
this->SetKeyBoneSequence(this->m_worldModel, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 1.0f, 0, 1, 0);
|
||||
this->m_animationState &= 0xFF77DFFB;
|
||||
this->UpdateBaseAnimation(0, -1);
|
||||
this->UpdateSelectionRadius();
|
||||
this->UpdateEffectAttachments();
|
||||
this->m_soundDataOverride = nullptr;
|
||||
|
||||
if (this->m_obj->m_guid == CGWorldFrame::GetActiveCamera()->m_targetGUID) {
|
||||
CGGameUI::ResetCamera(this->m_obj->m_guid);
|
||||
}
|
||||
|
||||
this->PlayDismountSound();
|
||||
|
||||
if (a2) {
|
||||
this->UpdateUnitCollisionBox(1, 0);
|
||||
}
|
||||
|
||||
if (this->GetObjectModel()->IsLoaded(0, 0)) {
|
||||
this->InitWheels();
|
||||
} else {
|
||||
this->m_wheelMask = 0;
|
||||
}
|
||||
|
||||
this->UpdateObjectEffectAnimationStates();
|
||||
this->m_clientFlags &= ~0x10000000;
|
||||
}
|
||||
|
||||
// VERIFY: 0ebfdfad manual
|
||||
// OFFSET: 0x0073D5D0
|
||||
void CGUnit_C::CreateUnitMount(int32_t a2, int32_t a3) {
|
||||
this->m_wheelMask = 0;
|
||||
|
||||
if (!this->m_mountModel) {
|
||||
CreatureDisplayInfoRec* displayInfo = g_creatureDisplayInfoDB.GetRecord(this->m_mountDisplayId);
|
||||
|
||||
if (!displayInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureModelDataRec* modelData = g_creatureModelDataDB.GetRecord(displayInfo->m_modelID);
|
||||
|
||||
if (!modelData) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_mountScale = displayInfo->m_creatureModelScale;
|
||||
CM2Model* mount = World::s_m2Scene->CreateModel(modelData->m_modelName, 0);
|
||||
mount->SetSequenceCallback(reinterpret_cast<void*>(&CGUnit_C::MountAnimEndCallback), this->m_obj->m_guid.m_guid);
|
||||
mount->SetEventCallback(reinterpret_cast<void*>(&CGUnit_C::AnimEventCallback), this->m_obj->m_guid.m_guid);
|
||||
C44Matrix transform = this->m_worldModel->m_worldTransform;
|
||||
mount->m_fFlags |= 0x8000;
|
||||
mount->m_worldTransform = transform;
|
||||
CCharacterComponent::ApplyMonsterGeosets(mount, displayInfo);
|
||||
CCharacterComponent::ReplaceMonsterSkin(mount, displayInfo, modelData);
|
||||
this->SetMountModel(mount);
|
||||
mount->Release();
|
||||
this->m_mountFootprintTextureId = modelData->m_footprintTextureID;
|
||||
this->m_mountFootprintLength = modelData->m_footprintTextureWidth * 0.027777778f;
|
||||
this->m_mountFootprintWidth = 0.027777778f * modelData->m_footprintTextureLength;
|
||||
this->m_soundDataOverride = this->GetMountSoundDataRec();
|
||||
this->m_mountModel->m_fFlags ^= (this->m_mountModel->m_fFlags ^ this->m_worldModel->m_fFlags) & 0x80000;
|
||||
this->m_worldModel->m_fFlags &= ~0x80000;
|
||||
CM2Model* parent = this->m_worldModel->m_attachParent;
|
||||
uint32_t attachmentId = this->m_worldModel->m_attachmentId;
|
||||
|
||||
if (parent) {
|
||||
this->m_worldModel->DetachFromParent();
|
||||
}
|
||||
|
||||
this->m_worldModel->AttachToParent(this->m_mountModel, 0, nullptr, 0);
|
||||
|
||||
if (parent) {
|
||||
this->m_mountModel->AttachToParent(parent, attachmentId, nullptr, 0);
|
||||
}
|
||||
|
||||
this->SetKeyBoneSequence(this->m_worldModel, 0xFFFFFFFF, this->m_mountAnimBehaviorId, 0xFFFFFFFF, 0, 1.0f, 1, 1, 0);
|
||||
C44Matrix scale(1.0f / this->m_mountScale);
|
||||
this->m_worldModel->m_fFlags |= 0x8000;
|
||||
this->m_worldModel->m_worldTransform = scale;
|
||||
mount->unk_0180 = this->m_worldModel->unk_0180;
|
||||
mount->unk_0184 = this->m_worldModel->unk_0184;
|
||||
mount->unk_0188 = this->m_worldModel->unk_0188;
|
||||
this->m_worldModel->m_fadeAlpha = 1.0f;
|
||||
this->m_worldModel->unk_0180 = 1.0f;
|
||||
this->m_worldModel->unk_0184 = 1.0f;
|
||||
this->m_worldModel->unk_0188 = 1.0f;
|
||||
this->m_worldModel->unk_018C = 0.0f;
|
||||
this->m_worldModel->unk_0190 = 0.0f;
|
||||
this->m_worldModel->unk_0194 = 0.0f;
|
||||
|
||||
if ((this->m_obj->m_type & TYPEMASK_PLAYER) && a3 && !static_cast<CGPlayer_C*>(this)->UpdateMountedCollisionBox(modelData->m_mountHeight, a2)) {
|
||||
this->Dismount();
|
||||
}
|
||||
}
|
||||
|
||||
CEffect* effect = this->m_mountTransitionEffect;
|
||||
|
||||
if (effect && !(effect->m_flags & 0x100)) {
|
||||
effect->MoveToDestroyList();
|
||||
}
|
||||
|
||||
this->m_animationState |= 0x10;
|
||||
this->UpdateBaseAnimation(0, -1);
|
||||
|
||||
if (this->m_obj->m_guid == CGWorldFrame::GetActiveCamera()->m_targetGUID) {
|
||||
CGGameUI::ResetCamera(this->m_obj->m_guid);
|
||||
}
|
||||
|
||||
this->UpdateObjectEffectAnimationStates();
|
||||
}
|
||||
|
||||
// VERIFY: e8fc52d0 manual
|
||||
// OFFSET: 0x0073C140
|
||||
void CGUnit_C::MountAnimEndCallback(CM2Model* model, uint32_t boneId, uint32_t sequenceId, int32_t interrupted, uint32_t time, uint64_t param) {
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(WOWGUID{ param }, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (!unit) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (unit->m_mountModel && unit->m_vehicle && unit->m_vehicle->m_vehicleRec && unit->m_vehicle->IsBoneAnimPlaying(boneId)) {
|
||||
unit->m_vehicle->BoneAnimEndHandler(model, boneId, sequenceId, interrupted, time);
|
||||
} else {
|
||||
unit->MountAnimEndHandler(model, boneId, sequenceId, interrupted, time);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 3001c8a3 auto
|
||||
// OFFSET: 0x0073BFF0
|
||||
void CGUnit_C::MountAnimEndHandler(CM2Model* model, uint32_t boneId, uint32_t sequenceId, int32_t interrupted, uint32_t time) {
|
||||
if (this->m_awaitingEndAnimId == static_cast<int32_t>(sequenceId)) {
|
||||
this->m_awaitingEndAnimId = -1;
|
||||
}
|
||||
|
||||
if (sequenceId == 192 || sequenceId == 200) {
|
||||
this->m_animationState &= ~0x40000;
|
||||
}
|
||||
|
||||
if (sequenceId == 121) {
|
||||
this->m_animationState &= ~0x80000;
|
||||
} else if (sequenceId == 37) {
|
||||
this->m_animationState &= ~0x800000;
|
||||
}
|
||||
|
||||
if (interrupted) {
|
||||
if (sequenceId == 39 || sequenceId == 187) {
|
||||
this->m_animationState &= ~0x4;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_animationState = (this->m_animationState & ~0x60) | 0x10;
|
||||
this->OnBaseAnimEnd(model, boneId, sequenceId);
|
||||
this->m_animationState |= 0x70;
|
||||
}
|
||||
|
||||
// VERIFY: 381b5889 manual
|
||||
// OFFSET: 0x00724EA0
|
||||
void CGUnit_C::PostShutdown() {
|
||||
CMissile::Destroy();
|
||||
CGNamePlateFrame* plate = s_unusedNamePlates.Head();
|
||||
|
||||
while (!s_unusedNamePlates.IsEnd(plate)) {
|
||||
CGNamePlateFrame* next = s_unusedNamePlates.RawNext(plate);
|
||||
s_unusedNamePlates.UnlinkNode(plate);
|
||||
delete plate;
|
||||
plate = next;
|
||||
}
|
||||
|
||||
CGUnit_C::s_lastNPCSoundGUID = WOWGUID();
|
||||
CVehicle_C::UninitSystem();
|
||||
CVehiclePassenger_C::UninitSystem();
|
||||
CVehicleCamera_C::UninitSystem();
|
||||
CGUnit_C::ShutdownMissileTrajectorySystem();
|
||||
}
|
||||
|
||||
// VERIFY: dc577adb manual
|
||||
// OFFSET: 0x00723A50
|
||||
void CGUnit_C::FootstepAnimEventHit(const C3Vector* position, int32_t left) {
|
||||
if (this->m_unit->m_unitFieldPetnumber || (this->m_movement->m_flags & 0x40000000) || (this->m_unit->m_unitFieldBytes1[2] & 0x2) || this->GetTransportGUID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((this->m_obj->m_type & TYPEMASK_PLAYER) && (static_cast<CGPlayer_C*>(this)->m_player->m_playerFlags & 0x10)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const C3Vector& cameraPos = CGWorldFrame::GetActiveCamera()->m_position;
|
||||
float dx = position->x - cameraPos.x;
|
||||
float dy = position->y - cameraPos.y;
|
||||
float dz = position->z - cameraPos.z;
|
||||
float distanceSquared = dx * dx + (dy * dy + dz * dz);
|
||||
|
||||
if (distanceSquared > 2500.0f) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((CWorld::enables & 0x400) && !(this->m_modelData->m_flags & 0x20)) {
|
||||
float size[2];
|
||||
size[0] = 0.0f;
|
||||
size[1] = 0.0f;
|
||||
int32_t textureId;
|
||||
this->GetFootprintInfo(&textureId, size);
|
||||
WOWGUID guid = this->m_obj->m_guid;
|
||||
int32_t activePlayer = guid == ClntObjMgrGetActivePlayer() ? 1 : 0;
|
||||
World::NewFootprint(textureId, size, position, this->GetFacing(), left == 0, this->m_terrainTypeId, activePlayer);
|
||||
}
|
||||
|
||||
if (this->m_modelData->m_footstepShakeSize) {
|
||||
CGWorldFrame::GetActiveCamera()->AddShakeById(this->m_modelData->m_footstepShakeSize, position);
|
||||
}
|
||||
|
||||
if (distanceSquared > 625.0f || (this->m_movement->m_flags & 0x2) || (this->m_modelData->m_flags & 0x1) || !CGUnit_C::s_cvShowFootPrintParticles->m_intValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t liquidType;
|
||||
float liquidHeight;
|
||||
int32_t liquidFlags;
|
||||
|
||||
if (World::QueryObjectLiquid(this->m_worldObject, &liquidType, &liquidHeight, &liquidFlags)) {
|
||||
int32_t flag8;
|
||||
int32_t flag9;
|
||||
World::QueryObjectLiquidFlags(this->m_worldObject, &flag8, &flag9);
|
||||
|
||||
if (!flag9) {
|
||||
return;
|
||||
}
|
||||
|
||||
float depth = liquidHeight - this->GetPosition().z;
|
||||
|
||||
if (this->m_movementData.m_collisionHeight * 0.5f <= depth) {
|
||||
return;
|
||||
}
|
||||
|
||||
C3Vector splash;
|
||||
splash.x = position->x;
|
||||
splash.y = position->y;
|
||||
splash.z = depth + position->z;
|
||||
CEffect* effect = new (SMemAlloc(sizeof(CEffect), __FILE__, __LINE__, 0)) CEffect();
|
||||
WOWGUID owner = this->m_obj->m_guid;
|
||||
effect->AddSpecialByPosition(!this->IsRunning(), splash, &owner, 0x220, CGObject_C::EffectOnceHandler);
|
||||
effect->Release();
|
||||
return;
|
||||
}
|
||||
|
||||
TerrainTypeRec* terrain = g_terrainTypeDB.GetRecord(this->m_terrainTypeId);
|
||||
|
||||
if (!terrain) {
|
||||
return;
|
||||
}
|
||||
|
||||
SpellVisualEffectNameRec* effectName = g_spellVisualEffectNameDB.GetRecord(this->IsRunning() ? terrain->m_footstepSprayWalk : terrain->m_footstepSprayRun);
|
||||
|
||||
if (!effectName) {
|
||||
return;
|
||||
}
|
||||
|
||||
C3Vector effectPosition = *position;
|
||||
|
||||
if (this->GetTransportGUID()) {
|
||||
C44Matrix transport;
|
||||
MovementGetTransportMtxX(WOWGUID{ this->GetTransportGUID() }, &transport, this->m_obj->m_guid, __FILE__, __LINE__);
|
||||
effectPosition *= transport.AffineInverse();
|
||||
}
|
||||
|
||||
CEffect* effect = new (SMemAlloc(sizeof(CEffect), __FILE__, __LINE__, 0)) CEffect();
|
||||
WOWGUID owner = this->m_obj->m_guid;
|
||||
effect->InitFromUnit(effectPosition, OsGetAsyncTimeMs(), 0, nullptr, effectName, &owner, 0x220, CGObject_C::EffectOnceHandler, 0, nullptr, WOWGUID{ this->GetTransportGUID() });
|
||||
effect->Release();
|
||||
}
|
||||
|
||||
// VERIFY: 5b00631f auto
|
||||
// OFFSET: 0x007555E0
|
||||
void CGUnit_C::ShakeCameraOnHit() {
|
||||
if (this->m_unit->m_unitFieldPetnumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t shakeId = this->m_modelData->m_deathThudShakeSize;
|
||||
|
||||
if (shakeId) {
|
||||
C3Vector position = this->GetPosition();
|
||||
CGWorldFrame::GetActiveCamera()->AddShakeById(shakeId, &position);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 9e04967c manual
|
||||
// OFFSET: 0x0071DCC0
|
||||
int32_t IsSpecialIdleAnim(uint32_t animId) {
|
||||
if (IsSpellCastAnim(animId)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
AnimationDataRec* rec = g_animationDataDB.GetRecord(animId);
|
||||
|
||||
if (rec && rec->m_behaviorID == 107) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
rec = g_animationDataDB.GetRecord(animId);
|
||||
|
||||
if (rec && rec->m_behaviorID == 46) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return GetAnimBehaviorId(animId) == 49;
|
||||
}
|
||||
|
||||
// VERIFY: 597f8f44 manual
|
||||
// OFFSET: 0x0072CDE0
|
||||
void CreatureQueryCallback(int32_t id, const WOWGUID& guid, void* param, bool success) {
|
||||
CreatureStats_C* stats = g_creatureDBCache.GetRecord(id, WOWGUID(), nullptr, nullptr, false);
|
||||
|
||||
if (!stats) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(guid, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (unit) {
|
||||
unit->DestroyNamePlate();
|
||||
unit->m_creatureCacheEntry = stats;
|
||||
|
||||
if (stats->m_family) {
|
||||
unit->UpdateModelScale(nullptr);
|
||||
}
|
||||
|
||||
unit->UpdateUnitCollisionBox(1, 0);
|
||||
}
|
||||
|
||||
CGGameUI::UnitNameUpdate(guid);
|
||||
Script_SendUnitSignal(guid, SCRIPT_EVENT_UNIT_CLASSIFICATION_CHANGED);
|
||||
TotemInfo* totem = CGGameUI::GetTotemInfo(guid);
|
||||
|
||||
if (totem) {
|
||||
totem->m_name = unit->GetUnitName(nullptr, 1);
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_PLAYER_TOTEM_UPDATE, "%d", totem->m_slot + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 4078ec8f manual
|
||||
// OFFSET: 0x00755380
|
||||
void CGUnit_C::ShowBloodSpurt(const WOWGUID& attacker, int32_t a3) {
|
||||
UnitBloodRec* blood = this->GetBloodRecord();
|
||||
|
||||
if (!blood) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t attachType = 15;
|
||||
CGUnit_C* attackerUnit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(attacker, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (attackerUnit) {
|
||||
C3Vector position = this->GetPosition();
|
||||
C3Vector attackerPosition = attackerUnit->GetPosition();
|
||||
float dx = attackerPosition.x - position.x;
|
||||
float dy = attackerPosition.y - position.y;
|
||||
float facing = this->CGUnit_C::GetRenderFacing();
|
||||
float cosFacing = cosf(facing);
|
||||
float sinFacing = sinf(facing);
|
||||
|
||||
if (dy * sinFacing + dx * cosFacing < 0.0f) {
|
||||
attachType = 16;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t effectId = attachType == 15 ? blood->m_combatBloodSpurtFront[a3 != 0] : blood->m_combatBloodSpurtBack[a3 != 0];
|
||||
SpellVisualEffectNameRec* effectName = g_spellVisualEffectNameDB.GetRecord(effectId);
|
||||
|
||||
if (!effectName) {
|
||||
return;
|
||||
}
|
||||
|
||||
CEffect* effect = new (SMemAlloc(sizeof(CEffect), __FILE__, __LINE__, 0)) CEffect();
|
||||
WOWGUID source = this->m_obj->m_guid;
|
||||
effect->AddEffect(attachType, 0, nullptr, effectName, &attacker, &source, 0x20, CGObject_C::EffectOnceHandler, nullptr, 0, nullptr);
|
||||
effect->Release();
|
||||
}
|
||||
|
||||
// VERIFY: 8ffb4576 manual
|
||||
// OFFSET: 0x00720BF0
|
||||
int32_t CGUnit_C::OverrideMissileFirePos(C3Vector* position, const SpellRec* spell) {
|
||||
if (!this->m_worldModel || !this->m_worldModel->IsLoaded(0, 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const SpellVisualRec* visual = GetSpellVisual(spell);
|
||||
|
||||
if (!visual) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
C3Vector offset;
|
||||
|
||||
if (visual->m_missileAttachment == -1) {
|
||||
if (0.0f == visual->m_missileCastOffset[0] && 0.0f == visual->m_missileCastOffset[1] && 0.0f == visual->m_missileCastOffset[2]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
CM2Model* model = this->m_worldModel;
|
||||
|
||||
if (model && model->IsLoaded(0, 0) && model->HasAttachment(s_effectAttachmentIds[12])) {
|
||||
offset.x = visual->m_missileCastOffset[0];
|
||||
offset.y = -visual->m_missileCastOffset[1];
|
||||
offset.z = visual->m_missileCastOffset[2];
|
||||
*position = this->GetAttachmentPosition(s_effectAttachmentIds[12], &offset);
|
||||
return 1;
|
||||
}
|
||||
|
||||
C44Matrix matrix = this->GetModelMatrix();
|
||||
matrix.d0 = 0.0f;
|
||||
matrix.d1 = 0.0f;
|
||||
matrix.d2 = 0.0f;
|
||||
offset.x = visual->m_missileCastOffset[0];
|
||||
offset.y = -visual->m_missileCastOffset[1];
|
||||
offset.z = visual->m_missileCastOffset[2];
|
||||
C3Vector rotated = offset * matrix;
|
||||
*position = this->GetModelPosition() + rotated;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t raw = visual->m_flags & 0x200;
|
||||
|
||||
if (!this->HasAttachmentForEffect(visual->m_missileAttachment, raw)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
offset.x = visual->m_missileCastOffset[0];
|
||||
offset.y = -visual->m_missileCastOffset[1];
|
||||
offset.z = visual->m_missileCastOffset[2];
|
||||
*position = this->GetAttachmentPositionForEffect(visual->m_missileAttachment, offset, raw);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 228a87fd manual
|
||||
// OFFSET: 0x00732100
|
||||
CM2Model* CGUnit_C::CreateItemModel(uint32_t displayId, uint32_t inventoryType, float* scale) {
|
||||
if (scale) {
|
||||
*scale = 1.0f;
|
||||
}
|
||||
|
||||
const char* path;
|
||||
|
||||
switch (inventoryType) {
|
||||
case 1:
|
||||
path = "Item\ObjectComponents\Head\\";
|
||||
break;
|
||||
case 3:
|
||||
path = "Item\ObjectComponents\Shoulder\\";
|
||||
break;
|
||||
case 14:
|
||||
path = "Item\ObjectComponents\Shield\\";
|
||||
break;
|
||||
case 24:
|
||||
path = "Item\ObjectComponents\Ammo\\";
|
||||
break;
|
||||
case 27:
|
||||
path = "Item\ObjectComponents\Quiver\\";
|
||||
break;
|
||||
default:
|
||||
path = "Item\ObjectComponents\Weapon\\";
|
||||
break;
|
||||
}
|
||||
|
||||
ItemDisplayInfoRec rec;
|
||||
|
||||
if (!g_itemDisplayInfoDB.GetRecordByIndex(displayId, &rec)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t index;
|
||||
|
||||
if (*rec.m_modelName[0]) {
|
||||
index = 0;
|
||||
} else if (*rec.m_modelName[1]) {
|
||||
index = 1;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
char fileName[260];
|
||||
|
||||
if (inventoryType == 1) {
|
||||
int32_t sex = this->m_displayInfoExtra ? this->m_displayInfoExtra->m_displaySexID : this->m_unit->m_unitFieldBytes0[2];
|
||||
ChrRacesRec* race = g_chrRacesDB.GetRecord(sex);
|
||||
|
||||
if (!race) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SStrPrintf(fileName, sizeof(fileName), "%s%s_%s%s.mdx", path, rec.m_modelName[index], race->m_clientPrefix, s_genderSuffix[sex]);
|
||||
} else {
|
||||
SStrPrintf(fileName, sizeof(fileName), "%s%s", path, rec.m_modelName[index]);
|
||||
}
|
||||
|
||||
CM2Model* model = World::s_m2Scene->CreateModel(fileName, 0);
|
||||
|
||||
if (!model) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (*rec.m_modelTexture[index]) {
|
||||
SStrPrintf(fileName, sizeof(fileName), "%s%s", path, rec.m_modelTexture[index]);
|
||||
CStatus status;
|
||||
CTexture* texture = CreateTexture(fileName, &status);
|
||||
|
||||
if (texture) {
|
||||
model->ReplaceTexture(2, texture);
|
||||
HandleClose(reinterpret_cast<HOBJECT>(texture));
|
||||
}
|
||||
}
|
||||
|
||||
CCharacterComponent::ComponentUtilAddItemVisual(model, rec.m_itemVisual);
|
||||
CM2Model* worldModel = this->m_worldModel;
|
||||
|
||||
if (scale && worldModel && worldModel->IsLoaded(0, 0)) {
|
||||
uint32_t attachId;
|
||||
|
||||
switch (inventoryType) {
|
||||
case 1:
|
||||
attachId = 11;
|
||||
break;
|
||||
case 14:
|
||||
attachId = 0;
|
||||
break;
|
||||
case 22:
|
||||
attachId = 2;
|
||||
break;
|
||||
case 24:
|
||||
case 25:
|
||||
attachId = 0xFFFFFFFF;
|
||||
break;
|
||||
default:
|
||||
attachId = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (worldModel->HasAttachment(attachId)) {
|
||||
C44Matrix transform = worldModel->GetAttachmentWorldTransform(attachId);
|
||||
*scale = sqrtf(transform.a1 * transform.a1 + transform.a2 * transform.a2 + transform.a0 * transform.a0);
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
// VERIFY: 0a6c1295 auto
|
||||
// OFFSET: 0x00719FF0
|
||||
UnitBloodRec* CGUnit_C::GetBloodRecord() {
|
||||
if (!this->m_bloodlevels) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return g_unitBloodDB.GetRecord(this->m_bloodlevels->m_violencelevel[ViolenceGetLevel()]);
|
||||
}
|
||||
|
||||
// VERIFY: ce51319d auto
|
||||
// OFFSET: 0x00725010
|
||||
void CGUnit_C::OnVirtualItemChanged(uint32_t slot, int32_t oldItemId) {
|
||||
ItemRec* oldRec = g_itemDB.GetRecord(oldItemId);
|
||||
ItemRec* rec = g_itemDB.GetRecord(this->m_unit->m_unitVirtualItemSlotId[slot]);
|
||||
this->m_virtualItemDisplayId[slot] = rec ? rec->m_displayInfoID : 0;
|
||||
CGUnitVirtualItem item;
|
||||
item.m_pad[0] = 0;
|
||||
item.m_pad[1] = 0;
|
||||
|
||||
if (rec) {
|
||||
item.m_classID = static_cast<uint8_t>(rec->m_classID);
|
||||
item.m_subclassID = static_cast<uint8_t>(rec->m_subclassID);
|
||||
item.m_soundOverrideSubclassID = static_cast<uint8_t>(rec->m_soundOverrideSubclassID);
|
||||
item.m_material = static_cast<uint8_t>(rec->m_material);
|
||||
item.m_inventoryType = static_cast<uint8_t>(rec->m_inventoryType);
|
||||
item.m_sheatheType = static_cast<uint8_t>(rec->m_sheatheType);
|
||||
} else {
|
||||
item.m_classID = 0;
|
||||
item.m_subclassID = 0;
|
||||
item.m_soundOverrideSubclassID = 0;
|
||||
item.m_material = 0;
|
||||
item.m_inventoryType = 0;
|
||||
item.m_sheatheType = 0;
|
||||
}
|
||||
|
||||
this->m_virtualItem[slot] = item;
|
||||
SHEATHE_TYPE sheatheType = static_cast<SHEATHE_TYPE>(oldRec ? oldRec->m_sheatheType : 0);
|
||||
CCharacterComponent::RemoveHandItem(this->m_worldModel, s_virtualItemInvSlots[slot], sheatheType, false);
|
||||
|
||||
if (slot == 1) {
|
||||
CCharacterComponent::RemoveHandItem(this->m_worldModel, s_virtualItemInvSlots[1], sheatheType, true);
|
||||
}
|
||||
|
||||
const CGUnitVirtualItem* current = this->GetVirtualItem(slot, false);
|
||||
ItemDisplayInfoRec displayRec;
|
||||
|
||||
if (current && this->GetVirtualItemDisplayRec(slot, displayRec)) {
|
||||
GEOCOMPONENTLINKS link = CCharacterComponent::AddHandItem(this->m_worldModel, &displayRec, s_virtualItemInvSlots[slot], static_cast<SHEATHE_TYPE>(current->m_sheatheType), this->m_sheatheState == 0, current->m_inventoryType == 14, false, 0);
|
||||
|
||||
if (this->m_characterComponent) {
|
||||
this->m_characterComponent->SetItemSlotUsingAttachSlot(static_cast<ITEM_SLOT>(-1), link);
|
||||
}
|
||||
|
||||
this->SetWeaponTrail(this->m_worldModel, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,7 @@ class CGUnitVirtualItem {
|
||||
/* 0006 */ uint8_t m_pad [2];
|
||||
};
|
||||
|
||||
class UnitBloodRec;
|
||||
class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
public:
|
||||
int32_t InitializeExtendedDisplay(CGPlayer_C* player, int32_t hasDisplayInfo);
|
||||
@@ -144,6 +145,7 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
int32_t IsPlayingUnarmedAnim();
|
||||
float GetMeleeChanceToCrit() const;
|
||||
float GetHealthRegenRateFromSpirit() const;
|
||||
float GetManaRegenRateFromSpirit() const;
|
||||
CGUnit_C* GetVehicleUnit() const;
|
||||
void SetWeaponTrail(CM2Model* model, uint32_t hand);
|
||||
static void InitActiveMover(const WOWGUID& guid);
|
||||
@@ -227,8 +229,10 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
static bool __stdcall IsAreaInAreaGroup(int32_t areaId, int32_t areaGroupId, int32_t* checked);
|
||||
static float __fastcall ComputeTrackingElevationAngle(const C3Vector& position, const C3Vector& target);
|
||||
static void InitMissileTrajectorySystem();
|
||||
static void ShutdownMissileTrajectorySystem();
|
||||
static void UpdateVehicleUISliders(CGUnit_C* unit, const VehicleRec* vehicleRec);
|
||||
static void AnimEndCallback(CM2Model* model, uint32_t boneId, uint32_t sequenceId, int32_t interrupted, uint32_t time, uint64_t param);
|
||||
static void MountAnimEndCallback(CM2Model* model, uint32_t boneId, uint32_t sequenceId, int32_t interrupted, uint32_t time, uint64_t param);
|
||||
static void AnimEventCallback(CM2Model* model, uint32_t boneId, uint32_t eventId, uint32_t data, const C3Vector* position, uint32_t time, uint64_t param);
|
||||
|
||||
/* 00DC */ TSList<void> m_unitMirrorLists [142];
|
||||
@@ -468,7 +472,7 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
int32_t IsUpdatingMissileTrajectory() const;
|
||||
int32_t IsMissileTrajectoryUpdateWaitingForMissileRelease() const;
|
||||
void SendFinalMissileTrajectoryUpdate();
|
||||
int32_t ComputeMissileTrajectory(const SpellRec* spell, int32_t* a2, CGUnit_C** a3, float* a4, C3Vector* position, float* facing, C3Vector* points, uint32_t* count, int32_t a9);
|
||||
int32_t ComputeMissileTrajectory(const SpellRec* spell, int32_t* a2, CGUnit_C** a3, C3Vector* launchPosition, C3Vector* position, float* facing, C3Vector* points, uint32_t* count, int32_t a9);
|
||||
int32_t OverrideMissileFirePos(C3Vector* position, const SpellRec* spell);
|
||||
bool IsLocalClientControlled() const;
|
||||
void FreeComponent();
|
||||
@@ -868,6 +872,7 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
void SetAttacking(WOWGUID guid);
|
||||
void UpdateObjectEffectMovementStates();
|
||||
void DestroyUnitMount(int32_t a2);
|
||||
void SetMountModel(CM2Model* model);
|
||||
void OnDeathAnimate();
|
||||
void ReadLootList(CDataStore* msg);
|
||||
void RemoveLootEffect();
|
||||
@@ -942,12 +947,14 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
int32_t UnsheatheRightWeapon();
|
||||
int32_t UnsheatheLeftWeapon();
|
||||
void AnimEndHandler(CM2Model* model, uint32_t boneId, uint32_t sequenceId, int32_t interrupted, uint32_t time);
|
||||
void MountAnimEndHandler(CM2Model* model, uint32_t boneId, uint32_t sequenceId, int32_t interrupted, uint32_t time);
|
||||
void OnBaseAnimEnd(CM2Model* model, uint32_t boneId, uint32_t sequenceId);
|
||||
void ExchangeSheathedWeapon(const C3Vector* position, uint32_t hand, uint32_t flag);
|
||||
int32_t GetPrecastStartAnim();
|
||||
static void BowModelLoaded(CM2Model* model, void* arg);
|
||||
void PlayWoundAnimKit(int32_t crit);
|
||||
void ShowBloodSpurt(const WOWGUID& attacker, int32_t a3);
|
||||
UnitBloodRec* GetBloodRecord();
|
||||
void ModifyPredictedPower(int32_t powerType, int32_t delta);
|
||||
void AddWorldText(const WOWGUID& source, int32_t reason, const SpellRec* spell, bool periodic);
|
||||
void AddWorldHealingText(const WOWGUID& source, int32_t amount, const SpellRec* spell, bool crit, int32_t a6);
|
||||
@@ -1096,7 +1103,6 @@ void NameQueryCallback(int32_t id, const WOWGUID& guid, void* param, bool succes
|
||||
float CalculateFacingTo(const C3Vector* from, const C3Vector* to);
|
||||
|
||||
void WeaponTrailsInitialize();
|
||||
void WeaponTrailsShutdown();
|
||||
|
||||
const char* GetObjectNameFromGuid(const WOWGUID& guid);
|
||||
void WriteMovementPacket(CGUnit_C* unit, uint32_t msgId, CDataStore* msg, int32_t include);
|
||||
|
||||
@@ -922,3 +922,19 @@ void CVehiclePassenger_C::UpdateAll(uint32_t time) {
|
||||
passenger = next;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 8bae8c48 manual
|
||||
// OFFSET: 0x00749CB0
|
||||
void CVehiclePassenger_C::ExecutePendingRescueTransitions() {
|
||||
for (uint32_t i = 0; i < CVehiclePassenger_C::s_rescueTransitions->Count(); i++) {
|
||||
VehiclePassengerRescueTransition& transition = CVehiclePassenger_C::s_rescueTransitions->m_data[i];
|
||||
CGUnit_C* unit = static_cast<CGUnit_C*>(ClntObjMgrObjectPtr(transition.m_passengerGuid, TYPEMASK_UNIT, __FILE__, __LINE__));
|
||||
|
||||
if (unit && unit->m_vehiclePassenger) {
|
||||
unit->m_vehiclePassenger->BeginTransition(transition.m_vehicleGuid, transition.m_seat, transition.m_instant);
|
||||
}
|
||||
}
|
||||
|
||||
CVehiclePassenger_C::s_rescueTransitions->m_count = 0;
|
||||
CVehiclePassenger_C::s_pendingCount = 0;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class CVehiclePassenger_C {
|
||||
static void Init(CGUnit_C* unit);
|
||||
|
||||
void StopMovement();
|
||||
void BeginTransition(WOWGUID vehicleGuid, uint8_t seat, uint8_t instant);
|
||||
void SetState(uint32_t state, CGUnit_C* vehicle, uint8_t seat, VehicleSeatRec* seatRec, uint32_t time, WOWGUID vehicleGuid);
|
||||
|
||||
/* 0000 */ uint32_t m_memHandle;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <windows.h>
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
#include "Engine/Source/Tempest/C4Quaternion.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "WoW/Source/WorldClient/Map.h"
|
||||
#include "WoW/Source/WorldClient/World.h"
|
||||
#include "_Triage/AreaList.h"
|
||||
#include "Engine/Source/Tempest/CMath.h"
|
||||
|
||||
// STATIC: 0x009F2010
|
||||
const char SI2::s_channelGroupNames[18][32] = {
|
||||
@@ -72,6 +73,9 @@ const int32_t SI2::s_channelGroupMaxSounds[18] = {
|
||||
4,
|
||||
};
|
||||
|
||||
// STATIC: 0x00AC384C
|
||||
static float s_unk_AC384C = 0.5f;
|
||||
|
||||
// STATIC: 0x00B4A340
|
||||
int32_t SI2::s_channelGroupNumSounds[18];
|
||||
|
||||
@@ -1442,3 +1446,38 @@ void SI2::ForceUpdateZoneSounds() {
|
||||
AreaListUpdateSounds(zone, area, rootRec, groupRec, inside);
|
||||
}
|
||||
|
||||
|
||||
// VERIFY: 34fea195 manual
|
||||
// OFFSET: 0x004C5D60
|
||||
bool SI2::GetObjectPosition(uint64_t guid, C3Vector* position) {
|
||||
CGObject_C* object = ClntObjMgrObjectPtr(WOWGUID{ guid }, TYPEMASK_OBJECT, __FILE__, __LINE__);
|
||||
|
||||
if (object) {
|
||||
*position = object->GetPosition();
|
||||
}
|
||||
|
||||
return object != nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: 8084b184 manual
|
||||
// OFFSET: 0x004C6810
|
||||
int32_t SI2::GetChunkLocation(int32_t* mapId, int32_t* chunkX, int32_t* chunkY, int32_t* subchunkX, int32_t* subchunkY) {
|
||||
*mapId = World::QueryMapId();
|
||||
CGObject_C* player = ClntObjMgrObjectPtr(ClntObjMgrGetActivePlayer(), TYPEMASK_PLAYER, __FILE__, __LINE__);
|
||||
|
||||
if (!player) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
C3Vector position = player->GetPosition();
|
||||
float x = -(position.x - 17066.666f);
|
||||
float y = -(position.y - 17066.666f) * 0.029999999f;
|
||||
*subchunkX = CMath::fint_(y - s_unk_AC384C);
|
||||
x *= 0.029999999f;
|
||||
*subchunkY = CMath::fint_(x - s_unk_AC384C);
|
||||
*chunkX = (*subchunkX >> 4) & 0x3F;
|
||||
*chunkY = (*subchunkY >> 4) & 0x3F;
|
||||
*subchunkX &= 0xF;
|
||||
*subchunkY &= 0xF;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1421,3 +1421,200 @@ void LoadAddOnEnableState(const char* character) {
|
||||
|
||||
SFile::Unload(data);
|
||||
}
|
||||
|
||||
// VERIFY: 3bde2f06 manual
|
||||
// OFFSET: 0x005F5620
|
||||
void UnloadAddOns() {
|
||||
int32_t changed = 0;
|
||||
char path[260];
|
||||
SStrPrintf(path, sizeof(path), "WTF\\Account\\%s\\SavedVariables", s_addOnAccountName);
|
||||
|
||||
if (!OsDirectoryExists(path)) {
|
||||
OsCreateDirectory(path, 1);
|
||||
}
|
||||
|
||||
SStrPrintf(path, sizeof(path), "WTF\\Account\\%s\\%s\\%s\\SavedVariables", s_addOnAccountName, ClientServices::GetSelectedRealmName(), ClientServices::GetCharacterName());
|
||||
|
||||
if (!OsDirectoryExists(path)) {
|
||||
OsCreateDirectory(path, 1);
|
||||
}
|
||||
|
||||
for (UIADDON* addon = s_addons.m_fulllist.Head(); addon; addon = s_addons.Next(addon)) {
|
||||
if (!addon->m_loading) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SStrPrintf(path, sizeof(path), "WTF\\Account\\%s\\SavedVariables\\%s.lua", s_addOnAccountName, addon->m_key.m_str);
|
||||
|
||||
if (addon->m_savedVariables.Count()) {
|
||||
if (OsFileExists(path)) {
|
||||
char backup[260];
|
||||
SStrCopy(backup, path, sizeof(backup));
|
||||
SStrPack(backup, ".bak", sizeof(backup));
|
||||
OsMoveFile(path, backup);
|
||||
} else {
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
HOSFILE file = OsCreateFile(path, OS_GENERIC_WRITE, 0, OS_CREATE_ALWAYS, OS_FILE_ATTRIBUTE_NORMAL, OS_FILE_TYPE_ANY);
|
||||
|
||||
if (file != OS_INVALID_FILE) {
|
||||
FrameScript_GetContext();
|
||||
const char* savedTaint = lua_tainted;
|
||||
|
||||
if (++lua_taintexpected && !lua_taintedclosure) {
|
||||
lua_tainted = nullptr;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < addon->m_savedVariables.Count(); i++) {
|
||||
const char* name = addon->m_savedVariables.m_data[i];
|
||||
|
||||
if (!name || !*name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const char* c = name;
|
||||
|
||||
while (*c < 0 || (*c >= '0' && *c <= '9') || (*c >= 'a' && *c <= 'z') || (*c >= 'A' && *c <= 'Z') || *c == '_') {
|
||||
if (!*++c) {
|
||||
FrameScript_PrintVariable(file, name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t written;
|
||||
OsWriteFile(file, "\r\n", 2, &written);
|
||||
OsCloseFile(file);
|
||||
|
||||
if (lua_taintexpected && !lua_taintedclosure) {
|
||||
lua_tainted = savedTaint;
|
||||
}
|
||||
|
||||
if (--lua_taintexpected <= 0) {
|
||||
lua_taintexpected = 0;
|
||||
}
|
||||
}
|
||||
} else if (OsFileExists(path)) {
|
||||
OsDeleteFile(path);
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
SStrPrintf(path, sizeof(path), "WTF\\Account\\%s\\%s\\%s\\SavedVariables\\%s.lua", s_addOnAccountName, ClientServices::GetSelectedRealmName(), ClientServices::GetCharacterName(), addon->m_key.m_str);
|
||||
|
||||
if (addon->m_savedVariablesPerCharacter.Count()) {
|
||||
if (OsFileExists(path)) {
|
||||
char backup[260];
|
||||
SStrCopy(backup, path, sizeof(backup));
|
||||
SStrPack(backup, ".bak", sizeof(backup));
|
||||
OsMoveFile(path, backup);
|
||||
} else {
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
HOSFILE file = OsCreateFile(path, OS_GENERIC_WRITE, 0, OS_CREATE_ALWAYS, OS_FILE_ATTRIBUTE_NORMAL, OS_FILE_TYPE_ANY);
|
||||
|
||||
if (file != OS_INVALID_FILE) {
|
||||
FrameScript_GetContext();
|
||||
const char* savedTaint = lua_tainted;
|
||||
|
||||
if (++lua_taintexpected && !lua_taintedclosure) {
|
||||
lua_tainted = nullptr;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < addon->m_savedVariablesPerCharacter.Count(); i++) {
|
||||
const char* name = addon->m_savedVariablesPerCharacter.m_data[i];
|
||||
|
||||
if (!name || !*name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const char* c = name;
|
||||
|
||||
while (*c < 0 || (*c >= '0' && *c <= '9') || (*c >= 'a' && *c <= 'z') || (*c >= 'A' && *c <= 'Z') || *c == '_') {
|
||||
if (!*++c) {
|
||||
FrameScript_PrintVariable(file, name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t written;
|
||||
OsWriteFile(file, "\r\n", 2, &written);
|
||||
OsCloseFile(file);
|
||||
|
||||
if (lua_taintexpected && !lua_taintedclosure) {
|
||||
lua_tainted = savedTaint;
|
||||
}
|
||||
|
||||
if (--lua_taintexpected <= 0) {
|
||||
lua_taintexpected = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (OsFileExists(path)) {
|
||||
OsDeleteFile(path);
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
SStrPrintf(path, sizeof(path), "WTF\\Account\\%s\\%s\\SavedVariables\\%s.lua", s_addOnAccountName, ClientServices::GetCharacterName(), addon->m_key.m_str);
|
||||
|
||||
if (OsFileExists(path)) {
|
||||
OsDeleteFile(path);
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
addon->m_loading = false;
|
||||
addon->m_loaded = false;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
SFile::RebuildHash();
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: fceb3ea4 manual
|
||||
// OFFSET: 0x005F76A0
|
||||
void SaveAddOnEnableState() {
|
||||
int32_t created = 0;
|
||||
|
||||
for (ADDONSTATELIST* list = s_addOnStates.Head(); list; list = s_addOnStates.Next(list)) {
|
||||
if (!list->m_accountWide) {
|
||||
continue;
|
||||
}
|
||||
|
||||
list->m_accountWide = false;
|
||||
char path[260];
|
||||
SStrPrintf(path, sizeof(path), "WTF\\Account\\%s\\%s\\%s", s_addOnAccountName, ClientServices::GetSelectedRealmName(), list->m_name);
|
||||
|
||||
if (!OsDirectoryExists(path)) {
|
||||
OsCreateDirectory(path, 1);
|
||||
}
|
||||
|
||||
SStrPack(path, "\\AddOns.txt", sizeof(path));
|
||||
|
||||
if (!created) {
|
||||
created = !OsFileExists(path);
|
||||
}
|
||||
|
||||
HOSFILE file = OsCreateFile(path, OS_GENERIC_WRITE, 0, OS_CREATE_ALWAYS, OS_FILE_ATTRIBUTE_NORMAL, OS_FILE_TYPE_ANY);
|
||||
|
||||
if (file == OS_INVALID_FILE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (ADDONSTATE* state = list->m_states.m_fulllist.Head(); state; state = list->m_states.Next(state)) {
|
||||
char line[1024];
|
||||
SStrPrintf(line, sizeof(line), "%s: %s\r\n", state->m_key.m_str, state->m_enabled ? "enabled" : "disabled");
|
||||
uint32_t written;
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
}
|
||||
|
||||
OsCloseFile(file);
|
||||
}
|
||||
|
||||
if (created) {
|
||||
SFile::RebuildHash();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "WoW/Source/WorldClient/FrameTime.h"
|
||||
#include "WoW/Source/WorldClient/World.h"
|
||||
#include "_Triage/CMoveSpline.h"
|
||||
#include "WoW/Source/DB/DBClient/DBClient.h"
|
||||
|
||||
// STATIC: 0x00AD1B4C
|
||||
float MAX_PITCH_ANGLE = 1.55334306f;
|
||||
@@ -4186,3 +4187,13 @@ void CGCamera::RestoreSavedDistancePitch() {
|
||||
float CGCamera::GetDefaultZoomMinDistance() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
// VERIFY: 26a4f582 manual
|
||||
// OFFSET: 0x00606410
|
||||
void CGCamera::AddShakeById(int32_t shakeId, const C3Vector* position) {
|
||||
CameraShakesRec* shake = g_cameraShakesDB.GetRecord(shakeId);
|
||||
|
||||
if (shake) {
|
||||
this->AddShake(*position, shake->m_shakeType, shake->m_direction, shake->m_amplitude * 0.027777778f, shake->m_frequency, shake->m_duration, shake->m_phase, shake->m_coefficient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ struct MipBits;
|
||||
|
||||
int32_t CopyCursorImage(uint32_t* image, MipBits* mipImages, uint32_t width, uint32_t height);
|
||||
void CursorInitialize();
|
||||
void CursorDestroy();
|
||||
|
||||
void CursorReleaseItemMips();
|
||||
void CursorSetHeldItem(WOWGUID item);
|
||||
|
||||
@@ -828,3 +828,30 @@ int32_t ReadyModelForUI(CGUnit_C* unit, uint32_t flags) {
|
||||
|
||||
return QueuePortraitUpdate(unit, flags) == 0;
|
||||
}
|
||||
|
||||
// VERIFY: 7490c1d9 auto
|
||||
// OFFSET: 0x00617860
|
||||
void PortraitShutdown() {
|
||||
s_portraitMaskGxTex = nullptr;
|
||||
HandleClose(reinterpret_cast<HOBJECT>(s_portraitMaskTexture));
|
||||
s_portraitMaskTexture = nullptr;
|
||||
|
||||
if (s_portraitDepthTexture) {
|
||||
HandleClose(reinterpret_cast<HOBJECT>(s_portraitDepthTexture));
|
||||
s_portraitDepthTexture = nullptr;
|
||||
}
|
||||
|
||||
PortraitCachePurge(&s_playerPortraitCache, 0, 1);
|
||||
PortraitCachePurge(&s_unitPortraitCache, 0, 1);
|
||||
|
||||
for (uint32_t i = 0; i < s_freePortraitTextures.m_count; i++) {
|
||||
HandleClose(reinterpret_cast<HOBJECT>(s_freePortraitTextures.m_data[i]));
|
||||
}
|
||||
|
||||
s_freePortraitTextures.Clear();
|
||||
s_playerPortraits.Clear();
|
||||
s_unitPortraits.Clear();
|
||||
s_itemPortraits.Clear();
|
||||
s_pendingPortraits.Clear();
|
||||
s_freePortraits.Clear();
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ int32_t RTAlphaSupported();
|
||||
void __fastcall UpdateAllPortraits();
|
||||
|
||||
void PortraitInitialize();
|
||||
void PortraitShutdown();
|
||||
void UpdatePendingPortraits();
|
||||
void SetPortraitTexture(CSimpleTexture* texture, const char* fileName);
|
||||
void SetPortraitTexture(CSimpleTexture* texture, uint32_t race, uint32_t sex, WOWGUID guid);
|
||||
|
||||
@@ -442,3 +442,14 @@ void SmartScreenRectPositionFrame(uint32_t grid, CSimpleFrame* frame, CSimpleFra
|
||||
frame->SetPoint(center ? FRAMEPOINT_CENTER : FRAMEPOINT_TOP, parent, FRAMEPOINT_BOTTOMLEFT, point.x, point.y, 1);
|
||||
frame->SetFrameDepth(depth, true);
|
||||
}
|
||||
|
||||
// VERIFY: 98e897bd auto
|
||||
// OFFSET: 0x00616060
|
||||
void SmartScreenRectShutdown() {
|
||||
s_searchQueue.Clear();
|
||||
s_freeNodes.Clear();
|
||||
|
||||
for (uint32_t i = 0; i < 2; i++) {
|
||||
s_grids[i].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ class CRect;
|
||||
class CSimpleFrame;
|
||||
|
||||
void SmartScreenRectClearAllGrids();
|
||||
void SmartScreenRectShutdown();
|
||||
void SmartScreenRectClearGrid(uint32_t grid);
|
||||
void SmartScreenRectPlace(uint32_t grid, CRect& rect);
|
||||
void SmartScreenRectPositionFrame(uint32_t grid, CSimpleFrame* frame, CSimpleFrame* parent, const C3Vector& position, int32_t center);
|
||||
|
||||
@@ -48,6 +48,7 @@ class ItemLinkInfo {
|
||||
};
|
||||
|
||||
class CGTalentGroup_C;
|
||||
struct ScriptAuraInfo;
|
||||
class CGTooltip;
|
||||
class TalentRec;
|
||||
class CAaRect;
|
||||
@@ -253,4 +254,7 @@ class CSimpleUI {
|
||||
extern uint32_t s_tooltipTitleColor;
|
||||
extern uint32_t s_tooltipTextColor;
|
||||
|
||||
int32_t SetCompareItem(CGTooltip* tooltip, uint32_t itemId, int32_t offset, int32_t shift, CGTooltip* compare);
|
||||
int32_t SetTooltipUnitAura(CGTooltip* tooltip, ScriptAuraInfo* info);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
int32_t Script_AddFontStrings(lua_State* L);
|
||||
int32_t Script_SetAnchorType(lua_State* L);
|
||||
int32_t Script_SetPetAction(lua_State* L);
|
||||
int32_t Script_SetShapeshift(lua_State* L);
|
||||
int32_t Script_SetPossession(lua_State* L);
|
||||
int32_t Script_SetQuestItem(lua_State* L);
|
||||
int32_t Script_SetQuestLogItem(lua_State* L);
|
||||
@@ -57,14 +56,12 @@ int32_t Script_SetTradeTargetItem(lua_State* L);
|
||||
int32_t Script_SetUnit(lua_State* L);
|
||||
int32_t Script_SetUnitBuff(lua_State* L);
|
||||
int32_t Script_SetUnitDebuff(lua_State* L);
|
||||
int32_t Script_SetUnitAura(lua_State* L);
|
||||
int32_t Script_SetSendMailItem(lua_State* L);
|
||||
int32_t Script_SetInboxItem(lua_State* L);
|
||||
int32_t Script_SetAuctionSellItem(lua_State* L);
|
||||
int32_t Script_SetAuctionItem(lua_State* L);
|
||||
int32_t Script_SetQuestRewardSpell(lua_State* L);
|
||||
int32_t Script_SetQuestLogRewardSpell(lua_State* L);
|
||||
int32_t Script_SetHyperlinkCompareItem(lua_State* L);
|
||||
int32_t Script_SetBuybackItem(lua_State* L);
|
||||
int32_t Script_SetSocketedItem(lua_State* L);
|
||||
int32_t Script_SetSocketGem(lua_State* L);
|
||||
@@ -464,6 +461,49 @@ static int32_t Script_SetSpell(lua_State* L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 12bc9108 manual
|
||||
// OFFSET: 0x00625630
|
||||
static int32_t Script_SetShapeshift(lua_State* L) {
|
||||
CGTooltip* tooltip = static_cast<CGTooltip*>(FrameScript_GetObjectThis(L, CGTooltip::GetObjectType()));
|
||||
|
||||
if (!lua_isnumber(L, 2)) {
|
||||
const char* name = tooltip->GetName();
|
||||
luaL_error(L, "Usage: %s:SetShapeshift(slot)", name ? name : "<unnamed>");
|
||||
}
|
||||
|
||||
uint32_t slot = static_cast<uint32_t>(lua_tonumber(L, 2));
|
||||
|
||||
if (slot - 1 < s_shapeshiftSpells.m_count) {
|
||||
int32_t spellId = s_shapeshiftSpells.m_data[slot - 1].m_spellId;
|
||||
uint32_t duration = 0;
|
||||
uint32_t start = 0;
|
||||
uint32_t enable = 0;
|
||||
Spell_C_GetSpellCooldown(spellId, 0, &duration, &start, &enable);
|
||||
int32_t brief = 1;
|
||||
CVar* uberTooltips = CVar::Lookup("UberTooltips");
|
||||
|
||||
if (uberTooltips && uberTooltips->m_intValue) {
|
||||
brief = 0;
|
||||
}
|
||||
|
||||
int32_t result;
|
||||
|
||||
if (enable && start && duration) {
|
||||
result = tooltip->SetSpell(spellId, brief, start + duration - OsGetAsyncTimeMs(), 0, 1, 0, 0, nullptr, nullptr, 0, 0, -1, -1, 0, 0);
|
||||
} else {
|
||||
result = tooltip->SetSpell(spellId, brief, 0, 0, 1, 0, 0, nullptr, nullptr, 0, 0, -1, -1, 0, 0);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
lua_pushnumber(L, 1.0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: ed4d980b manual
|
||||
// OFFSET: 0x00625B90
|
||||
static int32_t Script_SetSpellByID(lua_State* L) {
|
||||
@@ -1126,6 +1166,64 @@ done:
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: c5b104e7 auto
|
||||
// OFFSET: 0x00626240
|
||||
static int32_t Script_SetUnitAura(lua_State* L) {
|
||||
CGTooltip* tooltip = static_cast<CGTooltip*>(FrameScript_GetObjectThis(L, CGTooltip::GetObjectType()));
|
||||
ScriptAuraInfo info;
|
||||
|
||||
if (!Script_GetUnitAuraInfo(L, 2, &info)) {
|
||||
const char* name = tooltip->GetName();
|
||||
luaL_error(L, "Usage: %s:SetUnitAura(\"unit\", [index] or [\"name\", \"rank\"][, \"filter\"])", name ? name : "<unnamed>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return SetTooltipUnitAura(tooltip, &info);
|
||||
}
|
||||
|
||||
// VERIFY: 51f1907f manual
|
||||
// OFFSET: 0x00631B60
|
||||
static int32_t Script_SetHyperlinkCompareItem(lua_State* L) {
|
||||
CGTooltip* tooltip = static_cast<CGTooltip*>(FrameScript_GetObjectThis(L, CGTooltip::GetObjectType()));
|
||||
|
||||
if (!lua_isstring(L, 2)) {
|
||||
const char* name = tooltip->GetName();
|
||||
luaL_error(L, "Usage: %s:SetHyperlinkCompareItem(\"hyperlink\" [, offset, shiftButton])", name ? name : "<unnamed>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* link = lua_tolstring(L, 2, nullptr);
|
||||
ItemLinkInfo linkInfo;
|
||||
linkInfo.Clear();
|
||||
|
||||
if (ClntObjMgrObjectPtr(ClntObjMgrGetActivePlayer(), TYPEMASK_PLAYER, __FILE__, __LINE__) && linkInfo.GetItemIdFromLink(link)) {
|
||||
int32_t offset = 0;
|
||||
int32_t shift = StringToBOOL(L, 4, 0);
|
||||
|
||||
if (lua_isnumber(L, 3)) {
|
||||
offset = static_cast<int32_t>(lua_tonumber(L, 3)) - 1;
|
||||
}
|
||||
|
||||
if (lua_type(L, 5) == LUA_TTABLE) {
|
||||
lua_rawgeti(L, 5, 0);
|
||||
CGTooltip* compare = static_cast<CGTooltip*>(lua_touserdata(L, -1));
|
||||
|
||||
if (compare->IsA(CGTooltip::GetObjectType()) && SetCompareItem(tooltip, linkInfo.m_itemId, offset, shift, compare)) {
|
||||
lua_pushnumber(L, 1.0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (SetCompareItem(tooltip, linkInfo.m_itemId, offset, shift, nullptr)) {
|
||||
lua_pushnumber(L, 1.0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// STATIC: 0x00AD2AE0
|
||||
// VERIFY: da7bc442 manual
|
||||
// OFFSET: 0x0062E520
|
||||
|
||||
@@ -355,3 +355,64 @@ void CGAchievementInfo::LoadTrackedAchievements() {
|
||||
list.m_cvar->Set(value, true, false, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 628f101d manual
|
||||
// OFFSET: 0x005B4F00
|
||||
void CGAchievementInfo::ShutdownGame() {
|
||||
ClientServices::ClearMessageHandler(SMSG_ACHIEVEMENT_EARNED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CRITERIA_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_RESPOND_INSPECT_ACHIEVEMENTS);
|
||||
ClientServices::ClearMessageHandler(SMSG_ALL_ACHIEVEMENT_DATA);
|
||||
ClientServices::ClearMessageHandler(SMSG_ACHIEVEMENT_DELETED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CRITERIA_DELETED);
|
||||
ClientServices::ClearMessageHandler(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE);
|
||||
s_unkC1F450 = 0;
|
||||
s_unkACFD98.Clear();
|
||||
s_unkACFDA4.Clear();
|
||||
s_completedAchievements.Clear();
|
||||
s_unkACFDBC.Clear();
|
||||
s_unkACFDC8.Clear();
|
||||
s_unkACFDD4.Clear();
|
||||
s_trackedAchievements.Clear();
|
||||
s_completedQuests.Clear();
|
||||
|
||||
for (uint32_t i = 0; i < 124; i++) {
|
||||
ACHIEVEMENTCRITERIALIST* list = s_criteriaByType[i].m_fulllist.Head();
|
||||
|
||||
while (list) {
|
||||
ACHIEVEMENTCRITERIALIST* next = s_criteriaByType[i].Next(list);
|
||||
list->m_criteria.Clear();
|
||||
s_criteriaByType[i].Delete(list);
|
||||
list = next;
|
||||
}
|
||||
}
|
||||
|
||||
ACHIEVEMENT* achievement = s_achievements.m_fulllist.Head();
|
||||
|
||||
while (achievement) {
|
||||
ACHIEVEMENT* next = s_achievements.Next(achievement);
|
||||
achievement->m_criteria.Clear();
|
||||
s_achievements.Delete(achievement);
|
||||
achievement = next;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: f42c8dbe manual
|
||||
// OFFSET: 0x005B1FA0
|
||||
void CGAchievementInfo::SaveTrackedAchievements() {
|
||||
CVarIntListWrapper list;
|
||||
list.m_cvar = CVar::Lookup("trackedAchievements");
|
||||
list.m_pos = 2;
|
||||
list.m_state = 0;
|
||||
|
||||
for (CLIENT_ACHIEVEMENTS* node = s_trackedAchievements.Head(); node; node = s_trackedAchievements.Next(node)) {
|
||||
list.AddNextValue(node->m_id);
|
||||
}
|
||||
|
||||
if (list.m_state != 1) {
|
||||
list.m_buffer[0] = 'v';
|
||||
list.m_buffer[1] = 1;
|
||||
list.m_buffer[list.m_pos] = 0;
|
||||
list.m_cvar->Set(list.m_buffer, true, false, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,11 +55,13 @@ int32_t Packet_SMSG_QUERY_QUESTS_COMPLETED_RESPONSE(void* param, NETMESSAGE msgI
|
||||
|
||||
class CGAchievementInfo {
|
||||
public:
|
||||
static void SaveTrackedAchievements();
|
||||
static int32_t m_showAchievementUI;
|
||||
static void LoadTrackedAchievements();
|
||||
static WOWGUID m_inspect;
|
||||
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static bool IsCriteriaStat(int32_t criteriaId);
|
||||
static void UpdateAchievement(int32_t id, WowTime date);
|
||||
static void UpdateCriteria(int32_t id, uint64_t counter, uint32_t flags, WowTime date, WOWGUID player, uint32_t timer1, uint32_t timer2);
|
||||
|
||||
@@ -1948,3 +1948,22 @@ void CGActionBar::PickupAction(uint32_t slot) {
|
||||
CGActionBar::RemoveAction(slot);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 01a1fb58 auto
|
||||
// OFFSET: 0x005EEB70
|
||||
void CGActionBar::ShutdownGame() {
|
||||
}
|
||||
|
||||
// VERIFY: 58205ae6 auto
|
||||
// OFFSET: 0x005A7A90
|
||||
int32_t CGActionBar::GetMacroItem(uint32_t slot) {
|
||||
uint32_t action = CGActionBar::m_slotActions[slot];
|
||||
uint32_t macroId = (action && (action & 0xF0000000) == 0x40000000) ? action & 0xBFFFFFFF : 0;
|
||||
MACRONODE* macro = CGUIMacros::GetMacroByID(macroId);
|
||||
|
||||
if (macro) {
|
||||
return macro->m_itemID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ class CGActionBar {
|
||||
static void SetTemporaryActionBarFlags(uint32_t flags, int32_t enable);
|
||||
static void UpdateShapeShiftBar();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void UpdateAttackAction();
|
||||
static void UpdateItem(int32_t itemId);
|
||||
static void UpdateRangedAttackAction();
|
||||
|
||||
@@ -22,5 +22,7 @@ char* AddOnUnloadableToken(UIADDON_LOADABLE_REASON reason, UIADDON_LOADABLE_REAS
|
||||
bool LoadAddOn(const char* name, bool demandLoad, CStatus* status);
|
||||
uint32_t LoadAddOnFileCount();
|
||||
void LoadAddOns(CStatus* status);
|
||||
void UnloadAddOns();
|
||||
void SaveAddOnEnableState();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -201,3 +201,14 @@ void CGArenaTeamInfo::UpdateTeams(int32_t signal) {
|
||||
void CGArenaTeamInfo::EnterWorld() {
|
||||
CGArenaTeamInfo::UpdateTeams(0);
|
||||
}
|
||||
|
||||
// VERIFY: 05e453ae auto
|
||||
// OFFSET: 0x005A3DD0
|
||||
void CGArenaTeamInfo::ShutdownGame() {
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_TEAM_ROSTER);
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_TEAM_STATS);
|
||||
|
||||
for (uint32_t i = 0; i < 3; i++) {
|
||||
CGArenaTeamInfo::m_arenaTeams[i].FreeMemberArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ class CGArenaTeamInfo {
|
||||
static WOWGUID m_selectedMember;
|
||||
static void EnterWorld();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void QueryRoster(uint32_t index);
|
||||
static void UpdateTeams(int32_t signal);
|
||||
static bool CheckPersonalAndTeamRating(uint32_t rating, int32_t bracket);
|
||||
|
||||
@@ -299,3 +299,24 @@ bool CGAuctionHouse::IsItemForSell(WOWGUID item) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// VERIFY: 93924a65 manual
|
||||
// OFFSET: 0x0059E090
|
||||
void CGAuctionHouse::ShutdownGame() {
|
||||
ClientServices::ClearMessageHandler(MSG_AUCTION_HELLO);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_COMMAND_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_LIST_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_LIST_OWNER_ITEMS_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_LIST_BIDDER_ITEMS_RESULT);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_BIDDER_NOTIFICATION);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_OWNER_NOTIFICATION);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_REMOVED_NOTIFICATION);
|
||||
ClientServices::ClearMessageHandler(SMSG_AUCTION_LIST_PENDING_SALES);
|
||||
|
||||
for (uint32_t i = 0; i < CGAuctionHouse::m_outbidItems.m_count; i++) {
|
||||
delete CGAuctionHouse::m_outbidItems.m_data[i];
|
||||
}
|
||||
|
||||
CGAuctionHouse::m_outbidItems.Clear();
|
||||
CGAuctionHouse::m_numOutbidItems = 0;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ class CGAuctionHouse {
|
||||
static TSGrowableArray<AuctionItemInfo> m_bidderList;
|
||||
static void EnterWorld();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static uint8_t m_auctionsTabShowing;
|
||||
static bool IsSellItemValid(CGItem_C* item, int32_t showError);
|
||||
static void GetSellItem(WOWGUID* item, uint8_t* bag, uint8_t* slot);
|
||||
|
||||
@@ -133,3 +133,12 @@ void CGBarberShop::EnterWorld() {
|
||||
CGBarberShop::m_currentFacialHair = CGBarberShop::GetStyle(2, player->m_unit->m_unitFieldBytes0[0], player->m_player->m_playerBytes3[0], player->m_player->m_playerBytes2[0]);
|
||||
CGBarberShop::m_currentSkinColor = CGBarberShop::GetStyle(3, player->m_unit->m_unitFieldBytes0[0], player->m_player->m_playerBytes3[0], player->m_player->m_playerBytes[0]);
|
||||
}
|
||||
|
||||
// VERIFY: 51a462fe auto
|
||||
// OFFSET: 0x0052F060
|
||||
void CGBarberShop::ShutdownGame() {
|
||||
CGBarberShop::m_initialized = 0;
|
||||
CGBarberShop::m_useableStyles.InternalClear(0);
|
||||
ClientServices::ClearMessageHandler(SMSG_ENABLE_BARBER_SHOP);
|
||||
ClientServices::ClearMessageHandler(SMSG_BARBER_SHOP_RESULT);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ class CGBarberShop {
|
||||
static void AppearanceApplied();
|
||||
static void DisableBarberShop();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void RegisterScriptFunctions();
|
||||
};
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "WoW/Source/DB/DBClient/DBClient.h"
|
||||
#include "WoW/Source/DB/Rec/BattlemasterListRec.h"
|
||||
#include "WoW/Source/Ui/CGWorldStateInfo.h"
|
||||
#include "WoW/Source/Object/ObjectClient/Player_C.h"
|
||||
|
||||
// STATIC: 0x00BEA4A8
|
||||
WorldPvPQueueStatus CGBattlefieldInfo::m_worldPvPQueues[1];
|
||||
@@ -617,3 +618,64 @@ void CGBattlefieldInfo::AddVehicle(const WOWGUID& guid) {
|
||||
CGBattlefieldInfo::m_vehicleGuids[CGBattlefieldInfo::m_numVehicles] = guid;
|
||||
CGBattlefieldInfo::m_numVehicles++;
|
||||
}
|
||||
|
||||
// VERIFY: e38a0e4a manual
|
||||
// OFFSET: 0x0054E220
|
||||
void CGBattlefieldInfo::ShutdownGame() {
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_LIST);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_STATUS);
|
||||
ClientServices::ClearMessageHandler(MSG_PVP_LOG_DATA);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_STATUS_QUEUED);
|
||||
ClientServices::ClearMessageHandler(MSG_BATTLEGROUND_PLAYER_POSITIONS);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEGROUND_PLAYER_JOINED);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEGROUND_PLAYER_LEFT);
|
||||
ClientServices::ClearMessageHandler(SMSG_ARENA_OPPONENT_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_PORT_DENIED);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_MGR_ENTERING);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_MGR_EJECT_PENDING);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_MGR_EJECTED);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE);
|
||||
ClientServices::ClearMessageHandler(SMSG_BATTLEFIELD_MGR_STATE_CHANGE);
|
||||
|
||||
for (uint32_t i = 0; i < 80; i++) {
|
||||
delete CGBattlefieldInfo::m_scores[i];
|
||||
}
|
||||
|
||||
CGBattlefieldInfo::m_battlegroundTypes.Clear();
|
||||
}
|
||||
|
||||
// VERIFY: 8e23bef8 manual
|
||||
// OFFSET: 0x0054E5B0
|
||||
void CGBattlefieldInfo::RequestBattlegroundInstanceInfo(uint32_t index) {
|
||||
CGPlayer_C* player = static_cast<CGPlayer_C*>(ClntObjMgrObjectPtr(ClntObjMgrGetActivePlayer(), TYPEMASK_PLAYER, __FILE__, __LINE__));
|
||||
|
||||
if (!player || static_cast<int32_t>(index) < 0 || index >= CGBattlefieldInfo::m_battlegroundTypes.m_count) {
|
||||
return;
|
||||
}
|
||||
|
||||
BattlemasterListRec* rec = g_battlemasterListDB.GetRecord(CGBattlefieldInfo::m_battlegroundTypes.m_data[index]);
|
||||
|
||||
if (!rec) {
|
||||
return;
|
||||
}
|
||||
|
||||
CDataStore msg;
|
||||
msg.Put(static_cast<uint32_t>(CMSG_BATTLEFIELD_LIST));
|
||||
msg.Put(static_cast<uint32_t>(rec->m_id));
|
||||
msg.Put(static_cast<uint8_t>(1));
|
||||
uint8_t flag;
|
||||
|
||||
if (player->m_unit->m_unitFieldLevel >= player->m_player->m_playerFieldMaxLevel) {
|
||||
flag = 0;
|
||||
} else {
|
||||
flag = (player->m_player->m_playerFlags >> 25) & 1;
|
||||
}
|
||||
|
||||
msg.Put(flag);
|
||||
msg.Finalize();
|
||||
ClientServices::Send2(&msg);
|
||||
CGBattlefieldInfo::m_instances.Clear();
|
||||
CGBattlefieldInfo::m_bgTypeID = rec->m_id;
|
||||
}
|
||||
|
||||
@@ -71,9 +71,11 @@ void BattlefieldNameCacheCallback(int32_t id, const WOWGUID& guid, void* param,
|
||||
|
||||
class CGBattlefieldInfo {
|
||||
public:
|
||||
static void RequestBattlegroundInstanceInfo(uint32_t index);
|
||||
static void SetBattlemaster(WOWGUID battlemaster);
|
||||
static void EnterWorld();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static WOWGUID m_arenaOpponentPets[5][2];
|
||||
static WOWGUID m_arenaOpponents[5];
|
||||
static CGPartyMemberState m_arenaOpponentStats[5];
|
||||
|
||||
@@ -683,6 +683,20 @@ static int32_t Script_GetBattlegroundInfo(lua_State* L) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
// VERIFY: 81438931 auto
|
||||
// OFFSET: 0x0054E6D0
|
||||
int32_t Script_RequestBattlegroundInstanceInfo(lua_State* L) {
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
luaL_error(L, "Usage: RequestBattlegroundInstanceInfo(index)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t index = static_cast<uint32_t>(lua_tonumber(L, 1));
|
||||
CGBattlefieldInfo::RequestBattlegroundInstanceInfo(index - 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STATIC: 0x00ACD178
|
||||
static FrameScript_Method s_ScriptFunctions[] = {
|
||||
{ "GetNumBattlefields", &Script_GetNumBattlefields },
|
||||
|
||||
@@ -14,6 +14,13 @@ struct BattlenetPresenceValue {
|
||||
/* 0005 */ uint8_t unk_0005[519];
|
||||
};
|
||||
|
||||
struct BattlenetBlockList {
|
||||
/* 0000 */ uint32_t m_blockedCount;
|
||||
/* 0004 */ uint32_t m_blocked[100];
|
||||
/* 0194 */ uint32_t m_blockedToonCount;
|
||||
/* 0198 */ uint32_t m_blockedToons[100];
|
||||
};
|
||||
|
||||
struct BattlenetUIFriend {
|
||||
/* 0000 */ uint32_t m_presenceID;
|
||||
/* 0004 */ uint8_t unk_0004[820];
|
||||
@@ -37,6 +44,7 @@ class BattlenetUI {
|
||||
namespace BattlenetAPI {
|
||||
bool IsRIDEnabled();
|
||||
BattlenetPresenceValue GetPresenceValue(uint32_t presenceID, uint32_t field);
|
||||
BattlenetBlockList GetBlockList();
|
||||
}
|
||||
|
||||
bool BattlenetUI_IsAvailable();
|
||||
@@ -74,13 +82,11 @@ int32_t Script_BNGetNumConversationMembers(lua_State* L);
|
||||
int32_t Script_BNGetConversationMemberInfo(lua_State* L);
|
||||
int32_t Script_BNGetConversationInfo(lua_State* L);
|
||||
int32_t Script_BNListConversation(lua_State* L);
|
||||
int32_t Script_BNGetNumBlocked(lua_State* L);
|
||||
int32_t Script_BNGetBlockedInfo(lua_State* L);
|
||||
int32_t Script_BNIsBlocked(lua_State* L);
|
||||
int32_t Script_BNSetBlocked(lua_State* L);
|
||||
int32_t Script_BNSetSelectedBlock(lua_State* L);
|
||||
int32_t Script_BNGetSelectedBlock(lua_State* L);
|
||||
int32_t Script_BNGetNumBlockedToons(lua_State* L);
|
||||
int32_t Script_BNGetBlockedToonInfo(lua_State* L);
|
||||
int32_t Script_BNIsToonBlocked(lua_State* L);
|
||||
int32_t Script_BNSetToonBlocked(lua_State* L);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "WoW/Source/WowServices/BattlenetLogin.h"
|
||||
#include "WoW/Source/WowServices/Login.h"
|
||||
#include "WoW/Source/WowSvcs/WowSvcsClient/ClientServices.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
|
||||
// STATIC: 0x00ACC9E8
|
||||
static uint32_t s_presenceOnlineField = 0x10002;
|
||||
@@ -71,6 +72,50 @@ static int32_t Script_BNGetMaxPlayersInConversation(lua_State* L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 423fdd2d manual
|
||||
// OFFSET: 0x00536400
|
||||
static int32_t Script_BNGetNumBlocked(lua_State* L) {
|
||||
Login* login = ClientServices::LoginConnection();
|
||||
|
||||
if (!login || login->GetLoginServerType() != 1 || login->IsTrialAccount() || !BattlenetAPI::IsRIDEnabled()) {
|
||||
lua_pushnumber(L, 0.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!BattlenetUI_IsAvailable()) {
|
||||
lua_pushnumber(L, 0.0);
|
||||
DebugLog("BNUI: Num Blocked is 0. NOT CONNECTED");
|
||||
return 1;
|
||||
}
|
||||
|
||||
BattlenetBlockList blockList = BattlenetAPI::GetBlockList();
|
||||
lua_pushnumber(L, blockList.m_blockedCount);
|
||||
DebugLog("BNUI: Num Blocked is %d", blockList.m_blockedCount);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 6fff9574 manual
|
||||
// OFFSET: 0x00536890
|
||||
static int32_t Script_BNGetNumBlockedToons(lua_State* L) {
|
||||
Login* login = ClientServices::LoginConnection();
|
||||
|
||||
if (!login || login->GetLoginServerType() != 1 || login->IsTrialAccount() || !BattlenetAPI::IsRIDEnabled()) {
|
||||
lua_pushnumber(L, 0.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!BattlenetUI_IsAvailable()) {
|
||||
lua_pushnumber(L, 0.0);
|
||||
DebugLog("BNUI: Num Blocked toons is 0. NOT CONNECTED");
|
||||
return 1;
|
||||
}
|
||||
|
||||
BattlenetBlockList blockList = BattlenetAPI::GetBlockList();
|
||||
lua_pushnumber(L, blockList.m_blockedToonCount);
|
||||
DebugLog("BNUI: Num Blocked toons is %d", blockList.m_blockedToonCount);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// STATIC: 0x00ACCAE8
|
||||
static FrameScript_Method s_ScriptFunctions[] = {
|
||||
{ "BNGetInfo", &Script_BNGetInfo },
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "CGAutoCompleteName.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
#include <new>
|
||||
#include <typeinfo>
|
||||
#include "WoW/Source/WorldClient/FrameTime.h"
|
||||
|
||||
// STATIC: 0x00ACEB70
|
||||
TSList<AUTOCOMPLETE_NAMENODE, TSGetLink<AUTOCOMPLETE_NAMENODE>> CGAutoCompleteName::m_list;
|
||||
@@ -49,3 +52,95 @@ void CGAutoCompleteName::ResortAll() {
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: cd399474 manual
|
||||
// OFFSET: 0x0057AE80
|
||||
static AUTOCOMPLETE_NAMENODE* FindNodeByGuid(const WOWGUID& guid) {
|
||||
for (AUTOCOMPLETE_NAMENODE* node = CGAutoCompleteName::m_list.Head(); node; node = CGAutoCompleteName::m_list.Next(node)) {
|
||||
if (!node->m_presenceId && node->m_guid == guid) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: 040c821a auto
|
||||
// OFFSET: 0x0057B630
|
||||
static int32_t ApplyNodeFlags(AUTOCOMPLETE_NAMENODE* node, uint32_t flags, int32_t touch, const char* name) {
|
||||
if (!node) {
|
||||
SErrDisplayAppFatalMessage("", "", 0);
|
||||
}
|
||||
|
||||
node->m_flags |= flags;
|
||||
|
||||
if (touch) {
|
||||
node->m_lastUsed = FrameTime::s_curTimeMs;
|
||||
}
|
||||
|
||||
if (name && !node->m_name[0]) {
|
||||
SStrCopy(node->m_name, name, 305);
|
||||
}
|
||||
|
||||
SortNameNode(node);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 4d5b0997 manual
|
||||
// OFFSET: 0x0057B6A0
|
||||
static AUTOCOMPLETE_NAMENODE* AllocNameNode(const WOWGUID& guid, uint32_t flags, uint32_t lastUsed, const char* name) {
|
||||
AUTOCOMPLETE_NAMENODE* node = new (SMemAlloc(sizeof(AUTOCOMPLETE_NAMENODE), typeid(AUTOCOMPLETE_NAMENODE).raw_name(), -2, 0x8)) AUTOCOMPLETE_NAMENODE;
|
||||
node->m_presenceId = 0;
|
||||
node->m_guid = guid;
|
||||
|
||||
if (name) {
|
||||
SStrCopy(node->m_name, name, 305);
|
||||
} else {
|
||||
node->m_name[0] = '\0';
|
||||
}
|
||||
|
||||
if (node->m_lastUsed != lastUsed) {
|
||||
node->m_lastUsed = lastUsed;
|
||||
SortNameNode(node);
|
||||
}
|
||||
|
||||
node->m_flags = flags;
|
||||
SortNameNode(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
// VERIFY: d91cc811 auto
|
||||
// OFFSET: 0x0057B7C0
|
||||
void CGAutoCompleteName::AddFlags(const WOWGUID& guid, uint32_t flags, int32_t add, const char* name) {
|
||||
if (guid == WOWGUID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags & 0x8) {
|
||||
SErrDisplayAppFatalMessage("", "", 0);
|
||||
}
|
||||
|
||||
AUTOCOMPLETE_NAMENODE* node = FindNodeByGuid(guid);
|
||||
|
||||
if (node) {
|
||||
ApplyNodeFlags(node, flags, add, name);
|
||||
} else {
|
||||
AllocNameNode(guid, flags, add ? FrameTime::s_curTimeMs : 0, name);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 912690b2 auto
|
||||
// OFFSET: 0x0057B000
|
||||
int32_t CGAutoCompleteName::RemoveFlags(const WOWGUID& guid, uint32_t flags) {
|
||||
AUTOCOMPLETE_NAMENODE* node = FindNodeByGuid(guid);
|
||||
|
||||
if (node) {
|
||||
node->m_flags &= ~flags;
|
||||
|
||||
if (!(node->m_flags & ~0x20)) {
|
||||
CGAutoCompleteName::m_list.DeleteNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,16 @@
|
||||
struct lua_State;
|
||||
|
||||
struct AUTOCOMPLETE_NAMENODE : public TSLinkedNode<AUTOCOMPLETE_NAMENODE> {
|
||||
/* 0008 */ char m_name[312];
|
||||
/* 0008 */ char m_name[308];
|
||||
/* 013C */ uint32_t m_flags;
|
||||
/* 0140 */ uint32_t m_lastUsed;
|
||||
/* 0144 */ uint32_t m_presenceId;
|
||||
/* 0148 */ WOWGUID m_guid;
|
||||
};
|
||||
|
||||
class CGAutoCompleteName {
|
||||
public:
|
||||
static void RemoveFlagsFromAllNodes(uint32_t flags);
|
||||
static TSList<AUTOCOMPLETE_NAMENODE, TSGetLink<AUTOCOMPLETE_NAMENODE>> m_list;
|
||||
static bool s_resortNamesOnRecency;
|
||||
static void RemoveFlagsByName(const char* name, uint32_t flags, int32_t a3, int32_t a4);
|
||||
|
||||
@@ -7,3 +7,10 @@ void CGMinigameInfo::InitializeGame() {
|
||||
ClientServices::SetMessageHandler(SMSG_MINIGAME_SETUP, Packet_SMSG_MINIGAME_SETUP, nullptr);
|
||||
ClientServices::SetMessageHandler(SMSG_MINIGAME_STATE, Packet_SMSG_MINIGAME_STATE, nullptr);
|
||||
}
|
||||
|
||||
// VERIFY: 8dc40695 auto
|
||||
// OFFSET: 0x005C54B0
|
||||
void CGMinigameInfo::ShutdownGame() {
|
||||
ClientServices::ClearMessageHandler(SMSG_MINIGAME_SETUP);
|
||||
ClientServices::ClearMessageHandler(SMSG_MINIGAME_STATE);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ struct lua_State;
|
||||
|
||||
class CGMinigameInfo {
|
||||
public:
|
||||
static void ShutdownGame();
|
||||
static void InitializeGame();
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
#include "WoW/Source/WowSvcs/WowSvcsClient/ClientServices.h"
|
||||
#include <ctime>
|
||||
#include "WoW/Source/Ui/MinimapFrame.h"
|
||||
#include "WoW/Source/DB/DBClient/DBClient.h"
|
||||
#include "WoW/Source/Ui/GameUI.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
#include "WoW/Source/Ui/QuestTextParser.h"
|
||||
|
||||
// STATIC: 0x00BE8F40
|
||||
uint32_t CGWorldStateInfo::m_nextUITimeUpdate;
|
||||
@@ -129,3 +133,105 @@ bool CGWorldStateInfo::SetWorldState(uint32_t state, uint32_t value) {
|
||||
RefreshWorldStatePOIs(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
// VERIFY: 597548a3 auto
|
||||
// OFFSET: 0x005486E0
|
||||
void CGWorldStateInfo::OnUITime(uint32_t time) {
|
||||
CGWorldStateInfo::m_UITimeOffset = time - static_cast<uint32_t>(::time(nullptr));
|
||||
}
|
||||
|
||||
// VERIFY: 004fb22d manual
|
||||
// OFFSET: 0x005487D0
|
||||
void CGWorldStateInfo::ResetWorldStateUI() {
|
||||
CGWorldStateInfo::m_worldStateUI.m_count = 0;
|
||||
|
||||
for (int32_t i = 0; i < g_worldStateUIDB.m_numRecords; i++) {
|
||||
WorldStateUIRec* rec = g_worldStateUIDB.GetRecordByIndex(i);
|
||||
|
||||
if (rec->m_mapID != -1 && rec->m_mapID != CGWorldStateInfo::m_mapID) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rec->m_areaID && rec->m_areaID != CGWorldStateInfo::m_areaID && rec->m_areaID != CGWorldStateInfo::m_subAreaID) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rec->m_phaseShift && !(rec->m_phaseShift & CGGameUI::unk_AC80A4)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rec->m_type && rec->m_type != 3 && rec->m_type != 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
WorldStateUIEntry* entry = CGWorldStateInfo::m_worldStateUI.New();
|
||||
entry->m_id = rec->m_id;
|
||||
entry->m_state = rec->m_type;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 52346cc7 manual
|
||||
// OFFSET: 0x00548B20
|
||||
void CGWorldStateInfo::ShutdownGame() {
|
||||
CGWorldStateInfo::m_worldStates.InternalClear(0);
|
||||
CGWorldStateInfo::m_worldStateUI.Clear();
|
||||
}
|
||||
|
||||
// VERIFY: 78ef8608 auto
|
||||
// OFFSET: 0x005770D0
|
||||
bool WorldStateParseText(const char* text, char* buffer, uint32_t size) {
|
||||
if (!text) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t error = 0;
|
||||
*buffer = '\0';
|
||||
const char* start = text;
|
||||
|
||||
for (const char* percent = SStrChr(text, '%'); percent && *percent; percent = SStrChr(start, '%')) {
|
||||
uint32_t length = percent - start;
|
||||
|
||||
if (length) {
|
||||
uint32_t used = SStrLen(buffer);
|
||||
SStrPack(buffer, start, size);
|
||||
|
||||
if (used + length < size) {
|
||||
buffer[used + length] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
const char* cursor = percent + 1;
|
||||
const char* number = cursor;
|
||||
|
||||
while (*cursor >= '0' && *cursor <= '9') {
|
||||
cursor++;
|
||||
}
|
||||
|
||||
switch (*cursor) {
|
||||
case 'K':
|
||||
case 'k':
|
||||
ParseCountDownTimerText(buffer, size, GetWorldState(SStrToInt(number)));
|
||||
cursor++;
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
case 'w': {
|
||||
char value[16];
|
||||
SStrPrintf(value, sizeof(value), "%d", GetWorldState(SStrToInt(number)));
|
||||
SStrPack(buffer, value, size);
|
||||
cursor++;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
error = 1;
|
||||
SStrPack(buffer, "%", size);
|
||||
break;
|
||||
}
|
||||
|
||||
start = cursor;
|
||||
}
|
||||
|
||||
SStrPack(buffer, start, size);
|
||||
return error == 0;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ struct WorldStateUIEntry {
|
||||
};
|
||||
|
||||
int32_t GetWorldState(int32_t id);
|
||||
bool WorldStateParseText(const char* text, char* buffer, uint32_t size);
|
||||
|
||||
class CGWorldStateInfo {
|
||||
public:
|
||||
@@ -31,6 +32,7 @@ class CGWorldStateInfo {
|
||||
|
||||
static int32_t GetUITime();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static bool InitWorldStates(uint32_t mapId, uint32_t zoneId, uint32_t areaId);
|
||||
static bool SetWorldState(uint32_t state, uint32_t value);
|
||||
static void OnUITime(uint32_t time);
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include "Engine/Source/FrameScript/FrameScript.h"
|
||||
#include "Engine/Source/FrameScript/FrameScript_Object.h"
|
||||
#include "Engine/Source/lua-5.1/src/lua.h"
|
||||
#include "WoW/Source/DB/DBClient/DBClient.h"
|
||||
#include "WoW/Source/DB/Rec/WorldStateUIRec.h"
|
||||
#include "Engine/Source/lua-5.1/src/lauxlib.h"
|
||||
|
||||
// VERIFY: f57c55c3 manual
|
||||
// OFFSET: 0x00548720
|
||||
@@ -11,6 +14,51 @@ static int32_t Script_GetNumWorldStateUI(lua_State* L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 7bc72600 manual
|
||||
// OFFSET: 0x00548D40
|
||||
int32_t Script_GetWorldStateUIInfo(lua_State* L) {
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
luaL_error(L, "Usage: GetWorldStateUIInfo(index)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t index = static_cast<uint32_t>(lua_tonumber(L, 1));
|
||||
int32_t id = index - 1 < CGWorldStateInfo::m_worldStateUI.m_count ? CGWorldStateInfo::m_worldStateUI.m_data[index - 1].m_id : 0;
|
||||
WorldStateUIRec* rec = g_worldStateUIDB.GetRecord(id);
|
||||
|
||||
if (!rec) {
|
||||
lua_pushnumber(L, 0.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
lua_pushnumber(L, rec->m_type);
|
||||
double state;
|
||||
|
||||
if (rec->m_stateVariable) {
|
||||
WORLDSTATE* worldState = CGWorldStateInfo::m_worldStates.Ptr(rec->m_stateVariable, HASHKEY_NONE());
|
||||
state = worldState ? worldState->m_value : 0;
|
||||
} else {
|
||||
state = 1.0;
|
||||
}
|
||||
|
||||
lua_pushnumber(L, state);
|
||||
char text[256];
|
||||
WorldStateParseText(rec->m_string, text, sizeof(text));
|
||||
lua_pushstring(L, text);
|
||||
lua_pushstring(L, rec->m_icon);
|
||||
lua_pushstring(L, rec->m_dynamicIcon);
|
||||
lua_pushstring(L, rec->m_tooltip);
|
||||
lua_pushstring(L, rec->m_dynamicTooltip);
|
||||
lua_pushstring(L, rec->m_extendedUi);
|
||||
|
||||
for (uint32_t i = 0; i < 3; i++) {
|
||||
WORLDSTATE* worldState = CGWorldStateInfo::m_worldStates.Ptr(rec->m_extendedUistateVariable[i], HASHKEY_NONE());
|
||||
lua_pushnumber(L, worldState ? worldState->m_value : 0);
|
||||
}
|
||||
|
||||
return 11;
|
||||
}
|
||||
|
||||
// STATIC: 0x00ACD0D0
|
||||
static FrameScript_Method s_ScriptFunctions[] = {
|
||||
{ "GetNumWorldStateUI", &Script_GetNumWorldStateUI },
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "WoW/Source/ObjectMgrClient/ObjectMgrClient.h"
|
||||
#include "WoW/Source/Ui/Types.h"
|
||||
#include "WoW/Source/WowSvcs/WowSvcsClient/FriendList.h"
|
||||
#include "WoW/Source/Ui/CalendarEvent.h"
|
||||
|
||||
// STATIC: 0x00AD0340
|
||||
static TSList<CalendarPendingInvite, TSGetLink<CalendarPendingInvite> > s_pendingInvites;
|
||||
@@ -23,6 +24,21 @@ static TSList<CalendarPendingInvite, TSGetLink<CalendarPendingInvite> > s_pendin
|
||||
// STATIC: 0x00AD0350
|
||||
static CalendarEventClipboard s_eventClipboard;
|
||||
|
||||
// STATIC: 0x00AD0328
|
||||
static TSList<CALENDARHOLIDAYNODE, TSGetLink<CALENDARHOLIDAYNODE> > s_holidays;
|
||||
|
||||
// STATIC: 0x00AD0334
|
||||
static TSList<CALENDARRAIDRESETNODE, TSGetLink<CALENDARRAIDRESETNODE> > s_raidResets;
|
||||
|
||||
// STATIC: 0x00C2080C
|
||||
static CalendarDayInfo s_days[3][31];
|
||||
|
||||
// STATIC: 0x00C20DD8
|
||||
static CalendarEventTables s_eventTables;
|
||||
|
||||
// STATIC: 0x00C20F38
|
||||
static TSHashTable<DYNAMICHOLIDAYHASH, HASHKEY_NONE> s_dynamicHolidays;
|
||||
|
||||
// STATIC: 0x00C20F60
|
||||
static TSFixedArray<int32_t> s_eventTextures[2];
|
||||
|
||||
@@ -204,3 +220,191 @@ uint32_t CGCalendar::CountPendingInvites() {
|
||||
|
||||
return count > static_cast<uint32_t>(CGCalendar::m_numInitialPending) ? count : CGCalendar::m_numInitialPending;
|
||||
}
|
||||
|
||||
// VERIFY: 6c9627bd manual
|
||||
// OFFSET: 0x005C3FE0
|
||||
int32_t PH_CALENDAR_GROUP(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
||||
uint8_t clearPending = 1;
|
||||
|
||||
switch (msgId) {
|
||||
case SMSG_CALENDAR_SEND_CALENDAR:
|
||||
PH_SMSG_CALENDAR_SEND_CALENDAR(msg);
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_SEND_EVENT:
|
||||
CGCalendar::ProcessGetEvent(msg);
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_FILTER_GUILD:
|
||||
case SMSG_CALENDAR_ARENA_TEAM:
|
||||
CGCalendar::ProcessInitialInviteList(msg);
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_INVITE:
|
||||
CGCalendar::ProcessInvite(msg, &clearPending);
|
||||
|
||||
if (!clearPending) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_INVITE_REMOVED:
|
||||
CGCalendar::ProcessInviteRemoved(msg, &clearPending);
|
||||
|
||||
if (!clearPending) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_STATUS:
|
||||
CGCalendar::ProcessInviteStatus(msg, &clearPending);
|
||||
|
||||
if (!clearPending) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_RAID_LOCKOUT_ADDED:
|
||||
CGCalendar::ProcessLockoutAdded(msg);
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_RAID_LOCKOUT_REMOVED:
|
||||
CGCalendar::ProcessLockoutRemoved(msg);
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_INVITE_ALERT:
|
||||
CGCalendar::ProcessInviteAlert(msg);
|
||||
return 1;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT:
|
||||
CGCalendar::ProcessInviteRemovedAlert(msg);
|
||||
return 1;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT:
|
||||
CGCalendar::ProcessInviteStatusAlert(msg);
|
||||
return 1;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_REMOVED_ALERT:
|
||||
CGCalendar::ProcessEventRemovedAlert(msg, &clearPending);
|
||||
|
||||
if (!clearPending) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_UPDATED_ALERT:
|
||||
CGCalendar::ProcessEventUpdatedAlert(msg, &clearPending);
|
||||
|
||||
if (!clearPending) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT:
|
||||
CGCalendar::ProcessInviteModeratorStatusAlert(msg, &clearPending);
|
||||
|
||||
if (!clearPending) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_SEND_NUM_PENDING:
|
||||
CGCalendar::UpdatePendingInvites(msg);
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_INVITE_NOTES:
|
||||
CGCalendar::ProcessInviteNotes(msg, &clearPending);
|
||||
|
||||
if (!clearPending) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT:
|
||||
CGCalendar::ProcessInviteNotesAlert(msg);
|
||||
return 1;
|
||||
|
||||
case SMSG_CALENDAR_RAID_LOCKOUT_UPDATED:
|
||||
CGCalendar::ProcessLockoutUpdated(msg);
|
||||
break;
|
||||
}
|
||||
|
||||
CGCalendar::m_actionPending = 0;
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_CALENDAR_ACTION_PENDING, "%b", 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: d895f606 manual
|
||||
// OFFSET: 0x005BE220
|
||||
void CalendarEventTables::Clear() {
|
||||
for (uint32_t i = 0; i < 8; i++) {
|
||||
this->m_counts[i] = 0;
|
||||
this->m_tables[i].InternalClear(0);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 4b509dcd manual
|
||||
// OFFSET: 0x005BEAD0
|
||||
void CGCalendar::ShutdownGame() {
|
||||
if (CGCalendar::m_curEvent) {
|
||||
delete CGCalendar::m_curEvent;
|
||||
}
|
||||
|
||||
memset(&s_eventClipboard, 0, sizeof(s_eventClipboard));
|
||||
s_eventTables.Clear();
|
||||
s_holidays.Clear();
|
||||
s_raidResets.Clear();
|
||||
s_pendingInvites.Clear();
|
||||
s_dynamicHolidays.InternalClear(0);
|
||||
|
||||
for (uint32_t month = 0; month < 3; month++) {
|
||||
for (uint32_t day = 0; day < 31; day++) {
|
||||
s_days[month][day].m_numEvents = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < 2; i++) {
|
||||
if (s_eventTextures[i].m_count) {
|
||||
s_eventTextures[i].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_SEND_CALENDAR);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_SEND_EVENT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_INVITE);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_INVITE_REMOVED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_STATUS);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_INVITE_NOTES);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_FILTER_GUILD);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_ARENA_TEAM);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_RAID_LOCKOUT_ADDED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_INVITE_ALERT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_REMOVED_ALERT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_UPDATED_ALERT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_SEND_NUM_PENDING);
|
||||
ClientServices::ClearMessageHandler(SMSG_CALENDAR_CLEAR_PENDING_ACTION);
|
||||
}
|
||||
|
||||
// VERIFY: 24ff9070 auto
|
||||
// OFFSET: 0x005B7CE0
|
||||
void CGCalendar::UpdatePendingInvites(CDataStore* msg) {
|
||||
int32_t previous = CGCalendar::m_numInitialPending;
|
||||
msg->Get(reinterpret_cast<uint32_t&>(CGCalendar::m_numInitialPending));
|
||||
|
||||
if (CGCalendar::m_numInitialPending != previous) {
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_CALENDAR_UPDATE_PENDING_INVITES, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,32 @@ struct CalendarEventClipboard {
|
||||
};
|
||||
|
||||
int32_t PH_CALENDAR_GROUP(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||
void PH_SMSG_CALENDAR_SEND_CALENDAR(CDataStore* msg);
|
||||
|
||||
struct CALENDARHOLIDAYNODE : public TSLinkedNode<CALENDARHOLIDAYNODE> {
|
||||
};
|
||||
|
||||
struct CALENDARRAIDRESETNODE : public TSLinkedNode<CALENDARRAIDRESETNODE> {
|
||||
};
|
||||
|
||||
struct DYNAMICHOLIDAYHASH : public TSHashObject<DYNAMICHOLIDAYHASH, HASHKEY_NONE> {
|
||||
};
|
||||
|
||||
struct CALENDAREVENTHASH : public TSHashObject<CALENDAREVENTHASH, HASHKEY_NONE> {
|
||||
};
|
||||
|
||||
struct CalendarDayInfo {
|
||||
/* 0000 */ int32_t m_numEvents;
|
||||
/* 0004 */ uint32_t unk_0004[3];
|
||||
};
|
||||
|
||||
class CalendarEventTables {
|
||||
public:
|
||||
/* 0000 */ TSHashTable<CALENDAREVENTHASH, HASHKEY_NONE> m_tables[8];
|
||||
/* 0140 */ int32_t m_counts[8];
|
||||
|
||||
void Clear();
|
||||
};
|
||||
|
||||
struct CalendarPendingInvite : public TSLinkedNode<CalendarPendingInvite> {
|
||||
/* 0008 */ uint8_t unk_0008[16];
|
||||
@@ -38,8 +64,26 @@ class CGCalendar {
|
||||
|
||||
static void EnterWorld();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void QueryPendingInvites();
|
||||
static void SetFilter(CVar* var, int32_t value);
|
||||
static void ProcessGetEvent(CDataStore* msg);
|
||||
static void ProcessInitialInviteList(CDataStore* msg);
|
||||
static void ProcessInvite(CDataStore* msg, uint8_t* clearPending);
|
||||
static void ProcessInviteRemoved(CDataStore* msg, uint8_t* clearPending);
|
||||
static void ProcessInviteStatus(CDataStore* msg, uint8_t* clearPending);
|
||||
static void ProcessLockoutAdded(CDataStore* msg);
|
||||
static void ProcessLockoutRemoved(CDataStore* msg);
|
||||
static void ProcessLockoutUpdated(CDataStore* msg);
|
||||
static void ProcessInviteAlert(CDataStore* msg);
|
||||
static void ProcessInviteRemovedAlert(CDataStore* msg);
|
||||
static void ProcessInviteStatusAlert(CDataStore* msg);
|
||||
static void ProcessEventRemovedAlert(CDataStore* msg, uint8_t* clearPending);
|
||||
static void ProcessEventUpdatedAlert(CDataStore* msg, uint8_t* clearPending);
|
||||
static void ProcessInviteModeratorStatusAlert(CDataStore* msg, uint8_t* clearPending);
|
||||
static void ProcessInviteNotes(CDataStore* msg, uint8_t* clearPending);
|
||||
static void ProcessInviteNotesAlert(CDataStore* msg);
|
||||
static void UpdatePendingInvites(CDataStore* msg);
|
||||
};
|
||||
|
||||
int32_t Script_CalendarGetMinDate(lua_State* L);
|
||||
|
||||
@@ -53,6 +53,8 @@ class CGCalendarEvent {
|
||||
/* 054C */ uint32_t unk_054C;
|
||||
/* 0550 */ uint8_t unk_0550[3760];
|
||||
/* 1400 */ uint8_t unk_1400;
|
||||
|
||||
~CGCalendarEvent();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+324
-13
@@ -38,6 +38,7 @@
|
||||
#include "WoW/Source/WowSvcs/WowSvcsClient/ClientServices.h"
|
||||
#include "WoW/Source/WowSvcs/WowSvcsClient/FriendList.h"
|
||||
#include "Engine/Source/Tempest/CMath.h"
|
||||
#include "WoW/Source/WowSvcs/WowSvcsClient/AccountData.h"
|
||||
|
||||
// STATIC: 0x00BCEFEC
|
||||
int32_t CGChat::m_afk;
|
||||
@@ -215,7 +216,7 @@ TSExplicitList<PENDINGCHAT, 0> CGChat::s_pendingChat;
|
||||
static int32_t s_chatLogging[2];
|
||||
|
||||
// STATIC: 0x00B759D8
|
||||
static HSLOG s_chatLog;
|
||||
static HSLOG s_chatLog[2];
|
||||
|
||||
// STATIC: 0x00B75A60
|
||||
ChatRecord CGChat::m_chatHistory[60];
|
||||
@@ -357,6 +358,9 @@ int32_t CGChat::m_complaintsSystemStatus;
|
||||
// STATIC: 0x00BCF010
|
||||
static uint32_t s_joinedZoneChannels;
|
||||
|
||||
// STATIC: 0x00BCF014
|
||||
static uint32_t s_numSavedInstances;
|
||||
|
||||
// STATIC: 0x00BCF09C
|
||||
TSGrowableArray<ChatColorInfo> s_channelColors;
|
||||
|
||||
@@ -405,6 +409,9 @@ static TSGrowableArray<int32_t> s_pendingChannelFlags;
|
||||
// STATIC: 0x00BCFAD0
|
||||
static TSGrowableArray<int32_t> s_pendingChannelNumbers;
|
||||
|
||||
// STATIC: 0x00BCFAE0
|
||||
static TSGrowableArray<RaidInstanceInfo> s_savedInstances;
|
||||
|
||||
// VERIFY: 36ed0e4f auto
|
||||
// OFFSET: 0x004FBAF0
|
||||
int32_t CGChat::IsVoiceChatAllowed() {
|
||||
@@ -956,7 +963,7 @@ bool SpamFilter(char* text, bool cache) {
|
||||
return spam;
|
||||
}
|
||||
|
||||
// VERIFY: fe4a88da manual
|
||||
// VERIFY: 812184e4 manual
|
||||
// OFFSET: 0x00509DD0
|
||||
void CGChat::AddChatMessage(const char* text, int32_t type, const char* senderName, uint32_t language, const char* channelName, const char* targetName, const char* flags, WOWGUID senderGuid, uint32_t senderUnk, WOWGUID targetGuid, int32_t achievementID, bool isGM, const ChatConversation* conversation) {
|
||||
if (type >= CHAT_MSG_MAX) {
|
||||
@@ -1282,36 +1289,36 @@ emoteDone:
|
||||
channelPrefix[0] = 0;
|
||||
}
|
||||
|
||||
SLogWrite(s_chatLog, "%s%s", channelPrefix, translated);
|
||||
SLogWrite(s_chatLog[0], "%s%s", channelPrefix, translated);
|
||||
return;
|
||||
}
|
||||
|
||||
case CHAT_MSG_CHANNEL_NOTICE:
|
||||
case CHAT_MSG_CHANNEL_NOTICE_USER: {
|
||||
SStrPrintf(token, sizeof(token), "CHAT_%s_NOTICE", translated);
|
||||
SLogWrite(s_chatLog, FrameScript_GetText(token, -1, GENDER_NOT_APPLICABLE), channelString, senderName, targetName);
|
||||
SLogWrite(s_chatLog[0], FrameScript_GetText(token, -1, GENDER_NOT_APPLICABLE), channelString, senderName, targetName);
|
||||
return;
|
||||
}
|
||||
|
||||
case CHAT_MSG_IGNORED: {
|
||||
SLogWrite(s_chatLog, FrameScript_GetText("CHAT_IGNORED", -1, GENDER_NOT_APPLICABLE), senderName);
|
||||
SLogWrite(s_chatLog[0], FrameScript_GetText("CHAT_IGNORED", -1, GENDER_NOT_APPLICABLE), senderName);
|
||||
return;
|
||||
}
|
||||
|
||||
case CHAT_MSG_FILTERED: {
|
||||
SLogWrite(s_chatLog, FrameScript_GetText("CHAT_FILTERED", -1, GENDER_NOT_APPLICABLE), senderName);
|
||||
SLogWrite(s_chatLog[0], FrameScript_GetText("CHAT_FILTERED", -1, GENDER_NOT_APPLICABLE), senderName);
|
||||
return;
|
||||
}
|
||||
|
||||
case CHAT_MSG_RESTRICTED: {
|
||||
SLogWrite(s_chatLog, FrameScript_GetText("CHAT_RESTRICTED", -1, GENDER_NOT_APPLICABLE));
|
||||
SLogWrite(s_chatLog[0], FrameScript_GetText("CHAT_RESTRICTED", -1, GENDER_NOT_APPLICABLE));
|
||||
return;
|
||||
}
|
||||
|
||||
case CHAT_MSG_BN_CONVERSATION_NOTICE: {
|
||||
char noticeToken[128];
|
||||
SStrPrintf(noticeToken, sizeof(noticeToken), "CHAT_CONVERSATION_%s_NOTICE", translated);
|
||||
SLogWrite(s_chatLog, FrameScript_GetText(noticeToken, -1, GENDER_NOT_APPLICABLE), channelString, senderName);
|
||||
SLogWrite(s_chatLog[0], FrameScript_GetText(noticeToken, -1, GENDER_NOT_APPLICABLE), channelString, senderName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1400,7 +1407,7 @@ emoteDone:
|
||||
}
|
||||
|
||||
*dest = 0;
|
||||
SLogWrite(s_chatLog, line, senderName ? senderName : "");
|
||||
SLogWrite(s_chatLog[0], line, senderName ? senderName : "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3114,7 +3121,7 @@ bool InebriatedParseText(const char* text, char* buffer, uint32_t size, float dr
|
||||
return true;
|
||||
}
|
||||
|
||||
// VERIFY: f7ebdad8 manual
|
||||
// VERIFY: ea4fbe56 manual
|
||||
// OFFSET: 0x00503660
|
||||
void CGChat::AddTextEmoteMessage(const WOWGUID& guid, uint32_t emote, const char* target, uint32_t emoteNum) {
|
||||
if (!target) {
|
||||
@@ -3209,7 +3216,7 @@ void CGChat::AddTextEmoteMessage(const WOWGUID& guid, uint32_t emote, const char
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_CHAT_MSG_TEXT_EMOTE, "%s%s%s%s%s%s%d%d%s%d%d%s%u", buffer, sender->m_name, languageName, "", "", "", 0, 0, "", 0, 0, guidString, 0);
|
||||
|
||||
if (s_chatLogging[0]) {
|
||||
SLogWrite(s_chatLog, "%s", buffer);
|
||||
SLogWrite(s_chatLog[0], "%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3919,7 +3926,7 @@ int32_t CGChat::IsChatLogging(int32_t type) {
|
||||
return s_chatLogging[type];
|
||||
}
|
||||
|
||||
// VERIFY: 13db2022 auto
|
||||
// VERIFY: c767ca52 auto
|
||||
// OFFSET: 0x004FB3C0
|
||||
void CGChat::AddCombatMessage(const char* text) {
|
||||
if (!text) {
|
||||
@@ -3928,7 +3935,7 @@ void CGChat::AddCombatMessage(const char* text) {
|
||||
}
|
||||
|
||||
if (s_chatLogging[1]) {
|
||||
SLogWrite(s_chatLog, "%s", text);
|
||||
SLogWrite(s_chatLog[1], "%s", text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4874,3 +4881,307 @@ int32_t FormatTime(char* buffer, uint32_t size, int32_t seconds) {
|
||||
int32_t minutes = (seconds - 3600 * (hours + 24 * days)) / 60;
|
||||
return SStrPrintf(buffer, size, "%dd %dh %dm %ds", days, hours, minutes, seconds % 60);
|
||||
}
|
||||
|
||||
// VERIFY: 55b356a1 manual
|
||||
// OFFSET: 0x00501030
|
||||
int32_t CGChat::OnRaidInstanceInfo(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
||||
uint32_t count;
|
||||
msg->Get(count);
|
||||
|
||||
if (count) {
|
||||
if (count >= s_savedInstances.Count()) {
|
||||
s_savedInstances.SetCount(count);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
RaidInstanceInfo& info = s_savedInstances.m_data[i];
|
||||
msg->Get(info.m_mapID);
|
||||
msg->Get(info.m_difficulty);
|
||||
msg->Get(info.m_instanceID);
|
||||
uint8_t locked = 0;
|
||||
msg->Get(locked);
|
||||
info.m_locked = locked;
|
||||
uint8_t extended = 0;
|
||||
msg->Get(extended);
|
||||
info.m_extended = extended;
|
||||
msg->Get(info.m_resetTime);
|
||||
}
|
||||
}
|
||||
|
||||
s_numSavedInstances = count;
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_UPDATE_INSTANCE_INFO, nullptr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 7fc804e5 manual
|
||||
// OFFSET: 0x005019D0
|
||||
void ChatWindowInfo::Reset() {
|
||||
for (uint32_t i = 0; i < this->m_channels.m_count; i++) {
|
||||
if (this->m_channels.m_data[i]) {
|
||||
SMemFree(this->m_channels.m_data[i], __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
this->m_channels.m_data[i] = nullptr;
|
||||
}
|
||||
|
||||
this->m_channels.Clear();
|
||||
this->m_channelIDs.Clear();
|
||||
}
|
||||
|
||||
// VERIFY: 9faa2cc3 manual
|
||||
// OFFSET: 0x005072B0
|
||||
void CGChat::ShutdownGame() {
|
||||
for (uint32_t i = 0; i < 2; i++) {
|
||||
if (s_chatLog[i]) {
|
||||
SLogClose(s_chatLog[i]);
|
||||
}
|
||||
|
||||
s_chatLog[i] = nullptr;
|
||||
s_chatLogging[i] = 0;
|
||||
}
|
||||
|
||||
s_wordLists.Clear();
|
||||
s_profanityCache.Clear();
|
||||
s_spamCache.Clear();
|
||||
CGChat::s_pendingChat.Clear();
|
||||
CGChat::s_channels.SetCount(0);
|
||||
s_channelColors.Clear();
|
||||
|
||||
for (uint32_t i = 0; i < 10; i++) {
|
||||
s_chatWindows[i].Reset();
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < s_pendingChannelNames.m_count; i++) {
|
||||
if (s_pendingChannelNames.m_data[i]) {
|
||||
SMemFree(s_pendingChannelNames.m_data[i], __FILE__, __LINE__, 0);
|
||||
}
|
||||
}
|
||||
|
||||
s_pendingChannelNames.Clear();
|
||||
s_pendingChannelFlags.Clear();
|
||||
s_pendingChannelNumbers.Clear();
|
||||
s_numSavedInstances = 0;
|
||||
s_savedInstances.Clear();
|
||||
s_channelThrottle.Clear();
|
||||
CGChat::s_throttledChat.Clear();
|
||||
ClientServices::ClearMessageHandler(SMSG_CHANNEL_NOTIFY);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHANNEL_LIST);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHAT);
|
||||
ClientServices::ClearMessageHandler(SMSG_TEXT_EMOTE);
|
||||
ClientServices::ClearMessageHandler(SMSG_ZONE_UNDER_ATTACK);
|
||||
ClientServices::ClearMessageHandler(SMSG_DEFENSE_MESSAGE);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHAT_SERVER_MESSAGE);
|
||||
ClientServices::ClearMessageHandler(SMSG_RAID_INSTANCE_INFO);
|
||||
ClientServices::ClearMessageHandler(SMSG_RAID_INSTANCE_MESSAGE);
|
||||
ClientServices::ClearMessageHandler(SMSG_INSTANCE_RESET);
|
||||
ClientServices::ClearMessageHandler(SMSG_INSTANCE_RESET_FAILED);
|
||||
ClientServices::ClearMessageHandler(SMSG_UPDATE_LAST_INSTANCE);
|
||||
ClientServices::ClearMessageHandler(SMSG_UPDATE_INSTANCE_OWNERSHIP);
|
||||
ClientServices::ClearMessageHandler(SMSG_EXPECTED_SPAM_RECORDS);
|
||||
ClientServices::ClearMessageHandler(SMSG_TITLE_EARNED);
|
||||
ClientServices::ClearMessageHandler(SMSG_RESET_FAILED_NOTIFY);
|
||||
ClientServices::ClearMessageHandler(SMSG_GM_MESSAGECHAT);
|
||||
ClientServices::ClearMessageHandler(SMSG_LOG_XP_GAIN);
|
||||
ClientServices::ClearMessageHandler(SMSG_DURABILITY_DAMAGE_DEATH);
|
||||
ClientServices::ClearMessageHandler(SMSG_CHANNEL_MEMBER_COUNT);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMSAT_RECONNECT_TRY);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMSAT_DISCONNECT);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMSAT_CONNECT_FAIL);
|
||||
ClientServices::ClearMessageHandler(SMSG_VOICE_CHAT_STATUS);
|
||||
ClientServices::ClearMessageHandler(SMSG_USERLIST_ADD);
|
||||
ClientServices::ClearMessageHandler(SMSG_USERLIST_REMOVE);
|
||||
ClientServices::ClearMessageHandler(SMSG_USERLIST_UPDATE);
|
||||
ClientServices::ClearMessageHandler(SMSG_VOICESESSION_FULL);
|
||||
ClientServices::ClearMessageHandler(SMSG_SERVER_FIRST_ACHIEVEMENT);
|
||||
}
|
||||
|
||||
// VERIFY: f304335d manual
|
||||
// OFFSET: 0x00500380
|
||||
int32_t CGChat::OnUserListUpdate(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
||||
WOWGUID guid;
|
||||
uint8_t memberFlags;
|
||||
uint8_t channelFlags;
|
||||
uint32_t count;
|
||||
char channelName[128];
|
||||
msg->Get(guid.m_guid);
|
||||
msg->Get(memberFlags);
|
||||
msg->Get(channelFlags);
|
||||
msg->Get(count);
|
||||
msg->GetString(channelName, sizeof(channelName));
|
||||
|
||||
if (s_activeDisplayChannelType || SStrCmpUTF8I(channelName, CGChat::s_activeDisplayChannelName, STORM_MAX_STR)) {
|
||||
msg->m_read = msg->m_size;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t displayIndex = CGChat::FindDisplayChannelIndex(channelName, 0);
|
||||
|
||||
if (displayIndex) {
|
||||
ChatChannel* channel = &CGChat::s_channels.m_data[CGChat::s_displayChannels[displayIndex - 1].m_channelIndex];
|
||||
|
||||
if (channel->m_flags != channelFlags) {
|
||||
channel->m_flags = channelFlags;
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_CHANNEL_FLAGS_UPDATED, "%d", displayIndex);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < s_pendingUsers.m_count; i++) {
|
||||
PENDINGUSERLIST* user = &s_pendingUsers.m_data[i];
|
||||
|
||||
if (user->m_guid != guid) {
|
||||
continue;
|
||||
}
|
||||
|
||||
user->m_flags = memberFlags;
|
||||
|
||||
if (ComSatClient_IsMemberInVoiceSession(user->m_guid, 0, channelName)) {
|
||||
user->m_flags |= 0x40;
|
||||
}
|
||||
|
||||
if (ComSatClient_Unk7DB830(user->m_guid, 0, channelName)) {
|
||||
user->m_flags |= 0x80;
|
||||
}
|
||||
|
||||
if (ComSatClient_IsPlayerMuted(user->m_guid) || ComSatClient_IsTalkerSquelchedInChannel(user->m_guid, 0, channelName)) {
|
||||
user->m_flags |= 0x20;
|
||||
}
|
||||
|
||||
if (displayIndex) {
|
||||
CGChat::s_displayChannels[displayIndex - 1].m_count = s_pendingUsers.m_count;
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_CHANNEL_COUNT_UPDATE, "%d%d", displayIndex, s_pendingUsers.m_count);
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_CHANNEL_ROSTER_UPDATE, "%d%d", displayIndex, s_pendingUsers.m_count);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: e9ce2aa4 manual
|
||||
// OFFSET: 0x004FD300
|
||||
void CGChat::SaveChatSettingsCallback(HOSFILE localFile, HOSFILE file, void* param) {
|
||||
if (file == OS_INVALID_FILE) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t written = 0;
|
||||
char line[256];
|
||||
SStrPrintf(line, sizeof(line), "VERSION %d\n\n", 5);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "ADDEDVERSION %d\n\n", 13);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "%s %s\n\n", s_guildRecruitmentOption, CGChat::m_guildRecruitmentMode == 1 ? "AUTO" : "STANDARD");
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
OsWriteFile(file, "CHANNELS\n", SStrLen("CHANNELS\n"), &written);
|
||||
|
||||
for (uint32_t i = 0; i < CGChat::s_channels.m_count; i++) {
|
||||
ChatChannel* channel = &CGChat::s_channels.m_data[i];
|
||||
|
||||
if (channel->m_channelNumber && !channel->m_unk9C && !channel->m_zoneChannelID && channel->m_unkA5) {
|
||||
SStrPrintf(line, sizeof(line), "%s %d %d\n", channel->m_name, channel->m_unkA4 != 0, channel->m_channelNumber);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
}
|
||||
}
|
||||
|
||||
OsWriteFile(file, "END\n\n", SStrLen("END\n\n"), &written);
|
||||
SStrPrintf(line, sizeof(line), "ZONECHANNELS %d\n\n", s_joinedZoneChannels);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
OsWriteFile(file, "COLORS\n", SStrLen("COLORS\n"), &written);
|
||||
|
||||
for (uint32_t i = 0; i < CHAT_MSG_MAX; i++) {
|
||||
ChatColorInfo* color = &s_chatColors[i];
|
||||
|
||||
if (color->m_name[0]) {
|
||||
SStrPrintf(line, sizeof(line), "%s %d %d %d %c\n", color->m_name, color->m_color[0], color->m_color[1], color->m_color[2], color->m_unk48 ? 'Y' : 'N');
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < s_channelColors.m_count; i++) {
|
||||
ChatColorInfo* color = &s_channelColors.m_data[i];
|
||||
|
||||
if (color->m_name[0]) {
|
||||
SStrPrintf(line, sizeof(line), "%s %d %d %d %c\n", color->m_name, color->m_color[0], color->m_color[1], color->m_color[2], color->m_unk48 ? 'Y' : 'N');
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
}
|
||||
}
|
||||
|
||||
OsWriteFile(file, "END\n\n", SStrLen("END\n\n"), &written);
|
||||
|
||||
for (uint32_t w = 0; w < 10; w++) {
|
||||
ChatWindowInfo* info = &s_chatWindows[w];
|
||||
SStrPrintf(line, sizeof(line), "WINDOW %d\n", w + 1);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
|
||||
if (info->m_name[0]) {
|
||||
SStrPrintf(line, sizeof(line), "NAME %s\n", info->m_name);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
}
|
||||
|
||||
SStrPrintf(line, sizeof(line), "SIZE %d\n", info->m_unkD0);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "COLOR %d %d %d %d\n", info->m_color.r, info->m_color.g, info->m_color.b, info->m_color.a);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "LOCKED %d\n", info->m_unkD8 != 0);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "UNINTERACTABLE %d\n", info->m_unkE4 != 0);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "DOCKED %d\n", info->m_docked);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "SHOWN %d\n", info->m_shown != 0);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
|
||||
if (info->m_unkF4) {
|
||||
SStrPrintf(line, sizeof(line), "POSITION %s %f %f\n", FramePointToString(static_cast<FRAMEPOINT>(info->m_unkE8)), info->m_unkEC, info->m_unkF0);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
SStrPrintf(line, sizeof(line), "DIMENSIONS %f %f\n\n", info->m_width, info->m_height);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
}
|
||||
|
||||
OsWriteFile(file, "MESSAGES\n", SStrLen("MESSAGES\n"), &written);
|
||||
|
||||
for (uint32_t i = 0; i < 46; i++) {
|
||||
if (info->m_messageGroups[i]) {
|
||||
SStrPrintf(line, sizeof(line), "%s\n", s_chatMessageGroups[i].m_name);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
}
|
||||
}
|
||||
|
||||
OsWriteFile(file, "END\n\n", SStrLen("END\n\n"), &written);
|
||||
OsWriteFile(file, "CHANNELS\n", SStrLen("CHANNELS\n"), &written);
|
||||
uint32_t zoneChannels = 0;
|
||||
|
||||
for (uint32_t i = 0; i < info->m_channels.m_count; i++) {
|
||||
if (!info->m_channels.m_data[i]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int32_t channelId = info->m_channelIDs.m_data[i];
|
||||
|
||||
if (channelId) {
|
||||
zoneChannels |= 1 << (channelId - 1);
|
||||
}
|
||||
|
||||
for (uint32_t j = 0; j < CGChat::s_channels.m_count; j++) {
|
||||
if (!SStrCmpUTF8I(CGChat::s_channels.m_data[j].m_name, info->m_channels.m_data[i], STORM_MAX_STR) && !CGChat::s_channels.m_data[j].m_unkA0) {
|
||||
SStrPrintf(line, sizeof(line), "%s\n", info->m_channels.m_data[i]);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OsWriteFile(file, "END\n\n", SStrLen("END\n\n"), &written);
|
||||
SStrPrintf(line, sizeof(line), "ZONECHANNELS %d\n\n", zoneChannels & s_joinedZoneChannels);
|
||||
OsWriteFile(file, line, SStrLen(line), &written);
|
||||
OsWriteFile(file, "END\n\n", SStrLen("END\n\n"), &written);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 86438221 auto
|
||||
// OFFSET: 0x004FFDA0
|
||||
void CGChat::SaveChatSettings() {
|
||||
s_chatSettingsDirty = 0;
|
||||
SaveAccountData(7, CGChat::SaveChatSettingsCallback, nullptr);
|
||||
}
|
||||
|
||||
@@ -80,6 +80,16 @@ enum SLASH_COMMAND_ID {
|
||||
CHAT_MSG_MAX = 62,
|
||||
};
|
||||
|
||||
struct RaidInstanceInfo {
|
||||
/* 0000 */ uint32_t m_mapID;
|
||||
/* 0004 */ uint32_t m_difficulty;
|
||||
/* 0008 */ uint64_t m_instanceID;
|
||||
/* 0010 */ uint32_t m_locked;
|
||||
/* 0014 */ uint32_t m_extended;
|
||||
/* 0018 */ uint32_t m_resetTime;
|
||||
/* 001C */ uint32_t unk_001C;
|
||||
};
|
||||
|
||||
struct ChatConversation {
|
||||
/* 0000 */ uint8_t m_index;
|
||||
/* 0004 */ uint32_t m_presenceID;
|
||||
@@ -234,6 +244,7 @@ class ChatWindowInfo {
|
||||
void AddChannel(const char* name, int32_t id);
|
||||
void Init();
|
||||
void RemoveChannel(const char* name);
|
||||
void Reset();
|
||||
};
|
||||
|
||||
struct ChatRecord {
|
||||
@@ -260,14 +271,17 @@ int32_t Packet_SMSG_LOG_XPGAIN(void* param, NETMESSAGE msgId, uint32_t time, CDa
|
||||
|
||||
class CGChat {
|
||||
public:
|
||||
static void SaveChatSettings();
|
||||
static void ZoneUpdate();
|
||||
static void ProcessPendingChatQueue();
|
||||
static void LogReactionChanged(int32_t faction, int32_t reaction);
|
||||
static void LogFactionChanged(int32_t faction, int32_t delta, int32_t generic, float bonus);
|
||||
static void EnterWorld();
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void LoadChatSettings();
|
||||
static void LoadChatSettingsCallback(HOSFILE localFile, HOSFILE file, void* param);
|
||||
static void SaveChatSettingsCallback(HOSFILE localFile, HOSFILE file, void* param);
|
||||
static const char* GetChannelString(const char* name);
|
||||
static bool ChatTokenToGUID(const char* token, WOWGUID& guid);
|
||||
static CImVector GetChatColor(int32_t type);
|
||||
|
||||
@@ -456,3 +456,19 @@ void CGClassTrainer::RefreshList() {
|
||||
CGClassTrainer::FilterAndSortServices();
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_TRAINER_UPDATE, nullptr);
|
||||
}
|
||||
|
||||
// VERIFY: a07b4562 manual
|
||||
// OFFSET: 0x005963C0
|
||||
void CGClassTrainer::ShutdownGame() {
|
||||
for (uint32_t i = 0; i < CGClassTrainer::m_services.m_count; i++) {
|
||||
delete CGClassTrainer::m_services.m_data[i];
|
||||
}
|
||||
|
||||
CGClassTrainer::m_services.m_count = 0;
|
||||
|
||||
for (uint32_t i = 0; i < CGClassTrainer::m_skillLines.m_count; i++) {
|
||||
delete CGClassTrainer::m_skillLines.m_data[i];
|
||||
}
|
||||
|
||||
CGClassTrainer::m_skillLines.m_count = 0;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ struct TrainerSkillLineInfo {
|
||||
|
||||
class CGClassTrainer {
|
||||
public:
|
||||
static void ShutdownGame();
|
||||
static WOWGUID m_trainer;
|
||||
static char m_greetingText[2048];
|
||||
static int32_t m_trainerType;
|
||||
|
||||
@@ -177,3 +177,13 @@ void CGCommentator::PostInit(CGPlayer_C* player) {
|
||||
|
||||
FrameScript_SignalEvent(SCRIPT_EVENT_COMMENTATOR_ENTER_WORLD, nullptr);
|
||||
}
|
||||
|
||||
// VERIFY: acad482e auto
|
||||
// OFFSET: 0x00568340
|
||||
void CGCommentator::ShutdownGame() {
|
||||
ClientServices::ClearMessageHandler(SMSG_COMMENTATOR_PLAYER_INFO);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMMENTATOR_MAP_INFO);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMMENTATOR_STATE_CHANGED);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1);
|
||||
ClientServices::ClearMessageHandler(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ class CGCommentator {
|
||||
static CGCommentator s_Commentator;
|
||||
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void RegisterScriptFunctions();
|
||||
|
||||
/* 0000 */ float m_facing;
|
||||
|
||||
@@ -294,3 +294,52 @@ CurrencyTypesRec* CGCurrencyTypes::GetBackpackCurrencyInfo(int32_t index) {
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: 6cfe7d42 auto
|
||||
// OFFSET: 0x005EEB70
|
||||
void CGCurrencyTypes::ShutdownGame() {
|
||||
}
|
||||
|
||||
// VERIFY: 01c6b2ac manual
|
||||
// OFFSET: 0x005AFFD0
|
||||
CurrencyTypesRec* CGCurrencyTypes::GetCurrencyRec(int32_t index) {
|
||||
if (index < 0 || index >= CGCurrencyTypes::m_listSize) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < g_currencyTypesDB.m_numRecords; i++) {
|
||||
CurrencyTypesRec* rec = &g_currencyTypesDB.m_records[i];
|
||||
|
||||
if (rec->m_itemID == CGCurrencyTypes::m_list[index].m_itemID) {
|
||||
return rec;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: 86e21a80 manual
|
||||
// OFFSET: 0x005B04F0
|
||||
int32_t CGCurrencyTypes::IsCurrencyShown(int32_t index) {
|
||||
if (index < 0 || index >= CGCurrencyTypes::m_listSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (CGCurrencyTypes::m_list[index].m_isHeader) {
|
||||
return CGCurrencyTypes::m_list[index].m_categoryID == CGCurrencyTypes::m_categories[CGCurrencyTypes::m_numCategories - 1].m_id;
|
||||
}
|
||||
|
||||
CurrencyTypesRec* rec = CGCurrencyTypes::GetCurrencyRec(index);
|
||||
|
||||
if (!rec) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t bit = rec->m_bitIndex;
|
||||
|
||||
if (bit > 32) {
|
||||
return (g_currencyTokensUnused2CVar->m_intValue & (1 << (bit - 33))) != 0;
|
||||
}
|
||||
|
||||
return bit > 0 && (g_currencyTokensUnused1CVar->m_intValue & (1 << (bit - 1))) != 0;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ class CurrencyTypesRec;
|
||||
|
||||
class CGCurrencyTypes {
|
||||
public:
|
||||
static CurrencyTypesRec* GetCurrencyRec(int32_t index);
|
||||
static int32_t IsCurrencyShown(int32_t index);
|
||||
static int32_t m_listSize;
|
||||
static CurrencyListEntry m_list[95];
|
||||
static CurrencyCategoryInfo m_categories[32];
|
||||
@@ -35,6 +37,7 @@ class CGCurrencyTypes {
|
||||
static int32_t CurrencyCategorySortCallback(const void* a, const void* b);
|
||||
static int32_t DisplayListSortCallback(const void* a, const void* b);
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void EnterWorld();
|
||||
};
|
||||
|
||||
|
||||
@@ -93,6 +93,93 @@ static int32_t Script_GetBackpackCurrencyInfo(lua_State* L) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
// VERIFY: cae29f5c manual
|
||||
// OFFSET: 0x005B0680
|
||||
int32_t Script_GetCurrencyListInfo(lua_State* L) {
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
luaL_error(L, "Usage: GetCurrencyListInfo(index)");
|
||||
}
|
||||
|
||||
int32_t index = static_cast<int32_t>(lua_tonumber(L, 1)) - 1;
|
||||
|
||||
if (index < 0 || index >= CGCurrencyTypes::m_listSize) {
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
lua_pushnil(L);
|
||||
return 9;
|
||||
}
|
||||
|
||||
CurrencyListEntry* entry = &CGCurrencyTypes::m_list[index];
|
||||
|
||||
if (entry->m_name) {
|
||||
lua_pushstring(L, entry->m_name);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
|
||||
lua_pushboolean(L, entry->m_isHeader);
|
||||
lua_pushboolean(L, entry->m_isExpanded);
|
||||
lua_pushboolean(L, CGCurrencyTypes::IsCurrencyShown(index));
|
||||
lua_pushboolean(L, entry->m_isWatched);
|
||||
CGPlayer_C* player = static_cast<CGPlayer_C*>(ClntObjMgrObjectPtr(ClntObjMgrGetActivePlayer(), TYPEMASK_PLAYER, __FILE__, __LINE__));
|
||||
|
||||
if (player) {
|
||||
uint32_t count = 0;
|
||||
int32_t extraCurrencyType = 0;
|
||||
|
||||
if (entry->m_itemID == 43307) {
|
||||
count = player->m_player->m_playerFieldArenaCurrency;
|
||||
extraCurrencyType = 1;
|
||||
} else if (entry->m_itemID == 43308) {
|
||||
count = player->m_player->m_playerFieldHonorCurrency;
|
||||
extraCurrencyType = 2;
|
||||
} else {
|
||||
CGBag_C* bag = player->GetBag();
|
||||
|
||||
if (bag) {
|
||||
for (uint32_t slot = 118; slot <= 149; slot++) {
|
||||
WOWGUID itemGuid;
|
||||
itemGuid.m_guid = bag->GetItemGuid(slot);
|
||||
CGItem_C* item = static_cast<CGItem_C*>(ClntObjMgrObjectPtr(itemGuid, TYPEMASK_ITEM, __FILE__, __LINE__));
|
||||
|
||||
if (item && static_cast<int32_t>(item->m_obj->m_entryID) == entry->m_itemID) {
|
||||
count = item->m_item->m_itemFieldStackCount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lua_pushnumber(L, count);
|
||||
lua_pushinteger(L, extraCurrencyType);
|
||||
} else {
|
||||
lua_pushnumber(L, 0.0);
|
||||
lua_pushboolean(L, 0);
|
||||
}
|
||||
|
||||
WOWGUID none = WOWGUID();
|
||||
ItemStats_C* stats = g_itemDBCache.GetRecord(entry->m_itemID, none, nullptr, nullptr, false);
|
||||
|
||||
if (stats) {
|
||||
const char* path = ClientDBStringLookup(3);
|
||||
char texture[260];
|
||||
SStrPrintf(texture, sizeof(texture), "%s%s%s", path, *path ? "\\" : "", CGItem_C::GetInventoryArt(stats->m_displayId));
|
||||
lua_pushstring(L, texture);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
|
||||
lua_pushinteger(L, entry->m_itemID);
|
||||
|
||||
return 9;
|
||||
}
|
||||
|
||||
// STATIC: 0x00ACFC34
|
||||
static FrameScript_Method s_ScriptFunctions[] = {
|
||||
{ "GetCurrencyListSize", &Script_GetCurrencyListSize },
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
// STATIC: 0x00BEB630
|
||||
uint64_t CGDanceStudio::m_learnedDanceMoves;
|
||||
|
||||
// STATIC: 0x00BEB638
|
||||
static TSHashTable<KNOWNDANCES, HASHKEY_NONE> s_knownDances;
|
||||
|
||||
// VERIFY: 166fac44 auto
|
||||
// OFFSET: 0x00576A90
|
||||
void CGDanceStudio::InitializeGame() {
|
||||
@@ -20,3 +23,13 @@ int32_t Packet_SMSG_LEARNED_DANCE_MOVES(void* param, NETMESSAGE msgId, uint32_t
|
||||
msg->Get(CGDanceStudio::m_learnedDanceMoves);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 02b8c154 auto
|
||||
// OFFSET: 0x00575F20
|
||||
void CGDanceStudio::ShutdownGame() {
|
||||
ClientServices::ClearMessageHandler(SMSG_PLAY_DANCE);
|
||||
ClientServices::ClearMessageHandler(SMSG_STOP_DANCE);
|
||||
ClientServices::ClearMessageHandler(SMSG_NOTIFY_DANCE);
|
||||
ClientServices::ClearMessageHandler(SMSG_LEARNED_DANCE_MOVES);
|
||||
s_knownDances.InternalClear(0);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "WoW/Source/Net/Types.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
|
||||
class CDataStore;
|
||||
struct lua_State;
|
||||
|
||||
struct KNOWNDANCES : public TSHashObject<KNOWNDANCES, HASHKEY_NONE> {
|
||||
};
|
||||
|
||||
int32_t Packet_SMSG_PLAY_DANCE(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||
int32_t Packet_SMSG_STOP_DANCE(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||
int32_t Packet_SMSG_NOTIFY_DANCE(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||
@@ -18,6 +22,7 @@ class CGDanceStudio {
|
||||
static uint64_t m_learnedDanceMoves;
|
||||
|
||||
static void InitializeGame();
|
||||
static void ShutdownGame();
|
||||
static void LoadDance(int32_t danceId);
|
||||
static void RegisterScriptFunctions();
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user