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

Public Member Functions

 go_ulduar_working_harpoon ()
 
bool OnGossipHello (Player *user, 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_ulduar_working_harpoon()

go_ulduar_working_harpoon::go_ulduar_working_harpoon ( )
inline
939: GameObjectScript("go_ulduar_working_harpoon") { }
Definition: GameObjectScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool go_ulduar_working_harpoon::OnGossipHello ( Player user,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

942 {
943 if (!user || !go)
944 return true;
945
946 InstanceScript* pInstance = go->GetInstanceScript();
947 if (!pInstance)
948 return true;
949
950 Creature* rs = nullptr;
951 if (ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE))
952 rs = ObjectAccessor::GetCreature(*go, rsGUID);
953
954 if (!rs || !rs->IsInCombat())
955 {
956 go->SetRespawnTime(0);
957 go->Delete();
958 return true;
959 }
960
961 uint32 npc = 0;
962 uint32 spell = 0;
963 switch (go->GetEntry())
964 {
965 case GO_HARPOON_GUN_1:
967 spell = SPELL_CHAIN_1;
968 break;
969 case GO_HARPOON_GUN_2:
971 spell = SPELL_CHAIN_2;
972 break;
973 case GO_HARPOON_GUN_3:
975 spell = SPELL_CHAIN_3;
976 break;
977 case GO_HARPOON_GUN_4:
979 spell = SPELL_CHAIN_4;
980 break;
981 }
982
983 if (ObjectGuid g = pInstance->GetGuidData(npc))
984 if (Creature* hfs = ObjectAccessor::GetCreature(*go, g))
985 hfs->AI()->SetData(3, spell);
986
988 return true;
989 }
std::uint32_t uint32
Definition: Define.h:107
npc
Definition: BattlegroundSA.h:75
@ GO_JUST_DEACTIVATED
Definition: GameObject.h:114
@ GO_HARPOON_GUN_1
Definition: boss_razorscale.cpp:87
@ GO_HARPOON_GUN_2
Definition: boss_razorscale.cpp:88
@ GO_HARPOON_GUN_3
Definition: boss_razorscale.cpp:89
@ GO_HARPOON_GUN_4
Definition: boss_razorscale.cpp:90
@ SPELL_CHAIN_2
Definition: boss_razorscale.cpp:46
@ SPELL_CHAIN_3
Definition: boss_razorscale.cpp:47
@ SPELL_CHAIN_1
Definition: boss_razorscale.cpp:45
@ SPELL_CHAIN_4
Definition: boss_razorscale.cpp:48
@ DATA_HARPOON_FIRE_STATE_1
Definition: ulduar.h:62
@ DATA_HARPOON_FIRE_STATE_2
Definition: ulduar.h:63
@ DATA_HARPOON_FIRE_STATE_3
Definition: ulduar.h:64
@ DATA_HARPOON_FIRE_STATE_4
Definition: ulduar.h:65
@ TYPE_RAZORSCALE
Definition: ulduar.h:34
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
Definition: Creature.h:46
void Delete()
Definition: GameObject.cpp:979
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:2442
void SetRespawnTime(int32 respawn)
Definition: GameObject.cpp:1303
uint32 GetEntry() const
Definition: Object.h:112
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Definition: ObjectGuid.h:118
bool IsInCombat() const
Definition: Unit.h:820
Definition: InstanceScript.h:142
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95

References DATA_HARPOON_FIRE_STATE_1, DATA_HARPOON_FIRE_STATE_2, DATA_HARPOON_FIRE_STATE_3, DATA_HARPOON_FIRE_STATE_4, GameObject::Delete(), ObjectAccessor::GetCreature(), Object::GetEntry(), InstanceScript::GetGuidData(), WorldObject::GetInstanceScript(), GO_HARPOON_GUN_1, GO_HARPOON_GUN_2, GO_HARPOON_GUN_3, GO_HARPOON_GUN_4, GO_JUST_DEACTIVATED, Unit::IsInCombat(), GameObject::SetLootState(), GameObject::SetRespawnTime(), SPELL_CHAIN_1, SPELL_CHAIN_2, SPELL_CHAIN_3, SPELL_CHAIN_4, and TYPE_RAZORSCALE.