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

Public Member Functions

 npc_belnistraszAI (Creature *creature)
 
void Reset () override
 
void EnterCombat (Unit *who) override
 
void JustDied (Unit *) override
 
void sQuestAccept (Player *, Quest const *quest) override
 
void MovementInform (uint32 type, uint32 id) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) 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 OnPossess (bool)
 
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 EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
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 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 (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 sQuestSelect (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Private Attributes

InstanceScriptinstance
 
EventMap events
 
bool eventInProgress
 
bool channeling
 
uint8 eventProgress
 
uint8 spawnerCount
 

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)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

npc_belnistrasz::npc_belnistraszAI::npc_belnistraszAI ( Creature creature)
inline
90  : ScriptedAI(creature)
91  {
92  instance = creature->GetInstanceScript();
93  eventInProgress = false;
94  channeling = false;
95  eventProgress = 0;
96  spawnerCount = 0;
97  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
uint8 spawnerCount
Definition: razorfen_downs.cpp:253
bool channeling
Definition: razorfen_downs.cpp:251
uint8 eventProgress
Definition: razorfen_downs.cpp:252
bool eventInProgress
Definition: razorfen_downs.cpp:250
InstanceScript * instance
Definition: razorfen_downs.cpp:248

+ Here is the call graph for this function:

Member Function Documentation

void npc_belnistrasz::npc_belnistraszAI::EnterCombat ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

114  {
115  if (channeling)
116  Talk(SAY_WATCH_OUT, who);
117  else
118  {
121  if (urand(0, 100) > 40)
122  Talk(SAY_AGGRO, who);
123  }
124  }
Definition: razorfen_downs.cpp:73
Definition: razorfen_downs.cpp:74
bool channeling
Definition: razorfen_downs.cpp:251
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
EventMap events
Definition: razorfen_downs.cpp:249
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: razorfen_downs.cpp:57
Definition: razorfen_downs.cpp:58

+ Here is the call graph for this function:

void npc_belnistrasz::npc_belnistraszAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

127  {
129  me->DespawnOrUnsummon(5000);
130  }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
Definition: inflate.h:49
Creature *const me
Definition: CreatureAI.h:71
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
InstanceScript * instance
Definition: razorfen_downs.cpp:248
Definition: razorfen_downs.h:36

+ Here is the call graph for this function:

void npc_belnistrasz::npc_belnistraszAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

145  {
146  if (type == WAYPOINT_MOTION_TYPE && id == POINT_REACH_IDOL)
147  {
148  channeling = true;
150  }
151  }
bool channeling
Definition: razorfen_downs.cpp:251
Definition: razorfen_downs.cpp:53
Definition: razorfen_downs.cpp:63
EventMap events
Definition: razorfen_downs.cpp:249
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: MotionMaster.h:39

+ Here is the call graph for this function:

void npc_belnistrasz::npc_belnistraszAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

100  {
101  if (!eventInProgress)
102  {
105 
106  channeling = false;
107  eventProgress = 0;
108  spawnerCount = 0;
110  }
111  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
Definition: GossipDef.h:36
Definition: razorfen_downs.cpp:76
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
uint8 spawnerCount
Definition: razorfen_downs.cpp:253
bool channeling
Definition: razorfen_downs.cpp:251
Creature *const me
Definition: CreatureAI.h:71
uint8 eventProgress
Definition: razorfen_downs.cpp:252
bool eventInProgress
Definition: razorfen_downs.cpp:250
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: UpdateFields.h:135

+ Here is the call graph for this function:

void npc_belnistrasz::npc_belnistraszAI::sQuestAccept ( Player ,
Quest const quest 
)
inlineoverridevirtual

Reimplemented from UnitAI.

133  {
134  if (quest->GetQuestId() == QUEST_EXTINGUISHING_THE_IDOL)
135  {
136  eventInProgress = true;
141  }
142  }
Definition: GossipDef.h:36
Definition: razorfen_downs.cpp:60
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: razorfen_downs.cpp:67
Definition: razorfen_downs.cpp:65
void setFaction(uint32 faction)
Definition: Unit.h:1467
Creature *const me
Definition: CreatureAI.h:71
bool eventInProgress
Definition: razorfen_downs.cpp:250
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: razorfen_downs.cpp:62
void MovePath(uint32 path_id, bool repeatable)
Definition: MotionMaster.cpp:618
Definition: UpdateFields.h:135

+ Here is the call graph for this function:

void npc_belnistrasz::npc_belnistraszAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

154  {
155  if (!eventInProgress)
156  return;
157 
158  events.Update(diff);
159 
160  while (uint32 eventId = events.ExecuteEvent())
161  {
162  switch (eventId)
163  {
164  case EVENT_CHANNEL:
169  break;
172  creature->AI()->SetData(0,spawnerCount);
173  if (++spawnerCount < 8)
175  break;
176  case EVENT_PROGRESS:
177  {
178  switch (eventProgress)
179  {
180  case 0:
182  ++eventProgress;
184  break;
185  case 1:
187  ++eventProgress;
189  break;
190  case 2:
192  ++eventProgress;
194  break;
195  case 3:
200  break;
201  }
202  break;
203  }
204  case EVENT_COMPLETE:
205  {
207  me->SummonGameObject(GO_BELNISTRASZS_BRAZIER, 2577.196f, 947.0781f, 53.16757f, 2.356195f, 0, 0, 0.9238796f, 0.3826832f, 3600);
208  std::list<WorldObject*> ClusterList;
209  Trinity::AllWorldObjectsInRange objects(me, 50.0f);
211  me->VisitNearbyObject(50.0f, searcher);
212  for (std::list<WorldObject*>::const_iterator itr = ClusterList.begin(); itr != ClusterList.end(); ++itr)
213  {
214  if (Player* player = (*itr)->ToPlayer())
215  {
216  if (player->GetQuestStatus(QUEST_EXTINGUISHING_THE_IDOL) == QUEST_STATUS_INCOMPLETE)
217  player->CompleteQuest(QUEST_EXTINGUISHING_THE_IDOL);
218  }
219  else if (GameObject* go = (*itr)->ToGameObject())
220  {
221  if (go->GetEntry() == GO_IDOL_OVEN_FIRE || go->GetEntry() == GO_IDOL_CUP_FIRE || go->GetEntry() == GO_IDOL_MOUTH_FIRE)
222  go->Delete();
223  }
224  }
227  break;
228  }
229  case EVENT_FIREBALL:
231  return;
234  break;
235  case EVENT_FROST_NOVA:
237  return;
240  break;
241  }
242  }
243  if (!channeling)
245  }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
Definition: Object.cpp:2372
Definition: razorfen_downs.cpp:72
Definition: razorfen_downs.h:59
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: Unit.h:565
Definition: Unit.h:1110
Definition: inflate.h:49
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:89
Definition: Creature.h:467
Definition: razorfen_downs.cpp:70
uint8 spawnerCount
Definition: razorfen_downs.cpp:253
bool channeling
Definition: razorfen_downs.cpp:251
GameObject * ToGameObject()
Definition: Object.h:200
Definition: razorfen_downs.cpp:80
Definition: razorfen_downs.cpp:79
Definition: razorfen_downs.cpp:65
Definition: razorfen_downs.cpp:68
void VisitNearbyObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:587
Definition: razorfen_downs.cpp:77
Creature *const me
Definition: CreatureAI.h:71
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition: Unit.cpp:2849
Definition: razorfen_downs.cpp:78
uint8 eventProgress
Definition: razorfen_downs.cpp:252
Definition: razorfen_downs.cpp:53
Definition: Object.h:56
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
EventMap events
Definition: razorfen_downs.cpp:249
Position const PosSummonSpawner[3]
Definition: razorfen_downs.cpp:44
uint32_t uint32
Definition: Define.h:150
bool eventInProgress
Definition: razorfen_downs.cpp:250
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: GameObject.h:880
Definition: razorfen_downs.h:58
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: razorfen_downs.cpp:54
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: razorfen_downs.cpp:57
Definition: razorfen_downs.cpp:71
void Update(uint32 time)
Definition: EventMap.h:54
Definition: razorfen_downs.cpp:58
Definition: razorfen_downs.h:46
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
Definition: razorfen_downs.cpp:69
Definition: QuestDef.h:113
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: GridNotifiers.h:218
InstanceScript * instance
Definition: razorfen_downs.cpp:248
Definition: GridNotifiers.h:1317
Definition: razorfen_downs.h:36
Definition: razorfen_downs.cpp:55
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
Definition: razorfen_downs.h:60
Definition: razorfen_downs.cpp:56
Definition: razorfen_downs.h:61

+ Here is the call graph for this function:

Member Data Documentation

bool npc_belnistrasz::npc_belnistraszAI::channeling
private
bool npc_belnistrasz::npc_belnistraszAI::eventInProgress
private
uint8 npc_belnistrasz::npc_belnistraszAI::eventProgress
private
EventMap npc_belnistrasz::npc_belnistraszAI::events
private
InstanceScript* npc_belnistrasz::npc_belnistraszAI::instance
private
uint8 npc_belnistrasz::npc_belnistraszAI::spawnerCount
private

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