mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
### Summary This PR restores the Naxxramas raid strategies that were removed in commit 686fe513b25bbb20ccfcc89f08ee8c4b498a263e . The reintroduced logic is core‑friendly (no AzerothCore script headers or internal boss AI/EventMap dependencies), and the Naxxramas actions have been refactored into per‑boss files for better maintainability. ### Motivation The previous removal was meant to avoid core modifications and unblock upstreaming. This PR brings the strategies back while adhering to that requirement, using only observable state and mod‑playerbots helpers. ### What’s included - Re‑enabled the Naxxramas strategies previously removed. - Replaced core script header dependencies with observable checks (auras, casts, unit flags, flight state, etc.). - Split the Naxxramas action logic into per‑boss source files to avoid a “god file” and ease future maintenance. - Minor, non‑intrusive behavior improvements aligned with existing helpers. ### Future work Some strategies may still require refinement or more advanced handling later. This PR focuses on restoring the baseline logic without core dependencies, while keeping changes minimal and safe. **Any contributions are welcome to further improve and fine‑tune the Naxxramas strategies.** ### Testing Tested in some Naxx boxx. No server crash and boss killed :D Note: I'll make another PR with revised scripts when this one are merged --------- Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com> Co-authored-by: bash <hermensb@gmail.com> Co-authored-by: Revision <tkn963@gmail.com> Co-authored-by: kadeshar <kadeshar@gmail.com>
78 lines
2.7 KiB
C++
78 lines
2.7 KiB
C++
#include "Playerbots.h"
|
|
#include "RaidNaxxActions.h"
|
|
#include "RaidNaxxSpellIds.h"
|
|
#include "Spell.h"
|
|
#include "Timer.h"
|
|
|
|
//bool HeiganDanceAction::CalculateSafe()
|
|
//{
|
|
// Unit* boss = AI_VALUE2(Unit*, "find target", "heigan the unclean");
|
|
// if (!boss)
|
|
// {
|
|
// return false;
|
|
// }
|
|
// uint32 now = getMSTime();
|
|
// platform_phase = boss->IsWithinDist2d(platform.first, platform.second, 10.0f);
|
|
// if (last_eruption_ms != 0 && now - last_eruption_ms > 15000)
|
|
// {
|
|
// ResetSafe();
|
|
// }
|
|
// if (boss->HasUnitState(UNIT_STATE_CASTING))
|
|
// {
|
|
// Spell* spell = boss->GetCurrentSpell(CURRENT_GENERIC_SPELL);
|
|
// if (!spell)
|
|
// {
|
|
// spell = boss->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
|
|
// }
|
|
// if (spell)
|
|
// {
|
|
// SpellInfo const* info = spell->GetSpellInfo();
|
|
// bool isEruption = NaxxSpellIds::MatchesAnySpellId(info, {NaxxSpellIds::Eruption10});
|
|
// if (!isEruption && info && info->SpellName[LOCALE_enUS])
|
|
// {
|
|
// // Fallback to name for custom spell data.
|
|
// isEruption = botAI->EqualLowercaseName(info->SpellName[LOCALE_enUS], "eruption");
|
|
// }
|
|
// if (isEruption)
|
|
// {
|
|
// if (last_eruption_ms == 0 || now - last_eruption_ms > 500)
|
|
// {
|
|
// NextSafe();
|
|
// }
|
|
// last_eruption_ms = now;
|
|
// }
|
|
// }
|
|
// }
|
|
// return true;
|
|
//}
|
|
//
|
|
//bool HeiganDanceMeleeAction::Execute(Event event)
|
|
//{
|
|
// CalculateSafe();
|
|
// if (!platform_phase && botAI->IsMainTank(bot) && !AI_VALUE2(bool, "has aggro", "boss target"))
|
|
// {
|
|
// return false;
|
|
// }
|
|
// assert(curr_safe >= 0 && curr_safe <= 3);
|
|
// return MoveInside(bot->GetMapId(), waypoints[curr_safe].first, waypoints[curr_safe].second, bot->GetPositionZ(),
|
|
// botAI->IsMainTank(bot) ? 0 : 0, MovementPriority::MOVEMENT_COMBAT);
|
|
//}
|
|
//
|
|
//bool HeiganDanceRangedAction::Execute(Event event)
|
|
//{
|
|
// CalculateSafe();
|
|
// if (!platform_phase)
|
|
// {
|
|
// if (MoveTo(bot->GetMapId(), platform.first, platform.second, 276.54f, false, false, false, false,
|
|
// MovementPriority::MOVEMENT_COMBAT))
|
|
// {
|
|
// return true;
|
|
// }
|
|
// return MoveInside(bot->GetMapId(), platform.first, platform.second, 276.54f, 2.0f,
|
|
// MovementPriority::MOVEMENT_COMBAT);
|
|
// }
|
|
// botAI->InterruptSpell();
|
|
// return MoveInside(bot->GetMapId(), waypoints[curr_safe].first, waypoints[curr_safe].second, bot->GetPositionZ(), 0,
|
|
// MovementPriority::MOVEMENT_COMBAT);
|
|
//}
|