AzeorthCore 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 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_harpoon_canon()

go_harpoon_canon::go_harpoon_canon ( )
inline
501: GameObjectScript("go_harpoon_canon") { }
Definition: ScriptMgr.h:758

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from GameObjectScript.

504 {
505 InstanceScript* m_pInstance = go->GetInstanceScript();
506 if (m_pInstance && m_pInstance->GetData(DATA_SKADI_THE_RUTHLESS) == IN_PROGRESS)
507 if (m_pInstance->GetData(SKADI_IN_RANGE) == 1)
508 {
509 uint8 count = m_pInstance->GetData(SKADI_HITS) + 1;
510 m_pInstance->SetData(SKADI_HITS, count);
511
512 if (Creature* grauf = ObjectAccessor::GetCreature(*pPlayer, m_pInstance->GetGuidData(DATA_GRAUF)))
513 {
514 if (count >= 3)
515 {
516 m_pInstance->SetData(SKADI_IN_RANGE, 0);
517 grauf->AI()->DoAction(ACTION_REMOVE_SKADI);
518 }
519
520 grauf->AI()->DoAction(ACTION_MYGIRL_ACHIEVEMENT);
521 }
522 go->CastSpell((Unit*)nullptr, SPELL_LAUNCH_HARPOON);
523 }
524
525 return true;
526 }
std::uint8_t uint8
Definition: Define.h:110
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ ACTION_REMOVE_SKADI
Definition: boss_skadi.cpp:63
@ SPELL_LAUNCH_HARPOON
Definition: boss_skadi.cpp:51
@ ACTION_MYGIRL_ACHIEVEMENT
Definition: boss_skadi.cpp:65
@ DATA_SKADI_THE_RUTHLESS
Definition: utgarde_pinnacle.h:30
@ DATA_GRAUF
Definition: utgarde_pinnacle.h:32
@ SKADI_HITS
Definition: utgarde_pinnacle.h:42
@ SKADI_IN_RANGE
Definition: utgarde_pinnacle.h:43
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
Definition: Creature.h:46
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2081
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Definition: Unit.h:1290
Definition: InstanceScript.h:140
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

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.