AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_wind_stone::go_wind_stoneAI Struct Reference
Inheritance diagram for go_wind_stone::go_wind_stoneAI:
GameObjectAI

Public Member Functions

 go_wind_stoneAI (GameObject *go)
 
void InitializeAI () override
 
bool GossipHello (Player *player, bool reportUse) override
 
bool GossipSelect (Player *player, uint32 sender, uint32 action) override
 
void SummonNPC (GameObject *go, Player *player, uint32 npc, uint32 spellId)
 
- Public Member Functions inherited from GameObjectAI
 GameObjectAI (GameObject *go)
 
virtual ~GameObjectAI ()
 
virtual void UpdateAI (uint32)
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void DoAction (int32)
 
virtual void SetGUID (ObjectGuid, int32)
 
virtual ObjectGuid GetGUID (int32) const
 
virtual bool GossipHello (Player *, bool)
 
virtual bool GossipSelect (Player *, uint32, uint32)
 
virtual bool GossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual bool QuestAccept (Player *, Quest const *)
 
virtual bool QuestReward (Player *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *)
 
virtual void Destroyed (Player *, uint32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void OnGameEvent (bool, uint16)
 
virtual void OnStateChanged (uint32, Unit *)
 
virtual void EventInform (uint32)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual void JustSummoned (Creature *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 

Private Attributes

ObjectGuid _creatureGuid
 

Additional Inherited Members

- Static Public Member Functions inherited from GameObjectAI
static int32 Permissible (GameObject const *go)
 
- Protected Attributes inherited from GameObjectAI
GameObject *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ go_wind_stoneAI()

go_wind_stone::go_wind_stoneAI::go_wind_stoneAI ( GameObject go)
inline
1034: GameObjectAI(go) {}
Definition: GameObjectAI.h:33

Member Function Documentation

◆ GossipHello()

bool go_wind_stone::go_wind_stoneAI::GossipHello ( Player player,
bool  reportUse 
)
inlineoverridevirtual

Reimplemented from GameObjectAI.

1042 {
1043 if (reportUse)
1044 {
1045 uint32 gossipId = me->GetGOInfo()->GetGossipMenuId();
1046 bool _twilightSetAura = (player->HasAura(AURA_TWILIGHT_SET, player->GetGUID()));
1047 bool _medallionAura = (player->HasAura(AURA_MEDALLION, player->GetGUID()));
1048 bool _ringAura = (player->HasAura(AURA_RING, player->GetGUID()));
1049
1050 switch (gossipId)
1051 {
1052 case GOSSIPID_LESSER_WS:
1053 {
1054 if (!_twilightSetAura)
1055 me->CastSpell(player, SPELL_PUNISHMENT);
1056 break;
1057 }
1058 case GOSSIPID_WS:
1059 {
1060 if (!_twilightSetAura || !_medallionAura)
1061 me->CastSpell(player, SPELL_PUNISHMENT);
1062 break;
1063 }
1065 {
1066 if (!_twilightSetAura || !_medallionAura || !_ringAura)
1067 me->CastSpell(player, SPELL_PUNISHMENT);
1068 break;
1069 }
1070 default:
1071 break;
1072 }
1073 }
1074 return false;
1075 }
std::uint32_t uint32
Definition: Define.h:107
@ AURA_MEDALLION
Definition: zone_silithus.cpp:970
@ GOSSIPID_GREATER_WS
Definition: zone_silithus.cpp:991
@ GOSSIPID_LESSER_WS
Definition: zone_silithus.cpp:989
@ AURA_RING
Definition: zone_silithus.cpp:971
@ GOSSIPID_WS
Definition: zone_silithus.cpp:990
@ SPELL_PUNISHMENT
Definition: zone_silithus.cpp:972
@ AURA_TWILIGHT_SET
Definition: zone_silithus.cpp:969
GameObject *const me
Definition: GameObjectAI.h:35
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:136
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2087
uint32 GetGossipMenuId() const
Definition: GameObjectData.h:552
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698

References AURA_MEDALLION, AURA_RING, AURA_TWILIGHT_SET, Object::GetGUID(), GOSSIPID_GREATER_WS, GOSSIPID_LESSER_WS, GOSSIPID_WS, Unit::HasAura(), and SPELL_PUNISHMENT.

◆ GossipSelect()

bool go_wind_stone::go_wind_stoneAI::GossipSelect ( Player player,
uint32  sender,
uint32  action 
)
inlineoverridevirtual

Reimplemented from GameObjectAI.

1078 {
1079 Seconds respawnTimer{};
1081
1083 if (lastSpawn && lastSpawn->IsAlive())
1084 {
1085 // We already summoned something recently, return.
1086 CloseGossipMenuFor(player);
1087 return true;
1088 }
1089 else
1090 {
1092 }
1093
1094 if (sender == GOSSIPID_LESSER_WS)
1095 {
1096 respawnTimer = 300s; // Lesser Windstone respawn in 5 minutes
1097
1098 switch (action)
1099 {
1100 case 0:
1102 break;
1103 case 1:
1105 break;
1106 case 2:
1108 break;
1109 case 3:
1111 break;
1112 case 4:
1114 break;
1115 default:
1116 break;
1117 }
1118 }
1119 else if (sender == GOSSIPID_WS)
1120 {
1121 respawnTimer = 900s; // Windstone respawn in 15 minutes
1122
1123 switch (action)
1124 {
1125 case 0:
1127 break;
1128 case 1:
1130 break;
1131 case 2:
1133 break;
1134 case 3:
1136 break;
1137 case 4:
1139 break;
1140 default:
1141 break;
1142 }
1143 }
1144 else if (sender == GOSSIPID_GREATER_WS)
1145 {
1146 respawnTimer = 10800s; // Greater Windstone respawn in 3 hours
1147
1148 switch (action)
1149 {
1150 case 0:
1152 break;
1153 case 1:
1155 break;
1156 case 2:
1158 break;
1159 case 3:
1161 break;
1162 case 4:
1164 break;
1165 default:
1166 break;
1167 }
1168 }
1169
1170 me->DespawnOrUnsummon(5000ms, respawnTimer); // Despawn in 5 Seconds for respawnTimer value
1172 CloseGossipMenuFor(player);
1173 return false;
1174 }
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:30
@ NPC_TEMPLAR_AIR
Definition: zone_silithus.cpp:994
@ SPELL_TEMPLAR_FIRE
Definition: zone_silithus.cpp:975
@ NPC_TEMPLAR_WATER
Definition: zone_silithus.cpp:993
@ SPELL_DUKE_WATER
Definition: zone_silithus.cpp:983
@ NPC_ROYAL_FIRE
Definition: zone_silithus.cpp:1000
@ NPC_DUKE_AIR
Definition: zone_silithus.cpp:999
@ SPELL_ROYAL_WATER
Definition: zone_silithus.cpp:988
@ SPELL_ROYAL_AIR
Definition: zone_silithus.cpp:986
@ SPELL_ROYAL_RANDOM
Definition: zone_silithus.cpp:984
@ SPELL_DUKE_AIR
Definition: zone_silithus.cpp:981
@ SPELL_ROYAL_FIRE
Definition: zone_silithus.cpp:985
@ NPC_ROYAL_EARTH
Definition: zone_silithus.cpp:1002
@ NPC_TEMPLAR_EARTH
Definition: zone_silithus.cpp:995
@ NPC_TEMPLAR_FIRE
Definition: zone_silithus.cpp:992
@ NPC_DUKE_WATER
Definition: zone_silithus.cpp:997
@ SPELL_DUKE_FIRE
Definition: zone_silithus.cpp:980
@ NPC_ROYAL_WATER
Definition: zone_silithus.cpp:1003
@ NPC_ROYAL_AIR
Definition: zone_silithus.cpp:1001
@ SPELL_DUKE_RANDOM
Definition: zone_silithus.cpp:979
@ SPELL_DUKE_EARTH
Definition: zone_silithus.cpp:982
@ SPELL_ROYAL_EARTH
Definition: zone_silithus.cpp:987
@ NPC_DUKE_FIRE
Definition: zone_silithus.cpp:996
@ SPELL_TEMPLAR_AIR
Definition: zone_silithus.cpp:976
@ SPELL_TEMPLAR_WATER
Definition: zone_silithus.cpp:978
@ SPELL_TEMPLAR_EARTH
Definition: zone_silithus.cpp:977
@ SPELL_TEMPLAR_RANDOM
Definition: zone_silithus.cpp:974
@ NPC_DUKE_EARTH
Definition: zone_silithus.cpp:998
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition: CreatureAIImpl.h:25
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
Definition: Creature.h:43
void SendCloseGossip()
Definition: GossipDef.cpp:239
void SetGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:218
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:935
void Clear()
Definition: ObjectGuid.h:138
PlayerMenu * PlayerTalkClass
Definition: Player.h:2239
bool IsAlive() const
Definition: Unit.h:1654
ObjectGuid _creatureGuid
Definition: zone_silithus.cpp:1205
void SummonNPC(GameObject *go, Player *player, uint32 npc, uint32 spellId)
Definition: zone_silithus.cpp:1176

References CloseGossipMenuFor(), ObjectAccessor::GetCreature(), GO_FLAG_NOT_SELECTABLE, GOSSIPID_GREATER_WS, GOSSIPID_LESSER_WS, GOSSIPID_WS, Unit::IsAlive(), NPC_DUKE_AIR, NPC_DUKE_EARTH, NPC_DUKE_FIRE, NPC_DUKE_WATER, NPC_ROYAL_AIR, NPC_ROYAL_EARTH, NPC_ROYAL_FIRE, NPC_ROYAL_WATER, NPC_TEMPLAR_AIR, NPC_TEMPLAR_EARTH, NPC_TEMPLAR_FIRE, NPC_TEMPLAR_WATER, Player::PlayerTalkClass, RAND(), PlayerMenu::SendCloseGossip(), SPELL_DUKE_AIR, SPELL_DUKE_EARTH, SPELL_DUKE_FIRE, SPELL_DUKE_RANDOM, SPELL_DUKE_WATER, SPELL_ROYAL_AIR, SPELL_ROYAL_EARTH, SPELL_ROYAL_FIRE, SPELL_ROYAL_RANDOM, SPELL_ROYAL_WATER, SPELL_TEMPLAR_AIR, SPELL_TEMPLAR_EARTH, SPELL_TEMPLAR_FIRE, SPELL_TEMPLAR_RANDOM, and SPELL_TEMPLAR_WATER.

◆ InitializeAI()

void go_wind_stone::go_wind_stoneAI::InitializeAI ( )
inlineoverridevirtual

Reimplemented from GameObjectAI.

1037 {
1039 }
void RemoveGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:219

References GO_FLAG_NOT_SELECTABLE.

◆ SummonNPC()

void go_wind_stone::go_wind_stoneAI::SummonNPC ( GameObject go,
Player player,
uint32  npc,
uint32  spellId 
)
inline
1177 {
1178 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
1179 if (!spellInfo)
1180 return;
1181 SpellInfo const* spellInfoTrigger = sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell);
1182 if (!spellInfoTrigger)
1183 return;
1184 Spell* spell = new Spell(player, spellInfoTrigger, TRIGGERED_NONE);
1185 SpellCastResult result = spell->CheckCast(true);
1186 delete spell;
1187 if (result != SPELL_CAST_OK)
1188 {
1189 return;
1190 }
1191 player->CastSpell(player, spellInfoTrigger->Id, false);
1193 {
1194 summons->SetCorpseDelay(5 * MINUTE);
1195 summons->SetTarget(player->GetGUID());
1196 summons->SetLootRecipient(player);
1197 summons->CastSpell(summons, SPELL_SPAWN_IN, false);
1198 summons->AI()->Talk(SAY_ON_SPAWN_IN, player);
1199 summons->m_Events.AddEvent(new DelayedWindstoneSummonEvent(summons, player->GetGUID()), summons->m_Events.CalculateTime(5200));
1200 _creatureGuid = summons->GetGUID();
1201 }
1202 }
constexpr auto MINUTE
Definition: Common.h:47
@ SAY_ON_SPAWN_IN
Definition: zone_silithus.cpp:1004
@ SPELL_SPAWN_IN
Definition: zone_silithus.cpp:973
float summons[3][4]
Definition: boss_urom.cpp:76
@ EFFECT_0
Definition: SharedDefines.h:31
SpellCastResult
Definition: SharedDefines.h:948
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
@ TRIGGERED_NONE
Definition: SpellDefines.h:133
#define sSpellMgr
Definition: SpellMgr.h:825
@ TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE
Definition: Object.h:55
npc
Definition: BattlegroundSA.h:75
Definition: TemporarySummon.h:40
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
float GetPositionZ() const
Definition: Position.h:118
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
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:1167
Definition: Spell.h:287
SpellCastResult CheckCast(bool strict)
Definition: Spell.cpp:5658
Definition: SpellInfo.h:316
uint32 Id
Definition: SpellInfo.h:320
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition: SpellInfo.h:393
Definition: zone_silithus.cpp:1008

References Unit::CastSpell(), Spell::CheckCast(), EFFECT_0, SpellInfo::Effects, Object::GetGUID(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), SpellInfo::Id, MINUTE, SAY_ON_SPAWN_IN, SPELL_CAST_OK, SPELL_SPAWN_IN, sSpellMgr, WorldObject::SummonCreature(), summons, TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE, and TRIGGERED_NONE.

Member Data Documentation

◆ _creatureGuid

ObjectGuid go_wind_stone::go_wind_stoneAI::_creatureGuid
private