215 for (
uint8 i = 0; i < 40; ++i)
217 float randomAngle =
frand(0.0f, 2.0f *
float(
M_PI));
218 float randomDist = minDist + (maxDist - minDist) * std::sqrt(
rand_norm());
222 caster->MovePosition(pos, randomDist, randomAngle);
252 unstableMana->ModStackAmount(-1);
275 at->SetOrientation(caster->GetOrientation());
277 Position destPos = caster->GetPosition();
278 PathGenerator path(at);
279 path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false);
281 at->InitSplines(path.GetPath());
317 Player* player = ObjectAccessor::GetPlayer(*at, guid);
318 if (!player || !player->IsAlive() || player->IsGameMaster())
345 if (targetScale <= 0.01f)
354 std::array<DBCPosition2D, 2> points =
356 { 0.0f, currentScale },
357 { 1.0f, targetScale }
@ ENCOUNTER_FRAME_DISENGAGE
float frand(float min, float max)
#define RegisterAreaTriggerAI(ai_name)
#define RegisterSpellScript(spell_script)
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_PERIODIC_DUMMY
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
#define AuraEffectPeriodicFn(F, I, N)
void AddSC_boss_mana_devourer()
@ SPELL_ENERGY_VOID_DRAIN_POWER
@ SPELL_MANA_DEVOURER_ENERGIZE_PERIODIC
@ SPELL_ABSORB_LOOSE_MANA
@ SPELL_DECIMATING_ESSENCE
@ SPELL_LOOSE_MANA_AREATRIGGER
@ SPELL_ENERGY_VOID_DAMAGE
@ SPELL_LOOSE_MANA_MISSILE
@ SPELL_MANA_DEVOURER_ENERGIZE
AreaTriggerAI(AreaTrigger *a, uint32 scriptId={}) noexcept
GuidUnorderedSet const & GetInsideUnits() const
float CalcCurrentScale() const
void SetTimeToTargetScale(uint32 timeToTargetScale)
void SetOverrideScaleCurve(float overrideScale)
HookList< EffectPeriodicHandler > OnEffectPeriodic
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
void Repeat(Milliseconds time)
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
SpellRange GetMinMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
HookList< CastHandler > AfterCast
SpellInfo const * GetSpellInfo() const
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
SpellCastResult DoCast(uint32 spellId)
void SetPower(Powers power, int32 val, bool withPowerUpdate=true)
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
int32 GetPower(Powers power) const
bool HasUnitState(const uint32 f) const
std::vector< AreaTrigger * > GetAreaTriggers(uint32 spellId) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
bool Validate(SpellInfo const *) override
void HandlePeriodic(AuraEffect const *) const
bool Validate(SpellInfo const *) override
void HandlePeriodic(AuraEffect const *) const
bool Validate(SpellInfo const *) override
void HandlePeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
#define RegisterReturnToKarazhanCreatureAI(ai_name)
constexpr void GetPosition(float &x, float &y) const
void OnUnitExit(Unit *unit, AreaTriggerExitReason) override
uint32 GetInsidePlayersCount()
bool _shrinkPeriodicActive
void OnUpdate(uint32 diff) override
void UpdateSize(float currentScale, float targetScale) const
void OnUnitEnter(Unit *unit) override
void OnUnitEnter(Unit *unit) override
void OnCreate(Spell const *) override
void OnUpdate(uint32 diff) override
void RemoveAreaTriggers() const
void EnterEvadeMode(EvadeReason) override
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
boss_mana_devourer(Creature *creature)
void JustEngagedWith(Unit *who) override
void JustAppeared() override