OnQuestComplete

Sup guys,

Just wanted to tell you that the OnQuestComplete hook isn’t called anywhere, making it not functional, I searched a place where it would fit best and I found the HandleQuestgiverCompleteQuest function, starting from line ~511, what is about 50% of the function, the next code snippet is 50% of the function with the hook fired.


        if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE)
        {
            if (quest->IsRepeatable())
                _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanCompleteRepeatableQuest(quest), false);
            else
                _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false);
        }
        else
        {
            if (quest->GetReqItemsCount())                  // some items required
                _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false);
            else                                            // no items required
                _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true);
        }
		sScriptMgr->OnQuestComplete(GetPlayer(), ObjectAccessor::FindCreature(guid), quest);
    }
}