TrinityCore
boss_baleroc.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "InstanceScript.h"
20#include "SpellScript.h"
21#include "ObjectAccessor.h"
22#include "Containers.h"
23#include "firelands.h"
24#include "Map.h"
25#include "GridNotifiers.h"
26#include "PassiveAI.h"
27#include "Spell.h"
28#include "SpellAuras.h"
29#include "SpellAuraEffects.h"
30#include "SpellMgr.h"
31
33{
34 // Baleroc
35 //SPELL_LEASH = 101514, // Server-side, used to keep him in his encounter area? TrinityCore does not need a spell to handle this
60};
61
63{
74};
75
77{
79};
80
82{
86};
87
88enum Misc
89{
93};
94
96{
98 PHASE_ONE = 1
99};
100
101// http://www.wowhead.com/npc=53494/baleroc
103{
105 {
107 {
109 });
110 }
111
112 void Reset() override
113 {
117 }
118
119 void JustEngagedWith(Unit* target) override
120 {
122
125
126 _sharedThePain.clear();
127 }
128
130 {
131 //events.SetPhase(phase);
132
133 switch (phase)
134 {
135 case PHASE_ONE:
136 scheduler.Schedule(Milliseconds(8500), [this](TaskContext context)
137 {
138 me->AddAura(SPELL_INCENDIARY_SOUL, me); // No cast
140 context.Repeat(Milliseconds(11500));
141 });
142 scheduler.Schedule(Seconds(5), [this](TaskContext context)
143 {
145 context.Repeat(Seconds(34));
146 });
147 if (me->GetMap()->IsHeroic())
148 {
149 scheduler.Schedule(Seconds(26), [this](TaskContext context)
150 {
152 context.Repeat(Seconds(48));
153 });
154 }
155 scheduler.Schedule(Milliseconds(30500), [this](TaskContext context)
156 {
158 context.Repeat(Seconds(47));
159 });
161 {
165 });
166 break;
167 default:
168 break;
169 }
170 }
171
172 void DoAction(int32 action) override
173 {
174 switch (action)
175 {
179 EquipWeapon(action);
180 break;
181 default:
182 break;
183 }
184 }
185
186 void KilledUnit(Unit* who) override
187 {
189 {
190 _canYellKilledPlayer = false;
191 Talk(SAY_KILL);
192
194 {
196 });
197 }
198 }
199
200 void JustDied(Unit* killer) override
201 {
205 }
206
207 void EnterEvadeMode(EvadeReason reason) override
208 {
212 }
213
214 void UpdateAI(uint32 diff) override
215 {
216 scheduler.Update(diff);
219 }
220
221 void SetGUID(ObjectGuid const& guid, int32 type = 0) override
222 {
223 switch (type)
224 {
225 case GUID_TORMENTED:
226 ++_sharedThePain[guid];
227 break;
228 default:
229 break;
230 }
231 }
232
233 uint32 GetData(uint32 type) const override
234 {
235 switch (type)
236 {
237 case GUID_TORMENTED:
238 for (auto const& entry : _sharedThePain)
239 if (entry.second > 3)
240 return 1;
241 break;
242 default:
243 break;
244 }
245
246 return 0;
247 }
248
249private:
250 void EquipWeapon(uint8 equipment) const
251 {
252 switch (equipment)
253 {
254 case EQUIP_DEFAULT:
255 me->LoadEquipment(equipment);
256 me->SetCanDualWield(true);
257 break;
260 me->LoadEquipment(equipment);
261 me->SetCanDualWield(false);
262 break;
263 default:
264 break;
265 }
266 }
267 // Our default TaskScheduler has a UNIT_STATE_CASTING validator that would get in the way of certain tasks, run them on a separate track.
270 std::unordered_map<ObjectGuid, uint32> _sharedThePain;
271};
272
273// http://www.wowhead.com/npc=53495/shard-of-torment
275{
277
278 void IsSummonedBy(WorldObject* /*summoner*/) override
279 {
282 {
285 scheduler.Schedule(Milliseconds(1100), [this](TaskContext context)
286 {
288 context.Repeat(Seconds(1));
289 });
290 });
291 }
292
293 void SpellHitTarget(WorldObject* /*target*/, SpellInfo const* spellInfo) override
294 {
295 if (spellInfo->Id != SPELL_TORMENT)
296 return;
297
299 scheduler.Schedule(Milliseconds(1100), [this](TaskContext context)
300 {
302 context.Repeat(Seconds(1));
303 });
304 }
305
306 void UpdateAI(uint32 diff) override
307 {
308 scheduler.Update(diff);
309 }
310
311private:
313};
314
315// http://www.wowhead.com/spell=99342/blades-of-baloroc
317{
318 bool Validate(SpellInfo const* /*spellInfo*/) override
319 {
321 }
322
323 void ChooseBlade(SpellEffIndex /*effIndex*/)
324 {
325 Creature* caster = GetCaster()->ToCreature();
326 if (!caster || !caster->IsAIEnabled())
327 return;
328
329 switch (urand(1, 2))
330 {
331 case 1:
332 caster->AI()->DoCast(SPELL_INFERNO_BLADE);
333 caster->AI()->Talk(SAY_INFERNO_BLADE);
334 caster->AI()->Talk(EMOTE_INFERNO_BLADE);
335 break;
336 case 2:
337 caster->AI()->DoCast(SPELL_DECIMATION_BLADE);
338 caster->AI()->Talk(SAY_DECIMATION_BLADE);
339 caster->AI()->Talk(EMOTE_DECIMATION_BLADE);
340 break;
341 default:
342 break;
343 }
344 }
345
346 void Register() override
347 {
349 }
350};
351
352// http://www.wowhead.com/spell=99350/inferno-blade
354{
355 bool Load() override
356 {
357 return GetCaster()->GetTypeId() == TYPEID_UNIT;
358 }
359
360 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
361 {
362 if (GetTarget()->IsAIEnabled())
364 }
365
366 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
367 {
368 if (GetTarget()->IsAIEnabled())
370 }
371
372 void Register() override
373 {
376 }
377};
378
379// http://www.wowhead.com/spell=99352/decimation-blade
381{
382 bool Load() override
383 {
384 return GetCaster()->GetTypeId() == TYPEID_UNIT;
385 }
386
387 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
388 {
389 if (GetTarget()->IsAIEnabled())
391 }
392
393 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
394 {
395 if (GetTarget()->IsAIEnabled())
397 }
398
399 void Register() override
400 {
403 }
404};
405
406// http://www.wowhead.com/spell=99353/decimating-strike
408{
409 bool Validate(SpellInfo const* spellInfo) override
410 {
411 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } })
412 && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_2).CalcValue()) });
413 }
414
416 {
417 int32 healthPctDmg = GetHitUnit()->CountPctFromMaxHealth(GetEffectInfo(EFFECT_0).CalcValue(GetCaster()));
419
420 SetHitDamage(healthPctDmg < flatDmg ? flatDmg : healthPctDmg);
421 }
422
423 void Register() override
424 {
426 }
427};
428
429// http://www.wowhead.com/spell=99515/countdown
431{
432 bool Validate(SpellInfo const* /*spellInfo*/) override
433 {
435 }
436
438 {
439 Unit* firstTarget = ObjectAccessor::GetUnit(*GetCaster(), _targets.front());
440 Unit* secondTarget = ObjectAccessor::GetUnit(*GetCaster(), _targets.back());
441 if (!firstTarget || !secondTarget)
442 return;
443
444 firstTarget->CastSpell(secondTarget, SPELL_COUNTDOWN_VISUAL_LINK, true);
445 }
446
447 void HandleScript(SpellEffIndex /*effIndex*/)
448 {
450 }
451
452 void FilterTargets(std::list<WorldObject*>& targets)
453 {
454 if (WorldObject* tank = GetCaster()->GetVictim())
455 targets.remove(tank);
456
457 if (targets.size() < 2)
458 {
460 return;
461 }
462
464
465 _targets.push_back(targets.front()->GetGUID());
466 _targets.push_back(targets.back()->GetGUID());
467 }
468
469 void Register() override
470 {
474 }
475
477};
478
479// http://www.wowhead.com/spell=99516/countdown
481{
482 bool Validate(SpellInfo const* /*spellInfo*/) override
483 {
485 }
486
487 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
488 {
490 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
491 GetTarget()->CastSpell(static_cast<Unit*>(nullptr), SPELL_COUNTDOWN_AOE_EXPLOSION, true);
492 }
493
494 void Register() override
495 {
497 }
498};
499
500// http://www.wowhead.com/spell=99517/countdown
502{
503 bool Validate(SpellInfo const* /*spellInfo*/) override
504 {
506 }
507
509 {
510 PreventHitDefaultEffect(effIndex);
513 }
514
515 void FilterTargets(std::list<WorldObject*>& targets)
516 {
517 targets.remove(GetCaster());
518 targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_COUNTDOWN_AURA));
519 }
520
521 void Register() override
522 {
525 }
526};
527
528// http://www.wowhead.com/spell=99259/shards-of-torment
530{
531 bool Validate(SpellInfo const* /*spellInfo*/) override
532 {
534 }
535
536 bool Load() override
537 {
538 _hasTarget = false;
539 return GetCaster()->GetTypeId() == TYPEID_UNIT;
540 }
541
543 {
544 if (_hasTarget)
546 }
547
549 {
550 PreventHitDefaultEffect(effIndex);
552 }
553
554 void FilterTargets(std::list<WorldObject*>& targets)
555 {
556 // Shards of torment seems to target tanks if no other targets are available as of Warlords of Draenor
557 if (targets.size() <= 1)
558 {
559 _hasTarget = !targets.empty();
560 return;
561 }
562
563 Unit* caster = GetCaster();
564 if (WorldObject* tank = caster->GetVictim())
565 targets.remove(tank);
566
567 std::list<WorldObject*> melee, ranged;
568 for (WorldObject* target : targets)
569 {
570 if (caster->IsWithinMeleeRange(target->ToUnit()))
571 melee.push_back(target);
572 else
573 ranged.push_back(target);
574 }
575
576 targets.clear();
577
578 if (caster->GetMap()->Is25ManRaid())
579 if (WorldObject* target = GetRandomContainerElement(ranged, melee))
580 targets.push_back(target);
581
582 if (WorldObject* target = GetRandomContainerElement(melee, ranged))
583 targets.push_back(target);
584
585 _hasTarget = !targets.empty();
586 }
587
588 WorldObject* GetRandomContainerElement(std::list<WorldObject*>& priority1, std::list<WorldObject*>& priority2) const
589 {
590 WorldObject* target = nullptr;
591 target = GetRandomContainerElement(&priority1);
592 if (target)
593 priority1.remove(target);
594 else
595 {
596 target = GetRandomContainerElement(&priority2);
597 priority2.remove(target);
598 }
599
600 return target;
601 }
602
603 static WorldObject* GetRandomContainerElement(std::list<WorldObject*> const* list)
604 {
605 if (!list->empty())
607
608 return nullptr;
609 }
610
611 void Register() override
612 {
616 }
617
618 bool _hasTarget = false;
619};
620
621// http://www.wowhead.com/spell=99253/torment
623{
624 bool Validate(SpellInfo const* /*spellInfo*/) override
625 {
627 }
628
629 void OnHit(SpellEffIndex /*effIndex*/)
630 {
632 if (spell && spell->m_targets.GetUnitTargetGUID() == _target)
633 return;
634
635 if (GetHitUnit()->GetGUID() == _target)
637 }
638
639 void FilterTargets(std::list<WorldObject*>& targets)
640 {
641 targets.remove_if(PlayerCheck());
642 if (targets.empty())
643 return;
644
646 _target = targets.front()->GetGUID();
647 }
648
649 void Register() override
650 {
653 }
654
656};
657
658// http://www.wowhead.com/spell=99256/torment
660{
662 {
663 SetHitDamage(GetHitDamage() * GetHitUnit()->GetAuraCount(GetSpellInfo()->Id));
664 }
665
666 void Register() override
667 {
669 }
670};
671
673{
674 bool Validate(SpellInfo const* /*spellInfo*/) override
675 {
677 }
678
679 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
680 {
682 Unit* healer = eventInfo.GetProcTarget();
683 if (healer->HasAura(SPELL_VITAL_FLAME))
684 return;
685
686 bool is25ManHeroic = healer->GetMap()->IsHeroic() && healer->GetMap()->Is25ManRaid();
687 uint32 stacks = healer->GetAuraCount(SPELL_VITAL_SPARK) + std::min(uint8(ceil(GetStackAmount() / (is25ManHeroic ? 5.0 : 3.0))), uint8(255));
688
689 healer->SetAuraStack(SPELL_VITAL_SPARK, healer, stacks);
690 if (Aura* aura = healer->GetAura(SPELL_VITAL_SPARK))
691 aura->RefreshDuration();
692 }
693
694 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
695 {
696 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
698 }
699
700 void Register() override
701 {
704 }
705};
706
707// http://www.wowhead.com/spell=99257/tormented
709{
710 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
711 {
712 if (InstanceScript* instance = GetTarget()->GetInstanceScript())
713 if (Creature* baleroc = ObjectAccessor::GetCreature(*GetTarget(), instance->GetGuidData(DATA_BALEROC)))
714 baleroc->AI()->SetGUID(GetTarget()->GetGUID(), GUID_TORMENTED);
715 }
716
717 void Register() override
718 {
720 }
721};
722
723// http://www.wowhead.com/spell=99489/tormented
725{
726 bool Validate(SpellInfo const* /*spellInfo*/) override
727 {
729 }
730
732 {
733 PreventHitDefaultEffect(effIndex);
735 }
736
737 void Register() override
738 {
740 }
741};
742
743// http://www.wowhead.com/spell=99262/vital-spark
745{
746 bool Validate(SpellInfo const* /*spellInfo*/) override
747 {
749 }
750
751 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
752 {
754 if (Unit* target = eventInfo.GetProcTarget())
755 if (target->HasAura(SPELL_BLAZE_OF_GLORY))
757 }
758
759 void Register() override
760 {
762 }
763};
764
765// http://www.wowhead.com/spell=99263/vital-flame
767{
768 bool Validate(SpellInfo const* /*spellInfo*/) override
769 {
771 }
772
773 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
774 {
776 {
777 stacks = 0;
778 return;
779 }
780
782 int32 healingPct = sSpellMgr->AssertSpellInfo(SPELL_VITAL_SPARK, GetCastDifficulty())->GetEffect(EFFECT_0).CalcValue(GetCaster()) * stacks;
783
784 if (GetAura()->GetEffect(EFFECT_0)->GetAmount() < healingPct)
785 GetAura()->GetEffect(EFFECT_0)->SetAmount(healingPct);
786
788 }
789
790 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
791 {
792 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
794 }
795
796 void Register() override
797 {
800 }
801
803};
804
805// http://www.wowhead.com/achievement=5830/share-the-pain //17577
807{
808 public:
809 achievement_share_the_pain() : AchievementCriteriaScript("achievement_share_the_pain") { }
810
811 bool OnCheck(Player* /*source*/, Unit* target) override
812 {
813 if (!target)
814 return false;
815
816 return target->GetAI()->GetData(GUID_TORMENTED) == 0;
817 }
818};
819
821{
839};
Actions
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
std::chrono::minutes Minutes
Minutes shorthand typedef.
Definition: Duration.h:35
std::list< ObjectGuid > GuidList
Definition: ObjectGuid.h:394
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition: ScriptMgr.h:1371
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_FAILED_NO_VALID_TARGETS
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_DEATH
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_MOD_HEALING_DONE_VERSUS_AURASTATE
@ SPELL_AURA_OVERRIDE_AUTOATTACK_WITH_MELEE_SPELL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define sSpellMgr
Definition: SpellMgr.h:849
#define AuraEffectProcFn(F, I, N)
Definition: SpellScript.h:2160
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define SpellCastFn(F)
Definition: SpellScript.h:825
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define SpellHitFn(F)
Definition: SpellScript.h:854
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
EvadeReason
Definition: UnitAICommon.h:30
#define ENSURE_AI(a, b)
Definition: UnitAI.h:29
@ CURRENT_CHANNELED_SPELL
Definition: Unit.h:591
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ ACTION_EQUIP_DEFAULT
@ ACTION_EQUIP_INFERNO_BLADE
@ ACTION_EQUIP_DECIMATION_BLADE
@ SAY_DEATH
@ SAY_INFERNO_BLADE
@ EMOTE_INFERNO_BLADE
@ SAY_SHARDS_OF_TORMENT
@ SAY_AGGRO
@ SAY_KILL
@ EMOTE_ENRAGE
@ EMOTE_DECIMATION_BLADE
@ SAY_ENRAGE
@ SAY_DECIMATION_BLADE
@ EQUIP_INFERNO_BLADE
@ EQUIP_DECIMATION_BLADE
@ EQUIP_DEFAULT
@ SPELL_DECIMATION_BLADE_2
@ SPELL_COUNTDOWN
@ SPELL_INCENDIARY_SOUL
@ SPELL_SHARDS_OF_TORMENT_SUMMON
@ SPELL_SHARDS_OF_TORMENT
@ SPELL_TORMENT_PERIODIC
@ SPELL_TORMENT_PRE_VISUAL
@ SPELL_BLAZE_OF_GLORY
@ SPELL_TORMENT_ACTIVE
@ SPELL_INFERNO_BLADE
@ SPELL_DECIMATING_STRIKE
@ SPELL_VITAL_SPARK
@ SPELL_VITAL_FLAME
@ SPELL_COUNTDOWN_AOE_EXPLOSION
@ SPELL_TORMENTED
@ SPELL_COUNTDOWN_3
@ SPELL_BERSERK
@ SPELL_INFERNO_STRIKE
@ SPELL_COUNTDOWN_VISUAL_LINK
@ SPELL_BLADES_OF_BALEROC
@ SPELL_TORMENT
@ SPELL_WAVE_OF_TORMENT
@ SPELL_DECIMATION_BLADE
@ SPELL_COUNTDOWN_AURA
@ PHASE_ONE
@ PHASE_NONE
void AddSC_boss_baleroc()
Guids
@ GUID_TORMENTED
void SetAmount(int32 amount)
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
Unit * GetCaster() const
AuraEffect * GetEffect(uint8 effIndex) const
Aura * GetAura() const
Unit * GetTarget() const
Difficulty GetCastDifficulty() const
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:2035
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:2155
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:529
InstanceScript *const instance
virtual void UpdateAI(uint32 diff) override
TaskScheduler scheduler
SummonList summons
void Reset() override
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1946
void SetCanDualWield(bool value) override
Definition: Creature.cpp:1940
CreatureAI * AI() const
Definition: Creature.h:214
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
bool Is25ManRaid() const
Definition: Map.cpp:3320
bool IsHeroic() const
Definition: Map.cpp:3282
static Creature * ToCreature(Object *o)
Definition: Object.h:219
TypeID GetTypeId() const
Definition: Object.h:173
Unit * GetProcTarget() const
Definition: Unit.h:495
ObjectGuid GetUnitTargetGUID() const
Definition: Spell.cpp:210
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:495
uint32 const Id
Definition: SpellInfo.h:325
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
Definition: SpellScript.h:173
HookList< CastHandler > AfterCast
Definition: SpellScript.h:824
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > OnHit
Definition: SpellScript.h:850
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
HookList< CastHandler > OnCast
Definition: SpellScript.h:822
void FinishCast(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr)
void SetHitDamage(int32 damage)
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
Definition: Spell.h:255
SpellCastTargets m_targets
Definition: Spell.h:607
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
virtual void DoAction(int32)
Definition: UnitAI.h:72
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:73
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool IsWithinMeleeRange(Unit const *obj) const
Definition: Unit.h:699
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3685
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Definition: Unit.cpp:11665
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:11618
UnitAI * GetAI() const
Definition: Unit.h:660
bool IsAIEnabled() const
Definition: Unit.h:658
uint32 GetAuraCount(uint32 spellId) const
Definition: Unit.cpp:4648
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4560
Unit * GetVictim() const
Definition: Unit.h:715
uint64 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:785
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:1442
Map * GetMap() const
Definition: Object.h:624
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
bool OnCheck(Player *, Unit *target) override
bool Validate(SpellInfo const *) override
void ChooseBlade(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
WorldObject * GetRandomContainerElement(std::list< WorldObject * > &priority1, std::list< WorldObject * > &priority2) const
static WorldObject * GetRandomContainerElement(std::list< WorldObject * > const *list)
void HandleScript(SpellEffIndex effIndex)
void FilterTargets(std::list< WorldObject * > &targets)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void Register() override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
#define RegisterFirelandsAI(AI)
Definition: firelands.h:133
@ DATA_BALEROC
Definition: firelands.h:38
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
void JustDied(Unit *killer) override
void PreparePhase(Phases phase)
boss_baleroc(Creature *creature)
void JustEngagedWith(Unit *target) override
TaskScheduler separateScheduler
void KilledUnit(Unit *who) override
void Reset() override
std::unordered_map< ObjectGuid, uint32 > _sharedThePain
uint32 GetData(uint32 type) const override
void SetGUID(ObjectGuid const &guid, int32 type=0) override
void DoAction(int32 action) override
bool _canYellKilledPlayer
void EnterEvadeMode(EvadeReason reason) override
void UpdateAI(uint32 diff) override
void EquipWeapon(uint8 equipment) const
void JustEngagedWith(Unit *target) override
Definition: firelands.cpp:56
void JustDied(Unit *killer) override
Definition: firelands.cpp:62
void EnterEvadeMode(EvadeReason why) override
Definition: firelands.cpp:70
TaskScheduler scheduler
void IsSummonedBy(WorldObject *) override
void UpdateAI(uint32 diff) override
void SpellHitTarget(WorldObject *, SpellInfo const *spellInfo) override
npc_shard_of_torment(Creature *creature)