Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naxx core sync #740

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/strategy/raids/naxxramas/RaidNaxxActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,17 +834,14 @@ bool AnubrekhanPositionAction::Execute(Event event)
{
return false;
}
EventMap* eventMap = &boss_ai->events;
uint32 locust = eventMap->GetNextEventTime(2);
uint32 timer = eventMap->GetTimer();
bool inPhase = botAI->HasAura("locust swarm", boss) || boss->GetCurrentSpell(CURRENT_GENERIC_SPELL);
if (inPhase || (locust && locust - timer <= 8000))
if (inPhase)
{
if (botAI->IsMainTank(bot))
{
uint32 nearest = FindNearestWaypoint();
uint32 next_point;
if (inPhase || (locust && locust - timer <= 3000))
if (inPhase)
{
next_point = (nearest + 1) % intervals;
}
Expand Down
45 changes: 9 additions & 36 deletions src/strategy/raids/naxxramas/RaidNaxxTriggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,6 @@ bool BossEventTrigger<T>::IsActive()
return false;
}

template <class T>
bool BossPhaseTrigger<T>::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", boss_name);
if (!boss)
{
return false;
}
if (this->phase_mask == 0)
{
return true;
}
T* boss_ai = dynamic_cast<T*>(boss->GetAI());
EventMap* eventMap = &boss_ai->events;
uint8 phase_mask = eventMap->GetPhaseMask();
// bot->Yell("phase mask detected: " + to_string(phase_mask) + " compare with " + to_string(this->phase_mask),
// LANG_UNIVERSAL);
return phase_mask == this->phase_mask;
}

bool GrobbulusCloudTrigger::IsActive()
{
Unit* boss = AI_VALUE(Unit*, "boss target");
Expand Down Expand Up @@ -162,21 +142,6 @@ bool SapphironFlightTrigger::IsActive()
return helper.IsPhaseFlight();
}

// bool SapphironGroundExceptMainTankTrigger::IsActive()
// {
// return BossPhaseTrigger::IsActive() && !botAI->IsMainTank(bot);
// }

// bool SapphironFlightTrigger::IsActive()
// {
// return BossPhaseTrigger::IsActive();
// }

// bool SapphironGroundChillTrigger::IsActive()
// {
// return BossPhaseTrigger::IsActive() && !botAI->IsMainTank(bot) && botAI->HasAura("chill", bot);
// }

bool GluthTrigger::IsActive() { return helper.UpdateBossAI(); }

bool GluthMainTankMortalWoundTrigger::IsActive()
Expand Down Expand Up @@ -204,6 +169,15 @@ bool GluthMainTankMortalWoundTrigger::IsActive()

bool KelthuzadTrigger::IsActive() { return helper.UpdateBossAI(); }

bool AnubrekhanTrigger::IsActive() {
Unit* boss = AI_VALUE2(Unit*, "find target", "anub'rekhan");
if (!boss)
{
return false;
}
return true;
}

bool LoathebTrigger::IsActive() { return helper.UpdateBossAI(); }

bool ThaddiusPhasePetTrigger::IsActive()
Expand Down Expand Up @@ -234,4 +208,3 @@ bool ThaddiusPhaseThaddiusTrigger::IsActive()
}

template bool BossEventTrigger<Grobbulus::boss_grobbulus::boss_grobbulusAI>::IsActive();
template bool BossPhaseTrigger<Anubrekhan::boss_anubrekhan::boss_anubrekhanAI>::IsActive();
43 changes: 3 additions & 40 deletions src/strategy/raids/naxxramas/RaidNaxxTriggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,6 @@ class BossEventTrigger : public Trigger
uint32 boss_entry, event_id, last_event_time;
};

template <class T>
class BossPhaseTrigger : public Trigger
{
public:
BossPhaseTrigger(PlayerbotAI* ai, std::string boss_name, uint32 phase_mask, std::string name = "boss event")
: Trigger(ai, name, 1)
{
this->boss_name = boss_name;
this->phase_mask = phase_mask;
}
virtual bool IsActive();

protected:
std::string boss_name;
uint32 phase_mask;
};

class GrobbulusCloudTrigger : public BossEventTrigger<Grobbulus::boss_grobbulus::boss_grobbulusAI>
{
public:
Expand Down Expand Up @@ -117,10 +100,11 @@ class KelthuzadTrigger : public Trigger
KelthuzadBossHelper helper;
};

class AnubrekhanTrigger : public BossPhaseTrigger<Anubrekhan::boss_anubrekhan::boss_anubrekhanAI>
class AnubrekhanTrigger : public Trigger
{
public:
AnubrekhanTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "anub'rekhan", 0, "anub'rekhan trigger") {}
AnubrekhanTrigger(PlayerbotAI* ai) : Trigger(ai, "anub'rekhan") {}
bool IsActive() override;
};

class ThaddiusPhasePetTrigger : public Trigger
Expand Down Expand Up @@ -194,12 +178,6 @@ class SapphironGroundTrigger : public Trigger
SapphironBossHelper helper;
};

// class SapphironGroundExceptMainTankTrigger : public BossPhaseTrigger
// {
// public:
// SapphironGroundExceptMainTankTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "sapphiron", (1 << (2 - 1)),
// "sapphiron ground except main tank") {} virtual bool IsActive();
// };

class SapphironFlightTrigger : public Trigger
{
Expand All @@ -211,20 +189,6 @@ class SapphironFlightTrigger : public Trigger
SapphironBossHelper helper;
};

// class SapphironGroundChillTrigger : public BossPhaseTrigger
// {
// public:
// SapphironGroundChillTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "sapphiron", 0, "sapphiron chill") {}
// virtual bool IsActive();
// };

// class KelthuzadPhaseTwoTrigger : public BossPhaseTrigger
// {
// public:
// KelthuzadPhaseTwoTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "kel'thuzad", 1 << (2 - 1), "kel'thuzad
// trigger") {}
// };

class GluthTrigger : public Trigger
{
public:
Expand Down Expand Up @@ -257,5 +221,4 @@ class LoathebTrigger : public Trigger
LoathebBossHelper helper;
};

// template BossEventTrigger<class boss_grobbulus::boss_grobbulusAI>;
#endif
Loading