AzeorthCore 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 EnterCombat (Unit *) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void KilledUnit (Unit *) override
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 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 EnterCombat (Unit *)
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== 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 *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

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
 
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_mograineAI()

npc_mograine::npc_mograineAI::npc_mograineAI ( Creature creature)
inline
298 : ScriptedAI(creature)
299 {
300 instance = creature->GetInstanceScript();
301 }
Definition: ScriptedCreature.h:177
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
InstanceScript * instance
Definition: instance_scarlet_monastery.cpp:534

References WorldObject::GetInstanceScript(), and instance.

Member Function Documentation

◆ AshbringerEvent()

uint32 npc_mograine::npc_mograineAI::AshbringerEvent ( uint32  uiSteps)
inline
304 {
306
307 switch (uiSteps)
308 {
309 case 1:
310 me->GetMotionMaster()->MovePoint(0, 1152.039795f, 1398.405518f, 32.527878f);
311 return 2 * IN_MILLISECONDS;
312 case 2:
315 return 2 * IN_MILLISECONDS;
316 case 3:
317 Talk(3);
318 return 10 * IN_MILLISECONDS;
319 case 4:
320 me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000)->SetName("Highlord Mograine");
322 return 30 * IN_MILLISECONDS;
323 case 5:
324 mograine->StopMovingOnCurrentPos();
325 mograine->AI()->Talk(0);
327 return 4 * IN_MILLISECONDS;
328 case 6:
330 return 2 * IN_MILLISECONDS;
331 case 7:
332 Talk(4);
333 return 4 * IN_MILLISECONDS;
334 case 8:
335 mograine->AI()->Talk(1);
336 return 11 * IN_MILLISECONDS;
337 case 9:
339 return 4 * IN_MILLISECONDS;
340 case 10:
343 Talk(5);
344 return 2 * IN_MILLISECONDS;
345 case 11:
346 mograine->CastSpell(me, SPELL_FORGIVENESS, false);
347 return 1 * IN_MILLISECONDS;
348 case 12:
349 mograine->CastSpell(me, SPELL_COSMETIC_CHAIN, true);
350 return 0.5 * IN_MILLISECONDS;
351 case 13:
352 mograine->AI()->Talk(2);
353 mograine->DespawnOrUnsummon(3 * IN_MILLISECONDS);
354 mograine->Kill(me, me, true);
355 return 0;
356 default:
357 if(mograine)
358 mograine->DespawnOrUnsummon(0);
359 return 0;
360 }
361 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ UNIT_STAND_STATE_KNEEL
Definition: Unit.h:61
@ UNIT_STAND_STATE_STAND
Definition: Unit.h:53
@ SHEATH_STATE_UNARMED
Definition: Unit.h:126
@ SPELL_COSMETIC_CHAIN
Definition: instance_scarlet_monastery.cpp:193
@ NPC_HIGHLORD_MOGRAINE
Definition: instance_scarlet_monastery.cpp:192
@ SPELL_FORGIVENESS
Definition: instance_scarlet_monastery.cpp:195
Talk
Definition: boss_fathomlord_karathress.cpp:23
@ EMOTE_ONESHOT_POINT
Definition: SharedDefines.h:1889
@ EMOTE_ONESHOT_BATTLE_ROAR
Definition: SharedDefines.h:1908
@ FACTION_FRIENDLY
Definition: SharedDefines.h:173
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:58
Creature * me
Definition: ScriptedCreature.h:267
Definition: Creature.h:46
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2092
CreatureAI * AI() const
Definition: Creature.h:134
void SetName(std::string const &newname)
Definition: Object.h:447
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2395
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr) const
Definition: Object.cpp:2304
void SetFaction(uint32 faction)
Definition: Unit.cpp:10017
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:17770
MotionMaster * GetMotionMaster()
Definition: Unit.h:2258
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1491
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16793
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1958
void SetStandState(uint8 state)
Definition: Unit.cpp:16830
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210

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 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

421 {
422 if (damage < me->GetHealth() || hasDied || fakeDeath)
423 return;
424
425 //On first death, fake death and open door, as well as initiate whitemane if exist
427 {
429 Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f);
432 me->SetHealth(0);
433 if (me->IsNonMeleeSpellCast(false))
440
441 hasDied = true;
442 fakeDeath = true;
443 damage = 0;
445 }
446 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ SPELL_PERMANENT_FEIGN_DEATH
Definition: instance_scarlet_monastery.cpp:265
@ DATA_WHITEMANE
Definition: instance_scarlet_monastery.cpp:47
@ TYPE_MOGRAINE_AND_WHITE_EVENT
Definition: instance_scarlet_monastery.cpp:44
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:204
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
void SetInCombatWithZone()
Definition: Creature.cpp:2705
Definition: Unit.h:1290
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4057
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:4027
void SetHealth(uint32 val)
Definition: Unit.cpp:15335
void ClearComboPointHolders()
Definition: Unit.cpp:16998
void ClearAllReactives()
Definition: Unit.cpp:17006
void RemoveAllAuras()
Definition: Unit.cpp:5227
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1480
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:178
void MoveIdle()
Definition: MotionMaster.cpp:231
bool fakeDeath
Definition: instance_scarlet_monastery.cpp:532
bool hasDied
Definition: instance_scarlet_monastery.cpp:530

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.

◆ EnterCombat()

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

Reimplemented from ScriptedAI.

412 {
415 events.ScheduleEvent(EVENT_PULL_CATHEDRAL, 1000); // Has to be done via event, otherwise mob aggroing Mograine DOES NOT aggro the room
416 events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, urand(1000, 5000));
417 events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, urand(6000, 11000));
418 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SAY_MO_AGGRO
Definition: instance_scarlet_monastery.cpp:279
@ SPELL_RETRIBUTION_AURA
Definition: instance_scarlet_monastery.cpp:264
@ EVENT_SPELL_CRUSADER_STRIKE
Definition: instance_scarlet_monastery.cpp:246
@ EVENT_SPELL_HAMMER_OF_JUSTICE
Definition: instance_scarlet_monastery.cpp:247
@ EVENT_PULL_CATHEDRAL
Definition: instance_scarlet_monastery.cpp:248
events
Definition: boss_sartura.cpp:43

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

◆ KilledUnit()

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

Reimplemented from ScriptedAI.

449 {
451 }
@ SAY_MO_KILL
Definition: instance_scarlet_monastery.cpp:280

References SAY_MO_KILL.

◆ MoveInLineOfSight()

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

Reimplemented from CreatureAI.

395 {
396 if (who && who->GetDistance2d(me) < 15.0f)
397 if (Player* player = who->ToPlayer())
398 if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer)
399 {
403 me->SetFacingToObject(player);
404 // me->Yell(12389, LANG_UNIVERSAL, player); // Doesn't exist
405 SayAshbringer = true;
406 }
407
409 }
@ AURA_ASHBRINGER
Definition: instance_scarlet_monastery.cpp:190
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:156
Player * ToPlayer()
Definition: Object.h:195
float GetDistance2d(WorldObject const *obj) const
Definition: Object.cpp:1263
Definition: Player.h:1046
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20653
bool SayAshbringer
Definition: instance_scarlet_monastery.cpp:527

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
364 {
365 std::list<Creature*> creatureList;
372 for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
373 {
374 if (Creature* creature = *itr)
375 creature->AI()->AttackStart(me->GetVictim());
376 }
377 }
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:721
@ NPC_SCARLET_ABBOT
Definition: instance_scarlet_monastery.cpp:32
@ NPC_SCARLET_MONK
Definition: instance_scarlet_monastery.cpp:33
@ NPC_SCARLET_WIZARD
Definition: instance_scarlet_monastery.cpp:31
@ NPC_SCARLET_CHAPLAIN
Definition: instance_scarlet_monastery.cpp:35
@ NPC_SCARLET_CENTURION
Definition: instance_scarlet_monastery.cpp:29
@ NPC_SCARLET_CHAMPION
Definition: instance_scarlet_monastery.cpp:34
float const CATHEDRAL_PULL_RANGE
Definition: instance_scarlet_monastery.cpp:289
Unit * GetVictim() const
Definition: Unit.h:1386

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.

380 {
381 //Incase wipe during phase that mograine fake death
385 SayAshbringer = false;
386 timer = 0;
387 step = 1;
388 hasDied = false;
389 heal = false;
390 fakeDeath = false;
391 events.Reset();
392 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4823
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1481
bool heal
Definition: instance_scarlet_monastery.cpp:531
int timer
Definition: instance_scarlet_monastery.cpp:528
int step
Definition: instance_scarlet_monastery.cpp:529

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.

454 {
455 //When hit with resurrection say text
456 if (spell->Id == SPELL_SCARLET_RESURRECTION)
457 {
459 fakeDeath = false;
461 }
462 }
@ SPECIAL
Definition: InstanceScript.h:60
@ SAY_MO_RESURRECTED
Definition: instance_scarlet_monastery.cpp:281
@ SPELL_SCARLET_RESURRECTION
Definition: instance_scarlet_monastery.cpp:268

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

Reimplemented from ScriptedAI.

465 {
466 timer = timer - diff;
467 if (SayAshbringer && step < 15)
468 {
469 if (timer <= 0)
470 {
472 step++;
473 }
474 }
475
476 if (!UpdateVictim())
477 return;
478
480 {
481 //On resurrection, stop fake death and heal whitemane and resume fight
483 {
484 //Incase wipe during phase that mograine fake death
489 me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS, true);
490 events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, urand(1000, 5000));
491 events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, urand(6000, 11000));
492 if (me->GetVictim())
494 heal = true;
495 }
496 }
497
498 //This if-check to make sure mograine does not attack while fake death
499 if (fakeDeath)
500 return;
501
502 events.Update(diff);
504 return;
505
506 while (uint32 eventId = events.ExecuteEvent())
507 {
508 switch(eventId)
509 {
512 events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10000);
513 break;
516 events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60000);
517 break;
520 break;
521 }
522 }
524 }
std::uint32_t uint32
Definition: Define.h:108
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ SPELL_HAMMER_OF_JUSTICE
Definition: instance_scarlet_monastery.cpp:262
@ SPELL_CRUSADER_STRIKE
Definition: instance_scarlet_monastery.cpp:261
@ SPELL_LAY_ON_HANDS
Definition: instance_scarlet_monastery.cpp:263
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
bool UpdateVictim()
Definition: CreatureAI.cpp:268
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:299
void PullCathedral()
Definition: instance_scarlet_monastery.cpp:363
uint32 AshbringerEvent(uint32 uiSteps)
Definition: instance_scarlet_monastery.cpp:303

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, CreatureAI::UpdateVictim(), and urand().

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