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

Public Member Functions

 npc_mograineAI (Creature *creature)
 
uint32 AshbringerEvent (uint32 uiSteps)
 
void PullCathedral ()
 
void Reset () override
 
void MoveInLineOfSight (Unit *who) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void KilledUnit (Unit *) override
 
void SpellHit (Unit *, SpellInfo const *spell) 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
 
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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 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
 

Private Attributes

bool SayAshbringer = false
 
int timer = 0
 
int step = 1
 
bool hasDied
 
bool heal
 
bool fakeDeath
 
EventMap events
 
InstanceScriptinstance
 

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 ()
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- 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

◆ npc_mograineAI()

npc_mograine::npc_mograineAI::npc_mograineAI ( Creature creature)
inline
261 : ScriptedAI(creature)
262 {
263 instance = creature->GetInstanceScript();
264 }
Definition: ScriptedCreature.h:190
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
InstanceScript * instance
Definition: instance_scarlet_monastery.cpp:497

References WorldObject::GetInstanceScript(), and instance.

Member Function Documentation

◆ AshbringerEvent()

uint32 npc_mograine::npc_mograineAI::AshbringerEvent ( uint32  uiSteps)
inline
267 {
269
270 switch (uiSteps)
271 {
272 case 1:
273 me->GetMotionMaster()->MovePoint(0, 1152.039795f, 1398.405518f, 32.527878f);
274 return 2 * IN_MILLISECONDS;
275 case 2:
278 return 2 * IN_MILLISECONDS;
279 case 3:
280 Talk(3);
281 return 10 * IN_MILLISECONDS;
282 case 4:
283 me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000)->SetName("Highlord Mograine");
285 return 30 * IN_MILLISECONDS;
286 case 5:
287 mograine->StopMovingOnCurrentPos();
288 mograine->AI()->Talk(0);
290 return 4 * IN_MILLISECONDS;
291 case 6:
293 return 2 * IN_MILLISECONDS;
294 case 7:
295 Talk(4);
296 return 4 * IN_MILLISECONDS;
297 case 8:
298 mograine->AI()->Talk(1);
299 return 11 * IN_MILLISECONDS;
300 case 9:
302 return 4 * IN_MILLISECONDS;
303 case 10:
306 Talk(5);
307 return 2 * IN_MILLISECONDS;
308 case 11:
309 mograine->CastSpell(me, SPELL_FORGIVENESS, false);
310 return 1 * IN_MILLISECONDS;
311 case 12:
312 mograine->CastSpell(me, SPELL_COSMETIC_CHAIN, true);
313 return 0.5 * IN_MILLISECONDS;
314 case 13:
315 mograine->AI()->Talk(2);
316 mograine->DespawnOrUnsummon(3 * IN_MILLISECONDS);
317 mograine->Kill(me, me, true);
318 return 0;
319 default:
320 if (mograine)
321 mograine->DespawnOrUnsummon(0);
322 return 0;
323 }
324 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
Talk
Definition: hyjal.cpp:82
@ SPELL_COSMETIC_CHAIN
Definition: instance_scarlet_monastery.cpp:202
@ NPC_HIGHLORD_MOGRAINE
Definition: instance_scarlet_monastery.cpp:201
@ SPELL_FORGIVENESS
Definition: instance_scarlet_monastery.cpp:204
@ EMOTE_ONESHOT_POINT
Definition: SharedDefines.h:1917
@ EMOTE_ONESHOT_BATTLE_ROAR
Definition: SharedDefines.h:1936
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
@ UNIT_STAND_STATE_KNEEL
Definition: UnitDefines.h:40
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
@ SHEATH_STATE_UNARMED
Definition: UnitDefines.h:105
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.
Definition: CreatureAI.cpp:50
Creature * me
Definition: ScriptedCreature.h:280
Definition: Creature.h:43
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
CreatureAI * AI() const
Definition: Creature.h:140
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
void SetName(std::string const &newname)
Definition: Object.h:464
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17702
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1639
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:1167
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16689
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:2000
void SetStandState(uint8 state)
Definition: Unit.cpp:16726
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213

References Creature::AI(), Unit::CastSpell(), Creature::DespawnOrUnsummon(), EMOTE_ONESHOT_BATTLE_ROAR, EMOTE_ONESHOT_POINT, FACTION_FRIENDLY, WorldObject::FindNearestCreature(), Unit::GetMotionMaster(), Unit::HandleEmoteCommand(), IN_MILLISECONDS, Unit::Kill(), ScriptedAI::me, MotionMaster::MovePoint(), NPC_HIGHLORD_MOGRAINE, Unit::SetFaction(), WorldObject::SetName(), Unit::SetSheath(), Unit::SetStandState(), SHEATH_STATE_UNARMED, SPELL_COSMETIC_CHAIN, SPELL_FORGIVENESS, Unit::StopMovingOnCurrentPos(), WorldObject::SummonCreature(), CreatureAI::Talk(), TEMPSUMMON_TIMED_DESPAWN, UNIT_STAND_STATE_KNEEL, and UNIT_STAND_STATE_STAND.

Referenced by UpdateAI().

◆ DamageTaken()

void npc_mograine::npc_mograineAI::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.

384 {
385 if (damage < me->GetHealth() || hasDied || fakeDeath)
386 return;
387
388 //On first death, fake death and open door, as well as initiate whitemane if exist
390 {
392 Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f);
395 me->SetHealth(0);
396 if (me->IsNonMeleeSpellCast(false))
403
404 hasDied = true;
405 fakeDeath = true;
406 damage = 0;
408 }
409 }
@ SPELL_PERMANENT_FEIGN_DEATH
Definition: instance_scarlet_monastery.cpp:228
@ DATA_WHITEMANE
Definition: instance_scarlet_monastery.cpp:48
@ TYPE_MOGRAINE_AND_WHITE_EVENT
Definition: instance_scarlet_monastery.cpp:45
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:199
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
Definition: Unit.h:630
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4129
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:4099
void SetHealth(uint32 val)
Definition: Unit.cpp:15478
void ClearComboPointHolders()
Definition: Unit.cpp:16919
void ClearAllReactives()
Definition: Unit.cpp:16927
void RemoveAllAuras()
Definition: Unit.cpp:5319
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:180
void MoveIdle()
Definition: MotionMaster.cpp:232
bool fakeDeath
Definition: instance_scarlet_monastery.cpp:495
bool hasDied
Definition: instance_scarlet_monastery.cpp:493

References Unit::CastSpell(), Unit::ClearAllReactives(), Unit::ClearComboPointHolders(), DATA_WHITEMANE, fakeDeath, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), ObjectAccessor::GetUnit(), hasDied, IN_PROGRESS, instance, Unit::InterruptNonMeleeSpells(), Unit::IsNonMeleeSpellCast(), ScriptedAI::me, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), Unit::RemoveAllAuras(), ZoneScript::SetData(), Unit::SetHealth(), Creature::SetInCombatWithZone(), Unit::SetUnitFlag(), SPELL_PERMANENT_FEIGN_DEATH, TYPE_MOGRAINE_AND_WHITE_EVENT, and UNIT_FLAG_NOT_SELECTABLE.

◆ JustEngagedWith()

void npc_mograine::npc_mograineAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

375 {
378 events.ScheduleEvent(EVENT_PULL_CATHEDRAL, 1s); // Has to be done via event, otherwise mob aggroing Mograine DOES NOT aggro the room
379 events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 1s, 5s);
380 events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 6s, 11s);
381 }
events
Definition: boss_sartura.cpp:43
@ SAY_MO_AGGRO
Definition: instance_scarlet_monastery.cpp:242
@ SPELL_RETRIBUTION_AURA
Definition: instance_scarlet_monastery.cpp:227
@ EVENT_SPELL_CRUSADER_STRIKE
Definition: instance_scarlet_monastery.cpp:209
@ EVENT_SPELL_HAMMER_OF_JUSTICE
Definition: instance_scarlet_monastery.cpp:210
@ EVENT_PULL_CATHEDRAL
Definition: instance_scarlet_monastery.cpp:211

References Unit::CastSpell(), EVENT_PULL_CATHEDRAL, EVENT_SPELL_CRUSADER_STRIKE, EVENT_SPELL_HAMMER_OF_JUSTICE, ScriptedAI::me, SAY_MO_AGGRO, and SPELL_RETRIBUTION_AURA.

◆ KilledUnit()

void npc_mograine::npc_mograineAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

412 {
414 }
@ SAY_MO_KILL
Definition: instance_scarlet_monastery.cpp:243

References SAY_MO_KILL.

◆ MoveInLineOfSight()

void npc_mograine::npc_mograineAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

358 {
359 if (who && who->GetDistance2d(me) < 15.0f)
360 if (Player* player = who->ToPlayer())
361 if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer)
362 {
366 me->SetFacingToObject(player);
367 // me->Yell(12389, LANG_UNIVERSAL, player); // Doesn't exist
368 SayAshbringer = true;
369 }
370
372 }
@ AURA_ASHBRINGER
Definition: instance_scarlet_monastery.cpp:199
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:169
Player * ToPlayer()
Definition: Object.h:201
float GetDistance2d(WorldObject const *obj) const
Definition: Object.cpp:1274
Definition: Player.h:1081
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20537
bool SayAshbringer
Definition: instance_scarlet_monastery.cpp:490

References AURA_ASHBRINGER, FACTION_FRIENDLY, WorldObject::GetDistance2d(), ScriptedAI::me, CreatureAI::MoveInLineOfSight(), SayAshbringer, Unit::SetFacingToObject(), Unit::SetFaction(), Unit::SetSheath(), Unit::SetStandState(), SHEATH_STATE_UNARMED, Object::ToPlayer(), and UNIT_STAND_STATE_KNEEL.

◆ PullCathedral()

void npc_mograine::npc_mograineAI::PullCathedral ( )
inline
327 {
328 std::list<Creature*> creatureList;
335 for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
336 {
337 if (Creature* creature = *itr)
338 creature->AI()->AttackStart(me->GetVictim());
339 }
340 }
@ NPC_SCARLET_ABBOT
Definition: instance_scarlet_monastery.cpp:33
@ NPC_SCARLET_MONK
Definition: instance_scarlet_monastery.cpp:34
@ NPC_SCARLET_WIZARD
Definition: instance_scarlet_monastery.cpp:32
@ NPC_SCARLET_CHAPLAIN
Definition: instance_scarlet_monastery.cpp:36
@ NPC_SCARLET_CENTURION
Definition: instance_scarlet_monastery.cpp:30
@ NPC_SCARLET_CHAMPION
Definition: instance_scarlet_monastery.cpp:35
float const CATHEDRAL_PULL_RANGE
Definition: instance_scarlet_monastery.cpp:252
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:860
Unit * GetVictim() const
Definition: Unit.h:853

References CATHEDRAL_PULL_RANGE, GetCreatureListWithEntryInGrid(), Unit::GetVictim(), ScriptedAI::me, NPC_SCARLET_ABBOT, NPC_SCARLET_CENTURION, NPC_SCARLET_CHAMPION, NPC_SCARLET_CHAPLAIN, NPC_SCARLET_MONK, and NPC_SCARLET_WIZARD.

Referenced by UpdateAI().

◆ Reset()

void npc_mograine::npc_mograineAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

343 {
344 //Incase wipe during phase that mograine fake death
348 SayAshbringer = false;
349 timer = 0;
350 step = 1;
351 hasDied = false;
352 heal = false;
353 fakeDeath = false;
354 events.Reset();
355 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
bool heal
Definition: instance_scarlet_monastery.cpp:494
int timer
Definition: instance_scarlet_monastery.cpp:491
int step
Definition: instance_scarlet_monastery.cpp:492

References fakeDeath, hasDied, heal, ScriptedAI::me, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), SayAshbringer, SPELL_PERMANENT_FEIGN_DEATH, step, timer, UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.

◆ SpellHit()

void npc_mograine::npc_mograineAI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

417 {
418 //When hit with resurrection say text
419 if (spell->Id == SPELL_SCARLET_RESURRECTION)
420 {
422 fakeDeath = false;
424 }
425 }
@ SAY_MO_RESURRECTED
Definition: instance_scarlet_monastery.cpp:244
@ SPELL_SCARLET_RESURRECTION
Definition: instance_scarlet_monastery.cpp:231
@ SPECIAL
Definition: InstanceScript.h:61

References fakeDeath, SpellInfo::Id, instance, SAY_MO_RESURRECTED, ZoneScript::SetData(), SPECIAL, SPELL_SCARLET_RESURRECTION, and TYPE_MOGRAINE_AND_WHITE_EVENT.

◆ UpdateAI()

void npc_mograine::npc_mograineAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

428 {
429 timer = timer - diff;
430 if (SayAshbringer && step < 15)
431 {
432 if (timer <= 0)
433 {
435 step++;
436 }
437 }
438
439 if (!UpdateVictim())
440 return;
441
443 {
444 //On resurrection, stop fake death and heal whitemane and resume fight
446 {
447 //Incase wipe during phase that mograine fake death
452 me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS, true);
453 events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 1s, 5s);
454 events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 6s, 11s);
455 if (me->GetVictim())
457 heal = true;
458 }
459 }
460
461 //This if-check to make sure mograine does not attack while fake death
462 if (fakeDeath)
463 return;
464
465 events.Update(diff);
467 return;
468
469 while (uint32 eventId = events.ExecuteEvent())
470 {
471 switch (eventId)
472 {
475 events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10s);
476 break;
479 events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60s);
480 break;
483 break;
484 }
485 }
487 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_HAMMER_OF_JUSTICE
Definition: instance_scarlet_monastery.cpp:225
@ SPELL_CRUSADER_STRIKE
Definition: instance_scarlet_monastery.cpp:224
@ SPELL_LAY_ON_HANDS
Definition: instance_scarlet_monastery.cpp:226
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:280
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
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
void PullCathedral()
Definition: instance_scarlet_monastery.cpp:326
uint32 AshbringerEvent(uint32 uiSteps)
Definition: instance_scarlet_monastery.cpp:266

References AshbringerEvent(), Unit::CastSpell(), DATA_WHITEMANE, UnitAI::DoMeleeAttackIfReady(), EVENT_PULL_CATHEDRAL, EVENT_SPELL_CRUSADER_STRIKE, EVENT_SPELL_HAMMER_OF_JUSTICE, fakeDeath, ZoneScript::GetData(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), ObjectAccessor::GetUnit(), Unit::GetVictim(), hasDied, Unit::HasUnitState(), heal, instance, ScriptedAI::me, MotionMaster::MoveChase(), PullCathedral(), Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), SayAshbringer, SPECIAL, SPELL_CRUSADER_STRIKE, SPELL_HAMMER_OF_JUSTICE, SPELL_LAY_ON_HANDS, SPELL_PERMANENT_FEIGN_DEATH, SPELL_RETRIBUTION_AURA, step, timer, TYPE_MOGRAINE_AND_WHITE_EVENT, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ events

EventMap npc_mograine::npc_mograineAI::events
private

◆ fakeDeath

bool npc_mograine::npc_mograineAI::fakeDeath
private

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

◆ hasDied

bool npc_mograine::npc_mograineAI::hasDied
private

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

◆ heal

bool npc_mograine::npc_mograineAI::heal
private

Referenced by Reset(), and UpdateAI().

◆ instance

InstanceScript* npc_mograine::npc_mograineAI::instance
private

◆ SayAshbringer

bool npc_mograine::npc_mograineAI::SayAshbringer = false
private

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

◆ step

int npc_mograine::npc_mograineAI::step = 1
private

Referenced by Reset(), and UpdateAI().

◆ timer

int npc_mograine::npc_mograineAI::timer = 0
private

Referenced by Reset(), and UpdateAI().