From 5323fa1f3a6106d6c94c3a13da586702ec8b6d21 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Sat, 28 Mar 2009 04:55:59 +0300 Subject: [PATCH] [7560] Implement IconName for gameobject Signed-off-by: VladimirMangos Also small fix for 7558 sql update (for re-apply support) --- sql/mangos.sql | 3 ++- sql/updates/7558_01_mangos_mangos_string.sql | 2 +- sql/updates/7560_01_mangos_gameobject_template.sql | 4 ++++ sql/updates/Makefile.am | 2 ++ src/game/GameObject.h | 1 + src/game/QueryHandler.cpp | 4 +++- src/shared/Database/SQLStorage.cpp | 4 ++-- src/shared/revision_nr.h | 2 +- 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 sql/updates/7560_01_mangos_gameobject_template.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 0e4654d1c..cc36c0592 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_7558_02_mangos_command` bit(1) default NULL + `required_7560_01_mangos_gameobject_template` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -1409,6 +1409,7 @@ CREATE TABLE `gameobject_template` ( `type` tinyint(3) unsigned NOT NULL default '0', `displayId` mediumint(8) unsigned NOT NULL default '0', `name` varchar(100) NOT NULL default '', + `IconName` varchar(100) NOT NULL default '', `castBarCaption` varchar(100) NOT NULL default '', `faction` smallint(5) unsigned NOT NULL default '0', `flags` int(10) unsigned NOT NULL default '0', diff --git a/sql/updates/7558_01_mangos_mangos_string.sql b/sql/updates/7558_01_mangos_mangos_string.sql index 79012b791..c0b856a98 100644 --- a/sql/updates/7558_01_mangos_mangos_string.sql +++ b/sql/updates/7558_01_mangos_mangos_string.sql @@ -1,6 +1,6 @@ ALTER TABLE db_version CHANGE COLUMN required_7544_01_mangos_uptime required_7558_01_mangos_mangos_string bit; -DELETE FROM mangos_string WHERE entry IN (1123,1124,1125); +DELETE FROM mangos_string WHERE entry IN (1123,1124,1125,1126,1127); INSERT INTO mangos_string VALUES (1123,'Not pet found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1124,'Wrong pet type',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), diff --git a/sql/updates/7560_01_mangos_gameobject_template.sql b/sql/updates/7560_01_mangos_gameobject_template.sql new file mode 100644 index 000000000..f980687c7 --- /dev/null +++ b/sql/updates/7560_01_mangos_gameobject_template.sql @@ -0,0 +1,4 @@ +ALTER TABLE db_version CHANGE COLUMN required_7558_02_mangos_command required_7560_01_mangos_gameobject_template bit; + +ALTER TABLE gameobject_template + ADD COLUMN IconName varchar(100) NOT NULL default '' AFTER name; diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 70cbeb525..f3cd4650a 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -208,6 +208,7 @@ pkgdata_DATA = \ 7546_02_realmd_uptime.sql \ 7558_01_mangos_mangos_string.sql \ 7558_02_mangos_command.sql \ + 7560_01_mangos_gameobject_template.sql \ README ## Additional files to include when running 'make dist' @@ -396,4 +397,5 @@ EXTRA_DIST = \ 7546_02_realmd_uptime.sql \ 7558_01_mangos_mangos_string.sql \ 7558_02_mangos_command.sql \ + 7560_01_mangos_gameobject_template.sql \ README diff --git a/src/game/GameObject.h b/src/game/GameObject.h index a3f729817..5d7e9343e 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -39,6 +39,7 @@ struct GameObjectInfo uint32 type; uint32 displayId; char *name; + char *IconName; char *castBarCaption; uint32 faction; uint32 flags; diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index f624e5bc1..4e31bfa42 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -221,9 +221,11 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data ) { std::string Name; + std::string IconName; std::string CastBarCaption; Name = info->name; + IconName = info->IconName; CastBarCaption = info->castBarCaption; int loc_idx = GetSessionDbLocaleIndex(); @@ -245,7 +247,7 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data ) data << uint32(info->displayId); data << Name; data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4 - data << uint8(0); // 2.0.3, string + data << IconName; // 2.0.3, string. Icon name to use instead of default icon for go's (ex: "Attack" makes sword) data << CastBarCaption; // 2.0.3, string. Text will appear in Cast Bar when using GO (ex: "Collecting") data << uint8(0); // 2.0.3, string data.append(info->raw.data, 24); diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp index dbeee6540..9cb1dbbaf 100644 --- a/src/shared/Database/SQLStorage.cpp +++ b/src/shared/Database/SQLStorage.cpp @@ -31,8 +31,8 @@ const char CreatureDataAddonInfofmt[]="iiiiiiis"; const char CreatureModelfmt[]="iffbi"; const char CreatureInfoAddonInfofmt[]="iiiiiiis"; const char EquipmentInfofmt[]="iiii"; -const char GameObjectInfosrcfmt[]="iiissiifiiiiiiiiiiiiiiiiiiiiiiiis"; -const char GameObjectInfodstfmt[]="iiissiifiiiiiiiiiiiiiiiiiiiiiiiii"; +const char GameObjectInfosrcfmt[]="iiisssiifiiiiiiiiiiiiiiiiiiiiiiiis"; +const char GameObjectInfodstfmt[]="iiisssiifiiiiiiiiiiiiiiiiiiiiiiiii"; const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiffiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiisiiii"; const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiffiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiii"; const char PageTextfmt[]="isi"; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index aa013c01c..4d931d6ff 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 "7559" + #define REVISION_NR "7560" #endif // __REVISION_NR_H__ -- 2.11.4.GIT