aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-08-24 16:33:29 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-08-24 16:33:29 +0200
commit98e27a4f15aaf6d36522755a597d89730401fdb1 (patch)
treeb9e5588449c42e21b168beb22633db10ade5fe38 /src/server/game/Scripting
parentc496979e1c4826ea89d6e06b35607c35de820d20 (diff)
parentc20f92c08c2da751fd4c45d351650a8d722f0b91 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/tools/map_extractor/System.cpp
Diffstat (limited to 'src/server/game/Scripting')
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp16
-rw-r--r--src/server/game/Scripting/ScriptMgr.h12
2 files changed, 11 insertions, 17 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index a6201bb7d51..f1e6ba6ca6d 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -774,17 +774,6 @@ bool ScriptMgr::OnQuestSelect(Player* player, Creature* creature, Quest const* q
return tmpscript->OnQuestSelect(player, creature, quest);
}
-bool ScriptMgr::OnQuestComplete(Player* player, Creature* creature, Quest const* quest)
-{
- ASSERT(player);
- ASSERT(creature);
- ASSERT(quest);
-
- GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, false);
- player->PlayerTalkClass->ClearMenus();
- return tmpscript->OnQuestComplete(player, creature, quest);
-}
-
bool ScriptMgr::OnQuestReward(Player* player, Creature* creature, Quest const* quest, uint32 opt)
{
ASSERT(player);
@@ -1296,6 +1285,11 @@ void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newAre
FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea);
}
+void ScriptMgr::OnQuestStatusChange(Player* player, uint32 questId, QuestStatus status)
+{
+ FOREACH_SCRIPT(PlayerScript)->OnQuestStatusChange(player, questId, status);
+}
+
// Account
void ScriptMgr::OnAccountLogin(uint32 accountId)
{
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 9f52aec848f..506d792ce44 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -445,10 +445,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.
@@ -483,7 +480,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.
@@ -768,6 +765,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
@@ -965,7 +965,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);
@@ -1074,6 +1073,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 */