aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2013-12-29 15:13:14 -0500
committerSubv <subv2112@gmail.com>2013-12-29 15:13:14 -0500
commitd234d0f3d0889e799eb066ba39c9b1edbc964d6e (patch)
tree17d6281266900fe843573d03eff46a3b2beabedb /src/server/game/Scripting
parent8658b5338c905c79daf50cb56dbe739f82d25acc (diff)
parentc40cdc2968c58d952878c09a60926af74f782867 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps_rw
Diffstat (limited to 'src/server/game/Scripting')
-rw-r--r--src/server/game/Scripting/MapScripts.cpp18
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp6
-rw-r--r--src/server/game/Scripting/ScriptMgr.h5
3 files changed, 14 insertions, 15 deletions
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index 41c18b850a1..b9765bbbdc2 100644
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -166,7 +166,7 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
{
unit = obj->ToUnit();
if (!unit)
- TC_LOG_ERROR("scripts", "%s %s object could not be casted to unit.",
+ TC_LOG_ERROR("scripts", "%s %s object could not be cast to unit.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
}
return unit;
@@ -242,7 +242,7 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, const Script
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
if (!wSource)
- TC_LOG_ERROR("scripts", "%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ TC_LOG_ERROR("scripts", "%s source object could not be cast to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
{
@@ -335,7 +335,7 @@ void Map::ScriptsProcess()
}
}
- Object* target = NULL;
+ WorldObject* target = NULL;
if (step.targetGUID)
{
switch (GUID_HIPART(step.targetGUID))
@@ -421,28 +421,28 @@ void Map::ScriptsProcess()
switch (step.script->Talk.ChatType)
{
case CHAT_TYPE_SAY:
- cSource->Say(step.script->Talk.TextID, LANG_UNIVERSAL, targetGUID);
+ cSource->MonsterSay(step.script->Talk.TextID, LANG_UNIVERSAL, target);
break;
case CHAT_TYPE_YELL:
- cSource->Yell(step.script->Talk.TextID, LANG_UNIVERSAL, targetGUID);
+ cSource->MonsterYell(step.script->Talk.TextID, LANG_UNIVERSAL, target);
break;
case CHAT_TYPE_TEXT_EMOTE:
- cSource->TextEmote(step.script->Talk.TextID, targetGUID);
+ cSource->MonsterTextEmote(step.script->Talk.TextID, target);
break;
case CHAT_TYPE_BOSS_EMOTE:
- cSource->MonsterTextEmote(step.script->Talk.TextID, targetGUID, true);
+ cSource->MonsterTextEmote(step.script->Talk.TextID, target, true);
break;
case CHAT_TYPE_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
TC_LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
- cSource->Whisper(step.script->Talk.TextID, targetGUID);
+ cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer());
break;
case CHAT_MSG_RAID_BOSS_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
TC_LOG_ERROR("scripts", "%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
- cSource->MonsterWhisper(step.script->Talk.TextID, targetGUID, true);
+ cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer(), true);
break;
default:
break; // must be already checked at load
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 3674f8fe15e..6a1ab28efed 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -778,8 +778,7 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature)
ASSERT(player);
ASSERT(creature);
- /// @todo 100 is a funny magic number to have hanging around here...
- GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, 100);
+ GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS);
player->PlayerTalkClass->ClearMenus();
return tmpscript->GetDialogStatus(player, creature);
}
@@ -864,8 +863,7 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go)
ASSERT(player);
ASSERT(go);
- /// @todo 100 is a funny magic number to have hanging around here...
- GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, 100);
+ GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS);
player->PlayerTalkClass->ClearMenus();
return tmpscript->GetDialogStatus(player, go);
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 401be45a4e1..18ed549029d 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -24,6 +24,7 @@
#include <ace/Atomic_Op.h>
#include "DBCStores.h"
+#include "QuestDef.h"
#include "SharedDefines.h"
#include "World.h"
#include "Weather.h"
@@ -447,7 +448,7 @@ class CreatureScript : public UnitScript, public UpdatableScript<Creature>
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.
- virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return 100; }
+ virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
// Called when a CreatureAI object is needed for the creature.
virtual CreatureAI* GetAI(Creature* /*creature*/) const { return NULL; }
@@ -482,7 +483,7 @@ class GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
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.
- virtual uint32 GetDialogStatus(Player* /*player*/, GameObject* /*go*/) { return 100; }
+ virtual uint32 GetDialogStatus(Player* /*player*/, GameObject* /*go*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
// Called when the game object is destroyed (destructible buildings only).
virtual void OnDestroyed(GameObject* /*go*/, Player* /*player*/) { }