mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Removed OnQuestComplete hook, use QuestReward instead. Implemented OnQuestStatusChange hook
Also fixed some comments and added overrides The OnQuestComplete hook was unused and didnt work properly
This commit is contained in:
@@ -446,10 +446,7 @@ class CreatureScript : public UnitScript, public UpdatableScript<Creature>
|
||||
// Called when a player selects a quest in the creature's quest menu.
|
||||
virtual bool OnQuestSelect(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/) { return false; }
|
||||
|
||||
// Called when a player completes a quest with the creature.
|
||||
virtual bool OnQuestComplete(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/) { return false; }
|
||||
|
||||
// Called when a player selects a quest reward.
|
||||
// Called when a player completes a quest and is rewarded, opt is the selected item's index or 0
|
||||
virtual bool OnQuestReward(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
|
||||
|
||||
// Called when the dialog status between a player and the creature is requested.
|
||||
@@ -484,7 +481,7 @@ class GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
|
||||
// Called when a player accepts a quest from the gameobject.
|
||||
virtual bool OnQuestAccept(Player* /*player*/, GameObject* /*go*/, Quest const* /*quest*/) { return false; }
|
||||
|
||||
// Called when a player selects a quest reward.
|
||||
// Called when a player completes a quest and is rewarded, opt is the selected item's index or 0
|
||||
virtual bool OnQuestReward(Player* /*player*/, GameObject* /*go*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
|
||||
|
||||
// Called when the dialog status between a player and the gameobject is requested.
|
||||
@@ -769,6 +766,9 @@ class PlayerScript : public UnitScript
|
||||
|
||||
// Called when a player changes to a new map (after moving to new map)
|
||||
virtual void OnMapChanged(Player* /*player*/) { }
|
||||
|
||||
// Called after a player's quest status has been changed
|
||||
virtual void OnQuestStatusChange(Player* /*player*/, uint32 /*questId*/, QuestStatus /*status*/) { }
|
||||
};
|
||||
|
||||
class AccountScript : public ScriptObject
|
||||
@@ -966,7 +966,6 @@ class ScriptMgr
|
||||
bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code);
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest);
|
||||
bool OnQuestSelect(Player* player, Creature* creature, Quest const* quest);
|
||||
bool OnQuestComplete(Player* player, Creature* creature, Quest const* quest);
|
||||
bool OnQuestReward(Player* player, Creature* creature, Quest const* quest, uint32 opt);
|
||||
uint32 GetDialogStatus(Player* player, Creature* creature);
|
||||
CreatureAI* GetCreatureAI(Creature* creature);
|
||||
@@ -1075,6 +1074,7 @@ class ScriptMgr
|
||||
void OnPlayerSave(Player* player);
|
||||
void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent);
|
||||
void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea);
|
||||
void OnQuestStatusChange(Player* player, uint32 questId, QuestStatus status);
|
||||
|
||||
public: /* AccountScript */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user