From bc95a3e862a19911da7cce25fee4c34a31609403 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sun, 5 Apr 2009 04:24:14 +0400 Subject: [PATCH] [7616] Implement .debug play cinematic and .debig play movie. Rename .debug playsound to .debug play sound. --- sql/mangos.sql | 10 ++++-- sql/updates/7616_01_mangos_mangos_string.sql | 6 ++++ sql/updates/7616_02_mangos_command.sql | 8 +++++ sql/updates/Makefile.am | 4 +++ src/game/Chat.cpp | 10 +++++- src/game/Chat.h | 5 ++- src/game/DBCStores.cpp | 8 ++++- src/game/DBCStores.h | 2 ++ src/game/DBCStructure.h | 28 ++++++++++++++++ src/game/DBCfmt.h | 2 ++ src/game/Language.h | 7 +++- src/game/debugcmds.cpp | 48 ++++++++++++++++++++++++++++ src/shared/revision_nr.h | 2 +- 13 files changed, 132 insertions(+), 8 deletions(-) create mode 100644 sql/updates/7616_01_mangos_mangos_string.sql create mode 100644 sql/updates/7616_02_mangos_command.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 21f63ece..fe996f8b 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, - `required_7615_01_mangos_command` bit(1) default NULL + `required_7616_02_mangos_command` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -267,7 +267,9 @@ INSERT INTO `command` VALUES ('debug arena',3,'Syntax: .debug arena\r\n\r\nToggle debug mode for arenas. In debug mode GM can start arena with single player.'), ('debug bg',3,'Syntax: .debug bg\r\n\r\nToggle debug mode for battlegrounds. In debug mode GM can start battleground with single player.'), ('debug getvalue',3,'Syntax: .debug getvalue #field #isInt\r\n\r\nGet the field #field of the selected creature. If no creature is selected, get the content of your field.\r\n\r\nUse a #isInt of value 1 if the expected field content is an integer.'), -('debug playsound',1,'Syntax: .debug playsound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'), +('debug play cinematic',1,'Syntax: .debug play cinematic #cinematicid\r\n\r\nPlay cinematic #cinematicid for you. You stay at place while your mind fly.\r\n'), +('debug play movie',1,'Syntax: .debug play movie #movieid\r\n\r\nPlay movie #movieid for you.'), +('debug play sound',1,'Syntax: .debug play sound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'), ('debug setvalue',3,'Syntax: .debug setvalue #field #value #isInt\r\n\r\nSet the field #field of the selected creature with value #value. If no creature is selected, set the content of your field.\r\n\r\nUse a #isInt of value 1 if #value is an integer.'), ('debug update',3,'Syntax: .debug update #field #value\r\n\r\nUpdate the field #field of the selected character or creature with value #value.\r\n\r\nIf no #value is provided, display the content of field #field.'), ('debug Mod32Value',3,'Syntax: .debug Mod32Value #field #value\r\n\r\nAdd #value to field #field of your character.'), @@ -2924,7 +2926,9 @@ INSERT INTO `mangos_string` VALUES (1124,'Wrong pet type',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1125,'Your pet learned all talents',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1126,'Your pet talents have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -(1127,'Talents of %s\'s pet reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +(1127,'Talents of %s\'s pet reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/7616_01_mangos_mangos_string.sql b/sql/updates/7616_01_mangos_mangos_string.sql new file mode 100644 index 00000000..cd6e315a --- /dev/null +++ b/sql/updates/7616_01_mangos_mangos_string.sql @@ -0,0 +1,6 @@ +ALTER TABLE db_version CHANGE COLUMN required_7615_01_mangos_command required_7616_01_mangos_mangos_string bit; + +DELETE FROM mangos_string WHERE entry IN(1200,1201); +INSERT INTO mangos_string VALUES +(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); diff --git a/sql/updates/7616_02_mangos_command.sql b/sql/updates/7616_02_mangos_command.sql new file mode 100644 index 00000000..486e459a --- /dev/null +++ b/sql/updates/7616_02_mangos_command.sql @@ -0,0 +1,8 @@ +ALTER TABLE db_version CHANGE COLUMN required_7616_01_mangos_mangos_string required_7616_02_mangos_command bit; + +DELETE FROM `command` WHERE `name` IN ('debug playsound','debug play sound','debug play cinematic','debug play movie',); + +INSERT INTO `command` VALUES +('debug play cinematic',1,'Syntax: .debug play cinematic #cinematicid\r\n\r\nPlay cinematic #cinematicid for you. You stay at place while your mind fly.\r\n'), +('debug play movie',1,'Syntax: .debug play movie #movieid\r\n\r\nPlay movie #movieid for you.'), +('debug play sound',1,'Syntax: .debug play sound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 28d9d984..947a4c93 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -212,6 +212,8 @@ pkgdata_DATA = \ 7565_01_mangos_mangos_string.sql \ 7568_01_mangos_spell_proc_event.sql \ 7615_01_mangos_command.sql \ + 7616_01_mangos_mangos_string.sql \ + 7616_02_mangos_command.sql \ README ## Additional files to include when running 'make dist' @@ -404,4 +406,6 @@ EXTRA_DIST = \ 7565_01_mangos_mangos_string.sql \ 7568_01_mangos_spell_proc_event.sql \ 7615_01_mangos_command.sql \ + 7616_01_mangos_mangos_string.sql \ + 7616_02_mangos_command.sql \ README diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 2496f91a..1293f612 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -105,6 +105,14 @@ ChatCommand * ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; + static ChatCommand debugPlayCommandTable[] = + { + { "cinematic", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlayCinematicCommand, "", NULL }, + { "movie", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlayMovieCommand, "", NULL }, + { "sound", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlaySoundCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand debugSendCommandTable[] = { { "buyerror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendBuyErrorCommand, "", NULL }, @@ -131,7 +139,7 @@ ChatCommand * ChatHandler::getCommandTable() { "lootrecipient", SEC_GAMEMASTER, false, &ChatHandler::HandleDebugGetLootRecipient, "", NULL }, { "getvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugGetValue, "", NULL }, { "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugMod32Value, "", NULL }, - { "playsound", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlaySoundCommand, "", NULL }, + { "play", SEC_MODERATOR, false, NULL, "", debugPlayCommandTable }, { "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable }, { "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemFlagCommand, "", NULL }, { "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValue, "", NULL }, diff --git a/src/game/Chat.h b/src/game/Chat.h index 48914847..615ed645 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -118,13 +118,16 @@ class ChatHandler bool HandleDebugGetLootRecipient(const char * args); bool HandleDebugGetValue(const char* args); bool HandleDebugMod32Value(const char* args); - bool HandleDebugPlaySoundCommand(const char* args); bool HandleDebugSetValue(const char* args); bool HandleDebugSetItemFlagCommand(const char * args); bool HandleDebugSpawnVehicle(const char * args); bool HandleDebugUpdate(const char* args); bool HandleDebugUpdateWorldStateCommand(const char* args); + bool HandleDebugPlayCinematicCommand(const char* args); + bool HandleDebugPlayMovieCommand(const char* args); + bool HandleDebugPlaySoundCommand(const char* args); + bool HandleDebugSendBuyErrorCommand(const char* args); bool HandleDebugSendChannelNotifyCommand(const char* args); bool HandleDebugSendChatMsgCommand(const char* args); diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 983b6869..1d5fbb78 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -46,6 +46,7 @@ DBCStorage sCharTitlesStore(CharTitlesEntryfmt); DBCStorage sChatChannelsStore(ChatChannelsEntryfmt); DBCStorage sChrClassesStore(ChrClassesEntryfmt); DBCStorage sChrRacesStore(ChrRacesEntryfmt); +DBCStorage sCinematicSequencesStore(CinematicSequencesEntryfmt); DBCStorage sCreatureDisplayInfoStore(CreatureDisplayInfofmt); DBCStorage sCreatureFamilyStore(CreatureFamilyfmt); DBCStorage sCreatureSpellDataStore(CreatureSpellDatafmt); @@ -76,7 +77,9 @@ DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); //DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); + DBCStorage sHolidaysStore(Holidaysfmt); + DBCStorage sItemStore(Itemfmt); DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); //DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); @@ -91,6 +94,7 @@ DBCStorage sLockStore(LockEntryfmt); DBCStorage sMailTemplateStore(MailTemplateEntryfmt); DBCStorage sMapStore(MapEntryfmt); +DBCStorage sMovieStore(MovieEntryfmt); DBCStorage sQuestSortStore(QuestSortEntryfmt); @@ -197,7 +201,7 @@ void LoadDBCStores(const std::string& dataPath) { std::string dbcPath = dataPath+"dbc/"; - const uint32 DBCFilesCount = 75; + const uint32 DBCFilesCount = 77; barGoLink bar( DBCFilesCount ); @@ -234,6 +238,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChatChannelsStore, dbcPath,"ChatChannels.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrClassesStore, dbcPath,"ChrClasses.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrRacesStore, dbcPath,"ChrRaces.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCinematicSequencesStore, dbcPath,"CinematicSequences.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureDisplayInfoStore, dbcPath,"CreatureDisplayInfo.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureFamilyStore, dbcPath,"CreatureFamily.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureSpellDataStore, dbcPath,"CreatureSpellData.dbc"); @@ -284,6 +289,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sLockStore, dbcPath,"Lock.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMailTemplateStore, dbcPath,"MailTemplate.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMapStore, dbcPath,"Map.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMovieStore, dbcPath,"Movie.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestSortStore, dbcPath,"QuestSort.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc"); diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index b6e13291..95a2e4a4 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -72,6 +72,7 @@ extern DBCStorage sCharStartOutfitStore; extern DBCStorage sCharTitlesStore; extern DBCStorage sChrClassesStore; extern DBCStorage sChrRacesStore; +extern DBCStorage sCinematicSequencesStore; extern DBCStorage sCreatureDisplayInfoStore; extern DBCStorage sCreatureFamilyStore; extern DBCStorage sCreatureSpellDataStore; @@ -108,6 +109,7 @@ extern DBCStorage sItemSetStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; extern DBCStorage sMapStore; +extern DBCStorage sMovieStore; extern DBCStorage sQuestSortStore; extern DBCStorage sRandomPropertiesPointsStore; extern DBCStorage sScalingStatDistributionStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 288650f6..00df3202 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -648,6 +648,27 @@ struct ChrRacesEntry uint32 addon; // 68 (0 - original race, 1 - tbc addon, ...) }; +/* not used +struct CinematicCameraEntry +{ + uint32 id; // 0 index + char* filename; // 1 + uint32 soundid; // 2 in SoundEntries.dbc or 0 + float start_x; // 3 + float start_y; // 4 + float start_z; // 5 + float unk6; // 6 speed? +}; +*/ + +struct CinematicSequencesEntry +{ + uint32 Id; // 0 index + //uint32 unk1; // 1 always 0 + //uint32 cinematicCamera; // 2 id in CinematicCamera.dbc + // 3-9 always 0 +}; + struct CreatureDisplayInfoEntry { uint32 Displayid; // 0 m_ID @@ -1077,6 +1098,13 @@ struct MapEntry } }; +struct MovieEntry +{ + uint32 Id; // 0 index + //char* filename; // 1 + //uint32 unk2; // 2 always 100 +}; + struct QuestSortEntry { uint32 id; // 0 m_ID diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 7b3858fd..27ee3e1a 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -34,6 +34,7 @@ const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx"; // ChatChannelsEntryfmt, index not used (more compact store) const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; const char ChrRacesEntryfmt[]="nxixiixxixxxxissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; +const char CinematicSequencesEntryfmt[]="nxxxxxxxxx"; const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxxxx"; const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx"; const char CreatureSpellDatafmt[]="nxxxxxxxx"; @@ -70,6 +71,7 @@ const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiii const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char MapEntryfmt[]="nxixssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiffiixxix"; +const char MovieEntryfmt[]="nxx"; const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx"; const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii"; diff --git a/src/game/Language.h b/src/game/Language.h index 5aa4547f..4ff73e6d 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -765,7 +765,12 @@ enum MangosStrings LANG_RESET_PET_TALENTS_ONLINE = 1127, // Room for more level 3 1128-1199 not used - // FREE IDS 1200-9999 + // Debug commands + LANG_CINEMATIC_NOT_EXIST = 1200, + LANG_MOVIE_NOT_EXIST = 1201, + // Room for more debug 1202-1299 not used + + // FREE IDS 1300-9999 // Use for not-in-offcial-sources patches // 10000-10999 diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index e964e28c..fa20d243 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -212,6 +212,54 @@ bool ChatHandler::HandleDebugUpdateWorldStateCommand(const char* args) return true; } +bool ChatHandler::HandleDebugPlayCinematicCommand(const char* args) +{ + // USAGE: .debug play cinematic #cinematicid + // #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column) + if( !*args ) + { + SendSysMessage(LANG_BAD_VALUE); + SetSentErrorMessage(true); + return false; + } + + uint32 dwId = atoi((char*)args); + + if(!sCinematicSequencesStore.LookupEntry(dwId)) + { + PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, dwId); + SetSentErrorMessage(true); + return false; + } + + m_session->GetPlayer()->SendCinematicStart(dwId); + return true; +} + +bool ChatHandler::HandleDebugPlayMovieCommand(const char* args) +{ + // USAGE: .debug play movie #movieid + // #movieid - ID decimal number from Movie.dbc (1st column) + if( !*args ) + { + SendSysMessage(LANG_BAD_VALUE); + SetSentErrorMessage(true); + return false; + } + + uint32 dwId = atoi((char*)args); + + if(!sMovieStore.LookupEntry(dwId)) + { + PSendSysMessage(LANG_MOVIE_NOT_EXIST, dwId); + SetSentErrorMessage(true); + return false; + } + + m_session->GetPlayer()->SendMovieStart(dwId); + return true; +} + //Play sound bool ChatHandler::HandleDebugPlaySoundCommand(const char* args) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7fe261e8..94cd0500 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7615" + #define REVISION_NR "7616" #endif // __REVISION_NR_H__ -- 2.11.4.GIT