diff --git a/HookMgr.cpp b/HookMgr.cpp index 7aa36e0..ad01c86 100644 --- a/HookMgr.cpp +++ b/HookMgr.cpp @@ -1403,23 +1403,13 @@ bool Eluna::OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* pQu return true; } -//bool Eluna::OnQuestComplete(Player* pPlayer, Creature* pCreature, Quest const* pQuest) -//{ -// ENTRY_BEGIN(CreatureEventBindings, pCreature->GetEntry(), CREATURE_EVENT_ON_QUEST_COMPLETE, return false); -// Push(L, pPlayer); -// Push(L, pCreature); -// Push(L, pQuest); -// ENTRY_EXECUTE(0); -// ENDCALL(); -// return true; -//} - -bool Eluna::OnQuestReward(Player* pPlayer, Creature* pCreature, Quest const* pQuest) +bool Eluna::OnQuestReward(Player* pPlayer, Creature* pCreature, Quest const* pQuest, uint32 opt) { ENTRY_BEGIN(CreatureEventBindings, pCreature->GetEntry(), CREATURE_EVENT_ON_QUEST_REWARD, return false); Push(L, pPlayer); Push(L, pCreature); Push(L, pQuest); + Push(L, opt); ENTRY_EXECUTE(0); ENDCALL(); return true; @@ -1822,17 +1812,6 @@ bool Eluna::OnQuestAccept(Player* pPlayer, GameObject* pGameObject, Quest const* return true; } -//bool Eluna::OnQuestComplete(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest) -//{ -// ENTRY_BEGIN(GameObjectEventBindings, pGameObject->GetEntry(), GAMEOBJECT_EVENT_ON_QUEST_COMPLETE, return false); -// Push(L, pPlayer); -// Push(L, pGameObject); -// Push(L, pQuest); -// ENTRY_EXECUTE(0); -// ENDCALL(); -// return true; -//} - void Eluna::UpdateAI(GameObject* pGameObject, uint32 diff) { pGameObject->elunaEvents->Update(diff); @@ -1843,12 +1822,13 @@ void Eluna::UpdateAI(GameObject* pGameObject, uint32 diff) ENDCALL(); } -bool Eluna::OnQuestReward(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest) +bool Eluna::OnQuestReward(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest, uint32 opt) { ENTRY_BEGIN(GameObjectEventBindings, pGameObject->GetEntry(), GAMEOBJECT_EVENT_ON_QUEST_REWARD, return false); Push(L, pPlayer); Push(L, pGameObject); Push(L, pQuest); + Push(L, opt); ENTRY_EXECUTE(0); ENDCALL(); return true; diff --git a/HookMgr.h b/HookMgr.h index 6357804..3117157 100644 --- a/HookMgr.h +++ b/HookMgr.h @@ -226,7 +226,6 @@ namespace HookMgr CREATURE_EVENT_ON_DUMMY_EFFECT = 30, // (event, caster, spellid, effindex, creature) CREATURE_EVENT_ON_QUEST_ACCEPT = 31, // (event, player, creature, quest) // UNUSED = 32, // (event, creature) - // CREATURE_EVENT_ON_QUEST_COMPLETE = 33, // (event, player, creature, quest) Decapreted, use CREATURE_EVENT_ON_QUEST_REWARD CREATURE_EVENT_ON_QUEST_REWARD = 34, // (event, player, creature, quest, opt) CREATURE_EVENT_ON_DIALOG_STATUS = 35, // (event, player, creature) CREATURE_EVENT_ON_ADD = 36, // (event, creature) @@ -247,7 +246,6 @@ namespace HookMgr GAMEOBJECT_EVENT_ON_DAMAGED = 8, // (event, go, player) GAMEOBJECT_EVENT_ON_LOOT_STATE_CHANGE = 9, // (event, go, state) GAMEOBJECT_EVENT_ON_GO_STATE_CHANGED = 10, // (event, go, state) - // GAMEOBJECT_EVENT_ON_QUEST_COMPLETE = 11, // (event, player, go, quest) Decapreted, use GAMEOBJECT_EVENT_ON_QUEST_REWARD GAMEOBJECT_EVENT_ON_ADD = 12, // (event, gameobject) GAMEOBJECT_EVENT_ON_REMOVE = 13, // (event, gameobject) GAMEOBJECT_EVENT_COUNT diff --git a/LuaEngine.h b/LuaEngine.h index e64aebe..e263c43 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -219,8 +219,7 @@ public: bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action); bool OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action, const char* code); bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* pQuest); - //bool OnQuestComplete(Player* pPlayer, Creature* pCreature, Quest const* pQuest); - bool OnQuestReward(Player* pPlayer, Creature* pCreature, Quest const* pQuest); + bool OnQuestReward(Player* pPlayer, Creature* pCreature, Quest const* pQuest, uint32 opt); uint32 GetDialogStatus(Player* pPlayer, Creature* pCreature); void OnSummoned(Creature* creature, Unit* summoner); @@ -230,8 +229,7 @@ public: bool OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action); bool OnGossipSelectCode(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action, const char* code); bool OnQuestAccept(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest); - //bool OnQuestComplete(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest); - bool OnQuestReward(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest); + bool OnQuestReward(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest, uint32 opt); uint32 GetDialogStatus(Player* pPlayer, GameObject* pGameObject); #ifndef CLASSIC #ifndef TBC