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
1033: GameObjectAI(go) {}
Definition: GameObjectAI.h:34

Member Function Documentation

◆ GossipHello()

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

Reimplemented from GameObjectAI.

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

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.

1077 {
1078 Seconds respawnTimer{};
1080
1082 if (lastSpawn && lastSpawn->IsAlive())
1083 {
1084 // We already summoned something recently, return.
1085 CloseGossipMenuFor(player);
1086 return true;
1087 }
1088 else
1089 {
1091 }
1092
1093 if (sender == GOSSIPID_LESSER_WS)
1094 {
1095 respawnTimer = 300s; // Lesser Windstone respawn in 5 minutes
1096
1097 switch (action)
1098 {
1099 case 0:
1101 break;
1102 case 1:
1104 break;
1105 case 2:
1107 break;
1108 case 3:
1110 break;
1111 case 4:
1113 break;
1114 default:
1115 break;
1116 }
1117 }
1118 else if (sender == GOSSIPID_WS)
1119 {
1120 respawnTimer = 900s; // Windstone respawn in 15 minutes
1121
1122 switch (action)
1123 {
1124 case 0:
1126 break;
1127 case 1:
1129 break;
1130 case 2:
1132 break;
1133 case 3:
1135 break;
1136 case 4:
1138 break;
1139 default:
1140 break;
1141 }
1142 }
1143 else if (sender == GOSSIPID_GREATER_WS)
1144 {
1145 respawnTimer = 10800s; // Greater Windstone respawn in 3 hours
1146
1147 switch (action)
1148 {
1149 case 0:
1151 break;
1152 case 1:
1154 break;
1155 case 2:
1157 break;
1158 case 3:
1160 break;
1161 case 4:
1163 break;
1164 default:
1165 break;
1166 }
1167 }
1168
1169 me->DespawnOrUnsummon(5000ms, respawnTimer); // Despawn in 5 Seconds for respawnTimer value
1171 CloseGossipMenuFor(player);
1172 return false;
1173 }
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:30
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition: CreatureAIImpl.h:30
@ NPC_TEMPLAR_AIR
Definition: zone_silithus.cpp:993
@ SPELL_TEMPLAR_FIRE
Definition: zone_silithus.cpp:974
@ NPC_TEMPLAR_WATER
Definition: zone_silithus.cpp:992
@ SPELL_DUKE_WATER
Definition: zone_silithus.cpp:982
@ NPC_ROYAL_FIRE
Definition: zone_silithus.cpp:999
@ NPC_DUKE_AIR
Definition: zone_silithus.cpp:998
@ SPELL_ROYAL_WATER
Definition: zone_silithus.cpp:987
@ SPELL_ROYAL_AIR
Definition: zone_silithus.cpp:985
@ SPELL_ROYAL_RANDOM
Definition: zone_silithus.cpp:983
@ SPELL_DUKE_AIR
Definition: zone_silithus.cpp:980
@ SPELL_ROYAL_FIRE
Definition: zone_silithus.cpp:984
@ NPC_ROYAL_EARTH
Definition: zone_silithus.cpp:1001
@ NPC_TEMPLAR_EARTH
Definition: zone_silithus.cpp:994
@ NPC_TEMPLAR_FIRE
Definition: zone_silithus.cpp:991
@ NPC_DUKE_WATER
Definition: zone_silithus.cpp:996
@ SPELL_DUKE_FIRE
Definition: zone_silithus.cpp:979
@ NPC_ROYAL_WATER
Definition: zone_silithus.cpp:1002
@ NPC_ROYAL_AIR
Definition: zone_silithus.cpp:1000
@ SPELL_DUKE_RANDOM
Definition: zone_silithus.cpp:978
@ SPELL_DUKE_EARTH
Definition: zone_silithus.cpp:981
@ SPELL_ROYAL_EARTH
Definition: zone_silithus.cpp:986
@ NPC_DUKE_FIRE
Definition: zone_silithus.cpp:995
@ SPELL_TEMPLAR_AIR
Definition: zone_silithus.cpp:975
@ SPELL_TEMPLAR_WATER
Definition: zone_silithus.cpp:977
@ SPELL_TEMPLAR_EARTH
Definition: zone_silithus.cpp:976
@ SPELL_TEMPLAR_RANDOM
Definition: zone_silithus.cpp:973
@ NPC_DUKE_EARTH
Definition: zone_silithus.cpp:997
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
Definition: Creature.h:46
void SendCloseGossip()
Definition: GossipDef.cpp:239
void SetGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:219
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:933
void Clear()
Definition: ObjectGuid.h:138
PlayerMenu * PlayerTalkClass
Definition: Player.h:2219
bool IsAlive() const
Definition: Unit.h:1204
ObjectGuid _creatureGuid
Definition: zone_silithus.cpp:1204
void SummonNPC(GameObject *go, Player *player, uint32 npc, uint32 spellId)
Definition: zone_silithus.cpp:1175

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.

1036 {
1038 }
void RemoveGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:220

References GO_FLAG_NOT_SELECTABLE.

◆ SummonNPC()

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

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