aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting/ScriptMgr.h
diff options
context:
space:
mode:
authorRochet2 <tqbattlenet@gmail.com>2014-07-26 16:05:57 +0300
committerRochet2 <tqbattlenet@gmail.com>2014-08-24 14:31:38 +0300
commit9beae1dc97dbe534c7dbb84c0546bf97c9f8461b (patch)
tree4809f9a3206ba82ba2f0d9e701bd13c734f27de8 /src/server/game/Scripting/ScriptMgr.h
parenta63aa858dcb400eafb97eed1f590e34c27d934a4 (diff)
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
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r--src/server/game/Scripting/ScriptMgr.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 615b1d3bb06..ea25d51dab2 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -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 */