AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_strange_pool Class Reference
Inheritance diagram for go_strange_pool:
GameObjectScript ScriptObject UpdatableScript< GameObject >

Public Member Functions

 go_strange_pool ()
 
bool OnGossipHello (Player *player, GameObject *go) override
 
- Public Member Functions inherited from GameObjectScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, GameObject *)
 
virtual bool OnGossipSelect (Player *, GameObject *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, GameObject *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, GameObject *, Quest const *)
 
virtual bool OnQuestReward (Player *, GameObject *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, GameObject *)
 
virtual void OnDestroyed (GameObject *, Player *)
 
virtual void OnDamaged (GameObject *, Player *)
 
virtual void OnModifyHealth (GameObject *, Unit *, int32 &, SpellInfo const *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- Public Member Functions inherited from UpdatableScript< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ go_strange_pool()

go_strange_pool::go_strange_pool ( )
inline
243: GameObjectScript("go_strange_pool") { }
Definition: GameObjectScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool go_strange_pool::OnGossipHello ( Player player,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

246 {
247 if (InstanceScript* instance = go->GetInstanceScript())
248 if (roll_chance_i(instance->GetBossState(DATA_THE_LURKER_BELOW) != DONE ? 25 : 0) && !instance->IsEncounterInProgress())
249 {
250 player->CastSpell(player, SPELL_LURKER_SPAWN_TRIGGER, true);
251 if (Creature* lurker = go->SummonCreature(NPC_THE_LURKER_BELOW, 38.4567f, -417.324f, -18.916666f, 2.94960f, TEMPSUMMON_MANUAL_DESPAWN))
252 lurker->AI()->DoAction(ACTION_START_EVENT);
253
254 go->DespawnOrUnsummon();
255 go->SetRespawnDelay(7 * DAY);
256 go->SaveRespawnTime();
257 return true;
258 }
259
260 return false;
261 }
constexpr auto DAY
Definition: Common.h:49
bool roll_chance_i(int chance)
Definition: Random.h:59
@ DONE
Definition: InstanceScript.h:60
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:52
@ ACTION_START_EVENT
Definition: boss_lurker_below.cpp:44
@ SPELL_LURKER_SPAWN_TRIGGER
Definition: boss_lurker_below.cpp:35
@ NPC_THE_LURKER_BELOW
Definition: serpent_shrine.h:50
@ DATA_THE_LURKER_BELOW
Definition: serpent_shrine.h:30
Definition: Creature.h:46
void SetRespawnDelay(int32 respawn)
Definition: GameObject.cpp:1313
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:933
void SaveRespawnTime() override
Definition: GameObject.h:245
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
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
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: InstanceScript.h:142

References ACTION_START_EVENT, Unit::CastSpell(), DATA_THE_LURKER_BELOW, DAY, GameObject::DespawnOrUnsummon(), DONE, WorldObject::GetInstanceScript(), NPC_THE_LURKER_BELOW, roll_chance_i(), GameObject::SaveRespawnTime(), GameObject::SetRespawnDelay(), SPELL_LURKER_SPAWN_TRIGGER, WorldObject::SummonCreature(), and TEMPSUMMON_MANUAL_DESPAWN.