mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Merge commit 'origin/master' into 310
Conflicts: src/game/Player.cpp
This commit is contained in:
commit
950a4bf13f
52 changed files with 623 additions and 474 deletions
|
|
@ -366,12 +366,29 @@ struct GameObjectInfo
|
|||
uint32 ScriptId;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined( __GNUC__ )
|
||||
#pragma pack()
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
struct GameObjectLocale
|
||||
{
|
||||
std::vector<std::string> Name;
|
||||
std::vector<std::string> CastBarCaption;
|
||||
};
|
||||
|
||||
// client side GO show states
|
||||
enum GOState
|
||||
{
|
||||
GO_STATE_ACTIVE = 0, // show in world as used and not reset (closed door open)
|
||||
GO_STATE_READY = 1, // show in world as ready (closed door close)
|
||||
GO_STATE_ACTIVE_ALTERNATIVE = 2 // show in world as used in alt way and not reset (closed door open by cannon fire)
|
||||
};
|
||||
|
||||
#define MAX_GO_STATE 3
|
||||
|
||||
// from `gameobject`
|
||||
struct GameObjectData
|
||||
{
|
||||
|
|
@ -388,17 +405,10 @@ struct GameObjectData
|
|||
float rotation3;
|
||||
int32 spawntimesecs;
|
||||
uint32 animprogress;
|
||||
uint32 go_state;
|
||||
GOState go_state;
|
||||
uint8 spawnMask;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined( __GNUC__ )
|
||||
#pragma pack()
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
// For containers: [GO_NOT_READY]->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED->GO_READY -> ...
|
||||
// For bobber: GO_NOT_READY ->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED-><deleted>
|
||||
// For door(closed):[GO_NOT_READY]->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED->GO_READY(close) -> ...
|
||||
|
|
@ -425,7 +435,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
void AddToWorld();
|
||||
void RemoveFromWorld();
|
||||
|
||||
bool Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state);
|
||||
bool Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state);
|
||||
void Update(uint32 p_time);
|
||||
GameObjectInfo const* GetGOInfo() const;
|
||||
|
||||
|
|
@ -456,7 +466,6 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
|
||||
bool LoadFromDB(uint32 guid, Map *map);
|
||||
void DeleteFromDB();
|
||||
void SetLootState(LootState s) { m_lootState = s; }
|
||||
static uint32 GetLootId(GameObjectInfo const* info);
|
||||
uint32 GetLootId() const { return GetLootId(GetGOInfo()); }
|
||||
uint32 GetLockId() const
|
||||
|
|
@ -523,8 +532,8 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
void getFishLoot(Loot *loot, Player* loot_owner);
|
||||
GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); }
|
||||
void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); }
|
||||
uint8 GetGoState() const { return GetByteValue(GAMEOBJECT_BYTES_1, 0); }
|
||||
void SetGoState(uint8 state) { SetByteValue(GAMEOBJECT_BYTES_1, 0, state); }
|
||||
GOState GetGoState() const { return GOState(GetByteValue(GAMEOBJECT_BYTES_1, 0)); }
|
||||
void SetGoState(GOState state) { SetByteValue(GAMEOBJECT_BYTES_1, 0, state); }
|
||||
uint8 GetGoArtKit() const { return GetByteValue(GAMEOBJECT_BYTES_1, 2); }
|
||||
void SetGoArtKit(uint8 artkit) { SetByteValue(GAMEOBJECT_BYTES_1, 2, artkit); }
|
||||
uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); }
|
||||
|
|
@ -533,6 +542,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
void Use(Unit* user);
|
||||
|
||||
LootState getLootState() const { return m_lootState; }
|
||||
void SetLootState(LootState s) { m_lootState = s; }
|
||||
|
||||
void AddToSkillupList(uint32 PlayerGuidLow) { m_SkillupList.push_back(PlayerGuidLow); }
|
||||
bool IsInSkillupList(uint32 PlayerGuidLow) const
|
||||
|
|
@ -556,7 +566,10 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
bool hasQuest(uint32 quest_id) const;
|
||||
bool hasInvolvedQuest(uint32 quest_id) const;
|
||||
bool ActivateToQuest(Player *pTarget) const;
|
||||
void UseDoorOrButton(uint32 time_to_restore = 0); // 0 = use `gameobject`.`spawntimesecs`
|
||||
void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false);
|
||||
// 0 = use `gameobject`.`spawntimesecs`
|
||||
void ResetDoorOrButton();
|
||||
// 0 = use `gameobject`.`spawntimesecs`
|
||||
|
||||
uint32 GetLinkedGameObjectEntry() const
|
||||
{
|
||||
|
|
@ -613,7 +626,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
GameObjectInfo const* m_goInfo;
|
||||
uint64 m_rotation;
|
||||
private:
|
||||
void SwitchDoorOrButton(bool activate);
|
||||
void SwitchDoorOrButton(bool activate, bool alternative = false);
|
||||
|
||||
GridReference<GameObject> m_gridRef;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue