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.
 
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 (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 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
 
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=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)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 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 IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (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 *)
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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, 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 JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
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)
 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
 
- 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
104 : ScriptedAI(c), summons(me)
105 {
107 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
SummonList summons
Definition boss_ingvar_the_plunderer.cpp:111
InstanceScript * pInstance
Definition boss_ingvar_the_plunderer.cpp:109

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.

133 {
134 if (me->GetDisplayId() == DISPLAYID_DEFAULT && damage >= me->GetHealth())
135 {
136 damage = 0;
141 me->DisableRotate(false);
144 me->StopMoving();
145 FeignDeath(true);
146 events.Reset();
147 events.RescheduleEvent(EVENT_START_RESURRECTION, 1s);
148 events.RescheduleEvent(EVENT_YELL_DEAD_1, 0ms);
149 }
150 }
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:275
@ 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 MovementExpired(bool reset=true)
Definition MotionMaster.h:180
void MoveIdle()
Definition MotionMaster.cpp:232
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4161
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
void StopMoving()
Definition Unit.cpp:16702
void DisableRotate(bool apply)
Definition Unit.cpp:18327
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18086
uint32 GetDisplayId() const
Definition Unit.h:1887
uint32 GetHealth() const
Definition Unit.h:1038
void RemoveAllAuras()
Definition Unit.cpp:5351
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:719
void FeignDeath(bool apply)
Definition boss_ingvar_the_plunderer.cpp:195

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::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

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

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

◆ FeignDeath()

void boss_ingvar_the_plunderer::FeignDeath ( bool  apply)
inline
196 {
197 if (apply)
198 {
203 }
204 else
205 {
210 }
211 }
@ UNIT_DYNFLAG_DEAD
Definition SharedDefines.h:3126
@ UNIT_FLAG2_FEIGN_DEATH
Definition UnitDefines.h:289
@ 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:279
virtual void RemoveDynamicFlag(uint32 flag)
Definition Object.h:124
virtual void SetDynamicFlag(uint32 flag)
Definition Object.h:123
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:725
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:726
void SetStandState(uint8 state)
Definition Unit.cpp:16778
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:720

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.

214 {
215 events.Reset();
218 if (pInstance)
219 {
222 }
223 }
@ 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:656
void DespawnAll(uint32 delay=0)
Definition ScriptedCreature.cpp:71
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.

Reimplemented from CreatureAI.

153 {
154 events.Reset();
155 // schedule Phase 1 abilities
156 events.RescheduleEvent(EVENT_SPELL_ROAR, 15s);
157 events.RescheduleEvent(EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, 2s);
158 events.RescheduleEvent(EVENT_SPELL_SMASH, 5s);
159 events.RescheduleEvent(EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, 10s);
160
163
164 if (pInstance)
166 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ 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:3823
uint32 GetMaxHealth() const
Definition Unit.h:1039

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.

169 {
170 summons.Summon(s);
171 if (s->GetEntry() == NPC_ANNHYLDE)
172 {
173 ValkyrGUID = s->GetGUID();
174 s->SetCanFly(true);
175 s->SetDisableGravity(true);
176 s->SetPosition(s->GetPositionX(), s->GetPositionY(), s->GetPositionZ() + 35.0f, s->GetOrientation());
178 }
179 else if (s->GetEntry() == NPC_THROW)
180 {
181 ThrowGUID = s->GetGUID();
182 if (Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true))
183 s->GetMotionMaster()->MovePoint(0, t->GetPositionX(), t->GetPositionY(), t->GetPositionZ());
184 }
185 }
@ NPC_ANNHYLDE
Definition boss_ingvar_the_plunderer.cpp:31
@ NPC_THROW
Definition boss_ingvar_the_plunderer.cpp:32
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:3222
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3171
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:3307
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:213
uint32 GetEntry() const
Definition Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
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:110
Definition Unit.h:636
void SetFacingTo(float ori)
Definition Unit.cpp:20581
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:112
ObjectGuid ThrowGUID
Definition boss_ingvar_the_plunderer.cpp:113

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

◆ KilledUnit()

void boss_ingvar_the_plunderer::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

188 {
191 else
193 }
@ 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.

116 {
119 events.Reset();
122 me->LoadEquipment(1);
123 FeignDeath(false);
126 me->DisableRotate(false);
127
128 if (pInstance)
130 }
@ NOT_STARTED
Definition InstanceScript.h:58
void LoadEquipment(int8 id=1, bool force=false)
Definition Creature.cpp:1804
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition Creature.cpp:3535
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::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

233 {
234 if (!UpdateVictim())
235 return;
236
237 events.Update(diff);
238
240 return;
241
242 switch (events.ExecuteEvent())
243 {
244 case 0:
245 break;
248 break;
251 events.RescheduleEvent(EVENT_VALKYR_BEAM, 7s);
252 events.RescheduleEvent(EVENT_VALKYR_MOVE, 1ms);
253 events.RescheduleEvent(EVENT_ANNHYLDE_YELL, 3s);
254 break;
257 s->GetMotionMaster()->MovePoint(1, s->GetPositionX(), s->GetPositionY(), s->GetPositionZ() - 15.0f);
258 break;
261 s->AI()->Talk(YELL_ANHYLDE_2);
262 break;
266 c->CastSpell(me, SPELL_RESURRECTION_BEAM, false);
267 events.RescheduleEvent(EVENT_RESURRECTION_BALL, 4s);
268 break;
271 events.RescheduleEvent(EVENT_RESURRECTION_HEAL, 4s);
272 break;
276 FeignDeath(false);
277 events.RescheduleEvent(EVENT_MORPH_TO_UNDEAD, 3s);
278 break;
281 events.RescheduleEvent(EVENT_START_PHASE_2, 1s);
282 break;
285 {
286 c->DespawnOrUnsummon();
288 }
293
294 // schedule Phase 2 abilities
295 events.RescheduleEvent(EVENT_SPELL_ROAR, 15s);
296 events.RescheduleEvent(EVENT_SPELL_CLEAVE_OR_WOE_STRIKE, 2s);
297 events.RescheduleEvent(EVENT_SPELL_SMASH, 5s);
298 events.RescheduleEvent(EVENT_SPELL_ENRAGE_OR_SHADOW_AXE, 10s);
299
300 break;
301
302 // ABILITIES HERE:
303 case EVENT_UNROOT:
305 me->DisableRotate(false);
306 break;
307 case EVENT_SPELL_ROAR:
309
312
314 me->CastSpell((Unit*)nullptr, SPELL_STAGGERING_ROAR, false);
315 else
316 me->CastSpell((Unit*)nullptr, SPELL_DREADFUL_ROAR, false);
317 events.Repeat(15s, 20s);
318 break;
321 {
322 events.Repeat(3s);
323 break;
324 }
326 me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
327 else
329 events.Repeat(3s, 7s);
330 break;
333 {
334 events.Repeat(3s);
335 break;
336 }
338 me->DisableRotate(true);
341 me->CastSpell((Unit*)nullptr, SPELL_SMASH, false);
342 else
343 me->CastSpell((Unit*)nullptr, SPELL_DARK_SMASH, false);
344 events.Repeat(9s, 11s);
345 events.RescheduleEvent(EVENT_UNROOT, 3750ms);
346 break;
349 {
350 me->CastSpell(me, SPELL_ENRAGE, false);
351 events.Repeat(10s);
352 }
353 else
354 {
355 me->CastSpell((Unit*)nullptr, SPELL_SHADOW_AXE, true);
357 events.Repeat(35s);
358 events.RescheduleEvent(EVENT_AXE_RETURN, 10s);
359 }
360 break;
361 case EVENT_AXE_RETURN:
363 c->GetMotionMaster()->MoveCharge(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
364 events.RescheduleEvent(EVENT_AXE_PICKUP, 1500ms);
365 break;
366 case EVENT_AXE_PICKUP:
368 {
369 c->DestroyForNearbyPlayers();
370 c->DespawnOrUnsummon();
372 }
374 SetEquipmentSlots(true);
375 break;
376 }
377
380 }
@ EQUIP_UNEQUIP
Definition CreatureAI.h:66
@ EQUIP_NO_CHANGE
Definition CreatureAI.h:65
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ 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
bool UpdateVictim()
Definition CreatureAI.cpp:280
Definition Creature.h:43
void _AddCreatureSpellCooldown(uint32 spell_id, uint16 categoryId, uint32 end_time)
Definition Creature.cpp:2869
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
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:305
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4808
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:718
void SendMovementFlagUpdate(bool self=false)
Definition Unit.cpp:16756
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:1178
Unit * GetVictim() const
Definition Unit.h:862
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:210
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
Definition ScriptedCreature.cpp:529
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:210

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