TrinityCore
Loading...
Searching...
No Matches
bosses_opera.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/*
19 * Combat timers requires to be revisited, especially Romulo and Julianne
20 * Romulo and Julianne encounter requires additional checks, maybe something is missing or implemented wrongly
21 */
22
23#include "ScriptMgr.h"
24#include "Containers.h"
25#include "InstanceScript.h"
26#include "karazhan.h"
27#include "Map.h"
28#include "Player.h"
29#include "ScriptedCreature.h"
30#include "ScriptedGossip.h"
31#include "SpellAuraEffects.h"
32#include "SpellInfo.h"
33#include "SpellScript.h"
34#include "TemporarySummon.h"
35
36/*
37 * Wizard of Oz Event
38 */
39
64
66{
67 // Dorothee
71
72 // Strawman
75
76 // Tinhead
77 SPELL_CLEAVE = 31043,
78 SPELL_RUST = 31086,
79
80 // Roar
81 SPELL_MANGLE = 31041,
82 SPELL_SHRED = 31042,
83
84 // Crone
86
87 // Tito
89
90 // Cyclone
93 SPELL_CYCLONE_2 = 32335 // Shown in sniffs but makes cyclone overpowered, just like Karathress' cyclone
94};
95
103
105{
107
108 if (instance->GetData(DATA_OPERA_OZ_DEATH_COUNT) == 4)
109 creature->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_CRONE, true);
110}
111
112// 17535 - Dorothee
114{
115 boss_dorothee(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
116
117 void JustAppeared() override
118 {
119 _scheduler.Schedule(6s, [this](TaskContext& task)
120 {
121 switch (task.GetRepeatCounter())
122 {
123 case 0:
124 Talk(SAY_DOROTHEE_AGGRO);
125 me->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
126 task.Repeat(5s);
127 break;
128 case 1:
129 me->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
130 task.Repeat(5s);
131 break;
132 case 2:
133 me->SetImmuneToPC(false);
134 DoZoneInCombat();
135 break;
136 default:
137 break;
138 }
139 });
140
142 }
143
144 void Reset() override
145 {
147 }
148
149 void JustEngagedWith(Unit* /*who*/) override
150 {
152 .SetValidator([this]
153 {
155 })
156 .Schedule(0s, [this](TaskContext& task)
157 {
159 DoCast(target, SPELL_WATER_BOLT);
160 task.Repeat(2400ms);
161 })
162 .Schedule(10s, 20s, [this](TaskContext& task)
163 {
165 task.Repeat(20s, 25s);
166 })
167 .Schedule(35s, [this](TaskContext const& /*task*/)
168 {
171 });
172 }
173
174 void DoAction(int32 action) override
175 {
176 if (me->IsAlive())
177 if (action == ACTION_TITO_DIES)
179 }
180
186
187 void JustDied(Unit* /*killer*/) override
188 {
190
192 }
193
194 void UpdateAI(uint32 diff) override
195 {
196 _scheduler.Update(diff);
197
198 UpdateVictim();
199 }
200
201private:
204};
205
206// 17543 - Strawman
208{
209 boss_strawman(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
210
211 void JustAppeared() override
212 {
213 _scheduler.Schedule(27s, [this](TaskContext const& /*task*/)
214 {
215 me->SetImmuneToPC(false);
217 });
218 }
219
220 void Reset() override
221 {
223 }
224
225 void JustEngagedWith(Unit* /*who*/) override
226 {
228
230 .SetValidator([this]
231 {
233 })
234 .Schedule(5s, 10s, [this](TaskContext& task)
235 {
237 task.Repeat(13s, 18s);
238 })
239 .Schedule(10s, 15s, [this](TaskContext& task)
240 {
241 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
242 DoCast(target, SPELL_BRAIN_WIPE);
243 task.Repeat(15s, 20s);
244 });
245 }
246
252
253 void KilledUnit(Unit* /*victim*/) override
254 {
256 }
257
258 void JustDied(Unit* /*killer*/) override
259 {
261
263 }
264
265 void UpdateAI(uint32 diff) override
266 {
267 _scheduler.Update(diff);
268
269 UpdateVictim();
270 }
271
272private:
275};
276
277// 17547 - Tinhead
279{
280 boss_tinhead(Creature* creature) : ScriptedAI(creature), _isFirstRust(true), _instance(creature->GetInstanceScript()) { }
281
282 void JustAppeared() override
283 {
284 _scheduler.Schedule(35s, [this](TaskContext const& /*task*/)
285 {
286 me->SetImmuneToPC(false);
288 });
289 }
290
291 void Reset() override
292 {
294 }
295
296 void JustEngagedWith(Unit* /*who*/) override
297 {
299
301 .SetValidator([this]
302 {
304 })
305 .Schedule(5s, 10s, [this](TaskContext& task)
306 {
308 task.Repeat(5s, 10s);
309 })
310 .Schedule(6s, [this](TaskContext& task)
311 {
313 task.Repeat(6s);
314 });
315 }
316
317 void OnSpellCast(SpellInfo const* spellInfo) override
318 {
319 if (_isFirstRust && spellInfo->Id == SPELL_RUST)
320 {
321 _isFirstRust = false;
323 }
324 }
325
331
332 void KilledUnit(Unit* /*victim*/) override
333 {
335 }
336
337 void JustDied(Unit* /*killer*/) override
338 {
340
342 }
343
344 void UpdateAI(uint32 diff) override
345 {
346 _scheduler.Update(diff);
347
348 UpdateVictim();
349 }
350
351private:
355};
356
357// 17546 - Roar
358struct boss_roar : public ScriptedAI
359{
360 boss_roar(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
361
362 void JustAppeared() override
363 {
364 _scheduler.Schedule(18s, [this](TaskContext const& /*task*/)
365 {
366 me->SetImmuneToPC(false);
368 });
369 }
370
371 void Reset() override
372 {
374 }
375
376 void JustEngagedWith(Unit* /*who*/) override
377 {
379
381 .SetValidator([this]
382 {
384 })
385 .Schedule(8s, [this](TaskContext& task)
386 {
388 task.Repeat(10s);
389 })
390 .Schedule(15s, [this](TaskContext& task)
391 {
393 task.Repeat(10s, 20s);
394 });
395 }
396
402
403 void KilledUnit(Unit* /*victim*/) override
404 {
406 }
407
408 void JustDied(Unit* /*killer*/) override
409 {
411
413 }
414
415 void UpdateAI(uint32 diff) override
416 {
417 _scheduler.Update(diff);
418
419 UpdateVictim();
420 }
421
422private:
425};
426
427// 18168 - The Crone
428struct boss_crone : public BossAI
429{
431
432 void JustAppeared() override
433 {
435
436 scheduler.Schedule(2400ms, [this](TaskContext& task)
437 {
438 switch (task.GetRepeatCounter())
439 {
440 case 0:
441 me->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
442 Talk(SAY_CRONE_AGGRO);
443 task.Repeat(6s);
444 break;
445 case 1:
446 me->SetImmuneToPC(false);
447 DoZoneInCombat();
448 SetEquipmentSlots(false, EQUIP_ID_BROOM);
449 break;
450 default:
451 break;
452 }
453 });
454 }
455
456 void JustEngagedWith(Unit* /*who*/) override
457 {
458 scheduler.Schedule(5s, 20s, [this](TaskContext& task)
459 {
461 task.Repeat(10s, 15s);
462 });
463 }
464
473
474 void KilledUnit(Unit* /*victim*/) override
475 {
477 }
478
479 void JustDied(Unit* /*killer*/) override
480 {
481 _JustDied();
483
485 }
486
487 void UpdateAI(uint32 diff) override
488 {
489 scheduler.Update(diff);
490
491 UpdateVictim();
492 }
493};
494
495// 17548 - Tito
496struct npc_tito : public ScriptedAI
497{
499
500 void InitializeAI() override
501 {
502 me->SetCorpseDelay(3, true);
504 }
505
506 void JustAppeared() override
507 {
509 }
510
511 void Reset() override
512 {
514 }
515
516 void JustEngagedWith(Unit* /*who*/) override
517 {
518 _scheduler.Schedule(10s, [this](TaskContext& task)
519 {
521 task.Repeat(10s);
522 });
523 }
524
525 void JustReachedHome() override
526 {
528 }
529
530 void JustDied(Unit* /*killer*/) override
531 {
532 if (TempSummon* summon = me->ToTempSummon())
533 if (Creature* summoner = Object::ToCreature(summon->GetSummonerUnit()))
534 summoner->AI()->DoAction(ACTION_TITO_DIES);
535 }
536
537 void UpdateAI(uint32 diff) override
538 {
539 if (!UpdateVictim())
540 return;
541
542 _scheduler.Update(diff);
543 }
544
545private:
547};
548
549// 18412 - Cyclone (The Crone)
550struct npc_cyclone : public ScriptedAI
551{
553
554 void InitializeAI() override
555 {
557 }
558
564};
565
566/*
567 * Red Riding Hood Event
568 */
569
576
588
595
596// 17603 - Grandmother
598{
600
601 bool OnGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
602 {
603 if (menuId == GOSSIP_MENU_GRANDMOTHER)
604 {
605 CloseGossipMenuFor(player);
606
609 }
610 return false;
611 }
612};
613
614// 17521 - The Big Bad Wolf
616{
618
619 void JustAppeared() override
620 {
622
623 scheduler.Schedule(3s, [this](TaskContext const& /*task*/)
624 {
626 });
627
629 }
630
631 void JustEngagedWith(Unit* who) override
632 {
634
636
638 .Schedule(5s, 20s, [this](TaskContext& task)
639 {
641 task.Repeat(25s, 35s);
642 })
643 .Schedule(5s, 10s, [this](TaskContext& task)
644 {
646 task.Repeat(25s, 30s);
647 })
648 .Schedule(3s, [this](TaskContext& task)
649 {
651 task.Repeat(30s);
652 });
653 }
654
655 void OnSpellCast(SpellInfo const* spellInfo) override
656 {
657 if (spellInfo->Id == SPELL_PICK_RED_RIDING_HOOD)
659 }
660
666
667 void KilledUnit(Unit* /*victim*/) override
668 {
670 }
671
672 void JustDied(Unit* /*killer*/) override
673 {
674 _JustDied();
676 }
677
678 void UpdateAI(uint32 diff) override
679 {
680 scheduler.Update(diff);
681
682 UpdateVictim();
683 }
684};
685
686// 30769 - Pick Red Riding Hood
688{
689 bool Validate(SpellInfo const* /*spellInfo*/) override
690 {
692 }
693
694 void FilterTargets(std::list<WorldObject*>& targets)
695 {
697 }
698
699 void HandleScript(SpellEffIndex /*effIndex*/)
700 {
701 Unit* target = GetHitUnit();
702
703 if (Creature* caster = GetCaster()->ToCreature())
704 {
705 caster->GetThreatManager().AddThreat(target, 1000000.0f, nullptr, true, true);
706 caster->CastSpell(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
707 }
708 }
709
715};
716
717// 30768 - Little Red Riding Hood
735
736// 30755 - Picnic Basket Smell
738{
739 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
740 {
741 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTarget()->IsCreature())
742 if (Unit* caster = GetCaster())
743 GetTarget()->GetThreatManager().AddThreat(caster, -1000000.0f, nullptr, true, true);
744 }
745
750};
751
752/*
753 * Romeo and Juliet Event
754 */
755
769
792
824
831
838
839// 17534 - Julianne
840struct boss_julianne : public BossAI
841{
843
851
863
869
870 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
871 {
872 if (damage >= me->GetHealth() && who != me)
873 {
874 damage = me->GetHealth() -1;
875
877 return;
878
880 {
883 }
884 else if (events.IsInPhase(PHASE_BOTH))
885 {
888 }
889 }
890 }
891
892 uint32 GetData(uint32 data) const override
893 {
894 if (data == DATA_OTHER_IS_DEAD)
895 return events.IsInPhase(PHASE_DEATH) ? 1 : 0;
896
897 return 0;
898 }
899
900 void DoAction(int32 action) override
901 {
902 if (action == ACTION_FINISH_TRANSITION)
904 }
905
906 void KilledUnit(Unit* victim) override
907 {
908 if (victim != me)
910 }
911
912 void JustDied(Unit* /*killer*/) override
913 {
914 me->SetUninteractible(false);
916 }
917
918 void UpdateAI(uint32 diff) override
919 {
920 if (!UpdateVictim())
921 {
922 events.Update(diff);
923
924 while (uint32 eventId = events.ExecuteEvent())
925 {
926 if (eventId == EVENT_INTRO)
927 {
928 me->SetImmuneToPC(false);
930 }
931 }
932
933 return;
934 }
935
936 events.Update(diff);
937
939 return;
940
941 while (uint32 eventId = events.ExecuteEvent())
942 {
943 switch (eventId)
944 {
945 // Combat
948 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
950 events.Repeat(2s, 4s);
951 break;
952 case EVENT_DEVOTION:
955 events.Repeat(15s, 20s);
956 break;
959 if (Unit* target = DoSelectLowestHpFriendly(100.0f))
961 events.Repeat(15s, 20s);
962 break;
965 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
967 events.Repeat(25s, 35s);
968 break;
969
970 // Transition
976 break;
979 me->SetUninteractible(true);
981 break;
984 break;
985
989 me->SetUninteractible(false);
996 break;
997
998 // Misc
1002 me->SetUninteractible(true);
1005 break;
1007 if (Creature* romulo = instance->GetCreature(DATA_ROMULO))
1008 {
1009 if (romulo->AI()->GetData(DATA_OTHER_IS_DEAD))
1011 else
1013 }
1014 break;
1015 case EVENT_REVIVE_SELF:
1018 me->SetUninteractible(false);
1023 break;
1024 default:
1025 break;
1026 }
1027
1029 return;
1030 }
1031 }
1032};
1033
1034// 17533 - Romulo
1035struct boss_romulo : public BossAI
1036{
1038
1039 void JustAppeared() override
1040 {
1043 }
1044
1045 void JustEngagedWith(Unit* who) override
1046 {
1048
1050
1055 }
1056
1057 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
1058 {
1059 if (damage >= me->GetHealth() && who != me)
1060 {
1061 damage = me->GetHealth() -1;
1062
1064 return;
1065
1067 {
1070 }
1071 else if (events.IsInPhase(PHASE_BOTH))
1072 {
1075 }
1076 }
1077 }
1078
1079 uint32 GetData(uint32 data) const override
1080 {
1081 if (data == DATA_OTHER_IS_DEAD)
1082 return events.IsInPhase(PHASE_DEATH) ? 1 : 0;
1083
1084 return 0;
1085 }
1086
1087 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
1088 {
1089 if (spellInfo->Id == SPELL_UNDYING_LOVE)
1091 }
1092
1098
1099 void KilledUnit(Unit* victim) override
1100 {
1101 if (victim != me)
1103 }
1104
1105 void JustDied(Unit* /*killer*/) override
1106 {
1107 me->SetUninteractible(false);
1109 }
1110
1111 void UpdateAI(uint32 diff) override
1112 {
1113 if (!UpdateVictim())
1114 return;
1115
1116 events.Update(diff);
1117
1119 return;
1120
1121 while (uint32 eventId = events.ExecuteEvent())
1122 {
1123 switch (eventId)
1124 {
1125 // Combat
1129 events.Repeat(10s, 20s);
1130 break;
1134 events.Repeat(5s, 15s);
1135 break;
1139 events.Repeat(10s, 20s);
1140 break;
1141 case EVENT_DARING:
1144 events.Repeat(20s, 40s);
1145 break;
1146
1147 // Misc
1150 me->SetUninteractible(true);
1153 if (Creature* julianne = instance->GetCreature(DATA_JULIANNE))
1154 julianne->AI()->DoAction(ACTION_FINISH_TRANSITION);
1155 break;
1156 case EVENT_FEIGN_DEATH:
1158 me->SetUninteractible(true);
1161 break;
1163 if (Creature* julianne = instance->GetCreature(DATA_JULIANNE))
1164 {
1165 if (julianne->AI()->GetData(DATA_OTHER_IS_DEAD))
1167 else
1168 {
1171 }
1172 }
1173 break;
1174 case EVENT_REVIVE_SELF:
1177 me->SetUninteractible(false);
1182 break;
1183 default:
1184 break;
1185 }
1186
1188 return;
1189 }
1190 }
1191};
1192
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
@ FAIL
@ DONE
@ SPECIAL
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
void CloseGossipMenuFor(Player *player)
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
@ TARGET_UNIT_SRC_AREA_ENEMY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_MOD_TAUNT
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectRemoveFn(F, I, N, M)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ UNIT_STATE_CASTING
Definition Unit.h:290
JulianneRomuloEvents
@ EVENT_ROMULO_TRANSITION
@ EVENT_JULIANNE_TRANSITION_2_1
@ EVENT_BACKWARD_LUNGE
@ EVENT_POISONED_THRUST
@ EVENT_DEADLY_SWATHE
@ EVENT_JULIANNE_TRANSITION_1_1
@ EVENT_JULIANNE_TRANSITION_1_2
@ EVENT_BLINDING_PASSION
@ EVENT_DARING
@ EVENT_FEIGN_DEATH
@ EVENT_POWERFUL_ATTRACTION
@ EVENT_REVIVE_SELF
@ EVENT_REVIVE_OR_DIE
@ EVENT_DEVOTION
@ EVENT_ETERNAL_AFFECTION
@ EVENT_JULIANNE_TRANSITION_1_3
@ EVENT_INTRO
BigBadWolfSpells
@ SPELL_PICK_RED_RIDING_HOOD
@ SPELL_PICNIC_BASKET_SMELL
@ SPELL_WIDE_SWIPE
@ SPELL_LITTLE_RED_RIDING_HOOD
@ SPELL_TERRIFYING_HOWL
JulianneRomuloMisc
@ ACTION_FINISH_TRANSITION
@ DATA_OTHER_IS_DEAD
@ SPAWN_GROUP_ROMULO
WizardOfOzSpells
@ SPELL_CLEAVE
@ SPELL_CYCLONE_VISUAL
@ SPELL_WATER_BOLT
@ SPELL_MANGLE
@ SPELL_BRAIN_WIPE
@ SPELL_SHRED
@ SPELL_RUST
@ SPELL_FRIGHTENED_SCREAM
@ SPELL_CYCLONE_2
@ SPELL_ANNOYING_YIPPING
@ SPELL_CHAIN_LIGHTNING
@ SPELL_CYCLONE_1
@ SPELL_SUMMON_TITO
@ SPELL_BRAIN_BASH
JulianneRomuloSpells
@ SPELL_CLEAR_ALL_DEBUFFS
@ SPELL_ETERNAL_AFFECTION
@ SPELL_SUICIDE_WHILE_DEAD
@ SPELL_UNDYING_LOVE
@ SPELL_DRINK_POISON
@ SPELL_BLINDING_PASSION
@ SPELL_POISONED_THRUST
@ SPELL_POWERFUL_ATTRACTION
@ SPELL_FULL_HEAL
@ SPELL_DEADLY_SWATHE
@ SPELL_PERMANENT_FEIGN_DEATH
@ SPELL_DEVOTION
@ SPELL_BACKWARD_LUNGE
@ SPELL_DARING
WizardOfOzMisc
@ SPAWN_GROUP_CYCLONE
@ SPAWN_GROUP_CRONE
@ ACTION_TITO_DIES
@ EQUIP_ID_BROOM
BigBadWolfMisc
@ GOSSIP_MENU_GRANDMOTHER
@ SOUND_WOLF_DEATH
@ SPAWN_GROUP_BIG_BAD_WOLF
void AddSC_bosses_opera()
BigBadWolfTexts
@ SAY_WOLF_HOOD
@ SAY_WOLF_SLAY
@ SAY_WOLF_AGGRO
WizardOfOzTexts
@ SAY_ROAR_DEATH
@ SAY_ROAR_AGGRO
@ SAY_DOROTHEE_TITO_DEATH
@ SAY_DOROTHEE_DEATH
@ SAY_STRAWMAN_DEATH
@ SAY_CRONE_SLAY
@ SAY_CRONE_DEATH
@ SAY_DOROTHEE_AGGRO
@ SAY_STRAWMAN_SLAY
@ SAY_TINHEAD_DEATH
@ SAY_TINHEAD_SLAY
@ SAY_TINHEAD_AGGRO
@ SAY_CRONE_AGGRO
@ EMOTE_RUST
@ SAY_DOROTHEE_SUMMON
@ SAY_STRAWMAN_AGGRO
@ SAY_ROAR_SLAY
JulianneRomuloPhases
@ PHASE_BOTH
@ PHASE_DEATH
@ PHASE_SINGLE
void SummonCroneIfReady(InstanceScript *instance, Creature *creature)
JulianneRomuloTexts
@ SAY_JULIANNE_DEATH_1
@ SAY_ROMULO_DEATH
@ SAY_ROMULO_AGGRO
@ SAY_ROMULO_SLAY
@ SAY_JULIANNE_DEATH_2
@ SAY_JULIANNE_RESURRECT
@ SAY_JULIANNE_AGGRO
@ SAY_ROMULO_RESURRECT
@ SAY_JULIANNE_SLAY
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Unit * GetCaster() const
Unit * GetTarget() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
EventMap events
void DoZoneInCombat()
Definition CreatureAI.h:169
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetImmuneToPC(bool apply) override
Definition Creature.h:190
void SetReactState(ReactStates st)
Definition Creature.h:180
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition Creature.h:118
void Update(uint32 time)
Definition EventMap.h:77
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
EventId ExecuteEvent()
Definition EventMap.cpp:77
bool IsInPhase(PhaseIndex phase) const
Definition EventMap.h:246
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:32
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
GameObject * GetGameObject(uint32 type)
bool SpawnGroupSpawn(uint32 groupId, bool ignoreRespawn=false, bool force=false, std::vector< WorldObject * > *spawnedObjects=nullptr)
Definition Map.cpp:2360
bool SpawnGroupDespawn(uint32 groupId, bool deleteRespawnTimes=false, size_t *count=nullptr)
Definition Map.cpp:2449
static ObjectGuid const Empty
Definition ObjectGuid.h:314
Creature * ToCreature()
Definition Object.h:121
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
TaskScheduler::repeated_t GetRepeatCounter() const
Returns the repeat counter which increases every time the task is repeated.
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
TaskScheduler & Update()
Update the scheduler to the current time.
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
virtual void InitializeAI()
Definition UnitAI.cpp:35
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
ThreatManager & GetThreatManager()
Definition Unit.h:1093
bool IsAlive() const
Definition Unit.h:1205
TempSummon * ToTempSummon()
Definition Unit.h:1844
void SetUninteractible(bool apply)
Definition Unit.cpp:8583
uint64 GetHealth() const
Definition Unit.h:800
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4822
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3992
Map * GetMap() const
Definition Object.h:411
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:99
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
@ DATA_ROMULO
Definition karazhan.h:57
@ DATA_JULIANNE
Definition karazhan.h:56
@ DATA_OPERA_OZ_DEATH_COUNT
Definition karazhan.h:60
@ DATA_GO_STAGE_DOOR_LEFT
Definition karazhan.h:63
@ DATA_OPERA_PERFORMANCE
Definition karazhan.h:34
#define RegisterKarazhanCreatureAI(ai_name)
Definition karazhan.h:135
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:67
Unit * DoSelectLowestHpFriendly(float range, uint32 minHPDiff=1)
ScriptedAI(Creature *creature, uint32 scriptId=0) noexcept
void ResetThreatList(Unit *who=nullptr)
void DoPlaySoundToSet(WorldObject *source, uint32 soundId)
boss_big_bad_wolf(Creature *creature)
void KilledUnit(Unit *) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
void JustAppeared() override
void JustReachedHome() override
void OnSpellCast(SpellInfo const *spellInfo) override
void JustDied(Unit *) override
void JustDied(Unit *) override
void JustReachedHome() override
boss_crone(Creature *creature)
void UpdateAI(uint32 diff) override
void JustAppeared() override
void JustEngagedWith(Unit *) override
void KilledUnit(Unit *) override
void DoAction(int32 action) override
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
void JustAppeared() override
void JustReachedHome() override
InstanceScript * _instance
TaskScheduler _scheduler
boss_dorothee(Creature *creature)
void JustEngagedWith(Unit *) override
void Reset() override
void JustEngagedWith(Unit *who) override
void JustAppeared() override
void DamageTaken(Unit *who, uint32 &damage, DamageEffectType, SpellInfo const *) override
boss_julianne(Creature *creature)
void JustReachedHome() override
void KilledUnit(Unit *victim) override
uint32 GetData(uint32 data) const override
void DoAction(int32 action) override
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
TaskScheduler _scheduler
void JustReachedHome() override
void Reset() override
boss_roar(Creature *creature)
void KilledUnit(Unit *) override
InstanceScript * _instance
void JustAppeared() override
uint32 GetData(uint32 data) const override
boss_romulo(Creature *creature)
void DamageTaken(Unit *who, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustAppeared() override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void JustDied(Unit *) override
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
void KilledUnit(Unit *victim) override
void JustReachedHome() override
void KilledUnit(Unit *) override
boss_strawman(Creature *creature)
void JustEngagedWith(Unit *) override
TaskScheduler _scheduler
void JustReachedHome() override
InstanceScript * _instance
void JustDied(Unit *) override
void Reset() override
void JustAppeared() override
void UpdateAI(uint32 diff) override
void OnSpellCast(SpellInfo const *spellInfo) override
void JustDied(Unit *) override
void JustReachedHome() override
void JustEngagedWith(Unit *) override
InstanceScript * _instance
boss_tinhead(Creature *creature)
TaskScheduler _scheduler
void KilledUnit(Unit *) override
void Reset() override
void JustAppeared() override
void UpdateAI(uint32 diff) override
void JustAppeared() override
void InitializeAI() override
bool OnGossipSelect(Player *player, uint32 menuId, uint32) override
void JustReachedHome() override
void JustAppeared() override
void JustEngagedWith(Unit *) override
void InitializeAI() override
TaskScheduler _scheduler
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
void Reset() override