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

Public Member Functions

 npc_gunshipAI (Creature *creature)
 
void DamageTaken (Unit *, uint32 &damage) override
 
void JustDied (Unit *) override
 
void SetGUID (ObjectGuid guid, int32 id) override
 
uint32 GetData (uint32 id) const override
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void UpdateAI (uint32) override
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 
- 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 EnterCombat (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
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 bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void DoAction (int32)
 
virtual void SetData (uint32, uint32)
 
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)
 

Private Attributes

uint32 _teamInInstance
 
std::map< ObjectGuid, uint32_shipVisits
 
bool _summonedFirstMage
 
bool _died
 

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 NullCreatureAI
static int Permissible (const Creature *)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

npc_gunship::npc_gunshipAI::npc_gunshipAI ( Creature creature)
inline
669  : NullCreatureAI(creature),
671  _summonedFirstMage(false), _died(false)
672  {
673  me->setRegeneratingHealth(false);
674  }
uint32 _teamInInstance
Definition: boss_icecrown_gunship_battle.cpp:821
void setRegeneratingHealth(bool regenHealth)
Definition: Creature.h:663
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: forge_of_souls.h:33
Creature *const me
Definition: CreatureAI.h:71
bool _died
Definition: boss_icecrown_gunship_battle.cpp:824
bool _summonedFirstMage
Definition: boss_icecrown_gunship_battle.cpp:823
NullCreatureAI(Creature *c)
Definition: PassiveAI.cpp:24

+ Here is the call graph for this function:

Member Function Documentation

void npc_gunship::npc_gunshipAI::DamageTaken ( Unit ,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from UnitAI.

677  {
678  if (damage >= me->GetHealth())
679  {
680  JustDied(NULL);
681  damage = me->GetHealth() - 1;
682  return;
683  }
684 
685  if (_summonedFirstMage)
686  return;
687 
689  return;
690 
691  if (!me->HealthBelowPctDamaged(90, damage))
692  return;
693 
694  _summonedFirstMage = true;
696  captain->AI()->DoAction(ACTION_SPAWN_MAGE);
697  }
Definition: icecrown_citadel.h:353
uint32 _teamInInstance
Definition: boss_icecrown_gunship_battle.cpp:821
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1431
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: icecrown_citadel.h:184
Definition: Creature.h:467
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
Creature *const me
Definition: CreatureAI.h:71
bool _summonedFirstMage
Definition: boss_icecrown_gunship_battle.cpp:823
Definition: icecrown_citadel.h:185
Definition: SharedDefines.h:999
Transport * GetTransport() const
Definition: Object.h:602
uint32 GetEntry() const
Definition: Object.h:107
uint32_t uint32
Definition: g3dmath.h:168
Definition: boss_icecrown_gunship_battle.cpp:203
uint32 GetHealth() const
Definition: Unit.h:1426
Definition: icecrown_citadel.h:360
void JustDied(Unit *) override
Definition: boss_icecrown_gunship_battle.cpp:699

+ Here is the call graph for this function:

uint32 npc_gunship::npc_gunshipAI::GetData ( uint32  id) const
inlineoverridevirtual

Reimplemented from UnitAI.

809  {
810  if (id != ACTION_SHIP_VISITS)
811  return 0;
812 
813  uint32 max = 0;
814  for (std::map<ObjectGuid, uint32>::const_iterator itr = _shipVisits.begin(); itr != _shipVisits.end(); ++itr)
815  max = std::max(max, itr->second);
816 
817  return max;
818  }
T max(const T &x, const T &y)
Definition: g3dmath.h:320
uint32_t uint32
Definition: Define.h:150
std::map< ObjectGuid, uint32 > _shipVisits
Definition: boss_icecrown_gunship_battle.cpp:822
Definition: boss_icecrown_gunship_battle.cpp:207

+ Here is the call graph for this function:

void npc_gunship::npc_gunshipAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

700  {
701  if (_died)
702  return;
703 
704  _died = true;
705 
707  InstanceScript* instance = me->GetInstanceScript();
708  instance->SetBossState(DATA_ICECROWN_GUNSHIP_BATTLE, isVictory ? DONE : FAIL);
710  {
711  instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature);
712  creature->RemoveAurasDueToSpell(SPELL_CHECK_FOR_PLAYERS);
713  }
714 
717 
719  std::list<Creature*> creatures;
721  for (std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
722  {
723  Creature* stalker = *itr;
724  stalker->RemoveAllAuras();
725  stalker->DeleteThreatList();
726  stalker->CombatStop(true);
727  }
728 
729  uint32 explosionSpell = isVictory ? SPELL_EXPLOSION_VICTORY : SPELL_EXPLOSION_WIPE;
730  creatures.clear();
732  for (std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
733  {
734  Creature* hull = *itr;
735  if (hull->GetTransport() != me->GetTransport())
736  continue;
737 
738  hull->CastSpell(hull, explosionSpell, TRIGGERED_FULL_MASK);
739  }
740 
741  creatures.clear();
743  for (std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
744  {
745  Creature* cannon = *itr;
746  if (isVictory)
747  {
749  cannon->RemoveVehicleKit();
750  }
751  else
753  }
754 
755  uint32 creatureEntry = NPC_IGB_MURADIN_BRONZEBEARD;
756  uint8 textId = isVictory ? SAY_MURADIN_VICTORY : SAY_MURADIN_WIPE;
757  if (_teamInInstance == HORDE)
758  {
759  creatureEntry = NPC_IGB_HIGH_OVERLORD_SAURFANG;
760  textId = isVictory ? SAY_SAURFANG_VICTORY : SAY_SAURFANG_WIPE;
761  }
762 
763  if (Creature* creature = me->FindNearestCreature(creatureEntry, 100.0f))
764  creature->AI()->Talk(textId);
765 
766  if (isVictory)
767  {
769  otherTransport->EnableMovement(true);
770 
771  me->GetTransport()->EnableMovement(true);
772 
774  {
776  ship->CastSpell(ship, SPELL_ACHIEVEMENT, TRIGGERED_FULL_MASK);
778  }
779 
780  creatures.clear();
785  for (std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
786  (*itr)->DespawnOrUnsummon(1);
787  }
788  else
789  {
792  me->m_Events.CalculateTime(8000));
793  }
794  }
Definition: InstanceScript.h:46
void RemoveAllAuras()
Definition: Unit.cpp:3920
EventProcessor m_Events
Definition: Unit.h:1948
#define SIZE_OF_GRIDS
Definition: GridDefines.h:39
Definition: boss_icecrown_gunship_battle.cpp:68
Map * GetMap() const
Definition: Object.h:543
Definition: icecrown_citadel.h:353
void RemoveVehicleKit(bool onRemoveFromWorld=false)
Definition: Unit.cpp:14318
uint32 _teamInInstance
Definition: boss_icecrown_gunship_battle.cpp:821
Definition: boss_icecrown_gunship_battle.cpp:188
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Definition: boss_icecrown_gunship_battle.cpp:69
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.cpp:88
Definition: icecrown_citadel.h:117
Definition: boss_icecrown_gunship_battle.cpp:119
Definition: boss_icecrown_gunship_battle.cpp:52
Definition: inflate.h:49
TC_GAME_API void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:621
Definition: icecrown_citadel.h:184
Will ignore most target checks (mostly DBC target checks)
Definition: Unit.h:479
Definition: Transport.h:28
Definition: icecrown_citadel.h:179
void SetZoneMusic(uint32 zoneId, uint32 musicId)
Definition: Map.cpp:3905
Definition: Creature.h:467
Definition: icecrown_citadel.h:77
Definition: BattlegroundIC.h:46
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
Definition: InstanceScript.h:60
void SendEncounterUnit(uint32 type, Unit *unit=NULL, uint8 param1=0, uint8 param2=0)
Definition: InstanceScript.cpp:575
Definition: icecrown_citadel.h:200
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_icecrown_gunship_battle.cpp:114
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
bool _died
Definition: boss_icecrown_gunship_battle.cpp:824
Definition: icecrown_citadel.h:199
Definition: boss_icecrown_gunship_battle.cpp:116
void EnableMovement(bool enabled)
Definition: Transport.cpp:557
Definition: BattlegroundIC.h:47
Definition: icecrown_citadel.h:195
Definition: icecrown_citadel.h:523
uint32_t uint32
Definition: Define.h:150
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:95
Definition: icecrown_citadel.h:185
Definition: boss_icecrown_gunship_battle.cpp:51
Definition: icecrown_citadel.h:188
Definition: boss_icecrown_gunship_battle.cpp:134
Definition: boss_icecrown_gunship_battle.cpp:120
Definition: icecrown_citadel.h:186
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: SharedDefines.h:999
Definition: boss_icecrown_gunship_battle.cpp:187
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
Transport * GetTransport() const
Definition: Object.h:602
Definition: boss_icecrown_gunship_battle.cpp:118
void DeleteThreatList()
Definition: Unit.cpp:10700
Definition: icecrown_citadel.h:187
Definition: boss_icecrown_gunship_battle.cpp:135
Definition: ObjectAccessor.h:45
Definition: InstanceScript.h:141
uint8_t uint8
Definition: Define.h:152
uint32 GetEntry() const
Definition: Object.h:107
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:7371
Definition: icecrown_citadel.h:360
Definition: icecrown_citadel.h:194
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: boss_icecrown_gunship_battle.cpp:486
Definition: boss_icecrown_gunship_battle.cpp:117

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_gunship::npc_gunshipAI::SetGUID ( ObjectGuid  guid,
int32  id 
)
inlineoverridevirtual

Reimplemented from UnitAI.

797  {
798  if (id != ACTION_SHIP_VISITS)
799  return;
800 
801  std::map<ObjectGuid, uint32>::iterator itr = _shipVisits.find(guid);
802  if (itr == _shipVisits.end())
803  _shipVisits[guid] = 1;
804  else
805  ++itr->second;
806  }
std::map< ObjectGuid, uint32 > _shipVisits
Definition: boss_icecrown_gunship_battle.cpp:822
Definition: boss_icecrown_gunship_battle.cpp:207

Member Data Documentation

bool npc_gunship::npc_gunshipAI::_died
private
std::map<ObjectGuid, uint32> npc_gunship::npc_gunshipAI::_shipVisits
private
bool npc_gunship::npc_gunshipAI::_summonedFirstMage
private
uint32 npc_gunship::npc_gunshipAI::_teamInInstance
private

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