From 0b157c90662b03a9cc25f03f326accb6bda350eb Mon Sep 17 00:00:00 2001 From: kiper Date: Tue, 14 Aug 2012 01:49:18 +0200 Subject: Core/Globals: Add 5th field in reputation_spillover_template for Bilgewater Cartel/Gilneas spillover reputation. --- sql/updates/world/2012_08_12_03_world_misc_434.sql | 38 ++++++++++++++++++++++ ...2012_08_14_00_reputation_spillover_template.sql | 12 +++++++ sql/updates/world/2012_08_17_00_world_misc_434.sql | 38 ---------------------- src/server/game/Globals/ObjectMgr.cpp | 13 ++++++-- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 5 files changed, 62 insertions(+), 41 deletions(-) create mode 100644 sql/updates/world/2012_08_12_03_world_misc_434.sql create mode 100644 sql/updates/world/2012_08_14_00_reputation_spillover_template.sql delete mode 100644 sql/updates/world/2012_08_17_00_world_misc_434.sql diff --git a/sql/updates/world/2012_08_12_03_world_misc_434.sql b/sql/updates/world/2012_08_12_03_world_misc_434.sql new file mode 100644 index 00000000000..aa6c11ee1f8 --- /dev/null +++ b/sql/updates/world/2012_08_12_03_world_misc_434.sql @@ -0,0 +1,38 @@ +DELETE FROM `creature_text` WHERE `entry`=2768; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(2768,0,0,'Ok, $N. Follow me to the cave where I''ll attempt to harness the power of the rune stone into these goggles.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_1'), +(2768,1,0,'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_2'), +(2768,2,0,'I''ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_3'), +(2768,3,0,'%s begins tinkering with the goggles before the stone.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_4'), +(2768,4,0,'Help!!! Get these things off me so I can get my work done!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_AGGRO'), +(2768,5,0,'Almost done! Just a little longer!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_5'), +(2768,6,0,'I''ve done it! I have harnessed the power of the stone into the goggles! Let''s get out of here!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_6'), +(2768,7,0,'Phew! Glad to be back from that creepy cave.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_7'), +(2768,8,0,'%s hands one glowing goggles over to Doctor Draxlegauge.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_8'), +(2768,9,0,'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_9'); + +DELETE FROM `script_waypoint` WHERE `entry`=2768; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(2768,1,-2072.32,-2089.59,9.14603,0,''), +(2768,2,-2078.18,-2096.31,10.8916,0,''), +(2768,3,-2079.21,-2105.22,13.3174,0,''), +(2768,4,-2074.81,-2108.72,14.1485,0,''), +(2768,5,-2076,-2116.21,16.3934,0,''), +(2768,6,-2073.31,-2123.92,18.6202,4000,''), +(2768,7,-2064.41,-2133.33,21.5776,0,''), +(2768,8,-2044.08,-2153.12,20.121,18000,''), +(2768,9,-2044.08,-2153.12,20.121,3000,''), +(2768,10,-2044.08,-2153.12,20.121,0,''), +(2768,11,-2044.08,-2153.12,20.121,14000,''), +(2768,12,-2063.89,-2133.33,21.5648,0,''), +(2768,13,-2075,-2121.98,17.8443,0,''), +(2768,14,-2074.83,-2108.53,14.1036,0,''), +(2768,15,-2079.59,-2091.61,9.80862,0,''), +(2768,16,-2071.29,-2086.44,8.5181,0,''), +(2768,17,-2066.46,-2085.97,8.9241,7000,''); + +DELETE FROM `creature_questrelation` WHERE `id`=2768 AND `quest`=26050; +INSERT INTO `creature_questrelation` (`id`, `quest`) +VALUES (2768, 26050); + +UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' WHERE `entry`=2768; \ No newline at end of file diff --git a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql new file mode 100644 index 00000000000..cc7e011ca43 --- /dev/null +++ b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql @@ -0,0 +1,12 @@ +ALTER TABLE `reputation_spillover_template` +ADD COLUMN `faction5` SMALLINT(6) UNSIGNED DEFAULT '0' NOT NULL AFTER `rank_4`, +ADD COLUMN `rate_5` FLOAT DEFAULT '0' NOT NULL AFTER `faction5`, +ADD COLUMN `rank_5` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL AFTER `rate_5`; + +UPDATE `reputation_spillover_template` SET `faction5`=1134,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (72,47,54,930,69); +UPDATE `reputation_spillover_template` SET `faction5`=1133,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (76,530,911,81,68); + +DELETE FROM `reputation_spillover_template` WHERE `faction` IN (1134,1133); +INSERT INTO `reputation_spillover_template`(`faction`,`faction1`,`rate_1`,`rank_1`,`faction2`,`rate_2`,`rank_2`,`faction3`,`rate_3`,`rank_3`,`faction4`,`rate_4`,`rank_4`,`faction5`,`rate_5`,`rank_5`) VALUES +(1134,72,0.25,7,47,0.27,7,54,0.25,7,930,0.25,7,69,0.25,7), +(1133,76,0.25,7,530,0.27,7,911,0.25,7,81,0.25,7,68,0.25,7), \ No newline at end of file diff --git a/sql/updates/world/2012_08_17_00_world_misc_434.sql b/sql/updates/world/2012_08_17_00_world_misc_434.sql deleted file mode 100644 index aa6c11ee1f8..00000000000 --- a/sql/updates/world/2012_08_17_00_world_misc_434.sql +++ /dev/null @@ -1,38 +0,0 @@ -DELETE FROM `creature_text` WHERE `entry`=2768; -INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES -(2768,0,0,'Ok, $N. Follow me to the cave where I''ll attempt to harness the power of the rune stone into these goggles.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_1'), -(2768,1,0,'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_2'), -(2768,2,0,'I''ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_3'), -(2768,3,0,'%s begins tinkering with the goggles before the stone.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_4'), -(2768,4,0,'Help!!! Get these things off me so I can get my work done!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_AGGRO'), -(2768,5,0,'Almost done! Just a little longer!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_5'), -(2768,6,0,'I''ve done it! I have harnessed the power of the stone into the goggles! Let''s get out of here!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_6'), -(2768,7,0,'Phew! Glad to be back from that creepy cave.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_7'), -(2768,8,0,'%s hands one glowing goggles over to Doctor Draxlegauge.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_8'), -(2768,9,0,'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_9'); - -DELETE FROM `script_waypoint` WHERE `entry`=2768; -INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES -(2768,1,-2072.32,-2089.59,9.14603,0,''), -(2768,2,-2078.18,-2096.31,10.8916,0,''), -(2768,3,-2079.21,-2105.22,13.3174,0,''), -(2768,4,-2074.81,-2108.72,14.1485,0,''), -(2768,5,-2076,-2116.21,16.3934,0,''), -(2768,6,-2073.31,-2123.92,18.6202,4000,''), -(2768,7,-2064.41,-2133.33,21.5776,0,''), -(2768,8,-2044.08,-2153.12,20.121,18000,''), -(2768,9,-2044.08,-2153.12,20.121,3000,''), -(2768,10,-2044.08,-2153.12,20.121,0,''), -(2768,11,-2044.08,-2153.12,20.121,14000,''), -(2768,12,-2063.89,-2133.33,21.5648,0,''), -(2768,13,-2075,-2121.98,17.8443,0,''), -(2768,14,-2074.83,-2108.53,14.1036,0,''), -(2768,15,-2079.59,-2091.61,9.80862,0,''), -(2768,16,-2071.29,-2086.44,8.5181,0,''), -(2768,17,-2066.46,-2085.97,8.9241,7000,''); - -DELETE FROM `creature_questrelation` WHERE `id`=2768 AND `quest`=26050; -INSERT INTO `creature_questrelation` (`id`, `quest`) -VALUES (2768, 26050); - -UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' WHERE `entry`=2768; \ No newline at end of file diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 897446a73f9..c63f599cd45 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6804,8 +6804,8 @@ void ObjectMgr::LoadReputationSpilloverTemplate() _repSpilloverTemplateStore.clear(); // for reload case - uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 - QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template"); + uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4, faction5, rate_5, rank_5 FROM reputation_spillover_template"); if (!result) { @@ -6834,6 +6834,9 @@ void ObjectMgr::LoadReputationSpilloverTemplate() repTemplate.faction[3] = fields[10].GetUInt16(); repTemplate.faction_rate[3] = fields[11].GetFloat(); repTemplate.faction_rank[3] = fields[12].GetUInt8(); + repTemplate.faction[4] = fields[13].GetUInt16(); + repTemplate.faction_rate[4] = fields[14].GetFloat(); + repTemplate.faction_rank[4] = fields[15].GetUInt16(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); @@ -6899,6 +6902,12 @@ void ObjectMgr::LoadReputationSpilloverTemplate() sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]); continue; } + FactionEntry const* factionEntry4 = sFactionStore.LookupEntry(repTemplate.faction[4]); + if (repTemplate.faction[4] && !factionEntry4) + { + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[4]); + continue; + } _repSpilloverTemplateStore[factionId] = repTemplate; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index cd44c362258..1774facf874 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -153,7 +153,7 @@ enum ReputationRank #define MIN_REPUTATION_RANK (REP_HATED) #define MAX_REPUTATION_RANK 8 -#define MAX_SPILLOVER_FACTIONS 4 +#define MAX_SPILLOVER_FACTIONS 5 enum MoneyConstants { -- cgit v1.2.3