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

Public Member Functions

 go_harpoon_canon ()
 
bool OnGossipHello (Player *pPlayer, 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_harpoon_canon()

go_harpoon_canon::go_harpoon_canon ( )
inline
502: GameObjectScript("go_harpoon_canon") { }
Definition: GameObjectScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool go_harpoon_canon::OnGossipHello ( Player pPlayer,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

505 {
506 InstanceScript* m_pInstance = go->GetInstanceScript();
507 if (m_pInstance && m_pInstance->GetData(DATA_SKADI_THE_RUTHLESS) == IN_PROGRESS)
508 if (m_pInstance->GetData(SKADI_IN_RANGE) == 1)
509 {
510 uint8 count = m_pInstance->GetData(SKADI_HITS) + 1;
511 m_pInstance->SetData(SKADI_HITS, count);
512
513 if (Creature* grauf = ObjectAccessor::GetCreature(*pPlayer, m_pInstance->GetGuidData(DATA_GRAUF)))
514 {
515 if (count >= 3)
516 {
517 m_pInstance->SetData(SKADI_IN_RANGE, 0);
518 grauf->AI()->DoAction(ACTION_REMOVE_SKADI);
519 }
520
521 grauf->AI()->DoAction(ACTION_MYGIRL_ACHIEVEMENT);
522 }
523 go->CastSpell((Unit*)nullptr, SPELL_LAUNCH_HARPOON);
524 }
525
526 return true;
527 }
std::uint8_t uint8
Definition: Define.h:109
@ ACTION_REMOVE_SKADI
Definition: boss_skadi.cpp:64
@ SPELL_LAUNCH_HARPOON
Definition: boss_skadi.cpp:52
@ ACTION_MYGIRL_ACHIEVEMENT
Definition: boss_skadi.cpp:66
@ DATA_SKADI_THE_RUTHLESS
Definition: utgarde_pinnacle.h:31
@ DATA_GRAUF
Definition: utgarde_pinnacle.h:33
@ SKADI_HITS
Definition: utgarde_pinnacle.h:43
@ SKADI_IN_RANGE
Definition: utgarde_pinnacle.h:44
@ IN_PROGRESS
Definition: InstanceScript.h:58
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
Definition: Creature.h:43
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2087
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
Definition: Unit.h:630
Definition: InstanceScript.h:142
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

References ACTION_MYGIRL_ACHIEVEMENT, ACTION_REMOVE_SKADI, GameObject::CastSpell(), DATA_GRAUF, DATA_SKADI_THE_RUTHLESS, ObjectAccessor::GetCreature(), ZoneScript::GetData(), InstanceScript::GetGuidData(), WorldObject::GetInstanceScript(), IN_PROGRESS, ZoneScript::SetData(), SKADI_HITS, SKADI_IN_RANGE, and SPELL_LAUNCH_HARPOON.