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

Public Member Functions

 npc_sergeant_blyAI (Creature *creature)
 
void InitializeAI () override
 
void Reset () override
 
void JustRespawned () override
 
void EnterEvadeMode (EvadeReason reason) override
 
void MovementInform (uint32 type, uint32 id) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void DoAction (int32 action) override
 
void switchFactionIfAlive (uint32 entry, Player *target)
 
void sGossipSelect (Player *player, uint32, uint32 gossipListId) override
 
void sGossipHello (Player *player) override
 
- 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)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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.
 
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, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
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.
 
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.
 
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

InstanceScript * instance
 
bool startedFight
 
bool ableToPortHome
 
uint32 ShieldBash_Timer
 
uint32 Revenge_Timer
 
uint32 Porthome_Timer
 
ObjectGuid PlayerGUID
 
- Public Attributes inherited from ScriptedAI
Creature * me
 

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 AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_sergeant_blyAI()

npc_sergeant_bly::npc_sergeant_blyAI::npc_sergeant_blyAI ( Creature *  creature)
inline
79 : ScriptedAI(creature)
80 {
81 instance = creature->GetInstanceScript();
82 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
Definition ScriptedCreature.h:191
InstanceScript * instance
Definition zulfarrak.cpp:94

References WorldObject::GetInstanceScript(), and instance.

Member Function Documentation

◆ DoAction()

void npc_sergeant_bly::npc_sergeant_blyAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

249 {
250 if (action != ACTION_BLY_BETRAYAL || startedFight || !me->IsAlive() ||
253 return;
254
255 startedFight = true;
256 ableToPortHome = false;
257 events.ScheduleEvent(EVENT_BLY_FIRST_REPLY, 1500ms);
258 }
events
Definition boss_sartura.cpp:43
bool IsAlive() const
Definition Unit.h:1806
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
Creature * me
Definition ScriptedCreature.h:281
bool startedFight
Definition zulfarrak.cpp:96
bool ableToPortHome
Definition zulfarrak.cpp:97
@ EVENT_BLY_FIRST_REPLY
Definition zulfarrak.cpp:59
@ DATA_PYRAMID
Definition zulfarrak.h:51
@ PYRAMID_DONE
Definition zulfarrak.h:84
@ PYRAMID_MOVED_DOWNSTAIRS
Definition zulfarrak.h:81
@ ACTION_BLY_BETRAYAL
Definition zulfarrak.h:58

References ableToPortHome, ACTION_BLY_BETRAYAL, DATA_PYRAMID, EVENT_BLY_FIRST_REPLY, ZoneScript::GetData(), instance, Unit::IsAlive(), ScriptedAI::me, PYRAMID_DONE, PYRAMID_MOVED_DOWNSTAIRS, and startedFight.

Referenced by sGossipSelect().

◆ EnterEvadeMode()

void npc_sergeant_bly::npc_sergeant_blyAI::EnterEvadeMode ( EvadeReason  reason)
inlineoverridevirtual

Reimplemented from CreatureAI.

117 {
119 {
121 return;
122 }
123
124 if (ableToPortHome)
125 return;
126
128 {
129 ableToPortHome = true;
130 Porthome_Timer = 156000;
131 }
132 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235
uint32 Porthome_Timer
Definition zulfarrak.cpp:100
@ PYRAMID_KILLED_ALL_TROLLS
Definition zulfarrak.h:80
@ PYRAMID_WAVE_3
Definition zulfarrak.h:79

References ableToPortHome, DATA_PYRAMID, CreatureAI::EnterEvadeMode(), ZoneScript::GetData(), instance, Porthome_Timer, PYRAMID_KILLED_ALL_TROLLS, PYRAMID_WAVE_3, and startedFight.

◆ InitializeAI()

void npc_sergeant_bly::npc_sergeant_blyAI::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

85 {
86 ableToPortHome = false;
87 startedFight = false;
89 events.Reset();
91 Reset();
92 }
@ FACTION_FRIENDLY
Definition SharedDefines.h:189
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:322
void SetFaction(uint32 faction)
Definition Unit.cpp:6874
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:770
void Reset() override
Definition zulfarrak.cpp:103

References ableToPortHome, FACTION_FRIENDLY, ScriptedAI::me, Reset(), Unit::SetFaction(), Unit::SetNpcFlag(), startedFight, and UNIT_NPC_FLAG_GOSSIP.

Referenced by JustRespawned().

◆ JustRespawned()

void npc_sergeant_bly::npc_sergeant_blyAI::JustRespawned ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

112 {
113 InitializeAI();
114 }
void InitializeAI() override
Definition zulfarrak.cpp:84

References InitializeAI().

◆ MovementInform()

void npc_sergeant_bly::npc_sergeant_blyAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

135 {
136 if (type != POINT_MOTION_TYPE)
137 return;
138
139 // Weegli may already have left after a player selected his door option during the gathering walk.
142
144 {
146 {
147 AttackStart(shadowpriest);
148 // Reach the crew beyond normal aggro range; passive Weegli cannot answer this call.
149 me->CallForHelp(100.0f, shadowpriest);
150 shadowpriest->CallAssistance();
151 }
152 }
153 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
Definition Creature.h:47
void CallForHelp(float fRadius, Unit *target=nullptr)
Definition Creature.cpp:2532
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:121
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228
@ POINT_CREW_DESCENT
Definition zulfarrak.h:65
@ POINT_CREW_GATHER
Definition zulfarrak.h:66
@ NPC_SHADOWPRIEST_SEZZZIZ
Definition zulfarrak.h:34

References ScriptedAI::AttackStart(), Creature::CallForHelp(), DATA_PYRAMID, ObjectAccessor::GetCreature(), ZoneScript::GetData(), InstanceScript::GetGuidData(), instance, ScriptedAI::me, NPC_SHADOWPRIEST_SEZZZIZ, POINT_CREW_DESCENT, POINT_CREW_GATHER, POINT_MOTION_TYPE, PYRAMID_KILLED_ALL_TROLLS, PYRAMID_MOVED_DOWNSTAIRS, PYRAMID_WAVE_3, and ZoneScript::SetData().

◆ Reset()

void npc_sergeant_bly::npc_sergeant_blyAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

104 {
105 ShieldBash_Timer = 5000;
106 Revenge_Timer = 8000;
107 Porthome_Timer = 156000;
108 ableToPortHome = false;
109 }
uint32 ShieldBash_Timer
Definition zulfarrak.cpp:98
uint32 Revenge_Timer
Definition zulfarrak.cpp:99

References ableToPortHome, Porthome_Timer, Revenge_Timer, and ShieldBash_Timer.

Referenced by InitializeAI().

◆ sGossipHello()

void npc_sergeant_bly::npc_sergeant_blyAI::sGossipHello ( Player *  player)
inlineoverridevirtual

Reimplemented from UnitAI.

290 {
293 {
295 SendGossipMenuFor(player, 1517, me->GetGUID());
296 }
297 else
298 {
300 {
301 SendGossipMenuFor(player, 1515, me->GetGUID());
302 }
303 else
304 {
305 SendGossipMenuFor(player, 1516, me->GetGUID());
306 }
307 }
308 }
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:61
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition ScriptedGossip.cpp:28
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
Definition ScriptedGossip.cpp:45
@ GOSSIP_SENDER_MAIN
Definition ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition ScriptedGossip.h:68
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
#define GOSSIP_BLY
Definition zulfarrak.cpp:70
@ PYRAMID_NOT_STARTED
Definition zulfarrak.h:72

References AddGossipItemFor(), DATA_PYRAMID, ZoneScript::GetData(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_BLY, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, instance, ScriptedAI::me, PYRAMID_DONE, PYRAMID_MOVED_DOWNSTAIRS, PYRAMID_NOT_STARTED, SendGossipMenuFor(), and startedFight.

◆ sGossipSelect()

void npc_sergeant_bly::npc_sergeant_blyAI::sGossipSelect ( Player *  player,
uint32  ,
uint32  gossipListId 
)
inlineoverridevirtual

Reimplemented from UnitAI.

277 {
278 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
279 ClearGossipMenuFor(player);
280
281 if (action == GOSSIP_ACTION_INFO_DEF + 1 && !startedFight)
282 {
283 CloseGossipMenuFor(player);
284 PlayerGUID = player->GetGUID();
286 }
287 }
std::uint32_t uint32
Definition Define.h:107
void ClearGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:56
uint32 GetGossipOptionAction(uint32 selection) const
Definition GossipDef.h:271
PlayerMenu * PlayerTalkClass
Definition Player.h:2287
ObjectGuid PlayerGUID
Definition zulfarrak.cpp:101
void DoAction(int32 action) override
Definition zulfarrak.cpp:248

References ACTION_BLY_BETRAYAL, ClearGossipMenuFor(), CloseGossipMenuFor(), DoAction(), PlayerMenu::GetGossipOptionAction(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, PlayerGUID, Player::PlayerTalkClass, and startedFight.

◆ switchFactionIfAlive()

void npc_sergeant_bly::npc_sergeant_blyAI::switchFactionIfAlive ( uint32  entry,
Player *  target 
)
inline
261 {
263 {
264 if (crew->IsAlive())
265 {
266 crew->SetFaction(FACTION_BLY_HOSTILE);
267
268 if (target)
269 {
270 crew->AI()->AttackStart(target);
271 }
272 }
273 }
274 }
@ FACTION_BLY_HOSTILE
Definition zulfarrak.cpp:66

References FACTION_BLY_HOSTILE, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), instance, and ScriptedAI::me.

Referenced by UpdateAI().

◆ UpdateAI()

void npc_sergeant_bly::npc_sergeant_blyAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

156 {
157 events.Update(diff);
158 while (uint32 eventId = events.ExecuteEvent())
159 {
160 switch (eventId)
161 {
163 Talk(SAY_1);
164 events.ScheduleEvent(EVENT_BLY_SECOND_REPLY, 3s);
165 break;
167 Talk(SAY_2);
168 events.ScheduleEvent(EVENT_BLY_HOSTILE, 3s);
169 break;
171 {
172 // Weegli leaves when Bly turns hostile; he never joins the fight.
174 weegli->AI()->DoAction(ACTION_BLY_BETRAYAL);
175
181 if (target)
182 AttackStart(target);
183 break;
184 }
185 }
186 }
187
188 if (Porthome_Timer <= diff && ableToPortHome == true)
189 {
192 {
193 weegli->CastSpell(weegli, SPELL_BLYS_BAND_ESCAPE);
194 weegli->DespawnOrUnsummon(10s);
195 }
197 {
198 raven->CastSpell(raven, SPELL_BLYS_BAND_ESCAPE);
199 raven->DespawnOrUnsummon(10s);
200 }
202 {
203 oro->CastSpell(oro, SPELL_BLYS_BAND_ESCAPE);
204 oro->DespawnOrUnsummon(10s);
205 }
207 {
208 murta->CastSpell(murta, SPELL_BLYS_BAND_ESCAPE);
209 murta->DespawnOrUnsummon(10s);
210 }
212 me->DespawnOrUnsummon(10s);
213 Porthome_Timer = 156000; //set timer back so that the event doesn't keep triggering
214 }
215 else if (ableToPortHome)
216 {
217 Porthome_Timer -= diff;
218 }
219
220 if (!UpdateVictim())
221 {
222 return;
223 }
224
225 if (ShieldBash_Timer <= diff)
226 {
228 ShieldBash_Timer = 15000;
229 }
230 else
231 {
232 ShieldBash_Timer -= diff;
233 }
234
235 if (Revenge_Timer <= diff)
236 {
238 Revenge_Timer = 10000;
239 }
240 else
241 {
242 Revenge_Timer -= diff;
243 }
244
246 }
@ NOT_STARTED
Definition InstanceScript.h:58
bool UpdateVictim()
Definition CreatureAI.cpp:350
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2221
Definition Player.h:1086
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:274
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
Talk
Definition hyjal.cpp:82
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:244
void switchFactionIfAlive(uint32 entry, Player *target)
Definition zulfarrak.cpp:260
@ SAY_1
Definition zulfarrak.cpp:46
@ SAY_2
Definition zulfarrak.cpp:47
@ EVENT_BLY_SECOND_REPLY
Definition zulfarrak.cpp:60
@ EVENT_BLY_HOSTILE
Definition zulfarrak.cpp:61
@ SPELL_SHIELD_BASH
Definition zulfarrak.cpp:53
@ SPELL_REVENGE
Definition zulfarrak.cpp:54
@ SPELL_BLYS_BAND_ESCAPE
Definition zulfarrak.cpp:52
@ DATA_END_DOOR
Definition zulfarrak.h:53
@ NPC_WEEGLI
Definition zulfarrak.h:40
@ NPC_ORO
Definition zulfarrak.h:39
@ NPC_MURTA
Definition zulfarrak.h:41
@ NPC_RAVEN
Definition zulfarrak.h:38

References ableToPortHome, ACTION_BLY_BETRAYAL, ScriptedAI::AttackStart(), DATA_END_DOOR, Creature::DespawnOrUnsummon(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), EVENT_BLY_FIRST_REPLY, EVENT_BLY_HOSTILE, EVENT_BLY_SECOND_REPLY, FACTION_BLY_HOSTILE, ObjectAccessor::GetCreature(), ZoneScript::GetData(), InstanceScript::GetGuidData(), ObjectAccessor::GetPlayer(), instance, ScriptedAI::me, NOT_STARTED, NPC_MURTA, NPC_ORO, NPC_RAVEN, NPC_WEEGLI, PlayerGUID, Porthome_Timer, Revenge_Timer, SAY_1, SAY_2, Unit::SetFaction(), ShieldBash_Timer, SPELL_BLYS_BAND_ESCAPE, SPELL_REVENGE, SPELL_SHIELD_BASH, switchFactionIfAlive(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ ableToPortHome

bool npc_sergeant_bly::npc_sergeant_blyAI::ableToPortHome

◆ instance

InstanceScript* npc_sergeant_bly::npc_sergeant_blyAI::instance

◆ PlayerGUID

ObjectGuid npc_sergeant_bly::npc_sergeant_blyAI::PlayerGUID

Referenced by sGossipSelect(), and UpdateAI().

◆ Porthome_Timer

uint32 npc_sergeant_bly::npc_sergeant_blyAI::Porthome_Timer

Referenced by EnterEvadeMode(), Reset(), and UpdateAI().

◆ Revenge_Timer

uint32 npc_sergeant_bly::npc_sergeant_blyAI::Revenge_Timer

Referenced by Reset(), and UpdateAI().

◆ ShieldBash_Timer

uint32 npc_sergeant_bly::npc_sergeant_blyAI::ShieldBash_Timer

Referenced by Reset(), and UpdateAI().

◆ startedFight

bool npc_sergeant_bly::npc_sergeant_blyAI::startedFight

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