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

Public Member Functions

 npc_tirions_gambit_tirionAI (Creature *creature)
 
void Reset () override
 
void SetData (uint32 type, uint32 data) override
 
void DoAction (int32 param) override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void WaypointReached (uint32 pointId) override
 
void DoSummonAction (uint32 entry, uint8 id, int32 param=0)
 
void UpdateEscortAI (uint32 diff) override
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void UpdateEscortAI (uint32 diff)
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointReached (uint32 pointId)=0
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast. More...
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished. More...
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

EventMap events
 
SummonList summons
 
- 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 npc_escortAI
PlayerGetPlayerForEscort ()
 
- 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_tirions_gambit_tirionAI()

npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::npc_tirions_gambit_tirionAI ( Creature creature)
inline
693 : npc_escortAI(creature), summons(me)
694 {
695 }
Creature * me
Definition: ScriptedCreature.h:280
Definition: ScriptedEscortAI.h:53
SummonList summons
Definition: zone_icecrown.cpp:698

Member Function Documentation

◆ DoAction()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

713 {
714 if (param == ACTION_START_EVENT)
715 {
716 me->setActive(true);
717
718 Talk(0);
719 events.Reset();
721 Start(false, false);
722
723 int8 i = -1;
724 std::list<Creature*> cList;
726 for (std::list<Creature*>::const_iterator itr = cList.begin(); itr != cList.end(); ++itr, ++i)
727 {
728 (*itr)->SetWalk(true);
729 (*itr)->GetMotionMaster()->MoveFollow(me, 1.0f, Position::NormalizeOrientation(M_PI * i / 2.0f));
730 summons.Summon(*itr);
731 }
732 }
733 }
std::int8_t int8
Definition: Define.h:105
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:827
@ ACTION_START_EVENT
Definition: zone_icecrown.cpp:648
@ NPC_DISGUISED_CRUSADER
Definition: zone_icecrown.cpp:659
Talk
Definition: hyjal.cpp:82
events
Definition: boss_sartura.cpp:43
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void Start(bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition: ScriptedEscortAI.cpp:449
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
static float NormalizeOrientation(float o)
Definition: Position.h:233

References ACTION_START_EVENT, SummonList::DespawnAll(), GetCreatureListWithEntryInGrid(), ScriptedAI::me, Position::NormalizeOrientation(), NPC_DISGUISED_CRUSADER, WorldObject::setActive(), npc_escortAI::Start(), SummonList::Summon(), and summons.

◆ DoSummonAction()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::DoSummonAction ( uint32  entry,
uint8  id,
int32  param = 0 
)
inline
785 {
786 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
787 if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
788 if (summon->GetEntry() == entry)
789 {
790 switch (id)
791 {
793 summon->GetMotionMaster()->MovePoint(1, summon->GetPositionX() - param, summon->GetPositionY() + param * 2 + 3, summon->GetPositionZ());
794 break;
796 summon->SetUInt32Value(UNIT_NPC_EMOTESTATE, param);
797 break;
799 summon->DespawnOrUnsummon(param);
800 break;
802 summon->SetFacingTo(param / 100.0f);
803 break;
805 summon->AI()->Talk(param);
806 break;
808 summon->SetStandState(param);
809 break;
810 }
811 }
812 }
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ ACTION_SUMMON_EMOTE
Definition: zone_icecrown.cpp:650
@ ACTION_SUMMON_STAND_STATE
Definition: zone_icecrown.cpp:654
@ ACTION_SUMMON_MOVE_STRAIGHT
Definition: zone_icecrown.cpp:649
@ ACTION_SUMMON_DESPAWN
Definition: zone_icecrown.cpp:651
@ ACTION_SUMMON_TALK
Definition: zone_icecrown.cpp:653
@ ACTION_SUMMON_ORIENTATION
Definition: zone_icecrown.cpp:652
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
iterator begin()
Definition: ScriptedCreature.h:48
StorageType::const_iterator const_iterator
Definition: ScriptedCreature.h:37
iterator end()
Definition: ScriptedCreature.h:58
Definition: Creature.h:46

References ACTION_SUMMON_DESPAWN, ACTION_SUMMON_EMOTE, ACTION_SUMMON_MOVE_STRAIGHT, ACTION_SUMMON_ORIENTATION, ACTION_SUMMON_STAND_STATE, ACTION_SUMMON_TALK, SummonList::begin(), SummonList::end(), ObjectAccessor::GetCreature(), ScriptedAI::me, summons, and UNIT_NPC_EMOTESTATE.

Referenced by UpdateEscortAI().

◆ JustSummoned()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

736 {
737 summons.Summon(summon);
738 if (summon->GetEntry() == NPC_CHOSEN_ZEALOT || summon->GetEntry() == NPC_TIRION_LICH_KING)
739 summon->SetWalk(true);
740 else if (summon->GetEntry() != NPC_INVOKER_BASALEPH)
741 {
743 summon->SetImmuneToAll(true);
744 summon->GetMotionMaster()->MovePoint(4, 6135.97f, 2753.84f, 573.92f);
745 }
746 }
@ NPC_INVOKER_BASALEPH
Definition: zone_icecrown.cpp:661
@ NPC_CHOSEN_ZEALOT
Definition: zone_icecrown.cpp:662
@ NPC_TIRION_LICH_KING
Definition: zone_icecrown.cpp:663
@ EMOTE_STATE_READY2H
Definition: SharedDefines.h:1970
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition: Creature.cpp:3178
uint32 GetEntry() const
Definition: Object.h:112
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21256
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:810
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211

References EMOTE_STATE_READY2H, Object::GetEntry(), Unit::GetMotionMaster(), MotionMaster::MovePoint(), NPC_CHOSEN_ZEALOT, NPC_INVOKER_BASALEPH, NPC_TIRION_LICH_KING, Unit::SetImmuneToAll(), Unit::SetUInt32Value(), Creature::SetWalk(), SummonList::Summon(), summons, and UNIT_NPC_EMOTESTATE.

◆ Reset()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

701 {
702 me->setActive(false);
704 }
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
void SetStandState(uint8 state)
Definition: Unit.cpp:16682

References ScriptedAI::me, WorldObject::setActive(), Unit::SetStandState(), and UNIT_STAND_STATE_STAND.

◆ SetData()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from UnitAI.

707 {
708 if (type == 1 && data == 1)
709 events.ScheduleEvent(EVENT_SCENE_0 + 30, 10s);
710 }
@ EVENT_SCENE_0
Definition: zone_icecrown.cpp:657

References EVENT_SCENE_0.

◆ SummonedCreatureDespawn()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

749 {
750 summons.Despawn(summon);
751 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:89

References SummonList::Despawn(), and summons.

◆ UpdateEscortAI()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

815 {
816 events.Update(diff);
817 switch (events.ExecuteEvent())
818 {
820 Talk(2);
822
823 me->SummonCreature(NPC_CHOSEN_ZEALOT, 6160.74f, 2695.90f, 573.92f, 2.04f, TEMPSUMMON_TIMED_DESPAWN, 5 * MINUTE * IN_MILLISECONDS);
824 me->SummonCreature(NPC_CHOSEN_ZEALOT, 6164.98f, 2697.90f, 573.92f, 2.04f, TEMPSUMMON_TIMED_DESPAWN, 5 * MINUTE * IN_MILLISECONDS);
825 me->SummonCreature(NPC_CHOSEN_ZEALOT, 6161.26f, 2700.05f, 573.92f, 2.04f, TEMPSUMMON_TIMED_DESPAWN, 5 * MINUTE * IN_MILLISECONDS);
826
828 events.ScheduleEvent(EVENT_SCENE_0, 30s);
829 break;
830 case EVENT_SCENE_0:
832 me->SummonGameObject(GO_FROZEN_HEART, 6132.38f, 2760.76f, 574.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 180);
833 events.ScheduleEvent(EVENT_SCENE_0 + 1, 10s);
834 break;
835 case EVENT_SCENE_0+1:
837 events.ScheduleEvent(EVENT_SCENE_0 + 2, 2s);
838 break;
839 case EVENT_SCENE_0+2:
842 events.ScheduleEvent(EVENT_SCENE_0 + 3, 2s);
843 break;
844 case EVENT_SCENE_0+3:
845 Talk(3);
846 if (Creature* cr = me->SummonCreature(NPC_TIRION_LICH_KING, 6161.26f, 2700.05f, 573.92f, 2.04f, TEMPSUMMON_TIMED_DESPAWN, 5 * MINUTE * IN_MILLISECONDS))
847 cr->GetMotionMaster()->MovePoint(2, 6131.93f, 2756.84f, 573.92f);
848 events.ScheduleEvent(EVENT_SCENE_0 + 4, 4s);
849 break;
850 case EVENT_SCENE_0+4:
851 Talk(4);
852 me->SetFacingTo(4.42f);
853 events.ScheduleEvent(EVENT_SCENE_0 + 5, 25s);
854 break;
855 case EVENT_SCENE_0+5:
857 events.ScheduleEvent(EVENT_SCENE_0 + 6, 4s);
858 break;
859 case EVENT_SCENE_0+6:
861 me->LoadEquipment(2, true);
862 SetEscortPaused(false);
863 events.ScheduleEvent(EVENT_SCENE_0 + 7, 6s);
864 break;
865 case EVENT_SCENE_0+7:
867 break;
868 case EVENT_SCENE_0+8:
869 Talk(5);
870 events.ScheduleEvent(EVENT_SCENE_0 + 9, 5s);
871 break;
872 case EVENT_SCENE_0+9:
874 events.ScheduleEvent(EVENT_SCENE_0 + 10, 11s);
875 break;
876 case EVENT_SCENE_0+10:
877 Talk(6);
878 events.ScheduleEvent(EVENT_SCENE_0 + 11, 6s);
879 break;
880 case EVENT_SCENE_0+11:
882 events.ScheduleEvent(EVENT_SCENE_0 + 12, 7s);
883 break;
884 case EVENT_SCENE_0+12:
886 events.ScheduleEvent(EVENT_SCENE_0 + 13, 5s);
887 break;
888 case EVENT_SCENE_0+13:
889 Talk(7);
890 events.ScheduleEvent(EVENT_SCENE_0 + 14, 14s);
891 break;
892 case EVENT_SCENE_0+14:
893 Talk(8);
894 events.ScheduleEvent(EVENT_SCENE_0 + 15, 3s);
895 break;
896 case EVENT_SCENE_0+15:
897 {
899 events.ScheduleEvent(EVENT_SCENE_0 + 16, 1200ms);
900 uint8 i = 0;
901 for (SummonList::iterator itr = summons.begin(); itr != summons.end(); ++itr, ++i)
902 if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
903 if (summon->GetEntry() == NPC_DISGUISED_CRUSADER)
904 {
905 summon->SetWalk(false);
906 summon->GetMotionMaster()->MovePoint(2, 6132.38f + 4 * cos(2 * M_PI * (i / 3.0)), 2760.76f + 4 * std::sin(2 * M_PI * (i / 3.0)), me->GetPositionZ());
907 }
908 break;
909 }
910 case EVENT_SCENE_0+16:
916 go->Delete();
917 events.ScheduleEvent(EVENT_SCENE_0 + 17, 2s);
918 break;
919 case EVENT_SCENE_0+17:
921 events.ScheduleEvent(EVENT_SCENE_0 + 170, 3s);
922 break;
923 case EVENT_SCENE_0+170:
927 cr->AI()->Talk(0);
928 events.ScheduleEvent(EVENT_SCENE_0 + 18, 1s);
929 break;
930 case EVENT_SCENE_0+18:
931 {
933
934 std::list<Creature*> zealotList;
935 Position pos1 = {6160.0f, 2765.0f, 573.92f, 0.0f};
936 Position pos2 = {6115.0f, 2742.0f, 573.92f, 0.0f};
938 for (std::list<Creature*>::const_iterator itr = zealotList.begin(); itr != zealotList.end(); ++itr)
939 {
940 (*itr)->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY_UNARMED);
941 if ((*itr)->GetPositionX() > 6150.0f)
942 {
943 Position tpos = pos1;
944 (*itr)->MovePosition(tpos, frand(1.0f, 14.0f), frand(3.14f, 4.14f));
945 (*itr)->GetMotionMaster()->MovePoint(3, tpos.GetPositionX(), tpos.GetPositionY(), tpos.GetPositionZ());
946 }
947 else
948 {
949 Position tpos = pos2;
950 (*itr)->MovePosition(tpos, frand(1.0f, 14.0f), frand(0.0f, 1.0f));
951 (*itr)->GetMotionMaster()->MovePoint(3, tpos.GetPositionX(), tpos.GetPositionY(), tpos.GetPositionZ());
952 }
953 }
954
955 events.ScheduleEvent(EVENT_SCENE_0 + 19, 3s);
956 break;
957 }
958 case EVENT_SCENE_0+19:
960 events.ScheduleEvent(EVENT_SCENE_0 + 20, 3700ms);
961 break;
962 case EVENT_SCENE_0+20:
963 {
964 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
965 if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
966 {
967 summon->SetImmuneToAll(false);
968 if (summon->GetEntry() >= NPC_TIRION_EBON_KNIGHT && summon->GetEntry() <= NPC_TIRION_MOGRAINE)
969 {
970 if (summon->GetEntry() == NPC_TIRION_MOGRAINE)
971 summon->SetHomePosition(6135.97f, 2753.84f, 573.92f, 3.70f);
972 else
973 summon->SetHomePosition(6138.36f + frand(-2.0f, 2.0f), 2749.25f + frand(-2.0f, 2.0f), 573.92f, 2.03f);
974 }
975 }
977 std::list<Creature*> zealotList;
980 for (std::list<Creature*>::const_iterator itr = zealotList.begin(); itr != zealotList.end(); ++itr)
981 {
982 if (!target)
983 target = (*itr)->SelectNearestTarget(40.0f);
984 if (target)
985 (*itr)->AI()->AttackStart(target);
986 }
987
988 break;
989 }
990 case EVENT_SCENE_0+30:
991 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
992 if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
993 if (summon->GetEntry() >= NPC_TIRION_EBON_KNIGHT && summon->GetEntry() <= NPC_TIRION_MOGRAINE)
994 {
995 if (summon->GetEntry() == NPC_TIRION_MOGRAINE)
996 summon->GetMotionMaster()->MovePoint(6, 6135.97f, 2753.84f, 573.92f);
997 else
998 summon->GetMotionMaster()->MovePoint(6, 6138.36f + frand(-2.0f, 2.0f), 2749.25f + frand(-2.0f, 2.0f), 573.92f);
999 }
1000
1001 events.ScheduleEvent(EVENT_SCENE_0 + 310, 4s);
1002 break;
1003 case EVENT_SCENE_0+310:
1006 me->SummonGameObject(GO_ESCAPE_PORTAL, 6133.83f, 2757.24f, 573.914f, 1.97f, 0.0f, 0.0f, 0.0f, 0.0f, 60);
1008 events.ScheduleEvent(EVENT_SCENE_0 + 31, 6s);
1010 break;
1011 case EVENT_SCENE_0+31:
1013 events.ScheduleEvent(EVENT_SCENE_0 + 32, 7s);
1014 break;
1015 case EVENT_SCENE_0+32:
1017 events.ScheduleEvent(EVENT_SCENE_0 + 33, 7s);
1018 break;
1019 case EVENT_SCENE_0+33:
1020 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
1021 if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
1022 {
1023 if (summon->GetEntry() == NPC_TIRION_LICH_KING)
1024 summon->CastSpell(summon, SPELL_LICH_KINGS_FURY, false);
1025 summon->DespawnOrUnsummon(summon->GetEntry() == NPC_TIRION_LICH_KING ? 10000 : 4000);
1026 }
1027 me->DespawnOrUnsummon(10000);
1028 break;
1029 }
1030 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto MINUTE
Definition: Common.h:47
float frand(float min, float max)
Definition: Random.cpp:57
std::uint8_t uint8
Definition: Define.h:109
@ UNIT_STAND_STATE_DEAD
Definition: UnitDefines.h:39
@ UNIT_STAND_STATE_KNEEL
Definition: UnitDefines.h:40
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:47
@ SPELL_LICH_KINGS_FURY
Definition: zone_icecrown.cpp:675
@ SPELL_HEART_EXPLOSION
Definition: zone_icecrown.cpp:673
@ SPELL_TIRION_SMASH_HEART
Definition: zone_icecrown.cpp:672
@ EVENT_START_SCENE
Definition: zone_icecrown.cpp:656
@ SPELL_HEART_EXPLOSION_EFF
Definition: zone_icecrown.cpp:674
@ NPC_TIRION_MOGRAINE
Definition: zone_icecrown.cpp:667
@ GO_FROZEN_HEART
Definition: zone_icecrown.cpp:669
@ SPELL_TIRIONS_GAMBIT_CREDIT
Definition: zone_icecrown.cpp:676
@ NPC_TIRION_THASSARIAN
Definition: zone_icecrown.cpp:665
@ GO_ESCAPE_PORTAL
Definition: zone_icecrown.cpp:670
@ NPC_TIRION_EBON_KNIGHT
Definition: zone_icecrown.cpp:664
@ EMOTE_STATE_READY_UNARMED
Definition: SharedDefines.h:1919
@ EMOTE_ONESHOT_NONE
Definition: SharedDefines.h:1894
StorageType::iterator iterator
Definition: ScriptedCreature.h:36
void SetEscortPaused(bool on)
Definition: ScriptedEscortAI.cpp:523
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1793
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
Definition: GameObject.h:121
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:2355
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2455
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3084
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2369
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition: Object.cpp:2432
Definition: Position.h:28
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
Definition: Unit.h:630
void SetFacingTo(float ori)
Definition: Unit.cpp:20483
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 DoSummonAction(uint32 entry, uint8 id, int32 param=0)
Definition: zone_icecrown.cpp:784

References ACTION_SUMMON_DESPAWN, ACTION_SUMMON_EMOTE, ACTION_SUMMON_MOVE_STRAIGHT, ACTION_SUMMON_ORIENTATION, ACTION_SUMMON_STAND_STATE, ACTION_SUMMON_TALK, SummonList::begin(), Unit::CastSpell(), Creature::DespawnOrUnsummon(), DoSummonAction(), EMOTE_ONESHOT_NONE, EMOTE_STATE_READY2H, EMOTE_STATE_READY_UNARMED, SummonList::end(), EVENT_SCENE_0, EVENT_START_SCENE, WorldObject::FindNearestCreature(), WorldObject::FindNearestGameObject(), frand(), ObjectAccessor::GetCreature(), WorldObject::GetCreaturesWithEntryInRange(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_ESCAPE_PORTAL, GO_FROZEN_HEART, IN_MILLISECONDS, Creature::LoadEquipment(), ScriptedAI::me, MINUTE, NPC_CHOSEN_ZEALOT, NPC_DISGUISED_CRUSADER, NPC_TIRION_EBON_KNIGHT, NPC_TIRION_LICH_KING, NPC_TIRION_MOGRAINE, NPC_TIRION_THASSARIAN, npc_escortAI::SetEscortPaused(), Unit::SetFacingTo(), Unit::SetStandState(), SPELL_HEART_EXPLOSION, SPELL_HEART_EXPLOSION_EFF, SPELL_LICH_KINGS_FURY, SPELL_TIRION_SMASH_HEART, SPELL_TIRIONS_GAMBIT_CREDIT, WorldObject::SummonCreature(), WorldObject::SummonCreatureGroup(), WorldObject::SummonGameObject(), summons, TEMPSUMMON_TIMED_DESPAWN, UNIT_NPC_EMOTESTATE, UNIT_STAND_STATE_DEAD, UNIT_STAND_STATE_KNEEL, and UNIT_STAND_STATE_STAND.

◆ WaypointReached()

void npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::WaypointReached ( uint32  pointId)
inlineoverridevirtual

Implements npc_escortAI.

754 {
755 switch (pointId)
756 {
757 case 6:
758 me->SummonCreature(NPC_INVOKER_BASALEPH, 6130.26f, 2764.83f, 573.92f, 5.19f, TEMPSUMMON_TIMED_DESPAWN, 10 * MINUTE * IN_MILLISECONDS);
759 Talk(1);
760 break;
761 case 15:
762 {
763 uint8 i = 1;
764 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr, ++i)
765 if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
766 if (summon->GetEntry() == NPC_DISGUISED_CRUSADER)
767 {
768 summon->GetMotionMaster()->Clear(false);
769 summon->GetMotionMaster()->MovePoint(1, 6165.3f + 3 * i, 2759.85f + 1.5f * i, 573.914f);
770 }
771 break;
772 }
773 case 17:
774 SetEscortPaused(true);
775 events.ScheduleEvent(EVENT_START_SCENE, 7s);
776 break;
777 case 19:
778 SetEscortPaused(true);
779 events.ScheduleEvent(EVENT_SCENE_0 + 8, 5s);
780 break;
781 }
782 }

References SummonList::begin(), SummonList::end(), EVENT_SCENE_0, EVENT_START_SCENE, ObjectAccessor::GetCreature(), IN_MILLISECONDS, ScriptedAI::me, MINUTE, NPC_DISGUISED_CRUSADER, NPC_INVOKER_BASALEPH, npc_escortAI::SetEscortPaused(), WorldObject::SummonCreature(), summons, and TEMPSUMMON_TIMED_DESPAWN.

Member Data Documentation

◆ events

EventMap npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::events

◆ summons

SummonList npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::summons