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

Public Member Functions

 dragonmaw_race_npc (Creature *creature)
 
void Reset () override
 
void sQuestAccept (Player *player, Quest const *) override
 
void TakeOff ()
 
void StartRace ()
 
void FailQuest (Player *player)
 
void StartRaceAttacks ()
 
void FinishRace ()
 
void MovementInform (uint32, uint32 id) override
 
void PathEndReached (uint32) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- 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
 
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=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)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 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

ObjectGuid _playerGUID
 

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

◆ dragonmaw_race_npc()

dragonmaw_race_npc::dragonmaw_race_npc ( Creature creature)
inline
1864 : ScriptedAI(creature)
1865 {
1866 }
Definition: ScriptedCreature.h:190

Member Function Documentation

◆ FailQuest()

void dragonmaw_race_npc::FailQuest ( Player player)
inline
1930 {
1931 if (player)
1932 {
1933 switch (me->GetEntry())
1934 {
1935 case NPC_MUCKJAW:
1936 player->FailQuest(QUEST_MUCKJAW);
1937 break;
1938 case NPC_TROPE:
1939 player->FailQuest(QUEST_TROPE);
1940 break;
1941 case NPC_CORLOK:
1942 player->FailQuest(QUEST_CORLOK);
1943 break;
1944 case NPC_ICHMAN:
1945 player->FailQuest(QUEST_ICHMAN);
1946 break;
1947 case NPC_MULVERICK:
1948 player->FailQuest(QUEST_MULVERICK);
1949 break;
1950 case NPC_SKYSHATTER:
1951 player->FailQuest(QUEST_SKYSHATTER);
1952 break;
1953 default:
1954 break;
1955 }
1956 }
1958 me->DespawnOnEvade();
1959 }
@ QUEST_ICHMAN
Definition: zone_shadowmoon_valley.cpp:1832
@ NPC_ICHMAN
Definition: zone_shadowmoon_valley.cpp:1839
@ QUEST_MUCKJAW
Definition: zone_shadowmoon_valley.cpp:1829
@ NPC_SKYSHATTER
Definition: zone_shadowmoon_valley.cpp:1841
@ QUEST_TROPE
Definition: zone_shadowmoon_valley.cpp:1830
@ NPC_TROPE
Definition: zone_shadowmoon_valley.cpp:1837
@ NPC_CORLOK
Definition: zone_shadowmoon_valley.cpp:1838
@ QUEST_MULVERICK
Definition: zone_shadowmoon_valley.cpp:1833
@ QUEST_SKYSHATTER
Definition: zone_shadowmoon_valley.cpp:1834
@ NPC_MULVERICK
Definition: zone_shadowmoon_valley.cpp:1840
@ QUEST_CORLOK
Definition: zone_shadowmoon_valley.cpp:1831
@ NPC_MUCKJAW
Definition: zone_shadowmoon_valley.cpp:1836
TaskScheduler & CancelAll()
Definition: TaskScheduler.cpp:45
TaskScheduler scheduler
Definition: CreatureAI.h:75
Creature * me
Definition: ScriptedCreature.h:280
void DespawnOnEvade(Seconds respawnDelay=20s)
Definition: Creature.cpp:2186
uint32 GetEntry() const
Definition: Object.h:115
void FailQuest(uint32 quest_id)
Definition: PlayerQuest.cpp:885

References Player::FailQuest(), NPC_CORLOK, NPC_ICHMAN, NPC_MUCKJAW, NPC_MULVERICK, NPC_SKYSHATTER, NPC_TROPE, QUEST_CORLOK, QUEST_ICHMAN, QUEST_MUCKJAW, QUEST_MULVERICK, QUEST_SKYSHATTER, and QUEST_TROPE.

◆ FinishRace()

void dragonmaw_race_npc::FinishRace ( )
inline
2060 {
2062 me->SetHover(false);
2063 me->SetDisableGravity(false);
2064 me->SetWalk(true);
2065
2067 if (!player)
2068 return;
2069
2070 Talk(SAY_COMPLETE, player);
2071 switch (me->GetEntry())
2072 {
2073 case NPC_MUCKJAW:
2075 break;
2076 case NPC_TROPE:
2078 break;
2079 case NPC_CORLOK:
2081 break;
2082 case NPC_ICHMAN:
2084 break;
2085 case NPC_MULVERICK:
2087 break;
2088 case NPC_SKYSHATTER:
2090 break;
2091 default:
2092 break;
2093 }
2094 }
@ SAY_COMPLETE
Definition: zone_shadowmoon_valley.cpp:1858
Talk
Definition: hyjal.cpp:82
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:220
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3205
bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3370
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition: Creature.cpp:3191
Map * GetMap() const
Definition: Object.h:536
Definition: Player.h:1081
void AreaExploredOrEventHappens(uint32 questId)
Definition: PlayerQuest.cpp:1790
ObjectGuid _playerGUID
Definition: zone_shadowmoon_valley.cpp:2236

References Player::AreaExploredOrEventHappens(), ObjectAccessor::GetPlayer(), NPC_CORLOK, NPC_ICHMAN, NPC_MUCKJAW, NPC_MULVERICK, NPC_SKYSHATTER, NPC_TROPE, QUEST_CORLOK, QUEST_ICHMAN, QUEST_MUCKJAW, QUEST_MULVERICK, QUEST_SKYSHATTER, QUEST_TROPE, and SAY_COMPLETE.

◆ MovementInform()

void dragonmaw_race_npc::MovementInform ( uint32  ,
uint32  id 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

2097 {
2098 switch (me->GetEntry())
2099 {
2100 case NPC_MUCKJAW:
2101 switch (id)
2102 {
2103 case 4:
2104 TakeOff();
2105 break;
2106 case 7:
2107 StartRace();
2108 break;
2109 case 9:
2111 break;
2112 case 35:
2113 FinishRace();
2114 break;
2115 case 37:
2116 Reset();
2117 break;
2118 }
2119 break;
2120 case NPC_TROPE:
2121 switch (id)
2122 {
2123 case 5:
2124 TakeOff();
2125 break;
2126 case 7:
2127 StartRace();
2128 break;
2129 case 10:
2131 break;
2132 case 53:
2133 FinishRace();
2134 break;
2135 case 60:
2136 Reset();
2137 break;
2138 }
2139 break;
2140 case NPC_CORLOK:
2141 switch (id)
2142 {
2143 case 6:
2144 TakeOff();
2145 break;
2146 case 9:
2147 StartRace();
2148 break;
2149 case 12:
2151 break;
2152 case 79:
2153 FinishRace();
2154 break;
2155 case 89:
2156 Reset();
2157 break;
2158 }
2159 break;
2160 case NPC_ICHMAN:
2161 switch (id)
2162 {
2163 case 4:
2164 TakeOff();
2165 StartRace();
2166 break;
2167 case 12:
2169 break;
2170 case 107:
2171 FinishRace();
2172 break;
2173 case 111:
2174 Reset();
2175 break;
2176 }
2177 break;
2178 case NPC_MULVERICK:
2179 switch (id)
2180 {
2181 case 5:
2182 TakeOff();
2183 break;
2184 case 9:
2185 StartRace();
2186 break;
2187 case 12:
2189 break;
2190 case 166:
2191 FinishRace();
2192 break;
2193 case 172:
2194 Reset();
2195 break;
2196 }
2197 break;
2198 case NPC_SKYSHATTER:
2199 switch (id)
2200 {
2201 case 3:
2202 TakeOff();
2203 break;
2204 case 7:
2205 StartRace();
2208 break;
2209 case 10:
2211 break;
2212 case 140:
2213 FinishRace();
2214 break;
2215 case 145:
2216 Reset();
2217 break;
2218 }
2219 break;
2220 default:
2221 break;
2222 }
2223 }
@ SAY_SKYSHATTER_SPECIAL
Definition: zone_shadowmoon_valley.cpp:1859
void Reset() override
Definition: zone_shadowmoon_valley.cpp:1868
void FinishRace()
Definition: zone_shadowmoon_valley.cpp:2059
void StartRaceAttacks()
Definition: zone_shadowmoon_valley.cpp:1961
void TakeOff()
Definition: zone_shadowmoon_valley.cpp:1912
void StartRace()
Definition: zone_shadowmoon_valley.cpp:1917

References ObjectAccessor::GetPlayer(), NPC_CORLOK, NPC_ICHMAN, NPC_MUCKJAW, NPC_MULVERICK, NPC_SKYSHATTER, NPC_TROPE, and SAY_SKYSHATTER_SPECIAL.

◆ PathEndReached()

void dragonmaw_race_npc::PathEndReached ( uint32  )
inlineoverridevirtual

Reimplemented from CreatureAI.

2226 {
2227 Reset();
2228 }

◆ Reset()

void dragonmaw_race_npc::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1869 {
1872 me->SetWalk(true);
1873 me->SetDisableGravity(false);
1876 }
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: UnitDefines.h:295
void Clear()
Definition: ObjectGuid.h:138
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:726
void MoveIdle()
Definition: MotionMaster.cpp:232

References ObjectGuid::Clear(), and UNIT_NPC_FLAG_QUESTGIVER.

◆ sQuestAccept()

void dragonmaw_race_npc::sQuestAccept ( Player player,
Quest const *   
)
inlineoverridevirtual

Reimplemented from UnitAI.

1879 {
1881 if (player)
1882 {
1883 _playerGUID = player->GetGUID();
1884 Talk(SAY_START, player);
1885 }
1886
1887 switch (me->GetEntry())
1888 {
1889 case NPC_MUCKJAW:
1891 break;
1892 case NPC_TROPE:
1894 break;
1895 case NPC_CORLOK:
1897 break;
1898 case NPC_ICHMAN:
1900 break;
1901 case NPC_MULVERICK:
1903 break;
1904 case NPC_SKYSHATTER:
1906 break;
1907 default:
1908 break;
1909 }
1910 }
@ SAY_START
Definition: zone_shadowmoon_valley.cpp:1857
@ PATH_ICHMAN
Definition: zone_shadowmoon_valley.cpp:1846
@ PATH_TROPE
Definition: zone_shadowmoon_valley.cpp:1844
@ PATH_MULVERICK
Definition: zone_shadowmoon_valley.cpp:1847
@ PATH_CORLOK
Definition: zone_shadowmoon_valley.cpp:1845
@ PATH_MUCKJAW
Definition: zone_shadowmoon_valley.cpp:1843
@ PATH_SKYSHATTER
Definition: zone_shadowmoon_valley.cpp:1848
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:727
void MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:852

References Object::GetGUID(), NPC_CORLOK, NPC_ICHMAN, NPC_MUCKJAW, NPC_MULVERICK, NPC_SKYSHATTER, NPC_TROPE, PATH_CORLOK, PATH_ICHMAN, PATH_MUCKJAW, PATH_MULVERICK, PATH_SKYSHATTER, PATH_TROPE, SAY_START, and UNIT_NPC_FLAG_QUESTGIVER.

◆ StartRace()

void dragonmaw_race_npc::StartRace ( )
inline
1918 {
1919 me->SetWalk(false);
1920
1921 ScheduleTimedEvent(5s, [&]
1922 {
1924 if (!player || !me->IsWithinDist(player, 100.f))
1925 FailQuest(player);
1926 }, 5s);
1927 }
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
Definition: ScriptedCreature.cpp:321
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1327
void FailQuest(Player *player)
Definition: zone_shadowmoon_valley.cpp:1929

References ObjectAccessor::GetPlayer(), and WorldObject::IsWithinDist().

◆ StartRaceAttacks()

void dragonmaw_race_npc::StartRaceAttacks ( )
inline
1962 {
1963 /*
1964 * Timers are placeholders
1965 * After spawned, the rest is done via SmartAI
1966 */
1967 if (_playerGUID.IsEmpty())
1968 return;
1969
1971 if (!player)
1972 return;
1973
1974 switch (me->GetEntry())
1975 {
1976 case NPC_MUCKJAW:
1977 ScheduleTimedEvent(4s, [&]
1978 {
1980 if (!player)
1981 return;
1982
1983 Position summonPos;
1984 summonPos = me->GetRandomPoint(player->GetPosition(), 15.f);
1985 summonPos.m_positionZ = player->GetPositionZ(); // So they don't spawn at ground height
1987 }, 4s, 8s);
1988 break;
1989 case NPC_TROPE:
1990 ScheduleTimedEvent(4s, [&]
1991 {
1993 if (!player)
1994 return;
1995
1996 Position summonPos;
1997 summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
1998 summonPos.m_positionZ = player->GetPositionZ();
2000 }, 1s, 3s);
2001 break;
2002 case NPC_CORLOK:
2003 ScheduleTimedEvent(4s, [&]
2004 {
2006 if (!player)
2007 return;
2008
2009 Position summonPos;
2010 summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
2011 summonPos.m_positionZ = player->GetPositionZ();
2013 }, 1s, 3s);
2014 break;
2015 case NPC_ICHMAN:
2016 ScheduleTimedEvent(4s, [&]
2017 {
2019 if (!player)
2020 return;
2021
2022 Position summonPos;
2023 summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
2024 summonPos.m_positionZ = player->GetPositionZ();
2026 }, 1s, 3s);
2027 break;
2028 case NPC_MULVERICK:
2029 ScheduleTimedEvent(4s, [&]
2030 {
2032 if (!player)
2033 return;
2034
2035 Position summonPos;
2036 summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
2037 summonPos.m_positionZ = player->GetPositionZ();
2039 }, 1s, 3s);
2040 break;
2041 case NPC_SKYSHATTER:
2042 ScheduleTimedEvent(4s, [&]
2043 {
2045 if (!player)
2046 return;
2047
2048 Position summonPos;
2049 summonPos = me->GetRandomPoint(player->GetPosition(), 7.f);
2050 summonPos.m_positionZ = player->GetPositionZ(); // So they don't spawn at ground height
2052 }, 1s, 3s);
2053 break;
2054 default:
2055 break;
2056 }
2057 }
@ NPC_TARGET_MUCKJAW
Definition: zone_shadowmoon_valley.cpp:1850
@ NPC_TARGET_SKYSHATTER
Definition: zone_shadowmoon_valley.cpp:1855
@ NPC_TARGET_MULVERICK
Definition: zone_shadowmoon_valley.cpp:1854
@ NPC_TARGET_CORLOK
Definition: zone_shadowmoon_valley.cpp:1852
@ NPC_TARGET_ICHMAN
Definition: zone_shadowmoon_valley.cpp:1853
@ NPC_TARGET_TROPE
Definition: zone_shadowmoon_valley.cpp:1851
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
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:2366
void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
Definition: Object.cpp:1513
bool IsEmpty() const
Definition: ObjectGuid.h:161
Definition: Position.h:27
float m_positionZ
Definition: Position.h:57
float GetPositionZ() const
Definition: Position.h:118
void GetPosition(float &x, float &y) const
Definition: Position.h:121

References ObjectAccessor::GetPlayer(), Position::GetPosition(), Position::GetPositionZ(), ObjectGuid::IsEmpty(), Position::m_positionZ, NPC_CORLOK, NPC_ICHMAN, NPC_MUCKJAW, NPC_MULVERICK, NPC_SKYSHATTER, NPC_TARGET_CORLOK, NPC_TARGET_ICHMAN, NPC_TARGET_MUCKJAW, NPC_TARGET_MULVERICK, NPC_TARGET_SKYSHATTER, NPC_TARGET_TROPE, NPC_TROPE, and TEMPSUMMON_TIMED_DESPAWN.

◆ TakeOff()

void dragonmaw_race_npc::TakeOff ( )
inline
1913 {
1914 me->SetDisableGravity(true);
1915 }

◆ UpdateAI()

void dragonmaw_race_npc::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

2231 {
2232 scheduler.Update(diff);
2233 }
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27

Member Data Documentation

◆ _playerGUID

ObjectGuid dragonmaw_race_npc::_playerGUID
private