Add Player::OnQuestComplete()
Here is a hook attached to the player completing a quest. I chose event number 43 as it was the next in line. I am not sure if there is a more solid methodology. :)
local function OnQuestComplete(event, player, creature, quest) print(player:GetName().." completed quest "..quest:GetId()) end RegisterPlayerEvent(43, questItemTest.OnQuestComplete)
prints on AC: Theboss completed quest 7803
Hiya, should I submit a PR to azerothcore, or is there something that needs to be changed on these two hook PR's?
I am unsure how cross project PR's work. :)
@Rochet2 Merge? What do you think.
Hooks are a bit problematic as they need to be added server-side to different cores. I guess I would hope to change this in the future. Otherwise, I think the code looks alright.
Note to self: intended to be triggered at the end of Player::RewardQuest
New hooks are not likely to be added at this time as they require core changes. New hooks may be added if they document the core they work on
This has now been added as Player event 54, OnQuestStatusChanged. You can check the status for QUEST_STATUS_COMPLETE = 1