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

Public Member Functions

 npc_medivh_bm (Creature *creature)
 
void Reset () override
 
void JustSummoned (Creature *summon) override
 
void MoveInLineOfSight (Unit *who) override
 
void AttackStart (Unit *) override
 
void DoAction (int32 param) override
 
void JustDied (Unit *) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void SummonOrcs (float x, float y, uint32 duration, uint32 homeTime, bool first)
 
- 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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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 (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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 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)
 
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 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=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, 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 >
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
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- 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
 
EventMap _events
 
Movement::PointsArray _groundArray
 
Movement::PointsArray _airArray
 

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 ()
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- 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_medivh_bm()

npc_medivh_bm::npc_medivh_bm ( Creature creature)
inline
69 : ScriptedAI(creature)
70 {
71 _instance = creature->GetInstanceScript();
72
73 _groundArray.clear();
74 _airArray.clear();
75
76 _groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f, creature->GetPositionY(), creature->GetPositionZ()));
77 _airArray.push_back(G3D::Vector3(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ()));
78
79 for (uint8 i = 0; i < 10; ++i)
80 {
81 _groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 8.0f * std::sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ()));
82 }
83
84 for (uint8 i = 0; i < 40; ++i)
85 {
86 _airArray.push_back(G3D::Vector3(creature->GetPositionX() + i * 0.25f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + i * 0.25f * std::sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
87 }
88
89 for (uint8 i = 40; i < 80; ++i)
90 {
91 _airArray.push_back(G3D::Vector3(creature->GetPositionX() + 10.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 10.0f * std::sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
92 }
93 }
std::uint8_t uint8
Definition: Define.h:109
Definition: ScriptedCreature.h:190
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
InstanceScript * _instance
Definition: the_black_morass.cpp:245
Movement::PointsArray _airArray
Definition: the_black_morass.cpp:248
Movement::PointsArray _groundArray
Definition: the_black_morass.cpp:247

References _airArray, _groundArray, _instance, WorldObject::GetInstanceScript(), Position::GetPositionX(), Position::GetPositionY(), and Position::GetPositionZ().

Member Function Documentation

◆ AttackStart()

void npc_medivh_bm::AttackStart ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

150{ }

◆ DoAction()

void npc_medivh_bm::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

153 {
154 if (param == ACTION_OUTRO)
155 {
156 events.Reset();
157 events.ScheduleEvent(EVENT_OUTRO_1, 4000);
159
160 me->SummonGameObject(GO_DARK_PORTAL, -2086.0f, 7125.6215f, 30.5f, 6.148f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
161 }
162 }
@ ACTION_OUTRO
Definition: the_black_morass.h:100
@ GO_DARK_PORTAL
Definition: the_black_morass.cpp:30
@ EVENT_OUTRO_1
Definition: the_black_morass.cpp:38
events
Definition: boss_sartura.cpp:43
Creature * me
Definition: ScriptedCreature.h:280
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2369
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4111

References ACTION_OUTRO, EVENT_OUTRO_1, GO_DARK_PORTAL, Unit::InterruptNonMeleeSpells(), ScriptedAI::me, and WorldObject::SummonGameObject().

◆ JustDied()

void npc_medivh_bm::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

165 {
167 events.Reset();
168 }
constexpr auto DAY
Definition: Common.h:49
void SetRespawnTime(uint32 respawn)
Definition: Creature.cpp:3762

References DAY, ScriptedAI::me, and Creature::SetRespawnTime().

◆ JustSummoned()

void npc_medivh_bm::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

109 {
110 if (summon->GetEntry() == NPC_DP_CRYSTAL_STALKER)
111 {
112 summon->DespawnOrUnsummon(25000);
113 summon->CastSpell(summon, RAND(SPELL_BANISH_PURPLE, SPELL_BANISH_GREEN), true);
115 }
116 else if (summon->GetEntry() == NPC_DP_EMITTER_STALKER)
117 {
118 summon->CastSpell(summon, SPELL_BLACK_CRYSTAL, true);
119 Movement::MoveSplineInit init(summon);
120 init.MovebyPath(_groundArray);
121 init.SetCyclic();
122 init.Launch();
123 }
124 }
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition: CreatureAIImpl.h:30
@ SPELL_BLACK_CRYSTAL
Definition: the_black_morass.h:119
@ SPELL_BANISH_PURPLE
Definition: the_black_morass.h:121
@ SPELL_BANISH_GREEN
Definition: the_black_morass.h:122
@ NPC_DP_EMITTER_STALKER
Definition: the_black_morass.h:90
@ NPC_DP_CRYSTAL_STALKER
Definition: the_black_morass.h:91
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
uint32 GetEntry() const
Definition: Object.h:112
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
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
void MoveSplinePath(Movement::PointsArray *path)
Definition: MotionMaster.cpp:454
Definition: MoveSplineInit.h:71

References _airArray, _groundArray, Unit::CastSpell(), Creature::DespawnOrUnsummon(), Object::GetEntry(), Unit::GetMotionMaster(), Movement::MoveSplineInit::Launch(), Movement::MoveSplineInit::MovebyPath(), MotionMaster::MoveSplinePath(), NPC_DP_CRYSTAL_STALKER, NPC_DP_EMITTER_STALKER, RAND(), Movement::MoveSplineInit::SetCyclic(), SPELL_BANISH_GREEN, SPELL_BANISH_PURPLE, and SPELL_BLACK_CRYSTAL.

◆ MoveInLineOfSight()

void npc_medivh_bm::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

127 {
128 if (!events.Empty() || _instance->GetBossState(DATA_AEONUS) == DONE)
129 {
130 return;
131 }
132
133 if (who->IsPlayer() && me->IsWithinDistInMap(who, 20.0f))
134 {
137
139
140 events.ScheduleEvent(EVENT_CHECK_HEALTH_75, 500);
141 events.ScheduleEvent(EVENT_CHECK_HEALTH_50, 500);
142 events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 500);
143 events.ScheduleEvent(EVENT_SUMMON_CRYSTAL, 2000);
144 events.ScheduleEvent(EVENT_SUMMON_CRYSTAL, 4000);
145 events.ScheduleEvent(EVENT_SUMMON_CRYSTAL, 6000);
146 events.ScheduleEvent(EVENT_SUMMON_FLYING_CRYSTAL, 8000);
147 }
148 }
@ DONE
Definition: InstanceScript.h:60
@ SPELL_MEDIVH_CHANNEL
Definition: the_black_morass.h:118
@ SAY_MEDIVH_ENTER
Definition: the_black_morass.h:107
@ DATA_MEDIVH
Definition: the_black_morass.h:36
@ DATA_AEONUS
Definition: the_black_morass.h:33
@ EVENT_SUMMON_FLYING_CRYSTAL
Definition: the_black_morass.cpp:36
@ EVENT_CHECK_HEALTH_50
Definition: the_black_morass.cpp:33
@ EVENT_CHECK_HEALTH_75
Definition: the_black_morass.cpp:34
@ EVENT_SUMMON_CRYSTAL
Definition: the_black_morass.cpp:35
@ EVENT_CHECK_HEALTH_25
Definition: the_black_morass.cpp:32
Talk
Definition: hyjal.cpp:82
bool IsPlayer() const
Definition: Object.h:197
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1321
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References _instance, Unit::CastSpell(), DATA_AEONUS, DATA_MEDIVH, DONE, EVENT_CHECK_HEALTH_25, EVENT_CHECK_HEALTH_50, EVENT_CHECK_HEALTH_75, EVENT_SUMMON_CRYSTAL, EVENT_SUMMON_FLYING_CRYSTAL, InstanceScript::GetBossState(), Object::IsPlayer(), WorldObject::IsWithinDistInMap(), ScriptedAI::me, SAY_MEDIVH_ENTER, ZoneScript::SetData(), and SPELL_MEDIVH_CHANNEL.

◆ Reset()

void npc_medivh_bm::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

96 {
97 events.Reset();
99
101 {
103 }
104
105 me->SetImmuneToNPC(false);
106 }
@ SPELL_MANA_SHIELD
Definition: karazhan.cpp:54
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition: Unit.cpp:13577

References _instance, Unit::CastSpell(), DATA_AEONUS, DONE, InstanceScript::GetBossState(), ScriptedAI::me, Unit::SetImmuneToNPC(), SPELL_MANA_SHIELD, and SPELL_MEDIVH_CHANNEL.

◆ SummonOrcs()

void npc_medivh_bm::SummonOrcs ( float  x,
float  y,
uint32  duration,
uint32  homeTime,
bool  first 
)
inline
232 {
233 for (uint8 i = 0; i < 6; ++i)
234 {
235 if (Creature* cr = me->SummonCreature(NPC_SHADOW_COUNCIL_ENFORCER, -2091.731f, 7133.083f - 3.0f * i, 34.589f, 0.0f))
236 {
237 cr->GetMotionMaster()->MovePoint(0, (first && i == 3) ? x + 2.0f : x, cr->GetPositionY() + y, cr->GetMapHeight(x, cr->GetPositionY() + y, cr->GetPositionZ(), true));
238 cr->m_Events.AddEvent(new NpcRunToHome(*cr), cr->m_Events.CalculateTime(homeTime + urand(0, 2000)));
239 cr->DespawnOrUnsummon(duration + urand(0, 2000));
240 }
241 }
242 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ NPC_SHADOW_COUNCIL_ENFORCER
Definition: the_black_morass.cpp:29
Definition: Creature.h:46
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2355
Definition: the_black_morass.cpp:53

References ScriptedAI::me, NPC_SHADOW_COUNCIL_ENFORCER, WorldObject::SummonCreature(), and urand().

Referenced by UpdateAI().

◆ UpdateAI()

void npc_medivh_bm::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

171 {
172 events.Update(diff);
173 switch (uint32 eventId = events.ExecuteEvent())
174 {
178 if (_instance->GetData(DATA_SHIELD_PERCENT) <= eventId * 25)
179 {
180 Talk(eventId + 1);
181 break;
182 }
183 events.ScheduleEvent(eventId, 500);
184 break;
187 break;
190 events.ScheduleEvent(EVENT_SUMMON_FLYING_CRYSTAL, 1000);
191 break;
192 case EVENT_OUTRO_1:
193 me->SetFacingTo(6.21f);
195 events.ScheduleEvent(EVENT_OUTRO_2, 17000);
196 break;
197 case EVENT_OUTRO_2:
198 me->SetFacingTo(3.07f);
199 events.ScheduleEvent(EVENT_OUTRO_3, 2000);
200 break;
201 case EVENT_OUTRO_3:
202 SummonOrcs(-2046.158f, -3.0f, 37000, 30000, true);
203 events.ScheduleEvent(EVENT_OUTRO_4, 2000);
204 break;
205 case EVENT_OUTRO_4:
206 SummonOrcs(-2055.97f, -2.0f, 33000, 28000, false);
207 events.ScheduleEvent(EVENT_OUTRO_5, 2000);
208 break;
209 case EVENT_OUTRO_5:
210 SummonOrcs(-2064.0f, -1.5f, 29000, 26000, false);
211 events.ScheduleEvent(EVENT_OUTRO_6, 2000);
212 break;
213 case EVENT_OUTRO_6:
214 SummonOrcs(-2074.35f, -0.1f, 26000, 24000, false);
215 events.ScheduleEvent(EVENT_OUTRO_7, 7000);
216 break;
217 case EVENT_OUTRO_7:
219 events.ScheduleEvent(EVENT_OUTRO_8, 7000);
220 break;
221 case EVENT_OUTRO_8:
223 {
224 cr->SetFacingTo(3.07f);
225 cr->AI()->Talk(SAY_MEDIVH_ORCS_ANSWER);
226 }
227 break;
228 }
229 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_PORTAL_CRYSTALS
Definition: the_black_morass.h:120
@ SAY_MEDIVH_ORCS_ANSWER
Definition: the_black_morass.h:112
@ SAY_MEDIVH_ORCS_ENTER
Definition: the_black_morass.h:110
@ SAY_MEDIVH_WIN
Definition: the_black_morass.h:109
@ DATA_SHIELD_PERCENT
Definition: the_black_morass.h:39
@ EVENT_OUTRO_2
Definition: the_black_morass.cpp:39
@ EVENT_OUTRO_3
Definition: the_black_morass.cpp:40
@ EVENT_OUTRO_7
Definition: the_black_morass.cpp:44
@ EVENT_OUTRO_5
Definition: the_black_morass.cpp:42
@ EVENT_OUTRO_8
Definition: the_black_morass.cpp:45
@ EVENT_OUTRO_6
Definition: the_black_morass.cpp:43
@ EVENT_OUTRO_4
Definition: the_black_morass.cpp:41
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
void SetFacingTo(float ori)
Definition: Unit.cpp:20483
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
void SummonOrcs(float x, float y, uint32 duration, uint32 homeTime, bool first)
Definition: the_black_morass.cpp:231

References _instance, Unit::CastSpell(), DATA_SHIELD_PERCENT, EVENT_CHECK_HEALTH_25, EVENT_CHECK_HEALTH_50, EVENT_CHECK_HEALTH_75, EVENT_OUTRO_1, EVENT_OUTRO_2, EVENT_OUTRO_3, EVENT_OUTRO_4, EVENT_OUTRO_5, EVENT_OUTRO_6, EVENT_OUTRO_7, EVENT_OUTRO_8, EVENT_SUMMON_CRYSTAL, EVENT_SUMMON_FLYING_CRYSTAL, WorldObject::FindNearestCreature(), ZoneScript::GetData(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ScriptedAI::me, NPC_DP_EMITTER_STALKER, NPC_SHADOW_COUNCIL_ENFORCER, SAY_MEDIVH_ORCS_ANSWER, SAY_MEDIVH_ORCS_ENTER, SAY_MEDIVH_WIN, Unit::SetFacingTo(), SPELL_PORTAL_CRYSTALS, WorldObject::SummonCreature(), and SummonOrcs().

Member Data Documentation

◆ _airArray

Movement::PointsArray npc_medivh_bm::_airArray
private

Referenced by JustSummoned(), and npc_medivh_bm().

◆ _events

EventMap npc_medivh_bm::_events
private

◆ _groundArray

Movement::PointsArray npc_medivh_bm::_groundArray
private

Referenced by JustSummoned(), and npc_medivh_bm().

◆ _instance

InstanceScript* npc_medivh_bm::_instance
private