mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat: add PLAYER_EVENT_ON_COMPLETE_QUEST (#90)
This commit is contained in:
@@ -786,6 +786,11 @@ public:
|
||||
{
|
||||
sEluna->OnStoreNewItem(player, item, count);
|
||||
}
|
||||
|
||||
void OnPlayerCompleteQuest(Player* player, Quest const* quest) override
|
||||
{
|
||||
sEluna->OnPlayerCompleteQuest(player, quest);
|
||||
}
|
||||
};
|
||||
|
||||
class Eluna_ServerScript : public ServerScript
|
||||
|
||||
@@ -723,9 +723,10 @@ namespace LuaGlobalFunctions
|
||||
* PLAYER_EVENT_ON_CAN_INIT_TRADE = 48, // (event, player, target) - Can return false to prevent the trade
|
||||
* PLAYER_EVENT_ON_CAN_SEND_MAIL = 49, // (event, player, receiverGuid, mailbox, subject, body, money, cod, item) - Can return false to prevent sending the mail
|
||||
* PLAYER_EVENT_ON_CAN_JOIN_LFG = 50, // (event, player, roles, dungeons, comment) - Can return false to prevent queueing
|
||||
* PLAYER_EVENT_ON_QUEST_REWARD_ITEM = 51, // (event, player, item, count)
|
||||
* PLAYER_EVENT_ON_CREATE_ITEM = 52, // (event, player, item, count)
|
||||
* PLAYER_EVENT_ON_STORE_NEW_ITEM = 53, // (event, player, item, count)
|
||||
* PLAYER_EVENT_ON_QUEST_REWARD_ITEM = 51, // (event, player, item, count)
|
||||
* PLAYER_EVENT_ON_CREATE_ITEM = 52, // (event, player, item, count)
|
||||
* PLAYER_EVENT_ON_STORE_NEW_ITEM = 53, // (event, player, item, count)
|
||||
* PLAYER_EVENT_ON_COMPLETE_QUEST = 54, // (event, player, quest)
|
||||
* };
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -215,6 +215,7 @@ namespace Hooks
|
||||
PLAYER_EVENT_ON_QUEST_REWARD_ITEM = 51, // (event, player, item, count)
|
||||
PLAYER_EVENT_ON_CREATE_ITEM = 52, // (event, player, item, count)
|
||||
PLAYER_EVENT_ON_STORE_NEW_ITEM = 53, // (event, player, item, count)
|
||||
PLAYER_EVENT_ON_COMPLETE_QUEST = 54, // (event, player, quest)
|
||||
|
||||
PLAYER_EVENT_COUNT
|
||||
};
|
||||
|
||||
@@ -373,6 +373,7 @@ public:
|
||||
void OnQuestRewardItem(Player* player, Item* item, uint32 count);
|
||||
void OnCreateItem(Player* player, Item* item, uint32 count);
|
||||
void OnStoreNewItem(Player* player, Item* item, uint32 count);
|
||||
void OnPlayerCompleteQuest(Player* player, Quest const* quest);
|
||||
|
||||
/* Item */
|
||||
void OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, Item* pTarget);
|
||||
|
||||
@@ -662,3 +662,11 @@ void Eluna::OnStoreNewItem(Player* player, Item* item, uint32 count)
|
||||
Push(count);
|
||||
CallAllFunctions(PlayerEventBindings, key);
|
||||
}
|
||||
|
||||
void Eluna::OnPlayerCompleteQuest(Player* player, Quest const* quest)
|
||||
{
|
||||
START_HOOK(PLAYER_EVENT_ON_COMPLETE_QUEST);
|
||||
Push(player);
|
||||
Push(quest);
|
||||
CallAllFunctions(PlayerEventBindings, key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user