AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_gunship::npc_gunshipAI Struct Reference
Inheritance diagram for npc_gunship::npc_gunshipAI:
NullCreatureAI CreatureAI UnitAI

Public Member Functions

 npc_gunshipAI (Creature *creature)
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void JustDied (Unit *) override
 
void UpdateAI (uint32) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed. More...
 
- 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
 

Private Attributes

InstanceScript_instance
 
TeamId _teamIdInInstance
 
std::map< ObjectGuid, uint32_shipVisits
 
bool _died
 
bool _summonedFirstMage
 

Additional Inherited Members

- 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 NullCreatureAI
static int32 Permissible (Creature const *creature)
 
- 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 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_gunshipAI()

npc_gunship::npc_gunshipAI::npc_gunshipAI ( Creature creature)
inline
546 {
548 }
@ DATA_TEAMID_IN_INSTANCE
Definition: trial_of_the_champion.h:44
TeamId
Definition: SharedDefines.h:759
Definition: PassiveAI.h:53
Creature *const me
Definition: CreatureAI.h:73
void SetRegeneratingHealth(bool enable)
Definition: Creature.h:319
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
TeamId _teamIdInInstance
Definition: boss_icecrown_gunship_battle.cpp:752
InstanceScript * _instance
Definition: boss_icecrown_gunship_battle.cpp:751
bool _summonedFirstMage
Definition: boss_icecrown_gunship_battle.cpp:755
bool _died
Definition: boss_icecrown_gunship_battle.cpp:754

References CreatureAI::me, and Creature::SetRegeneratingHealth().

Member Function Documentation

◆ DamageTaken()

void npc_gunship::npc_gunshipAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

551 {
553 {
554 damage = 0;
555 return;
556 }
557
558 if (damage >= me->GetHealth())
559 {
560 JustDied(nullptr);
561 damage = me->GetHealth() - 1;
562 return;
563 }
564
566 return;
567
569 return;
570
571 if (!me->HealthBelowPctDamaged(90, damage))
572 return;
573
574 _summonedFirstMage = true;
576 captain->AI()->DoAction(ACTION_SPAWN_MAGE);
577 }
std::uint32_t uint32
Definition: Define.h:107
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ ACTION_SPAWN_MAGE
Definition: boss_icecrown_gunship_battle.cpp:194
@ NPC_IGB_MURADIN_BRONZEBEARD
Definition: icecrown_citadel.h:227
@ NPC_IGB_HIGH_OVERLORD_SAURFANG
Definition: icecrown_citadel.h:226
@ GO_THE_SKYBREAKER_H
Definition: icecrown_citadel.h:403
@ GO_ORGRIMS_HAMMER_A
Definition: icecrown_citadel.h:410
@ DATA_ICECROWN_GUNSHIP_BATTLE
Definition: icecrown_citadel.h:94
@ TEAM_HORDE
Definition: SharedDefines.h:761
Definition: Creature.h:46
uint32 GetEntry() const
Definition: Object.h:112
Transport * GetTransport() const
Definition: Object.h:599
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
uint32 GetHealth() const
Definition: Unit.h:869
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:874
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235

References _instance, _summonedFirstMage, _teamIdInInstance, ACTION_SPAWN_MAGE, DATA_ICECROWN_GUNSHIP_BATTLE, WorldObject::FindNearestCreature(), InstanceScript::GetBossState(), Object::GetEntry(), Unit::GetHealth(), WorldObject::GetTransport(), GO_ORGRIMS_HAMMER_A, GO_THE_SKYBREAKER_H, Unit::HealthBelowPctDamaged(), IN_PROGRESS, JustDied, CreatureAI::me, NPC_IGB_HIGH_OVERLORD_SAURFANG, NPC_IGB_MURADIN_BRONZEBEARD, and TEAM_HORDE.

◆ GetData()

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

Reimplemented from UnitAI.

739 {
740 if (id != ACTION_SHIP_VISITS_ENEMY)
741 return 0;
742
743 for (std::map<ObjectGuid, uint32>::const_iterator itr = _shipVisits.begin(); itr != _shipVisits.end(); ++itr)
744 if (itr->second == 0)
745 return 0;
746
747 return 1;
748 }
@ ACTION_SHIP_VISITS_ENEMY
Definition: boss_icecrown_gunship_battle.cpp:199
std::map< ObjectGuid, uint32 > _shipVisits
Definition: boss_icecrown_gunship_battle.cpp:753

References _shipVisits, and ACTION_SHIP_VISITS_ENEMY.

◆ JustDied()

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

Reimplemented from CreatureAI.

580 {
582 return;
583 _died = true;
584
588
590 {
592 if (Aura* a = creature->GetAura(SPELL_CHECK_FOR_PLAYERS))
593 a->SetDuration(0);
594 }
597 a->SetDuration(0);
598
599 uint32 explosionSpell = isVictory ? SPELL_EXPLOSION_VICTORY : SPELL_EXPLOSION_WIPE;
600 if (MotionTransport* t = (me->GetTransport() ? me->GetTransport()->ToMotionTransport() : nullptr))
601 {
602 Transport::PassengerSet const& passengers = t->GetStaticPassengers();
603 for (Transport::PassengerSet::const_iterator itr = passengers.begin(); itr != passengers.end(); ++itr)
604 {
605 if (!(*itr)->IsCreature() || (*itr)->GetEntry() != NPC_GUNSHIP_HULL)
606 continue;
607 (*itr)->ToCreature()->CastSpell((*itr)->ToCreature(), explosionSpell, true);
608 }
609 }
610
613 if (MotionTransport* t = go->ToMotionTransport())
614 {
615 Transport::PassengerSet const& passengers = t->GetStaticPassengers();
616 for (Transport::PassengerSet::const_iterator itr = passengers.begin(); itr != passengers.end(); ++itr)
617 {
618 if (!(*itr)->IsCreature() || (*itr)->GetEntry() != cannonEntry)
619 continue;
620 Creature* cannon = (*itr)->ToCreature();
621 cannon->CastSpell(cannon, SPELL_EJECT_ALL_PASSENGERS, true);
622
624 data << cannon->GetPackGUID();
625 data << uint32(0);
626 cannon->SendMessageToSet(&data, true);
627
628 cannon->RemoveVehicleKit();
629 }
630 }
631
632 uint32 creatureEntry = NPC_IGB_MURADIN_BRONZEBEARD;
633 uint8 textId = isVictory ? SAY_MURADIN_VICTORY : SAY_MURADIN_WIPE;
635 {
636 creatureEntry = NPC_IGB_HIGH_OVERLORD_SAURFANG;
637 textId = isVictory ? SAY_SAURFANG_VICTORY : SAY_SAURFANG_WIPE;
638 }
639 if (Creature* creature = me->FindNearestCreature(creatureEntry, 200.0f))
640 creature->AI()->Talk(textId);
641
642 if (isVictory)
643 {
645 if (MotionTransport* otherTransport = transport->ToMotionTransport())
646 otherTransport->EnableMovement(true);
647
649
651 {
652 ship->CastSpell(ship, SPELL_TELEPORT_PLAYERS_ON_VICTORY, true);
653 ship->CastSpell(ship, SPELL_ACHIEVEMENT, true);
654 ship->CastSpell(ship, SPELL_AWARD_REPUTATION_BOSS_KILL, true);
655 }
656
657 for (uint8 i = 0; i < 2; ++i)
659 if (MotionTransport* t = go->ToMotionTransport())
660 {
661 Transport::PassengerSet const& passengers = t->GetPassengers();
662 for (Transport::PassengerSet::const_iterator itr = passengers.begin(); itr != passengers.end(); ++itr)
663 {
664 if (!(*itr)->IsCreature())
665 continue;
666 Creature* c = (*itr)->ToCreature();
668 c->DespawnOrUnsummon(1);
669 }
670 }
671 }
672 else
673 {
676 }
677 }
std::uint8_t uint8
Definition: Define.h:109
@ ENCOUNTER_FRAME_DISENGAGE
Definition: InstanceScript.h:46
@ FAIL
Definition: InstanceScript.h:59
@ DONE
Definition: InstanceScript.h:60
@ NPC_ALLIANCE_GUNSHIP_CANNON
Definition: BattlegroundIC.h:46
@ NPC_HORDE_GUNSHIP_CANNON
Definition: BattlegroundIC.h:45
@ SPELL_ACHIEVEMENT
Definition: boss_icecrown_gunship_battle.cpp:116
@ SPELL_AWARD_REPUTATION_BOSS_KILL
Definition: boss_icecrown_gunship_battle.cpp:117
@ SPELL_EXPLOSION_WIPE
Definition: boss_icecrown_gunship_battle.cpp:120
@ SPELL_TELEPORT_PLAYERS_ON_RESET_H
Definition: boss_icecrown_gunship_battle.cpp:114
@ SPELL_EJECT_ALL_PASSENGERS
Definition: boss_icecrown_gunship_battle.cpp:184
@ SPELL_EXPLOSION_VICTORY
Definition: boss_icecrown_gunship_battle.cpp:121
@ SPELL_CHECK_FOR_PLAYERS
Definition: boss_icecrown_gunship_battle.cpp:111
@ SPELL_TELEPORT_PLAYERS_ON_RESET_A
Definition: boss_icecrown_gunship_battle.cpp:113
@ SPELL_TELEPORT_PLAYERS_ON_VICTORY
Definition: boss_icecrown_gunship_battle.cpp:115
@ SAY_MURADIN_WIPE
Definition: boss_icecrown_gunship_battle.cpp:65
@ SAY_SAURFANG_WIPE
Definition: boss_icecrown_gunship_battle.cpp:48
@ SAY_SAURFANG_VICTORY
Definition: boss_icecrown_gunship_battle.cpp:47
@ SAY_MURADIN_VICTORY
Definition: boss_icecrown_gunship_battle.cpp:64
@ NPC_ORGRIMS_HAMMER
Definition: icecrown_citadel.h:229
@ NPC_SKYBREAKER_MARINE
Definition: icecrown_citadel.h:236
@ NPC_KOR_KRON_REAVER
Definition: icecrown_citadel.h:241
@ NPC_KOR_KRON_SERGEANT
Definition: icecrown_citadel.h:242
@ NPC_SKYBREAKER_SERGEANT
Definition: icecrown_citadel.h:237
@ NPC_GUNSHIP_HULL
Definition: icecrown_citadel.h:230
@ AREA_ICECROWN_CITADEL
Definition: icecrown_citadel.h:585
@ DATA_THE_SKYBREAKER
Definition: icecrown_citadel.h:138
@ DATA_ENEMY_GUNSHIP
Definition: icecrown_citadel.h:137
@ DATA_ORGRIMS_HAMMER
Definition: icecrown_citadel.h:139
@ SMSG_PLAYER_VEHICLE_DATA
Definition: Opcodes.h:1221
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:103
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:159
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
Definition: GameObject.h:121
MotionTransport * ToMotionTransport()
Definition: GameObject.h:328
PackedGuid const & GetPackGUID() const
Definition: Object.h:111
Creature * ToCreature()
Definition: Object.h:202
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition: Object.cpp:2080
Map * GetMap() const
Definition: Object.h:531
std::size_t size() const
Definition: ObjectGuid.h:274
Definition: Transport.h:29
std::set< WorldObject * > PassengerSet
Definition: Transport.h:35
Definition: Transport.h:48
void EnableMovement(bool enabled)
Definition: Transport.cpp:455
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5552
void RemoveVehicleKit()
Definition: Unit.cpp:18683
EventProcessor m_Events
Definition: Unit.h:1792
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
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
Creature * GetCreature(uint32 type)
Definition: InstanceScript.cpp:100
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95
Map * instance
Definition: InstanceScript.h:148
void SendEncounterUnit(uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
Definition: InstanceScript.cpp:713
void SetZoneMusic(uint32 zoneId, uint32 musicId)
Definition: Map.cpp:3759
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319
Transport * GetTransport(ObjectGuid const guid)
Definition: Map.cpp:3329
Definition: WorldPacket.h:27
Definition: SpellAuras.h:87
Definition: boss_icecrown_gunship_battle.cpp:513

References _died, _instance, _teamIdInInstance, EventProcessor::AddEvent(), AREA_ICECROWN_CITADEL, EventProcessor::CalculateTime(), Unit::CastSpell(), DATA_ENEMY_GUNSHIP, DATA_ICECROWN_GUNSHIP_BATTLE, DATA_ORGRIMS_HAMMER, DATA_THE_SKYBREAKER, Creature::DespawnOrUnsummon(), DONE, MotionTransport::EnableMovement(), ENCOUNTER_FRAME_DISENGAGE, FAIL, WorldObject::FindNearestCreature(), Unit::GetAura(), InstanceScript::GetBossState(), InstanceScript::GetCreature(), Object::GetEntry(), Map::GetGameObject(), InstanceScript::GetGuidData(), WorldObject::GetMap(), Object::GetPackGUID(), WorldObject::GetTransport(), Map::GetTransport(), GO_ORGRIMS_HAMMER_A, GO_THE_SKYBREAKER_H, IN_PROGRESS, InstanceScript::instance, Unit::m_Events, CreatureAI::me, NPC_ALLIANCE_GUNSHIP_CANNON, NPC_GUNSHIP_HULL, NPC_HORDE_GUNSHIP_CANNON, NPC_IGB_HIGH_OVERLORD_SAURFANG, NPC_IGB_MURADIN_BRONZEBEARD, NPC_KOR_KRON_REAVER, NPC_KOR_KRON_SERGEANT, NPC_ORGRIMS_HAMMER, NPC_SKYBREAKER_MARINE, NPC_SKYBREAKER_SERGEANT, Unit::RemoveVehicleKit(), SAY_MURADIN_VICTORY, SAY_MURADIN_WIPE, SAY_SAURFANG_VICTORY, SAY_SAURFANG_WIPE, InstanceScript::SendEncounterUnit(), WorldObject::SendMessageToSet(), InstanceScript::SetBossState(), Map::SetZoneMusic(), PackedGuid::size(), SMSG_PLAYER_VEHICLE_DATA, SPELL_ACHIEVEMENT, SPELL_AWARD_REPUTATION_BOSS_KILL, SPELL_CHECK_FOR_PLAYERS, SPELL_EJECT_ALL_PASSENGERS, SPELL_EXPLOSION_VICTORY, SPELL_EXPLOSION_WIPE, SPELL_TELEPORT_PLAYERS_ON_RESET_A, SPELL_TELEPORT_PLAYERS_ON_RESET_H, SPELL_TELEPORT_PLAYERS_ON_VICTORY, TEAM_HORDE, Object::ToCreature(), and GameObject::ToMotionTransport().

◆ SetGUID()

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

Reimplemented from UnitAI.

704 {
706 return;
707
708 std::map<ObjectGuid, uint32>::iterator itr = _shipVisits.find(guid);
709 if (itr == _shipVisits.end())
710 {
711 if (id == ACTION_SHIP_VISITS_ENEMY)
713 }
714 else if (itr->second) // if 0 then achiev already failed
715 {
716 if (id == ACTION_SHIP_VISITS_SELF)
717 {
718 if (itr->second == ACTION_SHIP_VISITS_ENEMY)
719 itr->second = ACTION_SHIP_VISITS_SELF;
720 else if (itr->second == ACTION_SHIP_VISITS_ENEMY_2)
721 itr->second = ACTION_SHIP_VISITS_SELF_2;
722 }
723 else
724 {
725 if (itr->second == ACTION_SHIP_VISITS_SELF)
726 {
727 if (me->GetMap()->Is25ManRaid())
728 itr->second = 0;
729 else
730 itr->second = ACTION_SHIP_VISITS_ENEMY_2;
731 }
732 else if (itr->second == ACTION_SHIP_VISITS_SELF_2)
733 itr->second = 0;
734 }
735 }
736 }
@ ACTION_SHIP_VISITS_SELF
Definition: boss_icecrown_gunship_battle.cpp:198
@ ACTION_SHIP_VISITS_SELF_2
Definition: boss_icecrown_gunship_battle.cpp:200
@ ACTION_SHIP_VISITS_ENEMY_2
Definition: boss_icecrown_gunship_battle.cpp:201
bool Is25ManRaid() const
Definition: Map.h:453

References _shipVisits, ACTION_SHIP_VISITS_ENEMY, ACTION_SHIP_VISITS_ENEMY_2, ACTION_SHIP_VISITS_SELF, ACTION_SHIP_VISITS_SELF_2, WorldObject::GetMap(), Map::Is25ManRaid(), and CreatureAI::me.

◆ UpdateAI()

void npc_gunship::npc_gunshipAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from NullCreatureAI.

680 {
681 if (!sConfigMgr->GetOption<int32>("WipeGunshipBlizzlike.Enable", 1))
682 return;
683
685 return;
686
687 bool playerOnDeck = false;
688 me->GetMap()->DoForAllPlayers([&](Player* player)
689 {
690 if (!player->GetVehicle() && player->IsAlive())
691 playerOnDeck = true;
692 });
693
694 // Wipe if no player is on the deck
695 if (!playerOnDeck)
696 {
697 // Script runs on enemy ship. We want to kill our ship.
699 Creature::Kill(me, ship);
700 }
701 }
#define sConfigMgr
Definition: Config.h:74
std::int32_t int32
Definition: Define.h:103
Definition: Player.h:1064
Vehicle * GetVehicle() const
Definition: Unit.h:1673
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:17658
bool IsAlive() const
Definition: Unit.h:1204
void DoForAllPlayers(std::function< void(Player *)> exec)
Definition: Map.cpp:3824

References _instance, _teamIdInInstance, DATA_ICECROWN_GUNSHIP_BATTLE, DATA_ORGRIMS_HAMMER, DATA_THE_SKYBREAKER, Map::DoForAllPlayers(), InstanceScript::GetBossState(), InstanceScript::GetCreature(), WorldObject::GetMap(), Unit::GetVehicle(), IN_PROGRESS, Unit::IsAlive(), Unit::Kill(), CreatureAI::me, sConfigMgr, and TEAM_HORDE.

Member Data Documentation

◆ _died

bool npc_gunship::npc_gunshipAI::_died
private

Referenced by JustDied().

◆ _instance

InstanceScript* npc_gunship::npc_gunshipAI::_instance
private

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

◆ _shipVisits

std::map<ObjectGuid, uint32> npc_gunship::npc_gunshipAI::_shipVisits
private

Referenced by GetData(), and SetGUID().

◆ _summonedFirstMage

bool npc_gunship::npc_gunshipAI::_summonedFirstMage
private

Referenced by DamageTaken().

◆ _teamIdInInstance

TeamId npc_gunship::npc_gunshipAI::_teamIdInInstance
private

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