Priority of The Sacred Flame Base

This commit is contained in:
luis
2026-09-18 14:25:08 -03:00
parent 660bf7cec9
commit a9bc53c831
6 changed files with 547 additions and 0 deletions
@@ -0,0 +1,145 @@
/*
* Copyright (C) WowCommunity Project
*
* This SourceCode is NOT free a software. Please hold everything Private
* and read our Terms
*/
#include "priority_of_the_sacred_flame.h"
#include "Containers.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "TemporarySummon.h"
#include "MotionMaster.h"
#include "MovementTypedefs.h"
#include "ObjectAccessor.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "TaskScheduler.h"
enum Spells
{
SPELL_VINDICTIVE_WRATH = 422969,
SPELL_CASTIGATORS_SHIELD = 423015,
SPELL_CASTIGATORS_DETONATION = 423019,
SPELL_BURNING_LIGHT = 423051,
SPELL_HAMMER_OF_PURITY = 423062,
SPELL_HAMMER_SPIRAL = 423076
};
enum Events
{
EVENT_CASTIGATORS_SHIELD = 1,
EVENT_BURNING_LIGHT,
EVENT_HAMMER_OF_PURITY,
EVENT_CHECK_ENERGY
};
struct boss_baron_braunpyke : public BossAI
{
boss_baron_braunpyke(Creature* creature) : BossAI(creature, DATA_BARON_BRAUNPYKE)
{
Initialize();
}
void Initialize()
{
_vindictiveWrathActive = false;
_holyPower = 0;
}
void Reset() override
{
_Reset();
Initialize();
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_CASTIGATORS_SHIELD, 10s);
events.ScheduleEvent(EVENT_BURNING_LIGHT, 15s);
events.ScheduleEvent(EVENT_HAMMER_OF_PURITY, 20s);
events.ScheduleEvent(EVENT_CHECK_ENERGY, 2s);
}
void OnSpellCast(SpellInfo const* spell) override
{
if (spell->Id == SPELL_BURNING_LIGHT)
events.RescheduleEvent(EVENT_BURNING_LIGHT, 10s);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CHECK_ENERGY:
if (_holyPower >= 100)
{
DoCastSelf(SPELL_VINDICTIVE_WRATH);
_vindictiveWrathActive = true;
_holyPower = 0;
}
events.Repeat(2s);
break;
case EVENT_CASTIGATORS_SHIELD:
{
uint8 targetCount = _vindictiveWrathActive ? 5 : 3;
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f))
{
std::list<Unit*> targets;
SelectTargetList(targets, targetCount, SelectTargetMethod::Random, 0, 40.0f);
for (Unit* target : targets)
{
DoCast(target, SPELL_CASTIGATORS_SHIELD);
me->CastSpell(target->GetPosition(), SPELL_CASTIGATORS_DETONATION, true);
}
}
events.Repeat(25s);
break;
}
case EVENT_BURNING_LIGHT:
{
DoCastVictim(SPELL_BURNING_LIGHT, true);
events.Repeat(30s);
break;
}
case EVENT_HAMMER_OF_PURITY:
{
uint8 targetCount = _vindictiveWrathActive ? 5 : 3;
for (uint8 i = 0; i < targetCount; ++i)
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f))
{
DoCast(target, SPELL_HAMMER_OF_PURITY);
DoCast(target, SPELL_HAMMER_SPIRAL);
}
}
events.Repeat(35s);
break;
}
default:
break;
}
}
}
private:
bool _vindictiveWrathActive;
uint8 _holyPower;
};
void AddSC_boss_baron_braunpyke()
{
RegisterPriorityoftheSacredflameCreatureAI(boss_baron_braunpyke);
}
@@ -0,0 +1,119 @@
/*
* Copyright (C) WowCommunity Project
*
* This SourceCode is NOT free a software. Please hold everything Private
* and read our Terms
*/
#include "priority_of_the_sacred_flame.h"
#include "Containers.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "TemporarySummon.h"
#include "MotionMaster.h"
#include "MovementTypedefs.h"
#include "ObjectAccessor.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "TaskScheduler.h"
enum Spells
{
SPELL_STRENGTH_IN_NUMBERS = 424626,
SPELL_SAVAGE_MAULING = 447439,
SPELL_BATTLE_CRY = 424419,
SPELL_PIERCE_ARMOR = 424414,
SPELL_HURL_SPEAR = 447272
};
enum Events
{
EVENT_SAVAGE_MAULING = 1,
EVENT_BATTLE_CRY,
EVENT_HURL_SPEAR,
EVENT_PIERCE_ARMOR
};
struct boss_captain_dailcry : public BossAI
{
boss_captain_dailcry(Creature* creature) : BossAI(creature, DATA_CAPTAIN_DAILCRY)
{
Initialize();
}
void Initialize()
{
_emberShieldBroken = false;
}
void Reset() override
{
_Reset();
Initialize();
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_BATTLE_CRY, 10s);
events.ScheduleEvent(EVENT_PIERCE_ARMOR, 15s);
events.ScheduleEvent(EVENT_HURL_SPEAR, 20s);
events.ScheduleEvent(EVENT_SAVAGE_MAULING, 25s);
}
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
{
// Logic for breaking Ember's shield during Savage Mauling
if (!_emberShieldBroken && me->HasAura(SPELL_SAVAGE_MAULING))
{
// Shield break logic here
_emberShieldBroken = true;
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_BATTLE_CRY:
DoCastAOE(SPELL_BATTLE_CRY);
events.Repeat(30s);
break;
case EVENT_PIERCE_ARMOR:
DoCastVictim(SPELL_PIERCE_ARMOR);
events.Repeat(15s);
break;
case EVENT_HURL_SPEAR:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f))
DoCast(target, SPELL_HURL_SPEAR);
events.Repeat(20s);
break;
case EVENT_SAVAGE_MAULING:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f))
DoCast(target, SPELL_SAVAGE_MAULING);
events.Repeat(25s);
break;
default:
break;
}
}
}
private:
bool _emberShieldBroken;
};
void AddSC_boss_captain_dailcry()
{
RegisterPriorityoftheSacredflameCreatureAI(boss_captain_dailcry);
}
@@ -0,0 +1,145 @@
/*
* Copyright (C) WowCommunity Project
*
* This SourceCode is NOT free a software. Please hold everything Private
* and read our Terms
*/
#include "priority_of_the_sacred_flame.h"
#include "Containers.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "TemporarySummon.h"
#include "MotionMaster.h"
#include "MovementTypedefs.h"
#include "ObjectAccessor.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "TaskScheduler.h"
enum Spells
{
SPELL_THE_SACRED_FLAME = 425544,
SPELL_SANCTIFIED_GROUND = 425556,
SPELL_BARRIER_OF_LIGHT = 423588,
SPELL_EMBRACE_THE_LIGHT = 423665,
SPELL_INNER_FIRE = 423539,
SPELL_HOLY_FLAME = 451606,
SPELL_HOLY_SMITE = 423536,
SPELL_BLINDING_LIGHT = 428169,
// Arathi Neophyte
SPELL_OVERWHELMING_POWER = 425022
};
enum Events
{
EVENT_SACRED_FLAME = 1,
EVENT_HOLY_FLAME,
EVENT_HOLY_SMITE,
EVENT_INNER_FIRE,
EVENT_BLINDING_LIGHT,
EVENT_EMBRACE_THE_LIGHT,
EVENT_SUMMON_NEOPHYTES
};
struct boss_prioress_murrpray : public BossAI
{
boss_prioress_murrpray(Creature* creature) : BossAI(creature, DATA_PRIORESS_MURRPRAY)
{
Initialize();
}
void Initialize()
{
_barrierPhase = false;
}
void Reset() override
{
_Reset();
Initialize();
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_SACRED_FLAME, 10s);
events.ScheduleEvent(EVENT_HOLY_FLAME, 15s);
events.ScheduleEvent(EVENT_HOLY_SMITE, 5s);
events.ScheduleEvent(EVENT_INNER_FIRE, 20s);
if (IsHeroic() || IsMythic())
events.ScheduleEvent(EVENT_BLINDING_LIGHT, 25s);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
{
if (!_barrierPhase && me->HealthBelowPctDamaged(50, damage))
{
_barrierPhase = true;
events.Reset();
DoCastSelf(SPELL_BARRIER_OF_LIGHT);
events.ScheduleEvent(EVENT_EMBRACE_THE_LIGHT, 2s);
events.ScheduleEvent(EVENT_SUMMON_NEOPHYTES, 3s);
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SACRED_FLAME:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f))
DoCast(target, SPELL_THE_SACRED_FLAME);
events.Repeat(30s);
break;
case EVENT_HOLY_FLAME:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f))
DoCast(target, SPELL_HOLY_FLAME);
events.Repeat(20s);
break;
case EVENT_HOLY_SMITE:
DoCastVictim(SPELL_HOLY_SMITE);
events.Repeat(8s);
break;
case EVENT_INNER_FIRE:
DoCastSelf(SPELL_INNER_FIRE);
events.Repeat(45s);
break;
case EVENT_BLINDING_LIGHT:
DoCastAOE(SPELL_BLINDING_LIGHT);
events.Repeat(35s);
break;
case EVENT_EMBRACE_THE_LIGHT:
DoCastAOE(SPELL_EMBRACE_THE_LIGHT);
break;
case EVENT_SUMMON_NEOPHYTES:
for (uint8 i = 0; i < 3; ++i)
if (TempSummon* neophyte = me->SummonCreature(NPC_ARATHI_NEOPHYTE, me->GetRandomNearPosition(10.0f)))
neophyte->CastSpell(neophyte, SPELL_OVERWHELMING_POWER);
break;
default:
break;
}
}
}
private:
bool _barrierPhase;
};
void AddSC_boss_prioress_murrpray()
{
RegisterPriorityoftheSacredflameCreatureAI(boss_prioress_murrpray);
}
@@ -0,0 +1,84 @@
/*
* Copyright WowCommunity Project by Thordekk
*
*/
#include "priority_of_the_sacred_flame.h"
#include "GameObject.h"
#include "Map.h"
#include "TemporarySummon.h"
#include "CreatureAI.h"
#include "Vehicle.h"
#include "Player.h"
#include "SpellScript.h"
#include "MotionMaster.h"
#include "CombatAI.h"
#include "CreatureAIImpl.h"
#include "ObjectAccessor.h"
#include "ScriptedGossip.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "InstanceScript.h"
#include "Group.h"
#include "ChallengeMode.h"
static constexpr ObjectData creatureData[] =
{
{ BOSS_CAPTAIN_DAILCRY, DATA_CAPTAIN_DAILCRY },
{ BOSS_BARON_BRAUNPYKE, DATA_BARON_BRAUNPYKE },
{ BOSS_PRIORESS_MURRPRAY, DATA_PRIORESS_MURRPRAY },
{ 0, 0 } // END
};
static constexpr DungeonEncounterData const encounters[] =
{
{ BOSS_CAPTAIN_DAILCRY, {{ 2847 }} },
{ DATA_BARON_BRAUNPYKE, {{ 2835 }} },
{ DATA_PRIORESS_MURRPRAY, {{ 2848 }} },
};
class instance_priority_of_the_sacred_flame : public InstanceMapScript
{
public:
instance_priority_of_the_sacred_flame() : InstanceMapScript(POSFScriptName, 2649) { }
struct instance_priority_of_the_sacred_flame_InstanceMapScript : public InstanceScript
{
instance_priority_of_the_sacred_flame_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
// LoadObjectData(creatureData, nullptr);
LoadDungeonEncounterData(encounters);
}
void OnPlayerEnter(Player* player) override
{
if (!player->GetGroup() || !player->GetGroup()->GetLeaderGUID())
return;
player->GetGroup()->AddFollowerModeBots(player);
}
void OnPlayerExit(Player* player)
{
if (!player->GetGroup())
return;
player->GetGroup()->DespawnFollowerModeBots(player);
}
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_priority_of_the_sacred_flame_InstanceMapScript(map);
}
};
void AddSC_instance_priority_of_the_sacred_flame()
{
new instance_priority_of_the_sacred_flame();
}
@@ -0,0 +1,41 @@
/*
* Copyright WowCommunity Project by Thordekk
*
*/
#ifndef DEF_PRIORITY_OF_THE_SACRED_FLAME_H_
#define DEF_PRIORITY_OF_THE_SACRED_FLAME_H_
#include "CreatureAIImpl.h"
#define POSFScriptName "instance_priority_of_the_sacred_flame"
#define DataHeader "POSF"
constexpr uint32 EncounterCount = 3;
enum priorityofthesacredflameDataTypes
{
// Encounters
DATA_CAPTAIN_DAILCRY = 0,
DATA_BARON_BRAUNPYKE,
DATA_PRIORESS_MURRPRAY,
};
enum priorityofthesacredflameCreatureIds
{
// Bosses
BOSS_CAPTAIN_DAILCRY = 207946,
BOSS_BARON_BRAUNPYKE = 207939,
BOSS_PRIORESS_MURRPRAY = 207940,
NPC_ARATHI_NEOPHYTE = 211140,
};
template <class AI, class T>
inline AI* GetPriorityoftheSacredflameAI(T* obj)
{
return GetInstanceAI<AI>(obj, POSFScriptName);
}
#define RegisterPriorityoftheSacredflameCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetPriorityoftheSacredflameAI)
#endif
@@ -17,6 +17,12 @@ void AddSC_instance_the_rookery();
void AddSC_boss_stormguard_gorren(); void AddSC_boss_stormguard_gorren();
void AddSC_boss_voidstone_monstrosity(); void AddSC_boss_voidstone_monstrosity();
//Priority Of The Sacred Flame
void AddSC_instance_priority_of_the_sacred_flame();
void AddSC_boss_baron_braunpyke();
void AddSC_boss_captain_dailcry();
void AddSC_boss_prioress_murrpray();
// The name of this function should match: // The name of this function should match:
// void Add${NameOfDirectory}Scripts() // void Add${NameOfDirectory}Scripts()
void AddWarWithinScripts() void AddWarWithinScripts()
@@ -28,4 +34,11 @@ void AddWarWithinScripts()
AddSC_instance_the_rookery(); AddSC_instance_the_rookery();
AddSC_boss_stormguard_gorren(); AddSC_boss_stormguard_gorren();
AddSC_boss_voidstone_monstrosity(); AddSC_boss_voidstone_monstrosity();
//Priority Of The Sacred Flame
AddSC_instance_priority_of_the_sacred_flame();
AddSC_boss_baron_braunpyke();
AddSC_boss_captain_dailcry();
AddSC_boss_prioress_murrpray();
} }