mirror of
https://github.com/araxiaonline/AzerothCore-wotlk-with-NPCBots.git
synced 2026-06-13 03:22:24 -04:00
feat(Core): add OnPlayerQuestAccept hook to PlayerScript (#25875)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -422,6 +422,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg)
|
||||
void Player::AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver)
|
||||
{
|
||||
AddQuest(quest, questGiver);
|
||||
sScriptMgr->OnPlayerQuestAccept(this, quest);
|
||||
|
||||
if (CanCompleteQuest(quest->GetQuestId()))
|
||||
CompleteQuest(quest->GetQuestId());
|
||||
|
||||
@@ -852,6 +852,11 @@ void ScriptMgr::OnPlayerQuestAbandon(Player* player, uint32 questId)
|
||||
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_QUEST_ABANDON, script->OnPlayerQuestAbandon(player, questId));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerQuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_PLAYER_QUEST_ACCEPT, script->OnPlayerQuestAccept(player, quest));
|
||||
}
|
||||
|
||||
// Player anti cheat
|
||||
void ScriptMgr::AnticheatSetCanFlybyServer(Player* player, bool apply)
|
||||
{
|
||||
|
||||
@@ -190,6 +190,7 @@ enum PlayerHook
|
||||
PLAYERHOOK_ON_PLAYER_ENTER_COMBAT,
|
||||
PLAYERHOOK_ON_PLAYER_LEAVE_COMBAT,
|
||||
PLAYERHOOK_ON_QUEST_ABANDON,
|
||||
PLAYERHOOK_ON_PLAYER_QUEST_ACCEPT,
|
||||
PLAYERHOOK_ON_GET_QUEST_RATE,
|
||||
PLAYERHOOK_ON_CAN_PLAYER_FLY_IN_ZONE,
|
||||
PLAYERHOOK_ANTICHEAT_SET_CAN_FLY_BY_SERVER,
|
||||
@@ -730,6 +731,14 @@ public:
|
||||
*/
|
||||
virtual void OnPlayerQuestAbandon(Player* /*player*/, uint32 /*questId*/) { }
|
||||
|
||||
/**
|
||||
* @brief This hook called after a player accepts a quest, regardless of quest giver type
|
||||
*
|
||||
* @param player Contains information about the Player
|
||||
* @param quest Contains information about the Quest
|
||||
*/
|
||||
virtual void OnPlayerQuestAccept(Player* /*player*/, Quest const* /*quest*/) { }
|
||||
|
||||
/**
|
||||
* @brief This hook called before other CanFlyChecks are applied
|
||||
*
|
||||
|
||||
@@ -454,6 +454,7 @@ public: /* PlayerScript */
|
||||
void OnPlayerEnterCombat(Player* player, Unit* enemy);
|
||||
void OnPlayerLeaveCombat(Player* player);
|
||||
void OnPlayerQuestAbandon(Player* player, uint32 questId);
|
||||
void OnPlayerQuestAccept(Player* player, Quest const* quest);
|
||||
bool OnPlayerCanSendErrorAlreadyLooted(Player* player);
|
||||
void OnPlayerAfterCreatureLoot(Player* player);
|
||||
void OnPlayerAfterCreatureLootMoney(Player* player);
|
||||
|
||||
Reference in New Issue
Block a user