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 /*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 if (UpdateVictim())
200 }
201
202private:
205};
206
207// 17543 - Strawman
209{
210 boss_strawman(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
211
212 void JustAppeared() override
213 {
214 _scheduler.Schedule(27s, [this](TaskContext /*task*/)
215 {
216 me->SetImmuneToPC(false);
218 });
219 }
220
221 void Reset() override
222 {
224 }
225
226 void JustEngagedWith(Unit* /*who*/) override
227 {
229
231 .SetValidator([this]
232 {
234 })
235 .Schedule(5s, 10s, [this](TaskContext task)
236 {
238 task.Repeat(13s, 18s);
239 })
240 .Schedule(10s, 15s, [this](TaskContext task)
241 {
242 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
243 DoCast(target, SPELL_BRAIN_WIPE);
244 task.Repeat(15s, 20s);
245 });
246 }
247
253
254 void KilledUnit(Unit* /*victim*/) override
255 {
257 }
258
259 void JustDied(Unit* /*killer*/) override
260 {
262
264 }
265
266 void UpdateAI(uint32 diff) override
267 {
268 _scheduler.Update(diff);
269
270 if (UpdateVictim())
272 }
273
274private:
277};
278
279// 17547 - Tinhead
281{
282 boss_tinhead(Creature* creature) : ScriptedAI(creature), _isFirstRust(true), _instance(creature->GetInstanceScript()) { }
283
284 void JustAppeared() override
285 {
286 _scheduler.Schedule(35s, [this](TaskContext /*task*/)
287 {
288 me->SetImmuneToPC(false);
290 });
291 }
292
293 void Reset() override
294 {
296 }
297
298 void JustEngagedWith(Unit* /*who*/) override
299 {
301
303 .SetValidator([this]
304 {
306 })
307 .Schedule(5s, 10s, [this](TaskContext task)
308 {
310 task.Repeat(5s, 10s);
311 })
312 .Schedule(6s, [this](TaskContext task)
313 {
315 task.Repeat(6s);
316 });
317 }
318
319 void OnSpellCast(SpellInfo const* spellInfo) override
320 {
321 if (_isFirstRust && spellInfo->Id == SPELL_RUST)
322 {
323 _isFirstRust = false;
325 }
326 }
327
333
334 void KilledUnit(Unit* /*victim*/) override
335 {
337 }
338
339 void JustDied(Unit* /*killer*/) override
340 {
342
344 }
345
346 void UpdateAI(uint32 diff) override
347 {
348 _scheduler.Update(diff);
349
350 if (UpdateVictim())
352 }
353
354private:
358};
359
360// 17546 - Roar
361struct boss_roar : public ScriptedAI
362{
363 boss_roar(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
364
365 void JustAppeared() override
366 {
367 _scheduler.Schedule(18s, [this](TaskContext /*task*/)
368 {
369 me->SetImmuneToPC(false);
371 });
372 }
373
374 void Reset() override
375 {
377 }
378
379 void JustEngagedWith(Unit* /*who*/) override
380 {
382
384 .SetValidator([this]
385 {
387 })
388 .Schedule(8s, [this](TaskContext task)
389 {
391 task.Repeat(10s);
392 })
393 .Schedule(15s, [this](TaskContext task)
394 {
396 task.Repeat(10s, 20s);
397 });
398 }
399
405
406 void KilledUnit(Unit* /*victim*/) override
407 {
409 }
410
411 void JustDied(Unit* /*killer*/) override
412 {
414
416 }
417
418 void UpdateAI(uint32 diff) override
419 {
420 _scheduler.Update(diff);
421
422 if (UpdateVictim())
424 }
425
426private:
429};
430
431// 18168 - The Crone
432struct boss_crone : public BossAI
433{
435
436 void JustAppeared() override
437 {
439
440 scheduler.Schedule(2400ms, [this](TaskContext task)
441 {
442 switch (task.GetRepeatCounter())
443 {
444 case 0:
445 me->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
446 Talk(SAY_CRONE_AGGRO);
447 task.Repeat(6s);
448 break;
449 case 1:
450 me->SetImmuneToPC(false);
451 DoZoneInCombat();
452 SetEquipmentSlots(false, EQUIP_ID_BROOM);
453 break;
454 default:
455 break;
456 }
457 });
458 }
459
460 void JustEngagedWith(Unit* /*who*/) override
461 {
462 scheduler.Schedule(5s, 20s, [this](TaskContext task)
463 {
465 task.Repeat(10s, 15s);
466 });
467 }
468
477
478 void KilledUnit(Unit* /*victim*/) override
479 {
481 }
482
483 void JustDied(Unit* /*killer*/) override
484 {
485 _JustDied();
487
489 }
490
491 void UpdateAI(uint32 diff) override
492 {
493 scheduler.Update(diff);
494
495 if (UpdateVictim())
497 }
498};
499
500// 17548 - Tito
501struct npc_tito : public ScriptedAI
502{
504
505 void InitializeAI() override
506 {
507 me->SetCorpseDelay(3, true);
509 }
510
511 void JustAppeared() override
512 {
514 }
515
516 void Reset() override
517 {
519 }
520
521 void JustEngagedWith(Unit* /*who*/) override
522 {
523 _scheduler.Schedule(10s, [this](TaskContext task)
524 {
526 task.Repeat(10s);
527 });
528 }
529
530 void JustReachedHome() override
531 {
533 }
534
535 void JustDied(Unit* /*killer*/) override
536 {
537 if (TempSummon* summon = me->ToTempSummon())
538 if (Creature* summoner = Object::ToCreature(summon->GetSummonerUnit()))
539 summoner->AI()->DoAction(ACTION_TITO_DIES);
540 }
541
542 void UpdateAI(uint32 diff) override
543 {
544 if (!UpdateVictim())
545 return;
546
547 _scheduler.Update(diff, [this]
548 {
550 });
551 }
552
553private:
555};
556
557// 18412 - Cyclone (The Crone)
558struct npc_cyclone : public ScriptedAI
559{
561
562 void InitializeAI() override
563 {
565 }
566
572};
573
574/*
575 * Red Riding Hood Event
576 */
577
584
596
603
604// 17603 - Grandmother
606{
608
609 bool OnGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
610 {
611 if (menuId == GOSSIP_MENU_GRANDMOTHER)
612 {
613 CloseGossipMenuFor(player);
614
617 }
618 return false;
619 }
620};
621
622// 17521 - The Big Bad Wolf
624{
626
638
639 void JustEngagedWith(Unit* who) override
640 {
642
644
646 .Schedule(5s, 20s, [this](TaskContext task)
647 {
649 task.Repeat(25s, 35s);
650 })
651 .Schedule(5s, 10s, [this](TaskContext task)
652 {
654 task.Repeat(25s, 30s);
655 })
656 .Schedule(3s, [this](TaskContext task)
657 {
659 task.Repeat(30s);
660 });
661 }
662
663 void OnSpellCast(SpellInfo const* spellInfo) override
664 {
665 if (spellInfo->Id == SPELL_PICK_RED_RIDING_HOOD)
667 }
668
674
675 void KilledUnit(Unit* /*victim*/) override
676 {
678 }
679
680 void JustDied(Unit* /*killer*/) override
681 {
682 _JustDied();
684 }
685
686 void UpdateAI(uint32 diff) override
687 {
688 scheduler.Update(diff);
689
690 if (UpdateVictim())
692 }
693};
694
695// 30769 - Pick Red Riding Hood
697{
699
700 bool Validate(SpellInfo const* /*spellInfo*/) override
701 {
703 }
704
705 void FilterTargets(std::list<WorldObject*>& targets)
706 {
708 }
709
710 void HandleScript(SpellEffIndex /*effIndex*/)
711 {
712 Unit* target = GetHitUnit();
713
714 if (Creature* caster = GetCaster()->ToCreature())
715 {
716 caster->GetThreatManager().AddThreat(target, 1000000.0f, nullptr, true, true);
717 caster->CastSpell(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
718 }
719 }
720
726};
727
728// 30768 - Little Red Riding Hood
748
749// 30755 - Picnic Basket Smell
751{
753
754 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
755 {
756 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTarget()->IsCreature())
757 if (Unit* caster = GetCaster())
758 GetTarget()->GetThreatManager().AddThreat(caster, -1000000.0f, nullptr, true, true);
759 }
760
765};
766
767/*
768 * Romeo and Juliet Event
769 */
770
784
807
839
846
853
854// 17534 - Julianne
855struct boss_julianne : public BossAI
856{
858
866
878
884
885 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
886 {
887 if (damage >= me->GetHealth() && who != me)
888 {
889 damage = me->GetHealth() -1;
890
892 return;
893
895 {
898 }
899 else if (events.IsInPhase(PHASE_BOTH))
900 {
903 }
904 }
905 }
906
907 uint32 GetData(uint32 data) const override
908 {
909 if (data == DATA_OTHER_IS_DEAD)
910 return events.IsInPhase(PHASE_DEATH) ? 1 : 0;
911
912 return 0;
913 }
914
915 void DoAction(int32 action) override
916 {
917 if (action == ACTION_FINISH_TRANSITION)
919 }
920
921 void KilledUnit(Unit* victim) override
922 {
923 if (victim != me)
925 }
926
932
933 void UpdateAI(uint32 diff) override
934 {
935 if (!UpdateVictim())
936 {
937 events.Update(diff);
938
939 while (uint32 eventId = events.ExecuteEvent())
940 {
941 if (eventId == EVENT_INTRO)
942 {
943 me->SetImmuneToPC(false);
945 }
946 }
947
948 return;
949 }
950
951 events.Update(diff);
952
954 return;
955
956 while (uint32 eventId = events.ExecuteEvent())
957 {
958 switch (eventId)
959 {
960 // Combat
963 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
965 events.Repeat(2s, 4s);
966 break;
967 case EVENT_DEVOTION:
970 events.Repeat(15s, 20s);
971 break;
974 if (Unit* target = DoSelectLowestHpFriendly(100.0f))
976 events.Repeat(15s, 20s);
977 break;
980 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
982 events.Repeat(25s, 35s);
983 break;
984
985 // Transition
991 break;
996 break;
999 break;
1000
1011 break;
1012
1013 // Misc
1014 case EVENT_FEIGN_DEATH:
1020 break;
1022 if (Creature* romulo = instance->GetCreature(DATA_ROMULO))
1023 {
1024 if (romulo->AI()->GetData(DATA_OTHER_IS_DEAD))
1026 else
1028 }
1029 break;
1030 case EVENT_REVIVE_SELF:
1038 break;
1039 default:
1040 break;
1041 }
1042
1044 return;
1045 }
1046
1048 }
1049};
1050
1051// 17533 - Romulo
1052struct boss_romulo : public BossAI
1053{
1055
1056 void JustAppeared() override
1057 {
1060 }
1061
1062 void JustEngagedWith(Unit* who) override
1063 {
1065
1067
1072 }
1073
1074 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
1075 {
1076 if (damage >= me->GetHealth() && who != me)
1077 {
1078 damage = me->GetHealth() -1;
1079
1081 return;
1082
1084 {
1087 }
1088 else if (events.IsInPhase(PHASE_BOTH))
1089 {
1092 }
1093 }
1094 }
1095
1096 uint32 GetData(uint32 data) const override
1097 {
1098 if (data == DATA_OTHER_IS_DEAD)
1099 return events.IsInPhase(PHASE_DEATH) ? 1 : 0;
1100
1101 return 0;
1102 }
1103
1104 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
1105 {
1106 if (spellInfo->Id == SPELL_UNDYING_LOVE)
1108 }
1109
1115
1116 void KilledUnit(Unit* victim) override
1117 {
1118 if (victim != me)
1120 }
1121
1127
1128 void UpdateAI(uint32 diff) override
1129 {
1130 if (!UpdateVictim())
1131 return;
1132
1133 events.Update(diff);
1134
1136 return;
1137
1138 while (uint32 eventId = events.ExecuteEvent())
1139 {
1140 switch (eventId)
1141 {
1142 // Combat
1146 events.Repeat(10s, 20s);
1147 break;
1151 events.Repeat(5s, 15s);
1152 break;
1156 events.Repeat(10s, 20s);
1157 break;
1158 case EVENT_DARING:
1161 events.Repeat(20s, 40s);
1162 break;
1163
1164 // Misc
1170 if (Creature* julianne = instance->GetCreature(DATA_JULIANNE))
1171 julianne->AI()->DoAction(ACTION_FINISH_TRANSITION);
1172 break;
1173 case EVENT_FEIGN_DEATH:
1178 break;
1180 if (Creature* julianne = instance->GetCreature(DATA_JULIANNE))
1181 {
1182 if (julianne->AI()->GetData(DATA_OTHER_IS_DEAD))
1184 else
1185 {
1188 }
1189 }
1190 break;
1191 case EVENT_REVIVE_SELF:
1199 break;
1200 default:
1201 break;
1202 }
1203
1205 return;
1206 }
1207
1209 }
1210};
1211
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
@ FAIL
@ DONE
@ SPECIAL
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
void CloseGossipMenuFor(Player *player)
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
@ TARGET_UNIT_SRC_AREA_ENEMY
@ AURA_REMOVE_BY_EXPIRE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_MOD_TAUNT
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectRemoveFn(F, I, N, M)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_STATE_CASTING
Definition Unit.h:249
DamageEffectType
Definition Unit.h:366
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(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetImmuneToPC(bool apply) override
Definition Creature.h:138
void SetReactState(ReactStates st)
Definition Creature.h:128
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition Creature.h:98
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
bool IsInPhase(PhaseIndex phase) const
Definition EventMap.h:236
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:28
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
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:3382
bool SpawnGroupDespawn(uint32 groupId, bool deleteRespawnTimes=false, size_t *count=nullptr)
Definition Map.cpp:3458
static ObjectGuid const Empty
Definition ObjectGuid.h:140
Creature * ToCreature()
Definition Object.h:191
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskScheduler::repeated_t GetRepeatCounter() const
Returns the repeat counter which increases every time the task is repeated.
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
TaskScheduler & Update(success_t const &callback=EmptyCallback)
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
virtual void InitializeAI()
Definition UnitAI.cpp:36
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:783
ThreatManager & GetThreatManager()
Definition Unit.h:1169
bool IsAlive() const
Definition Unit.h:1247
TempSummon * ToTempSummon()
Definition Unit.h:1810
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4558
uint32 GetHealth() const
Definition Unit.h:927
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3807
bool HasUnitState(const uint32 f) const
Definition Unit.h:890
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:968
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:969
Map * GetMap() const
Definition Object.h:451
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2833
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:55
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_opera_little_red_riding_hood)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_opera_pick_red_riding_hood)
PrepareAuraScript(spell_opera_picnic_basket_smell)
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:66
Unit * DoSelectLowestHpFriendly(float range, uint32 minHPDiff=1)
ScriptedAI(Creature *creature)
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