[Raid] Sync with azerothcore (update the core before pull this commit)

This commit is contained in:
Yunfan Li
2024-05-26 23:44:10 +08:00
parent 9510b6b4df
commit fb839823af
5 changed files with 25 additions and 24 deletions

View File

@@ -46,7 +46,7 @@ uint32 GrobbulusRotateAction::GetCurrWaypoint()
if (!boss) { if (!boss) {
return false; return false;
} }
auto* boss_ai = dynamic_cast<boss_grobbulus::boss_grobbulusAI*>(boss->GetAI()); auto* boss_ai = dynamic_cast<Grobbulus::boss_grobbulus::boss_grobbulusAI*>(boss->GetAI());
EventMap* eventMap = &boss_ai->events; EventMap* eventMap = &boss_ai->events;
const uint32 event_time = eventMap->GetNextEventTime(2); const uint32 event_time = eventMap->GetNextEventTime(2);
return (event_time / 15000) % intervals; return (event_time / 15000) % intervals;
@@ -57,7 +57,7 @@ bool HeiganDanceAction::CalculateSafe() {
if (!boss) { if (!boss) {
return false; return false;
} }
boss_heigan::boss_heiganAI* boss_ai = dynamic_cast<boss_heigan::boss_heiganAI*>(boss->GetAI()); auto* boss_ai = dynamic_cast<Heigan::boss_heigan::boss_heiganAI*>(boss->GetAI());
EventMap* eventMap = &boss_ai->events; EventMap* eventMap = &boss_ai->events;
uint32 curr_phase = boss_ai->currentPhase; uint32 curr_phase = boss_ai->currentPhase;
uint32 curr_erupt = eventMap->GetNextEventTime(3); uint32 curr_erupt = eventMap->GetNextEventTime(3);
@@ -638,7 +638,7 @@ bool AnubrekhanPositionAction::Execute(Event event)
if (!boss) { if (!boss) {
return false; return false;
} }
boss_anubrekhan::boss_anubrekhanAI* boss_ai = dynamic_cast<boss_anubrekhan::boss_anubrekhanAI*>(boss->GetAI()); auto* boss_ai = dynamic_cast<Anubrekhan::boss_anubrekhan::boss_anubrekhanAI*>(boss->GetAI());
if (!boss_ai) { if (!boss_ai) {
return false; return false;
} }

View File

@@ -5,6 +5,7 @@
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "EventMap.h" #include "EventMap.h"
#include "Log.h" #include "Log.h"
#include "NamedObjectContext.h"
#include "ObjectGuid.h" #include "ObjectGuid.h"
#include "Player.h" #include "Player.h"
#include "PlayerbotAI.h" #include "PlayerbotAI.h"
@@ -68,14 +69,14 @@ class GenericBossHelper : public AiObject {
uint32 _timer = 0; uint32 _timer = 0;
}; };
class KelthuzadBossHelper: public GenericBossHelper<boss_kelthuzad::boss_kelthuzadAI> { class KelthuzadBossHelper: public GenericBossHelper<Kelthuzad::boss_kelthuzad::boss_kelthuzadAI> {
public: public:
KelthuzadBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "kel'thuzad") {} KelthuzadBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "kel'thuzad") {}
const std::pair<float, float> center = {3716.19f, -5106.58f}; const std::pair<float, float> center = {3716.19f, -5106.58f};
const std::pair<float, float> tank_pos = {3709.19f, -5104.86f}; const std::pair<float, float> tank_pos = {3709.19f, -5104.86f};
const std::pair<float, float> assist_tank_pos = {3746.05f, -5112.74f}; const std::pair<float, float> assist_tank_pos = {3746.05f, -5112.74f};
bool IsPhaseOne() { bool IsPhaseOne() {
return _event_map->GetNextEventTime(KELTHUZAD_EVENT_PHASE_2) != 0; return _event_map->GetNextEventTime(Kelthuzad::KELTHUZAD_EVENT_PHASE_2) != 0;
} }
bool IsPhaseTwo() { bool IsPhaseTwo() {
return !IsPhaseOne(); return !IsPhaseOne();
@@ -96,12 +97,12 @@ class KelthuzadBossHelper: public GenericBossHelper<boss_kelthuzad::boss_kelthuz
} }
}; };
class RazuviousBossHelper: public GenericBossHelper<boss_razuvious::boss_razuviousAI> { class RazuviousBossHelper: public GenericBossHelper<Razuvious::boss_razuvious::boss_razuviousAI> {
public: public:
RazuviousBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "instructor razuvious") {} RazuviousBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "instructor razuvious") {}
}; };
class SapphironBossHelper: public GenericBossHelper<boss_sapphiron::boss_sapphironAI> { class SapphironBossHelper: public GenericBossHelper<Sapphiron::boss_sapphiron::boss_sapphironAI> {
public: public:
const std::pair<float, float> mainTankPos = {3512.07f, -5274.06f}; const std::pair<float, float> mainTankPos = {3512.07f, -5274.06f};
const std::pair<float, float> center = {3517.31f, -5253.74f}; const std::pair<float, float> center = {3517.31f, -5253.74f};
@@ -111,7 +112,7 @@ class SapphironBossHelper: public GenericBossHelper<boss_sapphiron::boss_sapphir
if (!GenericBossHelper::UpdateBossAI()) { if (!GenericBossHelper::UpdateBossAI()) {
return false; return false;
} }
uint32 nextEventGround = _event_map->GetNextEventTime(EVENT_GROUND); uint32 nextEventGround = _event_map->GetNextEventTime(Sapphiron::EVENT_GROUND);
if (nextEventGround && nextEventGround != lastEventGround) if (nextEventGround && nextEventGround != lastEventGround)
lastEventGround = nextEventGround; lastEventGround = nextEventGround;
return true; return true;
@@ -123,10 +124,10 @@ class SapphironBossHelper: public GenericBossHelper<boss_sapphiron::boss_sapphir
return !IsPhaseGround(); return !IsPhaseGround();
} }
bool JustLanded() { bool JustLanded() {
return (_event_map->GetNextEventTime(EVENT_FLIGHT_START) - _timer) >= EVENT_FLIGHT_INTERVAL - POSITION_TIME_AFTER_LANDED; return (_event_map->GetNextEventTime(Sapphiron::EVENT_FLIGHT_START) - _timer) >= EVENT_FLIGHT_INTERVAL - POSITION_TIME_AFTER_LANDED;
} }
bool WaitForExplosion() { bool WaitForExplosion() {
return _event_map->GetNextEventTime(EVENT_FLIGHT_SPELL_EXPLOSION); return _event_map->GetNextEventTime(Sapphiron::EVENT_FLIGHT_SPELL_EXPLOSION);
} }
bool FindPosToAvoidChill(std::vector<float> &dest) { bool FindPosToAvoidChill(std::vector<float> &dest) {
Aura* aura = botAI->GetAura("chill", bot); Aura* aura = botAI->GetAura("chill", bot);
@@ -172,7 +173,7 @@ class SapphironBossHelper: public GenericBossHelper<boss_sapphiron::boss_sapphir
uint32 lastEventGround = 0; uint32 lastEventGround = 0;
}; };
class GluthBossHelper: public GenericBossHelper<boss_gluth::boss_gluthAI> { class GluthBossHelper: public GenericBossHelper<Gluth::boss_gluth::boss_gluthAI> {
public: public:
const std::pair<float, float> mainTankPos25 = {3331.48f, -3109.06f}; const std::pair<float, float> mainTankPos25 = {3331.48f, -3109.06f};
const std::pair<float, float> mainTankPos10 = {3278.29f, -3162.06f}; const std::pair<float, float> mainTankPos10 = {3278.29f, -3162.06f};
@@ -185,7 +186,7 @@ class GluthBossHelper: public GenericBossHelper<boss_gluth::boss_gluthAI> {
const float decimatedZombiePct = 10.0f; const float decimatedZombiePct = 10.0f;
GluthBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "gluth") {} GluthBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "gluth") {}
bool BeforeDecimate() { bool BeforeDecimate() {
uint32 decimate = _event_map->GetNextEventTime(GLUTH_EVENT_DECIMATE); uint32 decimate = _event_map->GetNextEventTime(Gluth::GLUTH_EVENT_DECIMATE);
return decimate && decimate - _timer <= 3000; return decimate && decimate - _timer <= 3000;
} }
bool JustStartCombat() { bool JustStartCombat() {
@@ -193,14 +194,14 @@ class GluthBossHelper: public GenericBossHelper<boss_gluth::boss_gluthAI> {
} }
}; };
class LoathebBossHelper: public GenericBossHelper<boss_loatheb::boss_loathebAI> { class LoathebBossHelper: public GenericBossHelper<Loatheb::boss_loatheb::boss_loathebAI> {
public: public:
const std::pair<float, float> mainTankPos = {2877.57f, -3967.00f}; const std::pair<float, float> mainTankPos = {2877.57f, -3967.00f};
const std::pair<float, float> rangePos = {2896.96f, -3980.61f}; const std::pair<float, float> rangePos = {2896.96f, -3980.61f};
LoathebBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "loatheb") {} LoathebBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "loatheb") {}
}; };
class FourhorsemanBossHelper: public GenericBossHelper<boss_four_horsemen::boss_four_horsemenAI> { class FourhorsemanBossHelper: public GenericBossHelper<FourHorsemen::boss_four_horsemen::boss_four_horsemenAI> {
public: public:
const float posZ = 241.27f; const float posZ = 241.27f;
const std::pair<float, float> attractPos[2] = {{2502.03f, -2910.90f}, {2484.61f, -2947.07f}}; // left (sir zeliek), right (lady blaumeux) const std::pair<float, float> attractPos[2] = {{2502.03f, -2910.90f}, {2484.61f, -2947.07f}}; // left (sir zeliek), right (lady blaumeux)
@@ -217,12 +218,12 @@ class FourhorsemanBossHelper: public GenericBossHelper<boss_four_horsemen::boss_
if (!lady) { if (!lady) {
return true; return true;
} }
ladyAI = dynamic_cast<boss_four_horsemen::boss_four_horsemenAI *>(lady->GetAI()); ladyAI = dynamic_cast<FourHorsemen::boss_four_horsemen::boss_four_horsemenAI *>(lady->GetAI());
if (!ladyAI) { if (!ladyAI) {
return true; return true;
} }
ladyEvent = &ladyAI->events; ladyEvent = &ladyAI->events;
const uint32 voidZone = ladyEvent->GetNextEventTime(EVENT_SECONDARY_SPELL); const uint32 voidZone = ladyEvent->GetNextEventTime(FourHorsemen::EVENT_SECONDARY_SPELL);
if (voidZone && lastEventVoidZone != voidZone) { if (voidZone && lastEventVoidZone != voidZone) {
voidZoneCounter++; voidZoneCounter++;
voidZoneCounter %= 8; voidZoneCounter %= 8;
@@ -291,13 +292,13 @@ class FourhorsemanBossHelper: public GenericBossHelper<boss_four_horsemen::boss_
protected: protected:
Unit* sir = nullptr; Unit* sir = nullptr;
Unit* lady = nullptr; Unit* lady = nullptr;
boss_four_horsemen::boss_four_horsemenAI* ladyAI = nullptr; FourHorsemen::boss_four_horsemen::boss_four_horsemenAI* ladyAI = nullptr;
EventMap* ladyEvent = nullptr; EventMap* ladyEvent = nullptr;
uint32 lastEventVoidZone = 0; uint32 lastEventVoidZone = 0;
uint32 voidZoneCounter = 0; uint32 voidZoneCounter = 0;
int posToGo = 0; int posToGo = 0;
}; };
class ThaddiusBossHelper: public GenericBossHelper<boss_thaddius::boss_thaddiusAI> { class ThaddiusBossHelper: public GenericBossHelper<Thaddius::boss_thaddius::boss_thaddiusAI> {
public: public:
const std::pair<float, float> tankPosFeugen = {3522.94f, -3002.60f}; const std::pair<float, float> tankPosFeugen = {3522.94f, -3002.60f};
const std::pair<float, float> tankPosStalagg = {3436.14f, -2919.98f}; const std::pair<float, float> tankPosStalagg = {3436.14f, -2919.98f};

View File

@@ -26,7 +26,7 @@ float HeiganDanceMultiplier::GetValue(Action* action)
return 1.0f; return 1.0f;
} }
boss_heigan::boss_heiganAI* boss_ai = dynamic_cast<boss_heigan::boss_heiganAI*>(boss->GetAI()); auto* boss_ai = dynamic_cast<Heigan::boss_heigan::boss_heiganAI*>(boss->GetAI());
EventMap* eventMap = &boss_ai->events; EventMap* eventMap = &boss_ai->events;
uint32 curr_phase = boss_ai->currentPhase; uint32 curr_phase = boss_ai->currentPhase;
uint32 curr_dance = eventMap->GetNextEventTime(4); uint32 curr_dance = eventMap->GetNextEventTime(4);
@@ -266,7 +266,7 @@ float GluthGenericMultiplier::GetValue(Action* action)
} }
if (dynamic_cast<PetAttackAction*>(action)) { if (dynamic_cast<PetAttackAction*>(action)) {
Unit* target = AI_VALUE(Unit*, "current target"); Unit* target = AI_VALUE(Unit*, "current target");
if (target && target->GetEntry() == NPC_ZOMBIE_CHOW) { if (target && target->GetEntry() == Gluth::NPC_ZOMBIE_CHOW) {
return 0.0f; return 0.0f;
} }
} }

View File

@@ -215,5 +215,5 @@ bool ThaddiusPhaseThaddiusTrigger::IsActive()
return helper.IsPhaseThaddius(); return helper.IsPhaseThaddius();
} }
template bool BossEventTrigger<boss_grobbulus::boss_grobbulusAI>::IsActive(); template bool BossEventTrigger<Grobbulus::boss_grobbulus::boss_grobbulusAI>::IsActive();
template bool BossPhaseTrigger<boss_anubrekhan::boss_anubrekhanAI>::IsActive(); template bool BossPhaseTrigger<Anubrekhan::boss_anubrekhan::boss_anubrekhanAI>::IsActive();

View File

@@ -61,7 +61,7 @@ protected:
uint32 phase_mask; uint32 phase_mask;
}; };
class GrobbulusCloudTrigger : public BossEventTrigger<boss_grobbulus::boss_grobbulusAI> class GrobbulusCloudTrigger : public BossEventTrigger<Grobbulus::boss_grobbulus::boss_grobbulusAI>
{ {
public: public:
GrobbulusCloudTrigger(PlayerbotAI* ai): BossEventTrigger(ai, 15931, 2, "grobbulus cloud event") { } GrobbulusCloudTrigger(PlayerbotAI* ai): BossEventTrigger(ai, 15931, 2, "grobbulus cloud event") { }
@@ -109,7 +109,7 @@ class KelthuzadTrigger : public Trigger
KelthuzadBossHelper helper; KelthuzadBossHelper helper;
}; };
class AnubrekhanTrigger : public BossPhaseTrigger<boss_anubrekhan::boss_anubrekhanAI> class AnubrekhanTrigger : public BossPhaseTrigger<Anubrekhan::boss_anubrekhan::boss_anubrekhanAI>
{ {
public: public:
AnubrekhanTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "anub'rekhan", 0, "anub'rekhan trigger") {} AnubrekhanTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "anub'rekhan", 0, "anub'rekhan trigger") {}