TrinityCore
boss_blood_queen_lana_thel.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 "icecrown_citadel.h"
19#include "Containers.h"
20#include "GridNotifiers.h"
21#include "InstanceScript.h"
22#include "Map.h"
23#include "MotionMaster.h"
24#include "ObjectAccessor.h"
25#include "Player.h"
26#include "ScriptedCreature.h"
27#include "ScriptMgr.h"
28#include "SpellAuraEffects.h"
29#include "SpellMgr.h"
30#include "SpellScript.h"
31
33{
47};
48
50{
74
75 // Blood Infusion
77};
78
80{
82
85};
86
87uint32 const vampireAuras[3][4] =
88{
89 {70867, 71473, 71532, 71533},
90 {70879, 71525, 71530, 71531},
91 {70877, 71474, 70877, 71474},
92};
93
94#define ESSENCE_OF_BLOOD_QUEEN RAID_MODE<uint32>(70867, 71473, 71532, 71533)
95#define ESSENCE_OF_BLOOD_QUEEN_PLR RAID_MODE<uint32>(70879, 71525, 71530, 71531)
96#define FRENZIED_BLOODTHIRST RAID_MODE<uint32>(70877, 71474, 70877, 71474)
97#define DELIRIOUS_SLASH RAID_MODE<uint32>(71623, 71624, 71625, 71626)
98#define PRESENCE_OF_THE_DARKFALLEN RAID_MODE<uint32>(70994, 71962, 71963, 71964)
99
101{
112
115};
116
118{
121};
122
124{
128};
129
130Position const centerPos = {4595.7090f, 2769.4190f, 400.6368f, 0.000000f};
131Position const airPos = {4595.7090f, 2769.4190f, 422.3893f, 0.000000f};
132
133bool IsVampire(Unit const* unit)
134{
135 for (uint8 i = 0; i < 3; ++i)
136 if (unit->HasAura(vampireAuras[i][unit->GetMap()->GetDifficultyID() - DIFFICULTY_10_N]))
137 return true;
138 return false;
139}
140
142{
144 {
145 Initialize();
146 }
147
149 {
151 }
152
153 void Reset() override
154 {
155 _Reset();
163 events.ScheduleEvent(EVENT_AIR_PHASE, 124s + (Is25ManRaid() ? 3s : 0s));
164 CleanAuras();
165 _vampires.clear();
166 Initialize();
167 }
168
169 void JustEngagedWith(Unit* who) override
170 {
172 {
175 return;
176 }
177
178 me->setActive(true);
182 CleanAuras();
183
187 }
188
189 void JustDied(Unit* /*killer*/) override
190 {
191 _JustDied();
193
196
197 CleanAuras();
198 }
199
201 {
212 }
213
214 void EnterEvadeMode(EvadeReason why) override
215 {
216 if (!_EnterEvadeMode(why))
217 return;
218
219 CleanAuras();
222 Reset();
223 }
224
225 void JustReachedHome() override
226 {
227 me->SetDisableGravity(false);
230 Talk(SAY_WIPE);
232 }
233
234 void KilledUnit(Unit* victim) override
235 {
236 if (victim->GetTypeId() == TYPEID_PLAYER)
237 Talk(SAY_KILL);
238 }
239
240 void SetGUID(ObjectGuid const& guid, int32 id) override
241 {
242 switch (id)
243 {
244 case GUID_VAMPIRE:
245 _vampires.insert(guid);
246 break;
247 case GUID_BLOODBOLT:
248 _bloodboltedPlayers.insert(guid);
249 break;
250 default:
251 break;
252 }
253 }
254
255 void MovementInform(uint32 type, uint32 id) override
256 {
257 if (type != POINT_MOTION_TYPE)
258 return;
259
260 switch (id)
261 {
262 case POINT_CENTER:
264 events.ScheduleEvent(EVENT_AIR_PHASE, 100s + (Is25ManRaid() ? 0s : 20s));
268 break;
269 case POINT_AIR:
270 _bloodboltedPlayers.clear();
274 break;
275 case POINT_GROUND:
276 me->SetDisableGravity(false);
278 if (Unit* victim = me->SelectVictim())
279 AttackStart(victim);
281 break;
282 default:
283 break;
284 }
285 }
286
287 void UpdateAI(uint32 diff) override
288 {
289 if (!UpdateVictim())
290 return;
291
292 events.Update(diff);
293
295 return;
296
297 while (uint32 eventId = events.ExecuteEvent())
298 {
299 switch (eventId)
300 {
301 case EVENT_BERSERK:
305 break;
307 {
308 std::list<Player*> targets;
309 SelectRandomTarget(false, &targets);
310 if (!targets.empty())
311 {
312 Unit* target = targets.front();
316 _vampires.insert(target->GetGUID());
319 }
320 break;
321 }
323 {
324 // victim can be nullptr when this is processed in the same update tick as EVENT_AIR_PHASE
325 if (me->GetVictim())
326 {
327 Player* newOfftank = SelectRandomTarget(true);
328 if (newOfftank)
329 {
330 if (_offtankGUID != newOfftank->GetGUID())
331 {
332 _offtankGUID = newOfftank->GetGUID();
333
334 // both spells have SPELL_ATTR5_SINGLE_TARGET_SPELL, no manual removal needed
335 newOfftank->CastSpell(me->GetVictim(), SPELL_BLOOD_MIRROR_DAMAGE, true);
336 me->EnsureVictim()->CastSpell(newOfftank, SPELL_BLOOD_MIRROR_DUMMY, true);
339 newOfftank->HasAura(SPELL_UNSATED_CRAVING) && !newOfftank->HasAura(SPELL_THIRST_QUENCHED) &&
340 !newOfftank->HasAura(SPELL_GUSHING_WOUND))
341 newOfftank->CastSpell(newOfftank, SPELL_GUSHING_WOUND, TRIGGERED_FULL_MASK);
342
343 }
344 }
345 else
347 }
349 break;
350 }
354 DoCast(_offtank, SPELL_DELIRIOUS_SLASH);
356 break;
358 {
359 std::list<Player*> targets;
360 SelectRandomTarget(false, &targets);
362 if (targets.size() > 1)
363 {
365 for (std::list<Player*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
367 }
369 break;
370 }
372 if (Player* target = SelectRandomTarget(false))
373 {
377 }
379 break;
381 {
382 std::list<Player*> targets;
383 SelectRandomTarget(false, &targets);
385 for (std::list<Player*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
389 break;
390 }
391 case EVENT_AIR_PHASE:
392 DoStopAttack();
397 break;
399 me->SetDisableGravity(true);
401 break;
404 break;
405 default:
406 break;
407 }
408
410 return;
411 }
412 }
413
414 bool WasVampire(ObjectGuid guid) const
415 {
416 return _vampires.count(guid) != 0;
417 }
418
419 bool WasBloodbolted(ObjectGuid guid) const
420 {
421 return _bloodboltedPlayers.count(guid) != 0;
422 }
423
424private:
425 // offtank for this encounter is the player standing closest to main tank
426 Player* SelectRandomTarget(bool includeOfftank, std::list<Player*>* targetList = nullptr)
427 {
429 return nullptr;
430
431 std::list<Player*> tempTargets;
432 Unit* maintank = me->GetThreatManager().GetCurrentVictim();
434 if (Player* refTarget = ref->GetVictim()->ToPlayer())
435 if (refTarget != maintank && (includeOfftank || (refTarget->GetGUID() != _offtankGUID)))
436 tempTargets.push_back(refTarget->ToPlayer());
437
438 if (tempTargets.empty())
439 return nullptr;
440
441 if (targetList)
442 {
443 *targetList = std::move(tempTargets);
444 return nullptr;
445 }
446
447 if (includeOfftank)
448 {
449 tempTargets.sort(Trinity::ObjectDistanceOrderPred(me->GetVictim()));
450 return tempTargets.front();
451 }
452
454 }
455
459};
460
461// helper for shortened code
463
464// 70946, 71475, 71476, 71477 - Vampiric Bite
466{
467 bool Validate(SpellInfo const* /*spell*/) override
468 {
470 }
471
473 {
475 {
478 }
479
480 return SPELL_CAST_OK;
481 }
482
483 void OnCast(SpellMissInfo missInfo)
484 {
485 if (GetCaster()->GetTypeId() != TYPEID_PLAYER || missInfo != SPELL_MISS_NONE)
486 return;
487
490
491 // Shadowmourne questline
492 if (Aura* aura = GetCaster()->GetAura(SPELL_GUSHING_WOUND))
493 {
494 if (aura->GetStackAmount() == 3)
495 {
497 GetCaster()->RemoveAura(aura);
498 }
499 else
501 }
502
503 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
504 if (Creature* bloodQueen = ObjectAccessor::GetCreature(*GetCaster(), instance->GetGuidData(DATA_BLOOD_QUEEN_LANA_THEL)))
505 bloodQueen->AI()->SetGUID(GetHitUnit()->GetGUID(), GUID_VAMPIRE);
506 }
507
508 void HandlePresence(SpellEffIndex /*effIndex*/)
509 {
512 }
513
514 void Register() override
515 {
519 }
520};
521
522// 70877, 71474 - Frenzied Bloodthirst
524{
525 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
526 {
527 if (InstanceScript* instance = GetTarget()->GetInstanceScript())
528 if (Creature* bloodQueen = ObjectAccessor::GetCreature(*GetTarget(), instance->GetGuidData(DATA_BLOOD_QUEEN_LANA_THEL)))
529 bloodQueen->AI()->Talk(EMOTE_BLOODTHIRST, GetTarget());
530 }
531
532 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
533 {
534 Unit* target = GetTarget();
535 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
536 if (InstanceScript* instance = target->GetInstanceScript())
537 if (Creature* bloodQueen = ObjectAccessor::GetCreature(*target, instance->GetGuidData(DATA_BLOOD_QUEEN_LANA_THEL)))
538 {
539 // this needs to be done BEFORE charm aura or we hit an assert in Unit::SetCharmedBy
540 if (target->GetVehicleKit())
541 target->RemoveVehicleKit();
542
543 bloodQueen->AI()->Talk(SAY_MIND_CONTROL);
544 bloodQueen->CastSpell(target, SPELL_UNCONTROLLABLE_FRENZY, true);
545 }
546 }
547
548 void Register() override
549 {
552 }
553};
554
556{
557 public:
558 explicit BloodboltHitCheck(LanaThelAI* ai) : _ai(ai) { }
559
560 bool operator()(WorldObject* object) const
561 {
562 return _ai->WasBloodbolted(object->GetGUID());
563 }
564
565 private:
567};
568
569// 71899, 71900, 71901, 71902 - Bloodbolt Whirl
571{
572 bool Validate(SpellInfo const* /*spell*/) override
573 {
575 }
576
577 bool Load() override
578 {
580 }
581
582 void FilterTargets(std::list<WorldObject*>& targets)
583 {
584 uint32 targetCount = (targets.size() + 2) / 3;
585 targets.remove_if(BloodboltHitCheck(static_cast<LanaThelAI*>(GetCaster()->GetAI())));
586 Trinity::Containers::RandomResize(targets, targetCount);
587 // mark targets now, effect hook has missile travel time delay (might cast next in that time)
588 for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
589 GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT);
590 }
591
593 {
594 PreventHitDefaultEffect(effIndex);
596 }
597
598 void Register() override
599 {
602 }
603};
604
605// 70871 - Essence of the Blood Queen
607{
608 bool Validate(SpellInfo const* /*spellInfo*/) override
609 {
611 }
612
613 void OnProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
614 {
616 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
617 if (!damageInfo || !damageInfo->GetDamage())
618 return;
619
620 CastSpellExtraArgs args(aurEff);
621 args.AddSpellBP0(CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount()));
623 }
624
625 void Register() override
626 {
628 }
629};
630
631// 71390 - Pact of the Darkfallen
633{
634 void FilterTargets(std::list<WorldObject*>& targets)
635 {
636 targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN));
637
638 bool remove = true;
639 std::list<WorldObject*>::const_iterator itrEnd = targets.end(), itr, itr2;
640 // we can do this, unitList is MAX 4 in size
641 for (itr = targets.begin(); itr != itrEnd && remove; ++itr)
642 {
643 if (!GetCaster()->IsWithinDist(*itr, 5.0f, false))
644 remove = false;
645
646 for (itr2 = targets.begin(); itr2 != itrEnd && remove; ++itr2)
647 if (itr != itr2 && !(*itr2)->IsWithinDist(*itr, 5.0f, false))
648 remove = false;
649 }
650
651 if (remove)
652 {
653 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
654 {
655 instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN);
656 targets.clear();
657 }
658 }
659 }
660
661 void Register() override
662 {
664 }
665};
666
667// 71340 - Pact of the Darkfallen
669{
670 bool Validate(SpellInfo const* /*spell*/) override
671 {
673 }
674
675 // this is an additional effect to be executed
676 void PeriodicTick(AuraEffect const* aurEff)
677 {
678 SpellInfo const* damageSpell = sSpellMgr->AssertSpellInfo(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE, GetCastDifficulty());
679 int32 damage = damageSpell->GetEffect(EFFECT_0).CalcValue();
680 float multiplier = 0.3375f + 0.1f * uint32(aurEff->GetTickNumber()/10); // do not convert to 0.01f - we need tick number/10 as INT (damage increases every 10 ticks)
681 damage = int32(damage * multiplier);
682
684 args.AddSpellBP0(damage);
686 }
687
688 void Register() override
689 {
691 }
692};
693
694// 71341 - Pact of the Darkfallen
696{
697 void FilterTargets(std::list<WorldObject*>& unitList)
698 {
699 unitList.remove_if(Trinity::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN));
700 unitList.push_back(GetCaster());
701 }
702
703 void Register() override
704 {
706 }
707};
708
709// 71446, 71478, 71479, 71480 - Twilight Bloodbolt
711{
712 void HandleResistance(DamageInfo const& damageInfo, uint32& resistAmount, int32& /*absorbAmount*/)
713 {
714 Unit* caster = damageInfo.GetAttacker();;
715 Unit* target = damageInfo.GetVictim();
716 uint32 damage = damageInfo.GetDamage();
717 uint32 resistedDamage = Unit::CalcSpellResistedDamage(caster, target, damage, SPELL_SCHOOL_MASK_SHADOW, nullptr);
718 resistedDamage += Unit::CalcSpellResistedDamage(caster, target, damage, SPELL_SCHOOL_MASK_ARCANE, nullptr);
719 resistAmount = resistedDamage;
720 }
721
722 void Register() override
723 {
725 }
726};
727
729{
730 public:
731 achievement_once_bitten_twice_shy_n() : AchievementCriteriaScript("achievement_once_bitten_twice_shy_n") { }
732
733 bool OnCheck(Player* source, Unit* target) override
734 {
735 if (!target)
736 return false;
737
738 if (LanaThelAI* lanaThelAI = CAST_AI(LanaThelAI, target->GetAI()))
739 return !lanaThelAI->WasVampire(source->GetGUID());
740 return false;
741 }
742};
743
745{
746 public:
747 achievement_once_bitten_twice_shy_v() : AchievementCriteriaScript("achievement_once_bitten_twice_shy_v") { }
748
749 bool OnCheck(Player* source, Unit* target) override
750 {
751 if (!target)
752 return false;
753
754 if (LanaThelAI* lanaThelAI = CAST_AI(LanaThelAI, target->GetAI()))
755 return lanaThelAI->WasVampire(source->GetGUID());
756 return false;
757 }
758};
759
761{
762 // Creatures
764
765 // Spells
774
775 // Achievements
778}
Texts
@ DIFFICULTY_10_N
Definition: DBCEnums.h:877
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ FAIL
@ POINT_MOTION_TYPE
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:393
Spells
Definition: PlayerAI.cpp:32
@ SPELL_BERSERK
Definition: PlayerAI.cpp:371
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:145
#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
SpellMissInfo
@ SPELL_MISS_NONE
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_SCHOOL_MASK_SHADOW
@ SPELL_SCHOOL_MASK_ARCANE
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES
SpellCastResult
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_CAST_OK
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ AURA_REMOVE_BY_ENEMY_SPELL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_OVERRIDE_SPELLS
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
#define sSpellMgr
Definition: SpellMgr.h:849
#define BeforeSpellHitFn(F)
Definition: SpellScript.h:847
#define SpellCheckCastFn(F)
Definition: SpellScript.h:830
#define AuraEffectProcFn(F, I, N)
Definition: SpellScript.h:2160
#define SpellOnResistAbsorbCalculateFn(F)
Definition: SpellScript.h:889
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
EvadeReason
Definition: UnitAICommon.h:30
#define CAST_AI(a, b)
Definition: UnitAI.h:28
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
@ UNIT_STATE_EVADE
Definition: Unit.h:277
@ UNIT_STATE_CASTING
Definition: Unit.h:270
T CalculatePct(T base, U pct)
Definition: Util.h:72
Guids
#define ESSENCE_OF_BLOOD_QUEEN
Position const centerPos
boss_blood_queen_lana_thel LanaThelAI
#define ESSENCE_OF_BLOOD_QUEEN_PLR
@ SPELL_FRENZIED_BLOODTHIRST_VISUAL
@ SPELL_UNCONTROLLABLE_FRENZY
@ SPELL_CLEAR_ALL_STATUS_AILMENTS
@ SPELL_PACT_OF_THE_DARKFALLEN_TARGET
@ SPELL_PRESENCE_OF_THE_DARKFALLEN
@ SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE
@ SPELL_FRENZIED_BLOODTHIRST
@ SPELL_BLOOD_MIRROR_VISUAL
@ SPELL_VAMPIRIC_BITE_DUMMY
@ SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR
@ SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL
@ SPELL_BLOOD_INFUSION_CREDIT
@ SPELL_TWILIGHT_BLOODBOLT
@ SPELL_BLOOD_MIRROR_DAMAGE
@ SPELL_PACT_OF_THE_DARKFALLEN
@ SPELL_PRESENCE_OF_THE_DARKFALLEN_2
@ SPELL_TWILIGHT_BLOODBOLT_TARGET
@ SPELL_BLOOD_MIRROR_DUMMY
bool IsVampire(Unit const *unit)
void AddSC_boss_blood_queen_lana_thel()
#define PRESENCE_OF_THE_DARKFALLEN
#define FRENZIED_BLOODTHIRST
@ SAY_PACT_OF_THE_DARKFALLEN
#define DELIRIOUS_SLASH
uint32 const vampireAuras[3][4]
Position const airPos
@ EVENT_PACT_OF_THE_DARKFALLEN
uint32 GetTickNumber() const
int32 GetAmount() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
Unit * GetTarget() const
Difficulty GetCastDifficulty() const
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:2155
HookList< AuraProcHandler > OnProc
Definition: SpellScript.h:2145
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
bool operator()(WorldObject *object) const
InstanceScript *const instance
void _JustReachedHome()
EventMap events
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:299
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetReactState(ReactStates st)
Definition: Creature.h:160
Unit * SelectVictim()
Definition: Creature.cpp:1211
Unit * GetVictim() const
Definition: Unit.h:441
Unit * GetAttacker() const
Definition: Unit.h:440
uint32 GetDamage() const
Definition: Unit.h:446
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void DelayEvents(Milliseconds delay)
Definition: EventMap.cpp:96
void CancelEventGroup(uint32 group)
Definition: EventMap.cpp:153
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:52
virtual bool SetBossState(uint32 id, EncounterState state)
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
Difficulty GetDifficultyID() const
Definition: Map.h:324
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveTargetedHome()
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
bool IsEmpty() const
Definition: ObjectGuid.h:319
void Clear()
Definition: ObjectGuid.h:286
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: Player.cpp:16050
DamageInfo * GetDamageInfo() const
Definition: Unit.h:505
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
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:829
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
HookList< CastHandler > OnCast
Definition: SpellScript.h:822
HookList< OnCalculateResistAbsorbHandler > OnCalculateResistAbsorb
Definition: SpellScript.h:888
void SetCustomCastResultMessage(SpellCustomErrors result)
HookList< BeforeHitHandler > BeforeHit
Definition: SpellScript.h:846
Unit * GetExplTargetUnit() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
Unit * GetCurrentVictim()
bool IsThreatListEmpty(bool includeOffline=false) const
Trinity::IteratorPair< ThreatListIterator, std::nullptr_t > GetSortedThreatList() const
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
virtual void SetGUID(ObjectGuid const &, int32=0)
Definition: UnitAI.h:75
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3685
ThreatManager & GetThreatManager()
Definition: Unit.h:1063
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
static uint32 CalcSpellResistedDamage(Unit const *attacker, Unit *victim, uint32 damage, SpellSchoolMask schoolMask, SpellInfo const *spellInfo)
Definition: Unit.cpp:1696
UnitAI * GetAI() const
Definition: Unit.h:660
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition: Unit.cpp:12725
AnimTier GetAnimTier() const
Definition: Unit.h:895
void AddUnitState(uint32 f)
Definition: Unit.h:731
Unit * EnsureVictim() const
Definition: Unit.h:717
Unit * GetVictim() const
Definition: Unit.h:715
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 RemoveVehicleKit(bool onRemoveFromWorld=false)
Definition: Unit.cpp:11459
Vehicle * GetVehicleKit() const
Definition: Unit.h:1711
Map * GetMap() const
Definition: Object.h:624
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
void setActive(bool isActiveObject)
Definition: Object.cpp:922
bool OnCheck(Player *source, Unit *target) override
bool OnCheck(Player *source, Unit *target) override
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex effIndex)
void OnProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void FilterTargets(std::list< WorldObject * > &unitList)
void FilterTargets(std::list< WorldObject * > &targets)
void HandleResistance(DamageInfo const &damageInfo, uint32 &resistAmount, int32 &)
bool Validate(SpellInfo const *) override
@ SPELL_UNSATED_CRAVING
@ SPELL_SHADOWS_FATE
@ LIGHT_S_HAMMER_TELEPORT
#define RegisterIcecrownCitadelCreatureAI(ai_name)
@ DATA_BLOOD_QUEEN_LANA_THEL
@ NPC_BLOOD_QUEEN_LANA_THEL
TC_GAME_API Player * GetPlayer(Map 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
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
bool Is25ManRaid() const
void KilledUnit(Unit *victim) override
void JustEngagedWith(Unit *who) override
bool WasBloodbolted(ObjectGuid guid) const
bool WasVampire(ObjectGuid guid) const
void SetGUID(ObjectGuid const &guid, int32 id) override
void UpdateAI(uint32 diff) override
Player * SelectRandomTarget(bool includeOfftank, std::list< Player * > *targetList=nullptr)
void MovementInform(uint32 type, uint32 id) override
void EnterEvadeMode(EvadeReason why) override