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
 Called at any Damage from any attacker (before damage apply) More...
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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 DoTeleportPlayer (Unit *unit, Position pos)
 
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 IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
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)
 
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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
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. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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)
 To specify the caster as target if the spell is self-cast. More...
 
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, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
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)
 Called when a summon reaches a waypoint or point movement finished. More...
 
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
 

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
 
TaskScheduler scheduler
 
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:190
Creature * me
Definition: ScriptedCreature.h:280
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 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

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: UnitDefines.h:159
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ 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
events
Definition: boss_sartura.cpp:43
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4111
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
void StopMoving()
Definition: Unit.cpp:16606
void DisableRotate(bool apply)
Definition: Unit.cpp:18231
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:17990
uint32 GetDisplayId() const
Definition: Unit.h:1507
uint32 GetHealth() const
Definition: Unit.h:869
void RemoveAllAuras()
Definition: Unit.cpp:5290
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:178
void MoveIdle()
Definition: MotionMaster.cpp:232
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: UnitDefines.h:268
@ UNIT_STAND_STATE_DEAD
Definition: UnitDefines.h:39
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition: UnitDefines.h:258
@ UNIT_DYNFLAG_DEAD
Definition: SharedDefines.h:3126
virtual void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:121
virtual void SetDynamicFlag(uint32 flag)
Definition: Object.h:120
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:689
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:690
void SetStandState(uint8 state)
Definition: Unit.cpp:16682
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684

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:60
@ DATA_INGVAR
Definition: utgarde_keep.h:29
@ YELL_DEAD_2
Definition: boss_ingvar_the_plunderer.cpp:44
@ NPC_INGVAR_UNDEAD
Definition: boss_ingvar_the_plunderer.cpp:30
Talk
Definition: hyjal.cpp:82
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition: DBCEnums.h:122
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: InstanceScript.cpp:612
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:58
@ 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:3793
uint32 GetMaxHealth() const
Definition: Unit.h:870

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:110
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3192
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3149
bool SetCanFly(bool enable, bool packetOnly=false) override
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition: Creature.cpp:3277
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
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:630
void SetFacingTo(float ori)
Definition: Unit.cpp:20483
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
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:57
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1793
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition: Creature.cpp:3505
void Clear()
Definition: ObjectGuid.h:138

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  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

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:67
@ EQUIP_NO_CHANGE
Definition: CreatureAI.h:66
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition: UpdateFields.h:116
#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:213
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
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:520
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:208
Definition: Creature.h:46
void _AddCreatureSpellCooldown(uint32 spell_id, uint16 categoryId, uint32 end_time)
Definition: Creature.cpp:2847
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4758
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:682
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16660
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:1168
Unit * GetVictim() const
Definition: Unit.h:789
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:313

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().