From 3fe34b205fb8d721843979574d7e902065df0235 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Sat, 10 Mar 2018 05:31:41 +0200 Subject: [PATCH] Fix TC build --- CreatureHooks.cpp | 2 +- GameObjectHooks.cpp | 10 +++++----- Hooks.h | 4 ++-- ItemHooks.cpp | 2 +- LuaEngine.h | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CreatureHooks.cpp b/CreatureHooks.cpp index 60540c3..51be71b 100644 --- a/CreatureHooks.cpp +++ b/CreatureHooks.cpp @@ -33,7 +33,7 @@ using namespace Hooks; return RETVAL;\ LOCK_ELUNA -bool Eluna::OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, Creature* pTarget) +bool Eluna::OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, Creature* pTarget) { START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_DUMMY_EFFECT, pTarget, false); Push(pCaster); diff --git a/GameObjectHooks.cpp b/GameObjectHooks.cpp index 6562e2d..a9ca705 100644 --- a/GameObjectHooks.cpp +++ b/GameObjectHooks.cpp @@ -30,7 +30,7 @@ using namespace Hooks; return RETVAL;\ LOCK_ELUNA -bool Eluna::OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, GameObject* pTarget) +bool Eluna::OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, GameObject* pTarget) { START_HOOK_WITH_RETVAL(GAMEOBJECT_EVENT_ON_DUMMY_EFFECT, pTarget->GetEntry(), false); Push(pCaster); @@ -78,19 +78,19 @@ void Eluna::GetDialogStatus(const Player* pPlayer, const GameObject* pGameObject #ifndef CLASSIC #ifndef TBC -void Eluna::OnDestroyed(GameObject* pGameObject, Player* pPlayer) +void Eluna::OnDestroyed(GameObject* pGameObject, WorldObject* attacker) { START_HOOK(GAMEOBJECT_EVENT_ON_DESTROYED, pGameObject->GetEntry()); Push(pGameObject); - Push(pPlayer); + Push(attacker); CallAllFunctions(GameObjectEventBindings, key); } -void Eluna::OnDamaged(GameObject* pGameObject, Player* pPlayer) +void Eluna::OnDamaged(GameObject* pGameObject, WorldObject* attacker) { START_HOOK(GAMEOBJECT_EVENT_ON_DAMAGED, pGameObject->GetEntry()); Push(pGameObject); - Push(pPlayer); + Push(attacker); CallAllFunctions(GameObjectEventBindings, key); } #endif diff --git a/Hooks.h b/Hooks.h index e693b1f..5b800f7 100644 --- a/Hooks.h +++ b/Hooks.h @@ -301,8 +301,8 @@ namespace Hooks GAMEOBJECT_EVENT_ON_QUEST_ACCEPT = 4, // (event, player, go, quest) - Can return true GAMEOBJECT_EVENT_ON_QUEST_REWARD = 5, // (event, player, go, quest, opt) - Can return true GAMEOBJECT_EVENT_ON_DIALOG_STATUS = 6, // (event, player, go) - GAMEOBJECT_EVENT_ON_DESTROYED = 7, // (event, go, player) - GAMEOBJECT_EVENT_ON_DAMAGED = 8, // (event, go, player) + GAMEOBJECT_EVENT_ON_DESTROYED = 7, // (event, go, attacker) + GAMEOBJECT_EVENT_ON_DAMAGED = 8, // (event, go, attacker) GAMEOBJECT_EVENT_ON_LOOT_STATE_CHANGE = 9, // (event, go, state) GAMEOBJECT_EVENT_ON_GO_STATE_CHANGED = 10, // (event, go, state) // UNUSED = 11, // (event, gameobject) diff --git a/ItemHooks.cpp b/ItemHooks.cpp index e172195..0dc4c86 100644 --- a/ItemHooks.cpp +++ b/ItemHooks.cpp @@ -21,7 +21,7 @@ using namespace Hooks; return RETVAL;\ LOCK_ELUNA -bool Eluna::OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, Item* pTarget) +bool Eluna::OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, Item* pTarget) { START_HOOK_WITH_RETVAL(ITEM_EVENT_ON_DUMMY_EFFECT, pTarget->GetEntry(), false); Push(pCaster); diff --git a/LuaEngine.h b/LuaEngine.h index fda782f..79ab5e0 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -348,7 +348,7 @@ public: bool OnAddonMessage(Player* sender, uint32 type, std::string& msg, Player* receiver, Guild* guild, Group* group, Channel* channel); /* Item */ - bool OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, Item* pTarget); + bool OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, Item* pTarget); bool OnQuestAccept(Player* pPlayer, Item* pItem, Quest const* pQuest); bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets); bool OnItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets); @@ -358,7 +358,7 @@ public: void HandleGossipSelectOption(Player* pPlayer, Item* item, uint32 sender, uint32 action, const std::string& code); /* Creature */ - bool OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, Creature* pTarget); + bool OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, Creature* pTarget); bool OnGossipHello(Player* pPlayer, Creature* pCreature); bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action); bool OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action, const char* code); @@ -390,7 +390,7 @@ public: void On_Reset(Creature* me); /* GameObject */ - bool OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, GameObject* pTarget); + bool OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, GameObject* pTarget); bool OnGameObjectUse(Player* pPlayer, GameObject* pGameObject); bool OnGossipHello(Player* pPlayer, GameObject* pGameObject); bool OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action); @@ -400,8 +400,8 @@ public: void GetDialogStatus(const Player* pPlayer, const GameObject* pGameObject); #ifndef CLASSIC #ifndef TBC - void OnDestroyed(GameObject* pGameObject, Player* pPlayer); - void OnDamaged(GameObject* pGameObject, Player* pPlayer); + void OnDestroyed(GameObject* pGameObject, WorldObject* attacker); + void OnDamaged(GameObject* pGameObject, WorldObject* attacker); #endif #endif void OnLootStateChanged(GameObject* pGameObject, uint32 state);