Eluna icon indicating copy to clipboard operation
Eluna copied to clipboard

Add Player::OnQuestComplete()

Open Myles512 opened this issue 4 years ago • 3 comments

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

Myles512 avatar Apr 16 '21 20:04 Myles512

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. :)

Myles512 avatar Apr 20 '21 05:04 Myles512

@Rochet2 Merge? What do you think.

xIvan0ff avatar May 24 '21 09:05 xIvan0ff

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

Rochet2 avatar May 26 '21 21:05 Rochet2

This has now been added as Player event 54, OnQuestStatusChanged. You can check the status for QUEST_STATUS_COMPLETE = 1

Foereaper avatar Oct 13 '23 23:10 Foereaper