*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
This commit is contained in:
@@ -17,17 +17,12 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __BATTLEGROUNDEY_H
|
||||
#define __BATTLEGROUNDEY_H
|
||||
|
||||
#include "Language.h"
|
||||
|
||||
class BattleGround;
|
||||
|
||||
#define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILISECONDS) //10 seconds
|
||||
#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILISECONDS) //2 seconds
|
||||
|
||||
enum BG_EY_WorldStates
|
||||
{
|
||||
EY_ALLIANCE_RESOURCES = 2749,
|
||||
@@ -54,7 +49,6 @@ enum BG_EY_WorldStates
|
||||
NETHERSTORM_FLAG_STATE_ALLIANCE = 2769,
|
||||
NETHERSTORM_FLAG_STATE_HORDE = 2770
|
||||
};
|
||||
|
||||
enum BG_EY_ProgressBarConsts
|
||||
{
|
||||
BG_EY_POINT_MAX_CAPTURERS_COUNT = 5,
|
||||
@@ -68,7 +62,6 @@ enum BG_EY_ProgressBarConsts
|
||||
BG_EY_PROGRESS_BAR_NEUTRAL_HIGH = 70,
|
||||
BG_EY_PROGRESS_BAR_ALI_CONTROLLED = 100
|
||||
};
|
||||
|
||||
enum BG_EY_Sounds
|
||||
{
|
||||
//strange ids, but sure about them
|
||||
@@ -78,13 +71,11 @@ enum BG_EY_Sounds
|
||||
BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE = 8173,
|
||||
BG_EY_SOUND_FLAG_RESET = 8192
|
||||
};
|
||||
|
||||
enum BG_EY_Spells
|
||||
{
|
||||
BG_EY_NETHERSTORM_FLAG_SPELL = 34976,
|
||||
BG_EY_PLAYER_DROPPED_FLAG_SPELL = 34991
|
||||
};
|
||||
|
||||
enum EYBattleGroundObjectEntry
|
||||
{
|
||||
BG_OBJECT_A_DOOR_EY_ENTRY = 184719, //Alliance door
|
||||
@@ -100,7 +91,6 @@ enum EYBattleGroundObjectEntry
|
||||
BG_OBJECT_HU_TOWER_CAP_EY_ENTRY = 184082, //Human Tower Cap Pt
|
||||
BG_OBJECT_DR_TOWER_CAP_EY_ENTRY = 184083 //Draenei Tower Cap Pt
|
||||
};
|
||||
|
||||
enum EYBattleGroundPointsTrigger
|
||||
{
|
||||
TR_BLOOD_ELF_POINT = 4476,
|
||||
@@ -112,7 +102,6 @@ enum EYBattleGroundPointsTrigger
|
||||
TR_MAGE_TOWER_BUFF = 4570,
|
||||
TR_DRAENEI_RUINS_BUFF = 4571
|
||||
};
|
||||
|
||||
enum EYBattleGroundGaveyards
|
||||
{
|
||||
EY_GRAVEYARD_MAIN_ALLIANCE = 1103,
|
||||
@@ -122,18 +111,15 @@ enum EYBattleGroundGaveyards
|
||||
EY_GRAVEYARD_DRAENEI_RUINS = 1107,
|
||||
EY_GRAVEYARD_MAGE_TOWER = 1108
|
||||
};
|
||||
|
||||
enum EYBattleGroundPoints
|
||||
{
|
||||
FEL_REALVER = 0,
|
||||
BLOOD_ELF = 1,
|
||||
DRAENEI_RUINS = 2,
|
||||
MAGE_TOWER = 3,
|
||||
|
||||
EY_PLAYERS_OUT_OF_POINTS = 4,
|
||||
EY_POINTS_MAX = 4
|
||||
};
|
||||
|
||||
enum EYBattleGroundCreaturesTypes
|
||||
{
|
||||
EY_SPIRIT_FEL_REALVER = 0,
|
||||
@@ -142,10 +128,8 @@ enum EYBattleGroundCreaturesTypes
|
||||
EY_SPIRIT_MAGE_TOWER = 3,
|
||||
EY_SPIRIT_MAIN_ALLIANCE = 4,
|
||||
EY_SPIRIT_MAIN_HORDE = 5,
|
||||
|
||||
BG_EY_CREATURES_MAX = 6
|
||||
};
|
||||
|
||||
enum EYBattleGroundObjectTypes
|
||||
{
|
||||
BG_EY_OBJECT_DOOR_A = 0,
|
||||
@@ -210,16 +194,13 @@ enum EYBattleGroundObjectTypes
|
||||
BG_EY_OBJECT_BERSERKBUFF_MAGE_TOWER = 58,
|
||||
BG_EY_OBJECT_MAX = 59
|
||||
};
|
||||
|
||||
#define BG_EY_NotEYWeekendHonorTicks 330
|
||||
#define BG_EY_EYWeekendHonorTicks 200
|
||||
|
||||
enum BG_EY_Score
|
||||
{
|
||||
BG_EY_WARNING_NEAR_VICTORY_SCORE = 1800,
|
||||
BG_EY_MAX_TEAM_SCORE = 2000
|
||||
};
|
||||
|
||||
enum BG_EY_FlagState
|
||||
{
|
||||
BG_EY_FLAG_STATE_ON_BASE = 0,
|
||||
@@ -227,14 +208,12 @@ enum BG_EY_FlagState
|
||||
BG_EY_FLAG_STATE_ON_PLAYER = 2,
|
||||
BG_EY_FLAG_STATE_ON_GROUND = 3
|
||||
};
|
||||
|
||||
enum EYBattleGroundPointState
|
||||
{
|
||||
EY_POINT_NO_OWNER = 0,
|
||||
EY_POINT_STATE_UNCONTROLLED = 0,
|
||||
EY_POINT_UNDER_CONTROL = 3
|
||||
};
|
||||
|
||||
struct BattleGroundEYPointIconsStruct
|
||||
{
|
||||
BattleGroundEYPointIconsStruct(uint32 _WorldStateControlIndex, uint32 _WorldStateAllianceControlledIndex, uint32 _WorldStateHordeControlledIndex)
|
||||
@@ -243,7 +222,6 @@ struct BattleGroundEYPointIconsStruct
|
||||
uint32 WorldStateAllianceControlledIndex;
|
||||
uint32 WorldStateHordeControlledIndex;
|
||||
};
|
||||
|
||||
struct BattleGroundEYLoosingPointStruct
|
||||
{
|
||||
BattleGroundEYLoosingPointStruct(uint32 _SpawnNeutralObjectType, uint32 _DespawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _DespawnObjectTypeHorde, uint32 _MessageIdHorde)
|
||||
@@ -251,14 +229,12 @@ struct BattleGroundEYLoosingPointStruct
|
||||
DespawnObjectTypeAlliance(_DespawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
|
||||
DespawnObjectTypeHorde(_DespawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde)
|
||||
{}
|
||||
|
||||
uint32 SpawnNeutralObjectType;
|
||||
uint32 DespawnObjectTypeAlliance;
|
||||
uint32 MessageIdAlliance;
|
||||
uint32 DespawnObjectTypeHorde;
|
||||
uint32 MessageIdHorde;
|
||||
};
|
||||
|
||||
struct BattleGroundEYCapturingPointStruct
|
||||
{
|
||||
BattleGroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId)
|
||||
@@ -267,7 +243,6 @@ struct BattleGroundEYCapturingPointStruct
|
||||
SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde),
|
||||
GraveYardId(_GraveYardId)
|
||||
{}
|
||||
|
||||
uint32 DespawnNeutralObjectType;
|
||||
uint32 SpawnObjectTypeAlliance;
|
||||
uint32 MessageIdAlliance;
|
||||
@@ -275,10 +250,8 @@ struct BattleGroundEYCapturingPointStruct
|
||||
uint32 MessageIdHorde;
|
||||
uint32 GraveYardId;
|
||||
};
|
||||
|
||||
const uint8 BG_EY_TickPoints[EY_POINTS_MAX] = {1, 2, 5, 10};
|
||||
const uint32 BG_EY_FlagPoints[EY_POINTS_MAX] = {75, 85, 100, 500};
|
||||
|
||||
//constant arrays:
|
||||
const BattleGroundEYPointIconsStruct m_PointsIconStruct[EY_POINTS_MAX] =
|
||||
{
|
||||
@@ -301,7 +274,6 @@ const BattleGroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX] =
|
||||
BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_A_D_RUINS, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_H_D_RUINS, EY_GRAVEYARD_DRAENEI_RUINS),
|
||||
BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_A_M_TOWER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_H_M_TOWER, EY_GRAVEYARD_MAGE_TOWER)
|
||||
};
|
||||
|
||||
class BattleGroundEYScore : public BattleGroundScore
|
||||
{
|
||||
public:
|
||||
@@ -309,21 +281,17 @@ class BattleGroundEYScore : public BattleGroundScore
|
||||
virtual ~BattleGroundEYScore() {};
|
||||
uint32 FlagCaptures;
|
||||
};
|
||||
|
||||
class BattleGroundEY : public BattleGround
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundEY();
|
||||
~BattleGroundEY();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
virtual void AddPlayer(Player *plr);
|
||||
virtual void StartingEventCloseDoors();
|
||||
virtual void StartingEventOpenDoors();
|
||||
|
||||
/* BG Flags */
|
||||
uint64 GetFlagPickerGUID() const { return m_FlagKeeper; }
|
||||
void SetFlagPicker(uint64 guid) { m_FlagKeeper = guid; }
|
||||
@@ -331,7 +299,6 @@ class BattleGroundEY : public BattleGround
|
||||
uint8 GetFlagState() const { return m_FlagState; }
|
||||
void RespawnFlag(bool send_message);
|
||||
void RespawnFlagAfterDrop();
|
||||
|
||||
void RemovePlayer(Player *plr,uint64 guid);
|
||||
void HandleBuffUse(uint64 const& buff_guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
@@ -345,11 +312,9 @@ class BattleGroundEY : public BattleGround
|
||||
virtual void FillInitialWorldStates(WorldPacket& data);
|
||||
void SetDroppedFlagGUID(uint64 guid) { m_DroppedFlagGUID = guid;}
|
||||
uint64 GetDroppedFlagGUID() const { return m_DroppedFlagGUID;}
|
||||
|
||||
/* Battleground Events */
|
||||
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj);
|
||||
virtual void EventPlayerDroppedFlag(Player *Source);
|
||||
|
||||
/* achievement req. */
|
||||
bool IsAllNodesConrolledByTeam(uint32 team) const;
|
||||
private:
|
||||
@@ -358,38 +323,30 @@ class BattleGroundEY : public BattleGround
|
||||
void EventTeamLostPoint(Player *Source, uint32 Point);
|
||||
void UpdatePointsCount(uint32 Team);
|
||||
void UpdatePointsIcons(uint32 Team, uint32 Point);
|
||||
|
||||
/* Point status updating procedures */
|
||||
void CheckSomeoneLeftPoint();
|
||||
void CheckSomeoneJoinedPoint();
|
||||
void UpdatePointStatuses();
|
||||
|
||||
/* Scorekeeping */
|
||||
uint32 GetTeamScore(uint32 Team) const { return m_TeamScores[GetTeamIndexByTeamId(Team)]; }
|
||||
void AddPoints(uint32 Team, uint32 Points);
|
||||
|
||||
void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; }
|
||||
void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; }
|
||||
|
||||
uint32 m_HonorScoreTics[2];
|
||||
uint32 m_TeamPointsCount[2];
|
||||
|
||||
uint32 m_Points_Trigger[EY_POINTS_MAX];
|
||||
|
||||
uint64 m_FlagKeeper; // keepers guid
|
||||
uint64 m_DroppedFlagGUID;
|
||||
uint32 m_FlagCapturedBgObjectType; // type that should be despawned when flag is captured
|
||||
uint8 m_FlagState; // for checking flag state
|
||||
int32 m_FlagsTimer;
|
||||
int32 m_TowerCapCheckTimer;
|
||||
|
||||
uint32 m_PointOwnedByTeam[EY_POINTS_MAX];
|
||||
uint8 m_PointState[EY_POINTS_MAX];
|
||||
int32 m_PointBarStatus[EY_POINTS_MAX];
|
||||
typedef std::vector<uint64> PlayersNearPointType;
|
||||
PlayersNearPointType m_PlayersNearPoint[EY_POINTS_MAX + 1];
|
||||
uint8 m_CurrentPointPlayersCount[2*EY_POINTS_MAX];
|
||||
|
||||
int32 m_PointAddingTimer;
|
||||
uint32 m_HonorTics;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user