TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_argent_captainAI Struct Reference

Public Member Functions

 npc_argent_captainAI (Creature *creature)
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *victim) override
 
void DoAction (int32 action) override
 
void EnterCombat (Unit *) override
 
bool CanAIAttack (Unit const *target) const override
 
void EnterEvadeMode (EvadeReason why) override
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
virtual void UpdateAI (uint32 diff) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
void Reset () 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 DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
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 constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, 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
 
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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.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 void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
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 sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Protected Attributes

EventMap Events
 
InstanceScriptinstance
 
float FollowAngle
 
float FollowDist
 
bool IsUndead
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Private Attributes

bool _firstDeath
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from ScriptedAI
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)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 

Constructor & Destructor Documentation

npc_argent_captainAI::npc_argent_captainAI ( Creature creature)
inline
1229  : ScriptedAI(creature), instance(creature->GetInstanceScript()), _firstDeath(true)
1230  {
1233  IsUndead = false;
1234  }
#define PET_FOLLOW_ANGLE
Definition: PetDefines.h:78
float FollowAngle
Definition: icecrown_citadel.cpp:1342
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * instance
Definition: icecrown_citadel.cpp:1341
bool _firstDeath
Definition: icecrown_citadel.cpp:1347
float FollowDist
Definition: icecrown_citadel.cpp:1343
bool IsUndead
Definition: icecrown_citadel.cpp:1344
#define PET_FOLLOW_DIST
Definition: PetDefines.h:77

Member Function Documentation

bool npc_argent_captainAI::CanAIAttack ( Unit const target) const
inlineoverridevirtual

Reimplemented from UnitAI.

1281  {
1282  // do not see targets inside Frostwing Halls when we are not there
1283  return (me->GetPositionY() > 2660.0f) == (target->GetPositionY() > 2660.0f);
1284  }
Creature *const me
Definition: CreatureAI.h:71
float GetPositionY() const
Definition: Position.h:105

+ Here is the call graph for this function:

void npc_argent_captainAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

1254  {
1255  if (action == ACTION_START_GAUNTLET)
1256  {
1258  {
1260  FollowAngle = me->GetAngle(crok) + me->GetOrientation();
1261  FollowDist = me->GetDistance2d(crok);
1263  }
1264 
1265  me->setActive(true);
1266  }
1267  else if (action == ACTION_RESET_EVENT)
1268  {
1269  _firstDeath = true;
1270  }
1271  }
float FollowAngle
Definition: icecrown_citadel.cpp:1342
Definition: MotionMaster.h:60
void setActive(bool isActiveObject)
Definition: Object.cpp:1473
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: icecrown_citadel.h:107
Definition: Unit.h:1130
Definition: icecrown_citadel.cpp:269
InstanceScript * instance
Definition: icecrown_citadel.cpp:1341
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
float GetOrientation() const
Definition: Position.h:107
bool _firstDeath
Definition: icecrown_citadel.cpp:1347
float GetAngle(Position const *pos) const
Definition: Position.cpp:63
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
float FollowDist
Definition: icecrown_citadel.cpp:1343
float GetDistance2d(WorldObject const *obj) const
Definition: Object.cpp:1612
Definition: icecrown_citadel.cpp:272
void SetReactState(ReactStates st)
Definition: Creature.h:502
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
Definition: MotionMaster.cpp:265

+ Here is the call graph for this function:

void npc_argent_captainAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1274  {
1275  me->SetHomePosition(*me);
1276  if (IsUndead)
1277  DoZoneInCombat();
1278  }
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:670
Creature *const me
Definition: CreatureAI.h:71
bool IsUndead
Definition: icecrown_citadel.cpp:1344

+ Here is the call graph for this function:

void npc_argent_captainAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

1287  {
1288  // not yet following
1290  {
1292  return;
1293  }
1294 
1295  if (!_EnterEvadeMode(why))
1296  return;
1297 
1298  if (!me->GetVehicle())
1299  {
1300  me->GetMotionMaster()->Clear(false);
1303  }
1304 
1305  Reset();
1306  }
float FollowAngle
Definition: icecrown_citadel.cpp:1342
void Clear(bool reset=true)
Definition: MotionMaster.h:138
Definition: MotionMaster.h:60
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: icecrown_citadel.h:107
InstanceScript * instance
Definition: icecrown_citadel.cpp:1341
Definition: Creature.h:467
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:255
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
MovementGeneratorType GetMotionSlotType(int slot) const
Definition: MotionMaster.cpp:671
void Reset() override
Definition: ScriptedCreature.h:192
float FollowDist
Definition: icecrown_citadel.cpp:1343
Vehicle * GetVehicle() const
Definition: Unit.h:2166
bool IsUndead
Definition: icecrown_citadel.cpp:1344
Definition: MotionMaster.h:43
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
Definition: MotionMaster.cpp:265

+ Here is the call graph for this function:

void npc_argent_captainAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1237  {
1238  if (_firstDeath)
1239  {
1240  _firstDeath = false;
1242  }
1243  else
1245  }
Definition: icecrown_citadel.cpp:93
Definition: icecrown_citadel.cpp:96
bool _firstDeath
Definition: icecrown_citadel.cpp:1347
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

void npc_argent_captainAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1248  {
1249  if (victim->GetTypeId() == TYPEID_PLAYER)
1251  }
Definition: icecrown_citadel.cpp:95
TypeID GetTypeId() const
Definition: Object.h:113
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: ObjectGuid.h:33

+ Here is the call graph for this function:

void npc_argent_captainAI::SpellHit ( Unit ,
SpellInfo const spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1309  {
1310  if (spell->Id == SPELL_REVIVE_CHAMPION && !IsUndead)
1311  {
1312  IsUndead = true;
1314  uint32 newEntry = 0;
1315  switch (me->GetEntry())
1316  {
1317  case NPC_CAPTAIN_ARNATH:
1318  newEntry = NPC_CAPTAIN_ARNATH_UNDEAD;
1319  break;
1320  case NPC_CAPTAIN_BRANDON:
1321  newEntry = NPC_CAPTAIN_BRANDON_UNDEAD;
1322  break;
1323  case NPC_CAPTAIN_GRONDEL:
1324  newEntry = NPC_CAPTAIN_GRONDEL_UNDEAD;
1325  break;
1326  case NPC_CAPTAIN_RUPERT:
1327  newEntry = NPC_CAPTAIN_RUPERT_UNDEAD;
1328  break;
1329  default:
1330  return;
1331  }
1332 
1334  me->UpdateEntry(newEntry, me->GetCreatureData());
1335  DoCast(me, SPELL_UNDEATH, true);
1336  }
1337  }
Definition: icecrown_citadel.cpp:94
CreatureData const * GetCreatureData() const
Definition: Creature.h:559
Definition: icecrown_citadel.cpp:129
Creature *const me
Definition: CreatureAI.h:71
void setDeathState(DeathState s) override
Definition: Creature.cpp:1624
Definition: Unit.h:545
Definition: icecrown_citadel.h:263
Definition: icecrown_citadel.h:260
uint32_t uint32
Definition: Define.h:150
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: icecrown_citadel.cpp:128
Definition: icecrown_citadel.h:259
Definition: icecrown_citadel.h:264
bool IsUndead
Definition: icecrown_citadel.cpp:1344
uint32 GetEntry() const
Definition: Object.h:107
Definition: icecrown_citadel.h:265
bool UpdateEntry(uint32 entry, CreatureData const *data=nullptr)
Definition: Creature.cpp:407
Definition: icecrown_citadel.h:258
Definition: icecrown_citadel.h:262
Definition: icecrown_citadel.h:261

+ Here is the call graph for this function:

Member Data Documentation

bool npc_argent_captainAI::_firstDeath
private
EventMap npc_argent_captainAI::Events
protected
float npc_argent_captainAI::FollowAngle
protected
float npc_argent_captainAI::FollowDist
protected
InstanceScript* npc_argent_captainAI::instance
protected
bool npc_argent_captainAI::IsUndead
protected

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