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

Public Member Functions

 boss_ingvar_the_plunderer (Creature *c)
 
void Reset () override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
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()
 
- 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)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, 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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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.
 
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, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
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.
 
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.
 
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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_ingvar_the_plunderer()

boss_ingvar_the_plunderer::boss_ingvar_the_plunderer ( Creature c)
inline
93 : ScriptedAI(c), summons(me)
94 {
96 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1242
Definition ScriptedCreature.h:191
Creature * me
Definition ScriptedCreature.h:281
SummonList summons
Definition boss_ingvar_the_plunderer.cpp:100
InstanceScript * pInstance
Definition boss_ingvar_the_plunderer.cpp:98

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ DamageTaken()

void boss_ingvar_the_plunderer::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 UnitAI.

122 {
123 // Residual damage (e.g. DoT ticks) during the feign death would restart
124 // the death sequence, repeating the yell and delaying Annhylde
126 {
127 if (damage >= me->GetHealth())
128 damage = me->GetHealth() - 1;
129 return;
130 }
131
132 if (me->GetDisplayId() == DISPLAYID_DEFAULT && damage >= me->GetHealth())
133 {
134 damage = me->GetHealth() - 1;
139 me->DisableRotate(false);
142 me->StopMoving();
143 FeignDeath(true);
144 events.Reset();
145 events.RescheduleEvent(EVENT_START_RESURRECTION, 1s);
146 events.RescheduleEvent(EVENT_YELL_DEAD_1, 0ms);
147 }
148 }
@ UNIT_FLAG2_FEIGN_DEATH
Definition UnitDefines.h:296
@ UNIT_STATE_ROOT
Definition UnitDefines.h:183
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
@ EVENT_YELL_DEAD_1
Definition boss_ingvar_the_plunderer.cpp:73
@ EVENT_START_RESURRECTION
Definition boss_ingvar_the_plunderer.cpp:72
@ DISPLAYID_DEFAULT
Definition boss_ingvar_the_plunderer.cpp:24
events
Definition boss_sartura.cpp:43
void MovementExpired(bool reset=true)
Definition MotionMaster.h:206
void MoveIdle()
Definition MotionMaster.cpp:235
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4312
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
bool HasUnitFlag2(UnitFlags2 flags) const
Definition Unit.h:754
void StopMoving()
Definition Unit.cpp:13034
void DisableRotate(bool apply)
Definition Unit.cpp:14535
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:14305
uint32 GetDisplayId() const
Definition Unit.h:1974
uint32 GetHealth() const
Definition Unit.h:1109
void RemoveAllAuras()
Definition Unit.cpp:5612
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
void FeignDeath(bool apply)
Definition boss_ingvar_the_plunderer.cpp:193

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

◆ EnterEvadeMode()

void boss_ingvar_the_plunderer::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

224 {
226 me->DisableRotate(false);
228 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235

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

◆ FeignDeath()

void boss_ingvar_the_plunderer::FeignDeath ( bool  apply)
inline
194 {
195 if (apply)
196 {
201 }
202 else
203 {
208 }
209 }
@ UNIT_DYNFLAG_DEAD
Definition SharedDefines.h:3359
@ UNIT_STAND_STATE_DEAD
Definition UnitDefines.h:42
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:35
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition UnitDefines.h:286
virtual void RemoveDynamicFlag(uint32 flag)
Definition Object.h:126
virtual void SetDynamicFlag(uint32 flag)
Definition Object.h:125
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:755
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:756
void SetStandState(uint8 state)
Definition Unit.cpp:13126
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:750

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::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

212 {
213 events.Reset();
216 if (pInstance)
217 {
220 }
221 }
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition DBCEnums.h:122
@ DONE
Definition InstanceScript.h:61
@ YELL_DEAD_2
Definition boss_ingvar_the_plunderer.cpp:44
@ NPC_INGVAR_UNDEAD
Definition boss_ingvar_the_plunderer.cpp:30
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition InstanceScript.cpp:674
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
Talk
Definition hyjal.cpp:82
@ DATA_INGVAR
Definition utgarde_keep.h:33

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::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

151 {
152 events.Reset();
153 // schedule Phase 1 abilities
154 events.RescheduleEvent(EVENT_SPELL_ROAR, 15s);
155 events.RescheduleEvent(EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, 2s);
156 events.RescheduleEvent(EVENT_SPELL_SMASH, 5s);
157 events.RescheduleEvent(EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, 10s);
158
161
162 if (pInstance)
164 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ EVENT_SPELL_SMASH
Definition boss_ingvar_the_plunderer.cpp:85
@ EVENT_SPELL_ROAR
Definition boss_ingvar_the_plunderer.cpp:83
@ EVENT_SPELL_CLEAVE_OR_WOE_STRIKE
Definition boss_ingvar_the_plunderer.cpp:84
@ EVENT_SPELL_ENRAGE_OR_SHADOW_AXE
Definition boss_ingvar_the_plunderer.cpp:86
@ YELL_AGGRO_1
Definition boss_ingvar_the_plunderer.cpp:38
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true, uint8 attackerLevel=0)
Definition Creature.cpp:3872
uint32 GetMaxHealth() const
Definition Unit.h:1110

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::JustSummoned ( Creature s)
inlineoverridevirtual

Reimplemented from CreatureAI.

167 {
168 summons.Summon(s);
169 if (s->GetEntry() == NPC_ANNHYLDE)
170 {
171 ValkyrGUID = s->GetGUID();
172 s->SetCanFly(true);
173 s->SetDisableGravity(true);
174 s->SetPosition(s->GetPositionX(), s->GetPositionY(), s->GetPositionZ() + 35.0f, s->GetOrientation());
176 }
177 else if (s->GetEntry() == NPC_THROW)
178 {
179 ThrowGUID = s->GetGUID();
180 if (Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true))
181 s->GetMotionMaster()->MovePoint(0, t->GetPositionX(), t->GetPositionY(), t->GetPositionZ());
182 }
183 }
@ NPC_ANNHYLDE
Definition boss_ingvar_the_plunderer.cpp:31
@ NPC_THROW
Definition boss_ingvar_the_plunderer.cpp:32
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3293
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
uint32 GetEntry() const
Definition Object.h:117
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
Definition Unit.h:665
void SetFacingTo(float ori)
Definition Unit.cpp:16455
void SetCanFly(bool enable)
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Unit.cpp:16566
void SetDisableGravity(bool disable)
Definition Unit.cpp:16506
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
ObjectGuid ValkyrGUID
Definition boss_ingvar_the_plunderer.cpp:101
ObjectGuid ThrowGUID
Definition boss_ingvar_the_plunderer.cpp:102

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

◆ KilledUnit()

void boss_ingvar_the_plunderer::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

186 {
189 else
191 }
@ 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::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

105 {
108 events.Reset();
111 me->LoadEquipment(1);
112 FeignDeath(false);
115 me->DisableRotate(false);
116
117 if (pInstance)
119 }
@ NOT_STARTED
Definition InstanceScript.h:58
void LoadEquipment(int8 id=1, bool force=false)
Definition Creature.cpp:1791
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition Creature.cpp:3533
void Clear()
Definition ObjectGuid.h:141

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::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

231 {
232 if (!UpdateVictim())
233 return;
234
235 events.Update(diff);
236
238 return;
239
240 switch (events.ExecuteEvent())
241 {
242 case 0:
243 break;
246 break;
249 events.RescheduleEvent(EVENT_VALKYR_BEAM, 7s);
250 events.RescheduleEvent(EVENT_VALKYR_MOVE, 1ms);
251 events.RescheduleEvent(EVENT_ANNHYLDE_YELL, 3s);
252 break;
255 s->GetMotionMaster()->MovePoint(1, s->GetPositionX(), s->GetPositionY(), s->GetPositionZ() - 15.0f);
256 break;
259 s->AI()->Talk(YELL_ANHYLDE_2);
260 break;
264 c->CastSpell(me, SPELL_RESURRECTION_BEAM, false);
265 events.RescheduleEvent(EVENT_RESURRECTION_BALL, 4s);
266 break;
269 events.RescheduleEvent(EVENT_RESURRECTION_HEAL, 4s);
270 break;
274 FeignDeath(false);
275 events.RescheduleEvent(EVENT_MORPH_TO_UNDEAD, 3s);
276 break;
279 events.RescheduleEvent(EVENT_START_PHASE_2, 1s);
280 break;
283 {
284 c->DespawnOrUnsummon();
286 }
290 me->CastSpell((Unit*)nullptr, SPELL_DREADFUL_ROAR, false);
292
293 // schedule Phase 2 abilities
294 events.RescheduleEvent(EVENT_SPELL_ROAR, 15s);
295 events.RescheduleEvent(EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, 2s);
296 events.RescheduleEvent(EVENT_SPELL_SMASH, 5s);
297 events.RescheduleEvent(EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, 10s);
298
299 break;
300
301 // ABILITIES HERE:
302 case EVENT_UNROOT:
304 me->DisableRotate(false);
305 break;
306 case EVENT_SPELL_ROAR:
308
310 me->CastSpell((Unit*)nullptr, SPELL_STAGGERING_ROAR, false);
311 else
312 me->CastSpell((Unit*)nullptr, SPELL_DREADFUL_ROAR, false);
313 events.Repeat(15s, 20s);
314 break;
317 {
318 events.Repeat(3s);
319 break;
320 }
322 me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
323 else
325 events.Repeat(3s, 7s);
326 break;
329 {
330 events.Repeat(3s);
331 break;
332 }
334 me->DisableRotate(true);
337 me->CastSpell((Unit*)nullptr, SPELL_SMASH, false);
338 else
339 me->CastSpell((Unit*)nullptr, SPELL_DARK_SMASH, false);
340 events.Repeat(9s, 11s);
341 events.RescheduleEvent(EVENT_UNROOT, 3750ms);
342 break;
345 {
346 me->CastSpell(me, SPELL_ENRAGE, false);
347 events.Repeat(10s);
348 }
349 else
350 {
351 me->CastSpell((Unit*)nullptr, SPELL_SHADOW_AXE, true);
353 events.Repeat(35s);
354 events.RescheduleEvent(EVENT_AXE_RETURN, 10s);
355 }
356 break;
357 case EVENT_AXE_RETURN:
359 c->GetMotionMaster()->MoveCharge(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
360 events.RescheduleEvent(EVENT_AXE_PICKUP, 1500ms);
361 break;
362 case EVENT_AXE_PICKUP:
364 {
365 c->DestroyForVisiblePlayers();
366 c->DespawnOrUnsummon();
368 }
370 SetEquipmentSlots(true);
371 break;
372 }
373
376 }
@ EQUIP_UNEQUIP
Definition CreatureAI.h:65
@ EQUIP_NO_CHANGE
Definition CreatureAI.h:64
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition UpdateFields.h:116
@ EVENT_ANNHYLDE_YELL
Definition boss_ingvar_the_plunderer.cpp:75
@ EVENT_START_PHASE_2
Definition boss_ingvar_the_plunderer.cpp:80
@ EVENT_RESURRECTION_HEAL
Definition boss_ingvar_the_plunderer.cpp:78
@ EVENT_RESURRECTION_BALL
Definition boss_ingvar_the_plunderer.cpp:77
@ EVENT_MORPH_TO_UNDEAD
Definition boss_ingvar_the_plunderer.cpp:79
@ EVENT_AXE_RETURN
Definition boss_ingvar_the_plunderer.cpp:87
@ EVENT_VALKYR_MOVE
Definition boss_ingvar_the_plunderer.cpp:74
@ EVENT_VALKYR_BEAM
Definition boss_ingvar_the_plunderer.cpp:76
@ EVENT_AXE_PICKUP
Definition boss_ingvar_the_plunderer.cpp:88
@ EVENT_UNROOT
Definition boss_ingvar_the_plunderer.cpp:82
@ 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
@ SPELL_CLEAVE
Definition boss_ingvar_the_plunderer.cpp:60
@ SPELL_ENRAGE
Definition boss_ingvar_the_plunderer.cpp:62
@ SPELL_SUMMON_VALKYR
Definition boss_ingvar_the_plunderer.cpp:53
@ SPELL_SHADOW_AXE
Definition boss_ingvar_the_plunderer.cpp:67
@ SPELL_DREADFUL_ROAR
Definition boss_ingvar_the_plunderer.cpp:64
@ SPELL_STAGGERING_ROAR
Definition boss_ingvar_the_plunderer.cpp:59
@ 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:66
@ SPELL_SMASH
Definition boss_ingvar_the_plunderer.cpp:61
@ SPELL_RESURRECTION_HEAL
Definition boss_ingvar_the_plunderer.cpp:56
@ SPELL_WOE_STRIKE
Definition boss_ingvar_the_plunderer.cpp:65
bool UpdateVictim()
Definition CreatureAI.cpp:350
Definition Creature.h:47
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:316
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:298
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5050
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:748
void SendMovementFlagUpdate(bool self=false)
Definition Unit.cpp:13088
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:1361
Unit * GetVictim() const
Definition Unit.h:904
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
Definition ScriptedCreature.cpp:557
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228

References 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::events

◆ pInstance

InstanceScript* boss_ingvar_the_plunderer::pInstance

◆ summons

SummonList boss_ingvar_the_plunderer::summons

◆ ThrowGUID

ObjectGuid boss_ingvar_the_plunderer::ThrowGUID

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

◆ ValkyrGUID

ObjectGuid boss_ingvar_the_plunderer::ValkyrGUID

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


The documentation for this struct was generated from the following file: