feat(Core/PvP): Set 30 sec timer before turn off FFA PvP flag. (#5090)

This commit is contained in:
UltraNix
2021-04-08 13:00:45 +02:00
committed by GitHub
parent 143fad42c7
commit 54e371e0e7
5 changed files with 109 additions and 45 deletions

View File

@@ -309,7 +309,8 @@ struct PvPInfo
bool IsInHostileArea{false}; ///> Marks if player is in an area which forces PvP flag
bool IsInNoPvPArea{false}; ///> Marks if player is in a sanctuary or friendly capital city
bool IsInFFAPvPArea{false}; ///> Marks if player is in an FFAPvP area (such as Gurubashi Arena)
time_t EndTimer{0}; ///> Time when player unflags himself for PvP (flag removed after 5 minutes)
time_t EndTimer{0}; ///> Time when player unflags himself for PvP (flag removed after 5 minutes)
time_t FFAPvPEndTimer{0}; ///> Time when player unflags himself for FFA PvP (flag removed after 30 sec)
};
struct DuelInfo
@@ -1843,7 +1844,8 @@ public:
bool IsActionButtonDataValid(uint8 button, uint32 action, uint8 type);
PvPInfo pvpInfo;
void UpdatePvPState(bool onlyFFA = false);
void UpdatePvPState();
void UpdateFFAPvPState(bool reset = true);
void SetPvP(bool state)
{
Unit::SetPvP(state);
@@ -1864,6 +1866,7 @@ public:
void UpdateAfkReport(time_t currTime);
void UpdatePvPFlag(time_t currTime);
void UpdateFFAPvPFlag(time_t currTime);
void UpdateContestedPvP(uint32 currTime);
void SetContestedPvPTimer(uint32 newTime) {m_contestedPvPTimer = newTime;}
void ResetContestedPvP()