AzerothCore 3.3.5a
OpenSource WoW Emulator
No Matches
npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI Struct Reference
Inheritance diagram for npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI:
NullCreatureAI CreatureAI UnitAI

Public Member Functions

 npc_pos_martin_or_gorkun_secondAI (Creature *creature)
void MovementInform (uint32 type, uint32 id) override
void DoAction (int32 p) override
void JustSummoned (Creature *s) override
void SummonedCreatureDespawn (Creature *s) override
void UpdateAI (uint32 diff) override
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
void MoveInLineOfSight (Unit *) override
void AttackStart (Unit *) override
void UpdateAI (uint32) override
void EnterEvadeMode (EvadeReason) override
void OnCharmed (bool) override
- 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.
void Talk (uint8 id, Milliseconds delay)
 CreatureAI (Creature *creature)
 ~CreatureAI () override
void MoveCircleChecks ()
void MoveBackwardsChecks ()
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
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.
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 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
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 ==================
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 ()
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 *)
- 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
virtual void InitializeAI ()
virtual void Reset ()
virtual void OnCharmed (bool apply)=0
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)
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 (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
virtual void HealReceived (Unit *, uint32 &)
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
virtual void HealDone (Unit *, uint32 &)
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
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)
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)
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always 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)
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

Public Attributes

EventMap events
SummonList summons
uint8 i

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason {
- Static Public Member Functions inherited from NullCreatureAI
static int32 Permissible (Creature const *creature)
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
bool UpdateVictimWithGaze ()
void SetGazeOn (Unit *target)
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
virtual void MoveInLineOfSight (Unit *)
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
- Protected Attributes inherited from CreatureAI
Creature *const me
EventMap events
TaskScheduler scheduler
CreatureBoundary const * _boundary
bool _negateBoundary
- Protected Attributes inherited from UnitAI
Unit *const me

Detailed Description

Constructor & Destructor Documentation

◆ npc_pos_martin_or_gorkun_secondAI()

npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::npc_pos_martin_or_gorkun_secondAI ( Creature creature)
922 : NullCreatureAI(creature), summons(me)
923 {
926 i = 0;
927 events.Reset();
928 events.RescheduleEvent(1, 500ms);
929 events.RescheduleEvent(2, 15s);
931 if (pInstance)
933 {
935 c->SetImmuneToPC(false);
936 c->SetReactState(REACT_AGGRESSIVE);
937 //c->ClearUnitState(UNIT_STATE_ONVEHICLE);
938 if (Player* plr = c->SelectNearestPlayer(100.0f))
939 {
940 c->AI()->AttackStart(plr);
942 }
943 }
944 }
Definition: UpdateFields.h:140
Definition: Unit.h:1037
Definition: boss_sartura.cpp:43
Definition: pit_of_saron.h:317
Definition: pit_of_saron.h:46
Definition: SharedDefines.h:1966
Definition: PassiveAI.h:53
Creature *const me
Definition: CreatureAI.h:73
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:94
Definition: Creature.h:46
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Player * SelectNearestPlayer(float distance=0) const
Definition: Object.cpp:2461
Definition: Player.h:1056
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
Map * instance
Definition: InstanceScript.h:147
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3307
InstanceScript * pInstance
Definition: pit_of_saron.cpp:946
SummonList summons
Definition: pit_of_saron.cpp:948

References DATA_TYRANNUS_GUID, CreatureAI::DoZoneInCombat(), EMOTE_STATE_READY1H, Map::GetCreature(), InstanceScript::GetGuidData(), WorldObject::GetInstanceScript(), i, InstanceScript::instance, CreatureAI::me, pInstance, REACT_AGGRESSIVE, SAY_BOSS_TYRANNUS_INTRO_1, WorldObject::SelectNearestPlayer(), Object::SetUInt32Value(), and UNIT_NPC_EMOTESTATE.

Member Function Documentation

◆ DoAction()

void npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::DoAction ( int32  p)

Reimplemented from UnitAI.

960 {
961 if (p == 1)
963 else if (p == 2)
964 {
965 events.Reset();
968 if (!pInstance)
969 return;
976 for (ObjectGuid const& guid : summons)
977 if (Creature* c = pInstance->instance->GetCreature(guid))
978 {
979 float hx, hy, hz, ho;
980 c->GetHomePosition(hx, hy, hz, ho);
982 float ang = frand(1.92f, 2.36f);
983 float dist = urand(50, 85);
984 c->GetMotionMaster()->MovePoint(0, TSSpawnPos.GetPositionX() + cos(ang)*dist, TSSpawnPos.GetPositionY() + std::sin(ang)*dist, 628.2f);
985 }
986 }
987 else if (p == 3)
988 {
989 if (pInstance)
991 {
992 for (ObjectGuid const& guid : summons)
993 if (Creature* s = pInstance->instance->GetCreature(guid))
994 if (s->IsAlive())
995 Unit::Kill(c, s);
996 if (me->IsAlive())
997 Unit::Kill(c, me);
998 }
999 }
1000 }
float frand(float min, float max)
Definition: Random.cpp:57
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
const Position TSMidPos
Definition: pit_of_saron.h:280
Definition: pit_of_saron.h:108
const Position TSSpawnPos
Definition: pit_of_saron.h:279
const Position TSCenterPos
Definition: pit_of_saron.h:283
Definition: pit_of_saron.h:48
Definition: SharedDefines.h:1898
Definition: SharedDefines.h:1894
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
Definition: ObjectGuid.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
float GetAngle(const Position *pos) const
Definition: Position.cpp:77
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17956
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
bool IsAlive() const
Definition: Unit.h:1822
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211

References DATA_SINDRAGOSA_GUID, SummonList::DespawnAll(), SummonList::DespawnEntry(), EMOTE_ONESHOT_CHEER, EMOTE_ONESHOT_NONE, frand(), Position::GetAngle(), Map::GetCreature(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), InstanceScript::instance, Unit::IsAlive(), Unit::Kill(), CreatureAI::me, MotionMaster::MovePoint(), NPC_FALLEN_WARRIOR, pInstance, Object::SetUInt32Value(), summons, TSCenterPos, TSMidPos, TSSpawnPos, UNIT_NPC_EMOTESTATE, and urand().

◆ JustSummoned()

void npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::JustSummoned ( Creature s)

Reimplemented from CreatureAI.

1003 {
1004 summons.Summon(s);
1005 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90

References SummonList::Summon(), and summons.

◆ MovementInform()

void npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::MovementInform ( uint32  type,
uint32  id 

Reimplemented from CreatureAI.

952 {
953 if (type == POINT_MOTION_TYPE && id == 2)
954 {
955 events.RescheduleEvent(5, 1s);
956 }
957 }
Definition: MotionMaster.h:46


◆ SummonedCreatureDespawn()

void npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::SummonedCreatureDespawn ( Creature s)

Reimplemented from CreatureAI.

1008 {
1009 summons.Despawn(s);
1010 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:91

References SummonList::Despawn(), and summons.

◆ UpdateAI()

void npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::UpdateAI ( uint32  diff)

Reimplemented from NullCreatureAI.

1013 {
1014 events.Update(diff);
1016 switch(events.ExecuteEvent())
1017 {
1018 case 0:
1019 break;
1020 case 1:
1021 if (TSData[i].entry)
1022 {
1024 {
1026 c->GetMotionMaster()->MovePoint(0, TSData[i].x, TSData[i].y, TSHeight);
1027 }
1028 ++i;
1029 events.ScheduleEvent(1, 150ms);
1030 }
1031 break;
1032 case 2:
1034 events.RescheduleEvent(3, 8s);
1035 break;
1036 case 3:
1037 if (pInstance)
1039 c->AI()->Talk(SAY_BOSS_TYRANNUS_INTRO_2);
1041 me->SetFacingTo(5.26f);
1042 me->SetOrientation(5.26f);
1044 for (ObjectGuid const& guid : summons)
1045 if (Creature* c = pInstance->instance->GetCreature(guid))
1046 {
1047 c->SetFacingTo(5.26f);
1048 c->SetOrientation(5.26f);
1049 c->SetHomePosition(*c);
1050 }
1051 events.RescheduleEvent(10, 15s);
1053 events.RescheduleEvent(4, 15s);
1054 break;
1055 case 4:
1056 if (pInstance)
1058 c->AI()->DoAction(1);
1059 break;
1060 case 5:
1063 if (pInstance)
1065 c->AI()->DoAction(1);
1066 break;
1067 case 10:
1069 if (Creature* c = me->SummonCreature(NPC_FALLEN_WARRIOR, 1060.95f, 102.79f, 630.2f, 2.01f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
1070 {
1071 float offset = frand(0.0f, 10.0f);
1072 c->GetMotionMaster()->MovePoint(0, 1047.0f + offset, 118.0f + offset, 628.2f);
1073 c->SetHomePosition(*me);
1074 for (ObjectGuid const& guid : summons)
1075 if (Creature* s = pInstance->instance->GetCreature(guid))
1076 {
1077 if (s->GetEntry() == NPC_FALLEN_WARRIOR)
1078 continue;
1079 c->SetInCombatWith(s);
1080 s->SetInCombatWith(c);
1081 c->AddThreat(s, 0.0f);
1082 s->AddThreat(c, 0.0f);
1083 }
1084 }
1085 events.RescheduleEvent(10, 3000);
1086 break;
1087 }
1089 if (!UpdateVictim())
1090 return;
1093 }
Definition: Object.h:47
const TSPosition TSData[]
Definition: pit_of_saron.h:294
Definition: pit_of_saron.h:114
const float TSHeight
Definition: pit_of_saron.h:281
Definition: pit_of_saron.h:328
Definition: pit_of_saron.h:318
Definition: pit_of_saron.h:321
Definition: pit_of_saron.h:329
Definition: pit_of_saron.h:319
Definition: pit_of_saron.h:47
Definition: boss_fathomlord_karathress.cpp:25
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:268
uint32 GetEntryCount(uint32 entry) const
Definition: ScriptedCreature.cpp:105
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:330
uint32 GetEntry() const
Definition: Object.h:109
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:2343
float GetOrientation() const
Definition: Position.h:120
void SetOrientation(float orientation)
Definition: Position.h:112
void SetFacingTo(float ori)
Definition: Unit.cpp:20884
uint32 entry
Definition: pit_of_saron.h:290

References DATA_LEADER_SECOND_GUID, DATA_TYRANNUS_GUID, UnitAI::DoMeleeAttackIfReady(), EMOTE_STATE_READY1H, TSPosition::entry, frand(), Map::GetCreature(), Object::GetEntry(), SummonList::GetEntryCount(), InstanceScript::GetGuidData(), Position::GetOrientation(), i, InstanceScript::instance, CreatureAI::me, NPC_FALLEN_WARRIOR, NPC_MARTIN_VICTUS_2, pInstance, SAY_BOSS_TYRANNUS_INTRO_2, SAY_GENERAL_ALLIANCE_OUTRO_1, SAY_GENERAL_ALLIANCE_TRASH, SAY_GENERAL_HORDE_OUTRO_1, SAY_GENERAL_HORDE_TRASH, Unit::SetFacingTo(), Creature::SetHomePosition(), Position::SetOrientation(), WorldObject::SummonCreature(), summons, TEMPSUMMON_CORPSE_TIMED_DESPAWN, TSCenterPos, TSData, TSHeight, TSSpawnPos, UNIT_NPC_EMOTESTATE, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ events

EventMap npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::events

◆ i

uint8 npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::i

◆ pInstance

InstanceScript* npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::pInstance

◆ summons

SummonList npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::summons