mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
Compare commits
5 Commits
19b85b1f12
...
f9643939d9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9643939d9 | ||
|
|
5492b3f231 | ||
|
|
8851d2e5e1 | ||
|
|
0a91d44600 | ||
|
|
44bee4cbd7 |
@ -38,7 +38,9 @@
|
|||||||
#include <common/MD5.hpp>
|
#include <common/MD5.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
int32_t CGlueMgr::m_acceptedContest = 1; // TODO
|
||||||
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
|
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
|
||||||
|
int32_t CGlueMgr::m_acceptedScanning = 1; // TODO
|
||||||
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
|
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
|
||||||
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
|
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
|
||||||
int32_t CGlueMgr::m_accountMsgAvailable;
|
int32_t CGlueMgr::m_accountMsgAvailable;
|
||||||
|
|||||||
@ -32,7 +32,9 @@ class CGlueMgr {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Static variables
|
// Static variables
|
||||||
|
static int32_t m_acceptedContest;
|
||||||
static int32_t m_acceptedEULA;
|
static int32_t m_acceptedEULA;
|
||||||
|
static int32_t m_acceptedScanning;
|
||||||
static int32_t m_acceptedTerminationWithoutNotice;
|
static int32_t m_acceptedTerminationWithoutNotice;
|
||||||
static int32_t m_acceptedTOS;
|
static int32_t m_acceptedTOS;
|
||||||
static int32_t m_accountMsgAvailable;
|
static int32_t m_accountMsgAvailable;
|
||||||
|
|||||||
@ -222,7 +222,13 @@ int32_t Script_ShowScanningNotice(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_ScanningAccepted(lua_State* L) {
|
int32_t Script_ScanningAccepted(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (CGlueMgr::m_acceptedScanning) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AcceptScanning(lua_State* L) {
|
int32_t Script_AcceptScanning(lua_State* L) {
|
||||||
@ -234,7 +240,13 @@ int32_t Script_ShowContestNotice(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_ContestAccepted(lua_State* L) {
|
int32_t Script_ContestAccepted(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (CGlueMgr::m_acceptedContest) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AcceptContest(lua_State* L) {
|
int32_t Script_AcceptContest(lua_State* L) {
|
||||||
|
|||||||
@ -1214,4 +1214,17 @@ struct CHARACTER_INFO {
|
|||||||
uint8_t firstLogin;
|
uint8_t firstLogin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CHARACTER_CREATE_INFO {
|
||||||
|
char name[48];
|
||||||
|
uint8_t raceID;
|
||||||
|
uint8_t classID;
|
||||||
|
uint8_t sexID;
|
||||||
|
uint8_t skinID;
|
||||||
|
uint8_t faceID;
|
||||||
|
uint8_t hairStyleID;
|
||||||
|
uint8_t hairColorID;
|
||||||
|
uint8_t facialHairStyleID;
|
||||||
|
uint8_t outfitID;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -96,7 +96,11 @@ const char* CGUnit_C::GetDisplayRaceNameFromRecord(const ChrRacesRec* raceRec, U
|
|||||||
return raceRec->m_name;
|
return raceRec->m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGUnit_C::CGUnit_C(uint32_t time, CClientObjCreate& objCreate) : CGObject_C(time, objCreate) {
|
CGUnit_C::CGUnit_C(uint32_t time, CClientObjCreate& objCreate)
|
||||||
|
: CGObject_C(time, objCreate)
|
||||||
|
, m_movement(&this->m_localMovement)
|
||||||
|
, m_localMovement(objCreate.move.status.position28, objCreate.move.status.facing34, this->GetGUID(), this)
|
||||||
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
this->RefreshDataPointers();
|
this->RefreshDataPointers();
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include "object/client/CClientObjCreate.hpp"
|
#include "object/client/CClientObjCreate.hpp"
|
||||||
#include "object/client/CGObject_C.hpp"
|
#include "object/client/CGObject_C.hpp"
|
||||||
#include "object/client/CGUnit.hpp"
|
#include "object/client/CGUnit.hpp"
|
||||||
|
#include "object/client/CMovementData_C.hpp"
|
||||||
#include "object/Types.hpp"
|
#include "object/Types.hpp"
|
||||||
#include "util/GUID.hpp"
|
#include "util/GUID.hpp"
|
||||||
|
|
||||||
@ -48,6 +49,9 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// Private member variables
|
// Private member variables
|
||||||
|
CMovementData_C* m_movement;
|
||||||
|
// TODO
|
||||||
|
CMovementData_C m_localMovement;
|
||||||
// TODO
|
// TODO
|
||||||
CreatureDisplayInfoRec* m_displayInfo;
|
CreatureDisplayInfoRec* m_displayInfo;
|
||||||
CreatureDisplayInfoExtraRec* m_displayInfoExtra;
|
CreatureDisplayInfoExtraRec* m_displayInfoExtra;
|
||||||
|
|||||||
7
src/object/client/CMovementData_C.cpp
Normal file
7
src/object/client/CMovementData_C.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include "object/client/CMovementData_C.hpp"
|
||||||
|
|
||||||
|
CMovementData_C::CMovementData_C(const C3Vector& position, float facing, const WOWGUID& guid, CGUnit_C* unit)
|
||||||
|
: CMovementShared(0, position, facing, guid)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
14
src/object/client/CMovementData_C.hpp
Normal file
14
src/object/client/CMovementData_C.hpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef OBJECT_CLIENT_C_MOVEMENT_DATA_C_HPP
|
||||||
|
#define OBJECT_CLIENT_C_MOVEMENT_DATA_C_HPP
|
||||||
|
|
||||||
|
#include "object/movement/CMovementShared.hpp"
|
||||||
|
|
||||||
|
class CGUnit_C;
|
||||||
|
|
||||||
|
class CMovementData_C : public CMovementShared {
|
||||||
|
public:
|
||||||
|
// Public member functions
|
||||||
|
CMovementData_C(const C3Vector& position, float facing, const WOWGUID& guid, CGUnit_C* unit);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
15
src/object/client/CMovement_C.hpp
Normal file
15
src/object/client/CMovement_C.hpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef OBJECT_CLIENT_C_MOVEMENT_C_HPP
|
||||||
|
#define OBJECT_CLIENT_C_MOVEMENT_C_HPP
|
||||||
|
|
||||||
|
#include "object/client/CMovementData_C.hpp"
|
||||||
|
#include "util/GUID.hpp"
|
||||||
|
#include <tempest/Vector.hpp>
|
||||||
|
|
||||||
|
class CMovement_C : public CMovementData_C {
|
||||||
|
public:
|
||||||
|
// Public member functions
|
||||||
|
CMovement_C(const C3Vector& position, float facing, const WOWGUID& guid, CGUnit_C* unit)
|
||||||
|
: CMovementData_C(position, facing, guid, unit) {};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
15
src/object/movement/CMovementShared.cpp
Normal file
15
src/object/movement/CMovementShared.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include "object/movement/CMovementShared.hpp"
|
||||||
|
|
||||||
|
CMovementShared::CMovementShared(const WOWGUID& transportGUID, const C3Vector& position, float facing, const WOWGUID& guid)
|
||||||
|
: CPassenger(transportGUID, position, guid)
|
||||||
|
{
|
||||||
|
this->m_facing = facing;
|
||||||
|
|
||||||
|
this->m_anchorPosition = position;
|
||||||
|
this->m_anchorFacing = facing;
|
||||||
|
this->m_anchorPitch = 0.0f;
|
||||||
|
this->m_cosAnchorPitch = 1.0f;
|
||||||
|
this->m_sinAnchorPitch = 0.0f;
|
||||||
|
|
||||||
|
this->m_spline = nullptr;
|
||||||
|
}
|
||||||
31
src/object/movement/CMovementShared.hpp
Normal file
31
src/object/movement/CMovementShared.hpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef OBJECT_MOVEMENT_C_MOVEMENT_SHARED_HPP
|
||||||
|
#define OBJECT_MOVEMENT_C_MOVEMENT_SHARED_HPP
|
||||||
|
|
||||||
|
#include "object/movement/CPassenger.hpp"
|
||||||
|
#include "util/GUID.hpp"
|
||||||
|
#include <tempest/Vector.hpp>
|
||||||
|
|
||||||
|
struct CMoveSpline;
|
||||||
|
|
||||||
|
class CMovementShared : public CPassenger {
|
||||||
|
public:
|
||||||
|
// Public member functions
|
||||||
|
CMovementShared(const WOWGUID& transportGUID, const C3Vector& position, float facing, const WOWGUID& guid);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Protected member variables
|
||||||
|
// TODO
|
||||||
|
C3Vector m_anchorPosition;
|
||||||
|
float m_anchorFacing;
|
||||||
|
float m_anchorPitch;
|
||||||
|
// TODO
|
||||||
|
C3Vector m_direction;
|
||||||
|
C2Vector m_direction2d;
|
||||||
|
float m_cosAnchorPitch;
|
||||||
|
float m_sinAnchorPitch;
|
||||||
|
// TODO
|
||||||
|
CMoveSpline* m_spline;
|
||||||
|
// TODO
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -48,7 +48,7 @@ CDataStore& operator>>(CDataStore& msg, CMovementStatus& move) {
|
|||||||
msg.Get(move.uint14);
|
msg.Get(move.uint14);
|
||||||
msg.Get(move.uint0);
|
msg.Get(move.uint0);
|
||||||
|
|
||||||
msg >> move.position18;
|
msg >> move.position28;
|
||||||
msg.Get(move.facing34);
|
msg.Get(move.facing34);
|
||||||
|
|
||||||
if (move.moveFlags & 0x200) {
|
if (move.moveFlags & 0x200) {
|
||||||
|
|||||||
18
src/object/movement/CPassenger.cpp
Normal file
18
src/object/movement/CPassenger.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "object/movement/CPassenger.hpp"
|
||||||
|
#include <tempest/Matrix.hpp>
|
||||||
|
|
||||||
|
C3Vector CPassenger::GetPosition() const {
|
||||||
|
return GetPosition(this->m_position);
|
||||||
|
}
|
||||||
|
|
||||||
|
C3Vector CPassenger::GetPosition(const C3Vector& position) const {
|
||||||
|
// If on transport, transform position by transport matrix
|
||||||
|
if (this->m_transportGUID) {
|
||||||
|
C44Matrix transportMatrix;
|
||||||
|
// MovementGetTransportMtxX(this->m_transportGUID, &transportMatrix);
|
||||||
|
|
||||||
|
return position * transportMatrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
return position;
|
||||||
|
}
|
||||||
30
src/object/movement/CPassenger.hpp
Normal file
30
src/object/movement/CPassenger.hpp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#ifndef OBJECT_MOVEMENT_C_PASSENGER_HPP
|
||||||
|
#define OBJECT_MOVEMENT_C_PASSENGER_HPP
|
||||||
|
|
||||||
|
#include "util/GUID.hpp"
|
||||||
|
#include <tempest/Vector.hpp>
|
||||||
|
|
||||||
|
class CPassenger {
|
||||||
|
public:
|
||||||
|
// Public member functions
|
||||||
|
CPassenger(const WOWGUID& transportGUID, const C3Vector& position, const WOWGUID& guid)
|
||||||
|
: m_transportGUID(transportGUID)
|
||||||
|
, m_position(position)
|
||||||
|
, m_facing(0.0f)
|
||||||
|
, m_guid(guid) {};
|
||||||
|
C3Vector GetPosition() const;
|
||||||
|
C3Vector GetPosition(const C3Vector& position) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Protected member variables
|
||||||
|
// TODO
|
||||||
|
WOWGUID m_transportGUID;
|
||||||
|
C3Vector m_position;
|
||||||
|
// TODO
|
||||||
|
float m_facing;
|
||||||
|
// TODO
|
||||||
|
const WOWGUID& m_guid;
|
||||||
|
// TODO
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user