AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI Struct Reference
Inheritance diagram for boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_ingvar_the_plundererAI (Creature *c)
 
void Reset () override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void JustSummoned (Creature *s) override
 
void KilledUnit (Unit *) override
 
void FeignDeath (bool apply)
 
void JustDied (Unit *) override
 
void EnterEvadeMode (EvadeReason why) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

InstanceScriptpInstance
 
EventMap events
 
SummonList summons
 
ObjectGuid ValkyrGUID
 
ObjectGuid ThrowGUID
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_ingvar_the_plundererAI()

boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::boss_ingvar_the_plundererAI ( Creature c)
inline
114 : ScriptedAI(c), summons(me)
115 {
117 }
Definition: ScriptedCreature.h:192
Creature * me
Definition: ScriptedCreature.h:282
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
InstanceScript * pInstance
Definition: boss_ingvar_the_plunderer.cpp:119
SummonList summons
Definition: boss_ingvar_the_plunderer.cpp:121

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ DamageTaken()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::DamageTaken ( Unit ,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

143 {
144 if (me->GetDisplayId() == DISPLAYID_DEFAULT && damage >= me->GetHealth())
145 {
146 damage = 0;
151 me->DisableRotate(false);
154 me->StopMoving();
155 FeignDeath(true);
156 events.Reset();
157 events.RescheduleEvent(EVENT_START_RESURRECTION, 1s);
158 events.RescheduleEvent(EVENT_YELL_DEAD_1, 0ms);
159 }
160 }
@ UNIT_STATE_ROOT
Definition: Unit.h:335
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
events
Definition: boss_sartura.cpp:43
@ EVENT_YELL_DEAD_1
Definition: boss_ingvar_the_plunderer.cpp:84
@ EVENT_START_RESURRECTION
Definition: boss_ingvar_the_plunderer.cpp:83
@ DISPLAYID_DEFAULT
Definition: boss_ingvar_the_plunderer.cpp:24
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4069
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
void StopMoving()
Definition: Unit.cpp:16824
void DisableRotate(bool apply)
Definition: Unit.cpp:18433
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18192
uint32 GetDisplayId() const
Definition: Unit.h:2168
uint32 GetHealth() const
Definition: Unit.h:1440
void RemoveAllAuras()
Definition: Unit.cpp:5239
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1481
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:178
void MoveIdle()
Definition: MotionMaster.cpp:231
void FeignDeath(bool apply)
Definition: boss_ingvar_the_plunderer.cpp:205

References Unit::DisableRotate(), DISPLAYID_DEFAULT, EVENT_START_RESURRECTION, EVENT_YELL_DEAD_1, FeignDeath(), Unit::GetDisplayId(), Unit::GetHealth(), Unit::GetMotionMaster(), Unit::InterruptNonMeleeSpells(), ScriptedAI::me, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), Unit::RemoveAllAuras(), Unit::SetControlled(), Unit::SetUnitFlag(), Unit::StopMoving(), UNIT_FLAG_NOT_SELECTABLE, and UNIT_STATE_ROOT.

◆ EnterEvadeMode()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

236 {
238 me->DisableRotate(false);
240 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:197

References Unit::DisableRotate(), CreatureAI::EnterEvadeMode(), ScriptedAI::me, Unit::SetControlled(), and UNIT_STATE_ROOT.

◆ FeignDeath()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::FeignDeath ( bool  apply)
inline
206 {
207 if (apply)
208 {
213 }
214 else
215 {
220 }
221 }
@ UNIT_FLAG2_FEIGN_DEATH
Definition: Unit.h:488
@ UNIT_STAND_STATE_DEAD
Definition: Unit.h:60
@ UNIT_STAND_STATE_STAND
Definition: Unit.h:53
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition: Unit.h:477
@ UNIT_DYNFLAG_DEAD
Definition: SharedDefines.h:3098
virtual void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:118
virtual void SetDynamicFlag(uint32 flag)
Definition: Object.h:117
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1487
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1488
void SetStandState(uint8 state)
Definition: Unit.cpp:16900
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1482

References ScriptedAI::me, Object::RemoveDynamicFlag(), Unit::RemoveUnitFlag(), Unit::RemoveUnitFlag2(), Object::SetDynamicFlag(), Unit::SetStandState(), Unit::SetUnitFlag(), Unit::SetUnitFlag2(), UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT, UNIT_STAND_STATE_DEAD, and UNIT_STAND_STATE_STAND.

Referenced by DamageTaken(), Reset(), and UpdateAI().

◆ JustDied()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

224 {
225 events.Reset();
228 if (pInstance)
229 {
232 }
233 }
@ DONE
Definition: InstanceScript.h:59
@ YELL_DEAD_2
Definition: boss_ingvar_the_plunderer.cpp:44
@ NPC_INGVAR_UNDEAD
Definition: boss_ingvar_the_plunderer.cpp:30
@ DATA_INGVAR
Definition: utgarde_keep.h:30
Talk
Definition: boss_fathomlord_karathress.cpp:23
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition: DBCEnums.h:128
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:67
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: InstanceScript.cpp:554
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, DATA_INGVAR, SummonList::DespawnAll(), DONE, InstanceScript::DoUpdateAchievementCriteria(), NPC_INGVAR_UNDEAD, pInstance, ZoneScript::SetData(), summons, and YELL_DEAD_2.

◆ JustEngagedWith()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

163 {
164 events.Reset();
165 // schedule Phase 1 abilities
166 events.RescheduleEvent(EVENT_SPELL_ROAR, 15s);
167 events.RescheduleEvent(EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, 2s);
168 events.RescheduleEvent(EVENT_SPELL_SMASH, 5s);
169 events.RescheduleEvent(EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, 10s);
170
173
174 if (pInstance)
176 }
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ EVENT_SPELL_SMASH
Definition: boss_ingvar_the_plunderer.cpp:96
@ EVENT_SPELL_ROAR
Definition: boss_ingvar_the_plunderer.cpp:94
@ EVENT_SPELL_CLEAVE_OR_WOE_STRIKE
Definition: boss_ingvar_the_plunderer.cpp:95
@ EVENT_SPELL_ENRAGE_OR_SHADOW_AXE
Definition: boss_ingvar_the_plunderer.cpp:97
@ YELL_AGGRO_1
Definition: boss_ingvar_the_plunderer.cpp:38
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true)
Definition: Creature.cpp:3689
uint32 GetMaxHealth() const
Definition: Unit.h:1441

References DATA_INGVAR, EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, EVENT_SPELL_ROAR, EVENT_SPELL_SMASH, Unit::GetMaxHealth(), IN_PROGRESS, Creature::LowerPlayerDamageReq(), ScriptedAI::me, pInstance, ZoneScript::SetData(), and YELL_AGGRO_1.

◆ JustSummoned()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::JustSummoned ( Creature s)
inlineoverridevirtual

Reimplemented from ScriptedAI.

179 {
180 summons.Summon(s);
181 if (s->GetEntry() == NPC_ANNHYLDE)
182 {
183 ValkyrGUID = s->GetGUID();
184 s->SetCanFly(true);
185 s->SetDisableGravity(true);
186 s->SetPosition(s->GetPositionX(), s->GetPositionY(), s->GetPositionZ() + 35.0f, s->GetOrientation());
188 }
189 else if (s->GetEntry() == NPC_THROW)
190 {
191 ThrowGUID = s->GetGUID();
192 if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true) )
193 s->GetMotionMaster()->MovePoint(0, t->GetPositionX(), t->GetPositionY(), t->GetPositionZ());
194 }
195 }
@ NPC_ANNHYLDE
Definition: boss_ingvar_the_plunderer.cpp:31
@ NPC_THROW
Definition: boss_ingvar_the_plunderer.cpp:32
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3092
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3055
bool SetCanFly(bool enable, bool packetOnly=false) override
Definition: Creature.cpp:3177
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
float GetPositionZ() const
Definition: Position.h:119
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
Definition: Unit.h:1290
void SetFacingTo(float ori)
Definition: Unit.cpp:20782
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
ObjectGuid ValkyrGUID
Definition: boss_ingvar_the_plunderer.cpp:122
ObjectGuid ThrowGUID
Definition: boss_ingvar_the_plunderer.cpp:123

References Object::GetEntry(), Object::GetGUID(), Unit::GetMotionMaster(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), MotionMaster::MovePoint(), NPC_ANNHYLDE, NPC_THROW, UnitAI::SelectTarget(), Creature::SetCanFly(), Creature::SetDisableGravity(), Unit::SetFacingTo(), Creature::SetPosition(), SummonList::Summon(), summons, ThrowGUID, and ValkyrGUID.

◆ KilledUnit()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

198 {
201 else
203 }
@ YELL_KILL_2
Definition: boss_ingvar_the_plunderer.cpp:43
@ YELL_KILL_1
Definition: boss_ingvar_the_plunderer.cpp:39

References DISPLAYID_DEFAULT, Unit::GetDisplayId(), ScriptedAI::me, YELL_KILL_1, and YELL_KILL_2.

◆ Reset()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

126 {
129 events.Reset();
132 me->LoadEquipment(1);
133 FeignDeath(false);
136 me->DisableRotate(false);
137
138 if (pInstance)
140 }
@ NOT_STARTED
Definition: InstanceScript.h:56
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:3405
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1777
void Clear()
Definition: ObjectGuid.h:140

References ObjectGuid::Clear(), DATA_INGVAR, SummonList::DespawnAll(), Unit::DisableRotate(), DISPLAYID_DEFAULT, FeignDeath(), Creature::LoadEquipment(), ScriptedAI::me, NOT_STARTED, pInstance, Unit::RemoveUnitFlag(), Unit::SetControlled(), ZoneScript::SetData(), Creature::SetDisplayId(), summons, ThrowGUID, UNIT_FLAG_NOT_SELECTABLE, UNIT_STATE_ROOT, and ValkyrGUID.

◆ UpdateAI()

void boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

243 {
244 if (!UpdateVictim())
245 return;
246
247 events.Update(diff);
248
250 return;
251
252 switch( events.ExecuteEvent() )
253 {
254 case 0:
255 break;
258 break;
261 events.RescheduleEvent(EVENT_VALKYR_BEAM, 7s);
262 events.RescheduleEvent(EVENT_VALKYR_MOVE, 1ms);
263 events.RescheduleEvent(EVENT_ANNHYLDE_YELL, 3s);
264 break;
267 s->GetMotionMaster()->MovePoint(1, s->GetPositionX(), s->GetPositionY(), s->GetPositionZ() - 15.0f);
268 break;
271 s->AI()->Talk(YELL_ANHYLDE_2);
272 break;
276 c->CastSpell(me, SPELL_RESURRECTION_BEAM, false);
277 events.RescheduleEvent(EVENT_RESURRECTION_BALL, 4s);
278 break;
281 events.RescheduleEvent(EVENT_RESURRECTION_HEAL, 4s);
282 break;
286 FeignDeath(false);
287 events.RescheduleEvent(EVENT_MORPH_TO_UNDEAD, 3s);
288 break;
291 events.RescheduleEvent(EVENT_START_PHASE_2, 1s);
292 break;
295 {
296 c->DespawnOrUnsummon();
298 }
303
304 // schedule Phase 2 abilities
305 events.RescheduleEvent(EVENT_SPELL_ROAR, 15s);
306 events.RescheduleEvent(EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, 2s);
307 events.RescheduleEvent(EVENT_SPELL_SMASH, 5s);
308 events.RescheduleEvent(EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, 10s);
309
310 break;
311
312 // ABILITIES HERE:
313 case EVENT_UNROOT:
315 me->DisableRotate(false);
316 break;
317 case EVENT_SPELL_ROAR:
319
322
324 me->CastSpell((Unit*)nullptr, SPELL_STAGGERING_ROAR, false);
325 else
326 me->CastSpell((Unit*)nullptr, SPELL_DREADFUL_ROAR, false);
327 events.Repeat(15s, 20s);
328 break;
331 {
332 events.Repeat(3s);
333 break;
334 }
336 me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
337 else
339 events.Repeat(3s, 7s);
340 break;
343 {
344 events.Repeat(3s);
345 break;
346 }
348 me->DisableRotate(true);
351 me->CastSpell((Unit*)nullptr, SPELL_SMASH, false);
352 else
353 me->CastSpell((Unit*)nullptr, SPELL_DARK_SMASH, false);
354 events.Repeat(9s, 11s);
355 events.RescheduleEvent(EVENT_UNROOT, 3750ms);
356 break;
359 {
360 me->CastSpell(me, SPELL_ENRAGE, false);
361 events.Repeat(10s);
362 }
363 else
364 {
365 me->CastSpell((Unit*)nullptr, SPELL_SHADOW_AXE, true);
367 events.Repeat(35s);
368 events.RescheduleEvent(EVENT_AXE_RETURN, 10s);
369 }
370 break;
371 case EVENT_AXE_RETURN:
373 c->GetMotionMaster()->MoveCharge(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
374 events.RescheduleEvent(EVENT_AXE_PICKUP, 1500ms);
375 break;
376 case EVENT_AXE_PICKUP:
378 {
379 c->DestroyForNearbyPlayers();
380 c->DespawnOrUnsummon();
382 }
384 SetEquipmentSlots(true);
385 break;
386 }
387
390 }
@ EQUIP_UNEQUIP
Definition: CreatureAI.h:66
@ EQUIP_NO_CHANGE
Definition: CreatureAI.h:65
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition: UpdateFields.h:116
@ UNIT_STATE_CASTING
Definition: Unit.h:340
#define SPELL_ENRAGE
Definition: boss_ingvar_the_plunderer.cpp:79
@ EVENT_ANNHYLDE_YELL
Definition: boss_ingvar_the_plunderer.cpp:86
@ EVENT_START_PHASE_2
Definition: boss_ingvar_the_plunderer.cpp:91
@ EVENT_RESURRECTION_HEAL
Definition: boss_ingvar_the_plunderer.cpp:89
@ EVENT_RESURRECTION_BALL
Definition: boss_ingvar_the_plunderer.cpp:88
@ EVENT_MORPH_TO_UNDEAD
Definition: boss_ingvar_the_plunderer.cpp:90
@ EVENT_AXE_RETURN
Definition: boss_ingvar_the_plunderer.cpp:98
@ EVENT_VALKYR_MOVE
Definition: boss_ingvar_the_plunderer.cpp:85
@ EVENT_VALKYR_BEAM
Definition: boss_ingvar_the_plunderer.cpp:87
@ EVENT_AXE_PICKUP
Definition: boss_ingvar_the_plunderer.cpp:99
@ EVENT_UNROOT
Definition: boss_ingvar_the_plunderer.cpp:93
#define SPELL_SMASH
Definition: boss_ingvar_the_plunderer.cpp:78
@ YELL_AGGRO_2
Definition: boss_ingvar_the_plunderer.cpp:42
@ YELL_ANHYLDE_2
Definition: boss_ingvar_the_plunderer.cpp:48
@ EMOTE_ROAR
Definition: boss_ingvar_the_plunderer.cpp:46
@ YELL_DEAD_1
Definition: boss_ingvar_the_plunderer.cpp:40
#define SPELL_STAGGERING_ROAR
Definition: boss_ingvar_the_plunderer.cpp:75
#define SPELL_DREADFUL_ROAR
Definition: boss_ingvar_the_plunderer.cpp:76
@ SPELL_CLEAVE
Definition: boss_ingvar_the_plunderer.cpp:61
@ SPELL_SUMMON_VALKYR
Definition: boss_ingvar_the_plunderer.cpp:53
@ SPELL_SHADOW_AXE
Definition: boss_ingvar_the_plunderer.cpp:72
@ SPELL_RESURRECTION_BALL
Definition: boss_ingvar_the_plunderer.cpp:55
@ SPELL_RESURRECTION_BEAM
Definition: boss_ingvar_the_plunderer.cpp:54
@ SPELL_INGVAR_TRANSFORM
Definition: boss_ingvar_the_plunderer.cpp:57
@ SPELL_DARK_SMASH
Definition: boss_ingvar_the_plunderer.cpp:71
@ SPELL_RESURRECTION_HEAL
Definition: boss_ingvar_the_plunderer.cpp:56
#define SPELL_WOE_STRIKE
Definition: boss_ingvar_the_plunderer.cpp:77
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
Definition: ScriptedCreature.cpp:495
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:206
Definition: Creature.h:46
void _AddCreatureSpellCooldown(uint32 spell_id, uint16 categoryId, uint32 end_time)
Definition: Creature.cpp:2756
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4708
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:1480
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16878
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
Unit * GetVictim() const
Definition: Unit.h:1386
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:299

References Creature::_AddCreatureSpellCooldown(), ScriptedAI::AttackStart(), Unit::CastSpell(), ObjectGuid::Clear(), SummonList::DespawnAll(), Unit::DisableRotate(), DISPLAYID_DEFAULT, UnitAI::DoMeleeAttackIfReady(), EMOTE_ROAR, EQUIP_NO_CHANGE, EQUIP_UNEQUIP, EVENT_ANNHYLDE_YELL, EVENT_AXE_PICKUP, EVENT_AXE_RETURN, EVENT_MORPH_TO_UNDEAD, EVENT_RESURRECTION_BALL, EVENT_RESURRECTION_HEAL, EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, EVENT_SPELL_ROAR, EVENT_SPELL_SMASH, EVENT_START_PHASE_2, EVENT_START_RESURRECTION, EVENT_UNROOT, EVENT_VALKYR_BEAM, EVENT_VALKYR_MOVE, EVENT_YELL_DEAD_1, FeignDeath(), ObjectAccessor::GetCreature(), Unit::GetDisplayId(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Object::GetUInt32Value(), Unit::GetVictim(), Unit::HasUnitFlag(), Unit::HasUnitState(), ScriptedAI::me, MotionMaster::MoveChase(), Unit::RemoveAura(), Unit::RemoveUnitFlag(), Unit::SendMovementFlagUpdate(), Unit::SetControlled(), ScriptedAI::SetEquipmentSlots(), SPELL_CLEAVE, SPELL_DARK_SMASH, SPELL_DREADFUL_ROAR, SPELL_ENRAGE, SPELL_INGVAR_TRANSFORM, SPELL_RESURRECTION_BALL, SPELL_RESURRECTION_BEAM, SPELL_RESURRECTION_HEAL, SPELL_SHADOW_AXE, SPELL_SMASH, SPELL_STAGGERING_ROAR, SPELL_SUMMON_VALKYR, SPELL_WOE_STRIKE, summons, ThrowGUID, UNIT_FLAG_NOT_SELECTABLE, UNIT_STATE_CASTING, UNIT_STATE_ROOT, UNIT_VIRTUAL_ITEM_SLOT_ID, CreatureAI::UpdateVictim(), ValkyrGUID, YELL_AGGRO_2, YELL_ANHYLDE_2, and YELL_DEAD_1.

Member Data Documentation

◆ events

EventMap boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::events

◆ pInstance

InstanceScript* boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::pInstance

◆ summons

SummonList boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::summons

◆ ThrowGUID

ObjectGuid boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::ThrowGUID

Referenced by JustSummoned(), Reset(), and UpdateAI().

◆ ValkyrGUID

ObjectGuid boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::ValkyrGUID

Referenced by JustSummoned(), Reset(), and UpdateAI().