aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-06-15 00:26:08 +0200
committerGitHub <noreply@github.com>2020-06-15 00:26:08 +0200
commitc715e635cf3feb50ac61d30659e614aaa2cc0c63 (patch)
tree5af30c80f8b1df3f60852adde4680951f6f55442 /src/server/scripts/Commands
parentabff505a6eaf3e649be506c802b80eed3dd35f3a (diff)
parentcf88f0a9735f9ba010a4ae46e848c8f1a86e17fa (diff)
Merge pull request #24554 from funjoker/cherry-picks
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp66
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp44
3 files changed, 71 insertions, 41 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 11417b305a5..81bc3e533e1 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -61,6 +61,7 @@ public:
{ "cinematic", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_CINEMATIC, false, &HandleDebugPlayCinematicCommand, "" },
{ "movie", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_MOVIE, false, &HandleDebugPlayMovieCommand, "" },
{ "sound", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_SOUND, false, &HandleDebugPlaySoundCommand, "" },
+ { "music", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_MUSIC, false, &HandleDebugPlayMusicCommand, "" },
};
static std::vector<ChatCommand> debugSendCommandTable =
{
@@ -117,8 +118,8 @@ public:
static bool HandleDebugPlayCinematicCommand(ChatHandler* handler, char const* args)
{
- // USAGE: .debug play cinematic #cinematicid
- // #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column)
+ // USAGE: .debug play cinematic #cinematicId
+ // #cinematicId - ID decimal number from CinemaicSequences.dbc (1st column)
if (!*args)
{
handler->SendSysMessage(LANG_BAD_VALUE);
@@ -126,12 +127,12 @@ public:
return false;
}
- uint32 id = atoul(args);
+ uint32 cinematicId = atoul(args);
- CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(id);
+ CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId);
if (!cineSeq)
{
- handler->PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, id);
+ handler->PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, cinematicId);
handler->SetSentErrorMessage(true);
return false;
}
@@ -139,7 +140,7 @@ public:
// Dump camera locations
if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->Camera[0]))
{
- handler->PSendSysMessage("Waypoints for sequence %u, camera %u", id, cineSeq->Camera[0]);
+ handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->Camera[0]);
uint32 count = 1;
for (FlyByCamera const& cam : *flyByCameras)
{
@@ -149,14 +150,14 @@ public:
handler->PSendSysMessage(SZFMTD " waypoints dumped", flyByCameras->size());
}
- handler->GetSession()->GetPlayer()->SendCinematicStart(id);
+ handler->GetSession()->GetPlayer()->SendCinematicStart(cinematicId);
return true;
}
static bool HandleDebugPlayMovieCommand(ChatHandler* handler, char const* args)
{
- // USAGE: .debug play movie #movieid
- // #movieid - ID decimal number from Movie.dbc (1st column)
+ // USAGE: .debug play movie #movieId
+ // #movieId - ID decimal number from Movie.dbc (1st column)
if (!*args)
{
handler->SendSysMessage(LANG_BAD_VALUE);
@@ -164,24 +165,24 @@ public:
return false;
}
- uint32 id = atoul(args);
+ uint32 movieId = atoul(args);
- if (!sMovieStore.LookupEntry(id))
+ if (!sMovieStore.LookupEntry(movieId))
{
- handler->PSendSysMessage(LANG_MOVIE_NOT_EXIST, id);
+ handler->PSendSysMessage(LANG_MOVIE_NOT_EXIST, movieId);
handler->SetSentErrorMessage(true);
return false;
}
- handler->GetSession()->GetPlayer()->SendMovieStart(id);
+ handler->GetSession()->GetPlayer()->SendMovieStart(movieId);
return true;
}
//Play sound
static bool HandleDebugPlaySoundCommand(ChatHandler* handler, char const* args)
{
- // USAGE: .debug playsound #soundid
- // #soundid - ID decimal number from SoundEntries.dbc (1st column)
+ // USAGE: .debug playsound #soundId
+ // #soundId - ID decimal number from SoundEntries.dbc (1st column)
if (!*args)
{
handler->SendSysMessage(LANG_BAD_VALUE);
@@ -198,6 +199,8 @@ public:
return false;
}
+ Player* player = handler->GetSession()->GetPlayer();
+
Unit* unit = handler->getSelectedUnit();
if (!unit)
{
@@ -206,15 +209,42 @@ public:
return false;
}
- if (!handler->GetSession()->GetPlayer()->GetTarget().IsEmpty())
- unit->PlayDistanceSound(soundId, handler->GetSession()->GetPlayer());
+ if (player->GetTarget().IsEmpty())
+ unit->PlayDistanceSound(soundId, player);
else
- unit->PlayDirectSound(soundId, handler->GetSession()->GetPlayer());
+ unit->PlayDirectSound(soundId, player);
handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, soundId);
return true;
}
+ static bool HandleDebugPlayMusicCommand(ChatHandler* handler, char const* args)
+ {
+ // USAGE: .debug play music #musicId
+ // #musicId - ID decimal number from SoundEntries.dbc (1st column)
+ if (!*args)
+ {
+ handler->SendSysMessage(LANG_BAD_VALUE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 musicId = atoul(args);
+ if (!sSoundKitStore.LookupEntry(musicId))
+ {
+ handler->PSendSysMessage(LANG_SOUND_NOT_EXIST, musicId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Player* player = handler->GetSession()->GetPlayer();
+
+ player->PlayDirectMusic(musicId, player);
+
+ handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, musicId);
+ return true;
+ }
+
static bool HandleDebugSendSpellFailCommand(ChatHandler* handler, char const* args)
{
if (!*args)
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 595af9223bc..4d818db8f9d 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -891,7 +891,7 @@ public:
const_cast<CreatureData*>(data)->posZ = z;
const_cast<CreatureData*>(data)->orientation = o;
}
- creature->SetPosition(x, y, z, o);
+ creature->UpdatePosition(x, y, z, o);
creature->GetMotionMaster()->Initialize();
if (creature->IsAlive()) // dead creature will reset movement generator at respawn
{
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 8917a50951f..ccb032f6c02 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -111,13 +111,13 @@ public:
{ "item_random_bonus_list_template", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_RANDOM_BONUS_LIST_TEMPLATE, true, &HandleReloadItemRandomBonusListTemplatesCommand, "" },
{ "item_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesItemCommand, "" },
{ "lfg_dungeon_rewards", rbac::RBAC_PERM_COMMAND_RELOAD_LFG_DUNGEON_REWARDS, true, &HandleReloadLfgRewardsCommand, "" },
- { "locales_achievement_reward", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_ACHIEVEMENT_REWARD, true, &HandleReloadLocalesAchievementRewardCommand, "" },
- { "locales_creature", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_CRETURE, true, &HandleReloadLocalesCreatureCommand, "" },
- { "locales_creature_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_CRETURE_TEXT, true, &HandleReloadLocalesCreatureTextCommand, "" },
- { "locales_gameobject", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_GAMEOBJECT, true, &HandleReloadLocalesGameobjectCommand, "" },
- { "locales_gossip_menu_option", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_GOSSIP_MENU_OPTION, true, &HandleReloadLocalesGossipMenuOptionCommand, "" },
- { "locales_page_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_PAGE_TEXT, true, &HandleReloadLocalesPageTextCommand, "" },
- { "locales_points_of_interest", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_POINTS_OF_INTEREST, true, &HandleReloadLocalesPointsOfInterestCommand, "" },
+ { "achievement_reward_locale", rbac::RBAC_PERM_COMMAND_RELOAD_ACHIEVEMENT_REWARD_LOCALE, true, &HandleReloadLocalesAchievementRewardCommand, "" },
+ { "creature_template_locale", rbac::RBAC_PERM_COMMAND_RELOAD_CRETURE_TEMPLATE_LOCALE, true, &HandleReloadLocalesCreatureCommand, "" },
+ { "creature_text_locale", rbac::RBAC_PERM_COMMAND_RELOAD_CRETURE_TEXT_LOCALE, true, &HandleReloadLocalesCreatureTextCommand, "" },
+ { "gameobject_template_locale", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_TEMPLATE_LOCALE, true, &HandleReloadLocalesGameobjectCommand, "" },
+ { "gossip_menu_option_locale", rbac::RBAC_PERM_COMMAND_RELOAD_GOSSIP_MENU_OPTION_LOCALE, true, &HandleReloadLocalesGossipMenuOptionCommand, "" },
+ { "page_text_locale", rbac::RBAC_PERM_COMMAND_RELOAD_PAGE_TEXT_LOCALE, true, &HandleReloadLocalesPageTextCommand, "" },
+ { "points_of_interest_locale", rbac::RBAC_PERM_COMMAND_RELOAD_POINTS_OF_INTEREST_LOCALE, true, &HandleReloadLocalesPointsOfInterestCommand, "" },
{ "mail_level_reward", rbac::RBAC_PERM_COMMAND_RELOAD_MAIL_LEVEL_REWARD, true, &HandleReloadMailLevelRewardCommand, "" },
{ "mail_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_MAIL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMailCommand, "" },
{ "milling_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_MILLING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMillingCommand, "" },
@@ -128,7 +128,7 @@ public:
{ "points_of_interest", rbac::RBAC_PERM_COMMAND_RELOAD_POINTS_OF_INTEREST, true, &HandleReloadPointsOfInterestCommand, "" },
{ "prospecting_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_PROSPECTING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesProspectingCommand, "" },
{ "quest_greeting", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_GREETING, true, &HandleReloadQuestGreetingCommand, "" },
- { "quest_locale", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_LOCALE, true, &HandleReloadQuestLocaleCommand, "" },
+ { "quest_locale", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_TEMPLATE_LOCALE, true, &HandleReloadQuestLocaleCommand, "" },
{ "quest_poi", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_POI, true, &HandleReloadQuestPOICommand, "" },
{ "quest_template", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_TEMPLATE, true, &HandleReloadQuestTemplateCommand, "" },
{ "rbac", rbac::RBAC_PERM_COMMAND_RELOAD_RBAC, true, &HandleReloadRBACCommand, "" },
@@ -997,9 +997,9 @@ public:
static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
{
- TC_LOG_INFO("misc", "Re-Loading Locales Achievement Reward Data...");
+ TC_LOG_INFO("misc", "Re-Loading Achievement Reward Data Locale...");
sAchievementMgr->LoadRewardLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_achievement_reward` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `achievement_reward_locale` reloaded.");
return true;
}
@@ -1013,49 +1013,49 @@ public:
static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, const char* /*args*/)
{
- TC_LOG_INFO("misc", "Re-Loading Locales Creature ...");
+ TC_LOG_INFO("misc", "Re-Loading Creature Template Locale...");
sObjectMgr->LoadCreatureLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_creature` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `creature_template_locale` reloaded.");
return true;
}
static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/)
{
- TC_LOG_INFO("misc", "Re-Loading Locales Creature Texts...");
+ TC_LOG_INFO("misc", "Re-Loading Creature Texts Locale...");
sCreatureTextMgr->LoadCreatureTextLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_creature_text` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `creature_text_locale` reloaded.");
return true;
}
static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
{
- TC_LOG_INFO("misc", "Re-Loading Locales Gameobject ... ");
+ TC_LOG_INFO("misc", "Re-Loading Gameobject Template Locale... ");
sObjectMgr->LoadGameObjectLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_gameobject` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `gameobject_template_locale` reloaded.");
return true;
}
static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
{
- TC_LOG_INFO("misc", "Re-Loading Locales Gossip Menu Option ... ");
+ TC_LOG_INFO("misc", "Re-Loading Gossip Menu Option Locale... ");
sObjectMgr->LoadGossipMenuItemsLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_gossip_menu_option` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `gossip_menu_option_locale` reloaded.");
return true;
}
static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, const char* /*args*/)
{
- TC_LOG_INFO("misc", "Re-Loading Locales Page Text ... ");
+ TC_LOG_INFO("misc", "Re-Loading Page Text Locale... ");
sObjectMgr->LoadPageTextLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_page_text` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `page_text_locale` reloaded.");
return true;
}
static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
{
- TC_LOG_INFO("misc", "Re-Loading Locales Points Of Interest ... ");
+ TC_LOG_INFO("misc", "Re-Loading Points Of Interest Locale... ");
sObjectMgr->LoadPointOfInterestLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_points_of_interest` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `points_of_interest_locale` reloaded.");
return true;
}