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 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
 
- 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)
 
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
213: GameObjectScript("go_strange_pool") { }
Definition: ScriptMgr.h:759

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from GameObjectScript.

216 {
217 if (InstanceScript* instance = go->GetInstanceScript())
218 if (roll_chance_i(instance->GetBossState(DATA_THE_LURKER_BELOW) != DONE ? 25 : 0) && !instance->IsEncounterInProgress())
219 {
220 player->CastSpell(player, SPELL_LURKER_SPAWN_TRIGGER, true);
221 if (Creature* lurker = ObjectAccessor::GetCreature(*go, instance->GetGuidData(NPC_THE_LURKER_BELOW)))
222 lurker->AI()->DoAction(ACTION_START_EVENT);
223 return true;
224 }
225
226 return false;
227 }
bool roll_chance_i(int chance)
Definition: Random.h:59
@ DONE
Definition: InstanceScript.h:59
@ ACTION_START_EVENT
Definition: boss_lurker_below.cpp:35
@ SPELL_LURKER_SPAWN_TRIGGER
Definition: boss_lurker_below.cpp:29
@ NPC_THE_LURKER_BELOW
Definition: serpent_shrine.h:53
@ DATA_THE_LURKER_BELOW
Definition: serpent_shrine.h:35
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
Definition: Creature.h:46
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:1169
Definition: InstanceScript.h:140

References ACTION_START_EVENT, Unit::CastSpell(), DATA_THE_LURKER_BELOW, DONE, ObjectAccessor::GetCreature(), WorldObject::GetInstanceScript(), NPC_THE_LURKER_BELOW, roll_chance_i(), and SPELL_LURKER_SPAWN_TRIGGER.