diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-15 08:13:08 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-15 08:13:08 +0200 |
commit | 8b0cec3d5540c399ac2b0f764405c0322b04844c (patch) | |
tree | 6eb1551bf3e0ac279da0e705dd1d894f0a88c0b3 | |
parent | fd10e25813b8e14a8c8a5f8a82fb5b56e6ce3432 (diff) | |
parent | a0ff0233c59a4c12c229a0d02d728819b18c7ed0 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Spells/SpellInfo.cpp
-rw-r--r-- | sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql (renamed from sql/updates/world/2013_08_14_00_world_gameobject_loot_template.sql) | 0 | ||||
-rw-r--r-- | sql/updates/world/2013_08_14_01_world_gameobject.sql | 72 | ||||
-rw-r--r-- | sql/updates/world/2013_08_14_01_world_gameobject_loot_template.sql | 253 | ||||
-rw-r--r-- | sql/updates/world/2013_08_15_00_world_sai.sql | 5 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 74 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.h | 1 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 26 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 23 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 19 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.h | 2 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 5 |
11 files changed, 467 insertions, 13 deletions
diff --git a/sql/updates/world/2013_08_14_00_world_gameobject_loot_template.sql b/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql index db3d6659ba5..db3d6659ba5 100644 --- a/sql/updates/world/2013_08_14_00_world_gameobject_loot_template.sql +++ b/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql diff --git a/sql/updates/world/2013_08_14_01_world_gameobject.sql b/sql/updates/world/2013_08_14_01_world_gameobject.sql new file mode 100644 index 00000000000..b0c832edb9e --- /dev/null +++ b/sql/updates/world/2013_08_14_01_world_gameobject.sql @@ -0,0 +1,72 @@ +SET @OGUID := 76803; + +DELETE FROM `gameobject` WHERE `id` IN (188539,190353); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES + -- Coldwind Tree +(@OGUID, 188539, 571, 1, 1, 4845.311, 722.2529, 169.1704, 5.585054, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+1, 188539, 571, 1, 1, 4845.701, 676.941, 164.153, 1.780234, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+2, 188539, 571, 1, 1, 4822.568, 667.1375, 166.1218, 5.235988, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+3, 188539, 571, 1, 1, 4839.788, 809.9525, 162.1743, 4.450591, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+4, 188539, 571, 1, 1, 4891.104, 799.2133, 168.9825, 4.76475, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+5, 188539, 571, 1, 1, 4809.472, 874.1573, 163.8867, 6.19592, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+6, 188539, 571, 1, 1, 4896.817, 854.5087, 175.6376, 5.881761, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+7, 188539, 571, 1, 1, 4871.93, 718.883, 165.3885, 1.518436, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+8, 188539, 571, 1, 1, 4890.049, 970.9612, 209.2152, 3.787367, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+9, 188539, 571, 1, 1, 4945.856, 839.2049, 190.6546, 3.490667, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+10, 188539, 571, 1, 1, 4819.289, 791.7388, 166.832, 4.537859, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+11, 188539, 571, 1, 1, 4928.494, 726.8925, 178.0483, 2.722713, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+12, 188539, 571, 1, 1, 4822.72, 801.2385, 166.1128, 5.98648, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+13, 188539, 571, 1, 1, 4890.223, 789.971, 166.3956, 5.445428, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+14, 188539, 571, 1, 1, 4878.446, 770.7858, 163.0117, 5.183629, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+15, 188539, 571, 1, 1, 4893.438, 709.8468, 164.7574, 5.811947, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+16, 188539, 571, 1, 1, 4938.004, 853.88, 188.1079, 4.049168, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+17, 188539, 571, 1, 1, 4928.94, 976.3659, 213.8083, 3.455756, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+18, 188539, 571, 1, 1, 4902.952, 997.422, 217.0715, 4.171338, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+19, 188539, 571, 1, 1, 4909.807, 998.5203, 217.5305, 4.625124, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+20, 188539, 571, 1, 1, 4900.104, 1009.844, 221.0865, 1.710422, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+21, 188539, 571, 1, 1, 5122.282, 1034.124, 227.2998, 2.303831, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+22, 188539, 571, 1, 1, 5135.159, 1036.437, 225.7432, 5.340709, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+23, 188539, 571, 1, 1, 5122.978, 1091.059, 226.1329, 1.989672, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+24, 188539, 571, 1, 1, 5113.761, 1088.344, 227.6372, 3.752462, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+25, 188539, 571, 1, 1, 5107.944, 1096.339, 225.5093, 3.665196, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+26, 188539, 571, 1, 1, 5152.663, 1080.674, 223.8049, 5.026549, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+27, 188539, 571, 1, 1, 5189.047, 1086.043, 220.8354, 4.223697, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+28, 188539, 571, 1, 1, 5179.044, 1072.715, 221.8447, 3.351047, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+29, 188539, 571, 1, 1, 5222.162, 1092.083, 219.5214, 3.909541, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+30, 188539, 571, 1, 1, 5251.857, 1078.996, 220.9522, 0.087266, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+31, 188539, 571, 1, 1, 4842.251, 665.0809, 163.0047, 2.600535, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+32, 188539, 571, 1, 1, 4850.285, 659.3837, 162.0293, 2.583081, 0, 0, 0, 1, 120, 255, 1), +-- Poster Knife +(@OGUID+33, 190353, 571, 1, 1, 4845.379, 722.2457, 169.3926, 2.548179, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+34, 190353, 571, 1, 1, 4822.594, 667.0778, 166.3232, 2.18166, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+35, 190353, 571, 1, 1, 4819.184, 791.6855, 167.0265, 0.9424766, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+36, 190353, 571, 1, 1, 4822.843, 801.2508, 166.3003, 2.932139, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+37, 190353, 571, 1, 1, 4878.438, 770.6991, 163.227, 1.623156, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+38, 190353, 571, 1, 1, 4891.163, 799.1904, 169.2256, 2.129301, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+39, 190353, 571, 1, 1, 4809.532, 874.2202, 164.0672, 3.38594, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+40, 190353, 571, 1, 1, 4896.821, 854.4781, 175.846, 2.286379, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+41, 190353, 571, 1, 1, 4872.037, 718.7377, 165.5899, 1.902409, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+42, 190353, 571, 1, 1, 4890.018, 970.9833, 209.4513, 0, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+43, 190353, 571, 1, 1, 4839.718, 809.8333, 162.3687, 1.221729, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+44, 190353, 571, 1, 1, 4928.391, 726.8994, 178.2229, 5.969027, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+45, 190353, 571, 1, 1, 4893.49, 709.8345, 164.9516, 2.687807, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+46, 190353, 571, 1, 1, 4890.262, 789.9007, 166.38, 1.902409, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+47, 190353, 571, 1, 1, 4937.972, 853.8556, 188.2954, 1.204277, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+48, 190353, 571, 1, 1, 4928.847, 976.4125, 213.9889, 0, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+49, 190353, 571, 1, 1, 4902.885, 997.4144, 217.2868, 0.8377575, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+50, 190353, 571, 1, 1, 4909.735, 998.4642, 217.7249, 1.291542, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+51, 190353, 571, 1, 1, 4900.08, 1009.665, 221.2879, 1.553341, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+52, 190353, 571, 1, 1, 5122.176, 1034.082, 227.4803, 0, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+54, 190353, 571, 1, 1, 5135.044, 1036.4, 225.8995, 0, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+55, 190353, 571, 1, 1, 5122.983, 1091.042, 226.3065, 1.605702, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+56, 190353, 571, 1, 1, 5113.695, 1088.284, 227.8359, 0.7155849, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+57, 190353, 571, 1, 1, 5107.816, 1096.331, 225.7246, 0.3316107, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+58, 190353, 571, 1, 1, 5152.607, 1080.622, 224.0202, 1.850049, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+59, 190353, 571, 1, 1, 5189.124, 1085.911, 221.0087, 1.274088, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+60, 190353, 571, 1, 1, 5179.001, 1072.72, 222.0274, 0, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+61, 190353, 571, 1, 1, 5222.177, 1092.026, 219.7277, 1.274088, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+62, 190353, 571, 1, 1, 5251.752, 1079.047, 221.1224, 0, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+63, 190353, 571, 1, 1, 4945.764, 839.31, 190.6546, 0, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+64, 190353, 571, 1, 1, 4845.712, 676.88, 164.3336, 1.692969, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+65, 190353, 571, 1, 1, 4842.208, 665.113, 163.1968, 5.742135, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+66, 190353, 571, 1, 1, 4850.357, 659.3613, 162.2515, 2.565632, 0, 0, 0, 1, 120, 255, 1); diff --git a/sql/updates/world/2013_08_14_01_world_gameobject_loot_template.sql b/sql/updates/world/2013_08_14_01_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..c04849be454 --- /dev/null +++ b/sql/updates/world/2013_08_14_01_world_gameobject_loot_template.sql @@ -0,0 +1,253 @@ +SET @ThoriumGems := 12900; +SET @FelIronGems := 12901; +SET @RareGems := 12902; +SET @EpicGems := 12903; +SET @AdamantiteGems := 12904; +SET @WotlkGreenGems := 12905; +SET @WotlkBlueGems := 12906; + +DELETE FROM `reference_loot_template` WHERE `entry` IN (@ThoriumGems,@FelIronGems,@RareGems,@AdamantiteGems,@WotlkGreenGems,@WotlkBlueGems); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ThoriumGems +(@ThoriumGems,12363,40,1,1,1,1), -- Arcane Crystal +(@ThoriumGems, 7910,12,1,1,1,1), -- Star Ruby +(@ThoriumGems,12800,12,1,1,1,1), -- Azerothian Diamond +(@ThoriumGems,12361,12,1,1,1,1), -- Blue Sapphire +(@ThoriumGems,12364,12,1,1,1,1), -- Huge Emerald +(@ThoriumGems,12799,12,1,1,1,1), -- Large Opal +-- Fel Iron Gems +(@FelIronGems,23112,0,1,1,1,1), -- Golden Draenite +(@FelIronGems,23077,0,1,1,1,1), -- Blood Garnet +(@FelIronGems,21929,0,1,1,1,1), -- Flame Spessarite +(@FelIronGems,23079,0,1,1,1,1), -- Deep Peridot +(@FelIronGems,23107,0,1,1,1,1), -- Shadow Draenite +(@FelIronGems,23117,0,1,1,1,1), -- Azure Moonstone +-- Rare Gems +(@RareGems,23437,0,1,1,1,1), -- Talasite +(@RareGems,23439,0,1,1,1,1), -- Noble Topaz +(@RareGems,23440,0,1,1,1,1), -- Dawnstone +(@RareGems,23436,0,1,1,1,1), -- Living Ruby +(@RareGems,23441,0,1,1,1,1), -- Nightseye +(@RareGems,23438,0,1,1,1,1), -- Star of Elune +-- Epic Gems +(@EpicGems,32227,0,1,1,1,2), -- Crimson Spinel +(@EpicGems,32228,0,1,1,1,2), -- Empyrean Sapphire +(@EpicGems,32229,0,1,1,1,2), -- Lionseye +(@EpicGems,32230,0,1,1,1,2), -- Shadowsong Amethyst +(@EpicGems,32231,0,1,1,1,2), -- Pyrestone +(@EpicGems,32249,0,1,1,1,2), -- Seaspray Emerald +-- Adamantite Gems +(@AdamantiteGems,23112,0,1,1,1,2), -- Golden Draenite +(@AdamantiteGems,23077,0,1,1,1,2), -- Blood Garnet +(@AdamantiteGems,21929,0,1,1,1,2), -- Flame Spessarite +(@AdamantiteGems,23079,0,1,1,1,2), -- Deep Peridot +(@AdamantiteGems,23107,0,1,1,1,2), -- Shadow Draenite +(@AdamantiteGems,23117,0,1,1,1,2), -- Azure Moonstone +-- WOTLK Green Gems +(@WotlkGreenGems,36917,0,1,1,1,1), -- Bloodstone +(@WotlkGreenGems,36920,0,1,1,1,1), -- Sun Crystal +(@WotlkGreenGems,36923,0,1,1,1,1), -- Chalcedony +(@WotlkGreenGems,36926,0,1,1,1,1), -- Shadow Crystal +(@WotlkGreenGems,36929,0,1,1,1,1), -- Huge Citrine +(@WotlkGreenGems,36932,0,1,1,1,1), -- Dark Jade +-- WOTLK Blue Gems +(@WotlkBlueGems,36918,0,1,1,1,1), -- Scarlet Ruby +(@WotlkBlueGems,36921,0,1,1,1,1), -- Autumn's Glow +(@WotlkBlueGems,36924,0,1,1,1,1), -- Sky Sapphire +(@WotlkBlueGems,36927,0,1,1,1,1), -- Twilight Opal +(@WotlkBlueGems,36930,0,1,1,1,1), -- Monarch Topaz +(@WotlkBlueGems,36933,0,1,1,1,1); -- Forest Emerald +-- -------------------------------------------------------------------------------------------------------------------------------------------------------- +-- -------------------------------------------------------------------------------------------------------------------------------------------------------- +-- ------------------- +-- -- CLASSIC ZONES -- +-- ------------------- +SET @Copper := 1502; +SET @Tin := 1503; +SET @Silver := 1504; +SET @Iron := 1505; +SET @Gold :=1506; +SET @Mithril :=1742; +SET @Truesilver := 5045; +SET @DarkIron := 11213; +SET @SmallThorium := 9597; +SET @RichThorium := 12883; +SET @Incendicite := 1409; -- (OR 29574??) +SET @Indurium := 3266; + +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Copper,@Tin,@Silver,@Iron,@Gold,@Mithril,@Truesilver,@DarkIron,@SmallThorium,@RichThorium,17938,13960,17241,@Incendicite,@Indurium); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Copper Vein +(@Copper,2770,100,1,0,1,9), -- Copper Ore +(@Copper,2835, 25,1,0,1,11), -- Rough Stone +(@Copper,774 ,5,1,1,1,1), -- Malachite +(@Copper,1210,5,1,1,1,1), -- Shadowgem +(@Copper,818 ,5,1,1,1,1), -- Tigerseye +(@Copper,22634,-100,1,0,1,2), -- Underlight Ore (only on quest) +-- Tin Vein +(@Tin,2771,100,1,0,1,9), -- Tin Ore +(@Tin,2836,25,1,0,1,13), -- Coarse Stone +(@Tin,1206,5,1,1,1,1), -- Moss Agate +(@Tin,1705,5,1,1,1,1), -- Lesser Moonstone +(@Tin,1210,5,1,1,1,1), -- Shadowgem +(@Tin,1529,5,1,1,1,1), -- Jade +(@Tin,2798,-100,1,0,1,2), -- Rethban Ore (only on quest) +(@Tin,22634,-100,1,0,1,2), -- Underlight Ore (only on quest) +-- Silver Vein & Ooze Covered Silver Vein +(@Silver,2775,100,1,0,2,4), -- Silver Ore +(@Silver,1206,5,1,1,1,1), -- Moss Agate +(@Silver,1705,5,1,1,1,1), -- Lesser Moonstone +(@Silver,1210,5,1,1,1,1), -- Shadowgem +-- Iron Deposit +(@Iron,2772,100,1,0,2,4), -- Iron Ore +(@Iron,2838,100,1,0,1,5), -- Heavy Stone +(@Iron,1529,5,1,1,1,1), -- Jade +(@Iron,3864,5,1,1,1,1), -- Citrine +(@Iron,1705,5,1,1,1,1), -- Lesser Moonstone +(@Iron,7909,5,1,1,1,1), -- Aquamarine +-- Gold Vein & Ooze Covered Gold Vein +(@Gold,2776,100,1,0,2,4), -- Gold Ore +(@Gold,3864,5,1,1,1,1), -- Citrine +(@Gold,1705,5,1,1,1,1), -- Lesser Moonstone +(@Gold,7909,5,1,1,1,1), -- Aquamarine +-- Mithril Deposit & Ooze Covered +(@Mithril,3858,100,1,0,2,4), -- Mithril Ore +(@Mithril,7912,80,1,0,1,8), -- Solid Stone +(@Mithril,7909,5,1,1,1,1), -- Aquamarine +(@Mithril,3864,5,1,1,1,1), -- Citrine +(@Mithril,7910,5,1,1,1,1), -- Star Ruby +(@Mithril,9262,5,1,1,1,1), -- Black Vitriol +-- Truesilver Deposit & Ooze Covered +(@Truesilver,7911,100,1,0,2,4), -- Truesilver Ore +(@Truesilver,7909,5,1,1,1,1), -- Aquamarine +(@Truesilver,3864,5,1,1,1,1), -- Citrine +(@Truesilver,7910,5,1,1,1,1), -- Star Ruby +-- Dark Iron Deposit +(@DarkIron,11370,100,1,0,2,4), -- Dark Iron Ore +(@DarkIron, 9262,5,1,1,1,1), -- Black Vitriol +(@DarkIron,11382,5,1,1,1,1), -- Blood of the Mountain +(@DarkIron,11754,5,1,1,1,1), -- Black Diamond +-- Small Thorium Vein Covered +(@SmallThorium,10620,100,1,0,2,3), -- Thorium Ore +(@SmallThorium,12365,100,1,0,1,5), -- Dense Stone +(@SmallThorium,1,15,1,0,-@ThoriumGems,1), -- One From Gems +-- Rich Thorium Vein & Ooze Covered +(@RichThorium,10620,100,1,0,3,5), -- Thorium Ore +(@RichThorium,12365,100,1,0,4,7), -- Dense Stone +(@RichThorium,1,25,1,0,-@ThoriumGems,1), -- One From Gems +-- Special Cases: +-- Truesilver Vein+Tainted Vitriol +(17938,7911,100,1,0,2,8), -- Truesilver Ore +(17938,7909,5,1,1,1,1), -- Aquamarine +(17938,3864,5,1,1,1,1), -- Citrine +(17938,7910,5,1,1,1,1), -- Star Ruby +(17938,11513,50,1,0,1,1), -- Tainted Vitriol +-- Small Thorium Vein+Tainted Vitriol +(13960,10620,100,1,0,1,8), -- Thorium Ore +(13960,12365,100,1,0,1,10), -- Dense Stone +(13960,1,15,1,0,-@ThoriumGems,1), -- One From Gems +(13960,11513,50,1,0,1,1), -- Tainted Vitriol +-- Hakkari Thorium Vein +(17241,10620,100,1,0,1,8), -- Thorium Ore +(17241,12365,100,1,0,1,10), -- Dense Stone +(17241,1,15,1,0,-@ThoriumGems,1), -- One From Gems +(17241,19774,40,1,0,5,10), -- Souldarite +-- Incendicite Mineral Vein +(@Incendicite,3340,-100,1,0,1,2), -- Incendicite Ore (for quest) +-- Indurium Mineral Vein +(@Indurium,5833,-100,1,0,2,4); -- Indurium Ore (for quest) +-- ------------------------------- +-- -- The Burning Crusade Zones -- +-- ------------------------------- +SET @FelIron :=18359; +SET @Nethercite := 22070; +SET @Adamantite := 18361; +SET @RichAdamantite := 26861; +SET @Khorium := 18363; +SET @GemVein := 26862; +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@FelIron,@Nethercite,@Adamantite,@RichAdamantite,@Khorium,@GemVein); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Fel Iron Deposit +(@FelIron,23424,100,1,0,2,4), -- Fel Iron Ore +(@FelIron,22573,10,1,0,1,2), -- Mote of Earth +(@FelIron,22574,10,1,0,1,2), -- Mote of Fire +(@FelIron,23427,5,1,0,1,2), -- Eternium Ore +(@FelIron,1,5,1,0,-@FelIronGems,1), -- One From Green Gems +-- Nethercite Deposit +(@Nethercite,32464,100,1,0,1,2), -- Nethercite Ore +(@Nethercite,22573,10,1,0,1,4), -- Mote of Earth +(@Nethercite,22574,10,1,0,1,4), -- Mote of Fire +(@Nethercite,1,5,1,0,-@FelIronGems,1), -- One From Green Gems +(@Nethercite,2,1,1,0,-@RareGems,1), -- One From Blue Gems +-- Adamantite Deposit +(@Adamantite,23425,100,1,0,2,4), -- Adamantite Ore +(@Adamantite,22573,10,1,0,1,8), -- Mote of Earth +(@Adamantite,23427,10,1,0,1,2), -- Eternium Ore +(@Adamantite,1,5,1,0,-@AdamantiteGems,1), -- One From Green Gems +(@Adamantite,2,1,1,0,-@RareGems,1), -- One From Blue Gems +-- Rich Adamantite Deposit +(@RichAdamantite,23425,100,1,0,5,7), -- Adamantite Ore +(@RichAdamantite,22573,10,1,0,4,8), -- Mote of Earth +(@RichAdamantite,23427,10,1,0,2,3), -- Eternium Ore +(@RichAdamantite,1,5,1,0,-@AdamantiteGems,1), -- One From Green Gems +(@RichAdamantite,2,1,1,0,-@RareGems,1), -- One From Blue Gems +-- Khorium Vein +(@Khorium,23426,100,1,0,2,4), -- Khorim Ore +(@Khorium,22573,35,1,0,2,5), -- Mote of Earth +(@Khorium,22574,10,1,0,2,5), -- Mote of Fire +(@Khorium,23427,10,1,0,1,3), -- Eternium Ore +(@khorium,1,5,1,0,-@FelIronGems,1), -- One From Gems +(@khorium,2,1,1,0,-@RareGems,1), -- One From Gems +-- Ancient Gem Vein +(@GemVein,34907,70,1,1,1,9), -- Shattered Gem Fragments +(@GemVein,1,20,1,1,-@EpicGems,1), -- Epic Gems +(@GemVein,2,10,1,1,-@FelIronGems,1); -- One From Gems +-- ---------------------------------- +-- -- Wrath of the Lich King Zones -- +-- ---------------------------------- +SET @Cobalt :=24153; +SET @RichCobalt := 24154; +SET @Saronite := 24155; +SET @RichSaronite := 24156; +SET @Titanium := 24157; +SET @PureSaronite := 27244; +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Cobalt,@RichCobalt,@Saronite,@RichSaronite,@PureSaronite,@Titanium); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Cobalt Deposit +(@Cobalt,36909,100,1,0,2,4), -- Cobalt Ore +(@Cobalt,37701,30,1,0,1,2), -- Crystallized Earth +(@Cobalt,37705,30,1,0,1,2), -- Crystallized Water +(@Cobalt,1,5,1,0,-@WotlkGreenGems,1), -- One From Green Gems +-- Rich Cobalt Deposit +(@RichCobalt,36909,100,1,0,4,8), -- Cobalt Ore +(@RichCobalt,37701,30,1,0,1,2), -- Crystallized Earth +(@RichCobalt,37705,30,1,0,1,2), -- Crystallized Water +(@RichCobalt,1,5,1,0,-@WotlkGreenGems,1), -- One From Green Gems +(@RichCobalt,2,5,1,0,-@WotlkBlueGems,1), -- One From Blue Gems +-- Saronite Deposit +(@Saronite,36912,100,1,0,2,4), -- Saronite Ore +(@Saronite,37701,40,1,0,1,2), -- Crystallized Earth +(@Saronite,37703,40,1,0,1,2), -- Crystallized Shadow +(@Saronite,1,5,1,0,-@WotlkGreenGems,1), -- One From Green Gems +-- Rich Saronite Deposit +(@RichSaronite,36912,100,1,0,5,7), -- Saronite Ore +(@RichSaronite,37701,40,1,0,1,8), -- Crystallized Earth +(@RichSaronite,37703,40,1,0,1,8), -- Crystallized Shadow +(@RichSaronite,1,5,1,0,-@WotlkGreenGems,1), -- One From Green Gems +(@RichSaronite,2,5,1,0,-@WotlkBlueGems,1), -- One From Blue Gems +-- Titanium Vein +(@Titanium,36910,100,1,0,2,4), -- Titanium Ore +(@Titanium,37701,50,1,0,3,6), -- Crystallized Earth +(@Titanium,37705,50,1,0,3,6), -- Crystallized Water +(@Titanium,37702,50,1,0,3,6), -- Crystallized Fire +(@Titanium,37703,50,1,0,3,6), -- Crystallized Air +(@Titanium,1,25,1,0,-@WotlkGreenGems,1), -- One From Green Gems +(@Titanium,2,5,1,0,-@WotlkBlueGems,1), -- One From Blue Gems +-- Pure Saronite Deposit +(@PureSaronite,36912,100,1,0,22,38), -- Saronite Ore +(@PureSaronite,35627,60,1,0,2,4), -- Eternal Earth +(@PureSaronite,35624,60,1,0,2,4), -- Eternal Shadow +(@PureSaronite,1,35,1,0,-@WotlkGreenGems,1), -- One From Green Gems +(@PureSaronite,2,50,1,0,-@WotlkBlueGems,1); -- One From Blue Gems + +DELETE FROM `reference_loot_template` WHERE `entry` IN (12909,12991,12992,12993,12994,12995,12996,12997,12998,12999);
\ No newline at end of file diff --git a/sql/updates/world/2013_08_15_00_world_sai.sql b/sql/updates/world/2013_08_15_00_world_sai.sql new file mode 100644 index 00000000000..36ee8fb12cf --- /dev/null +++ b/sql/updates/world/2013_08_15_00_world_sai.sql @@ -0,0 +1,5 @@ +-- SELECT `entryorguid`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`comment` FROM `smart_scripts` WHERE `event_type`=14; +UPDATE `smart_scripts` SET `event_type`=74,`event_param2`=`event_param1`,`event_param1`=0,`target_type`=9 WHERE `entryorguid`=20049 AND `id`=4; +UPDATE `smart_scripts` SET `event_type`=74,`event_param2`=`event_param1`,`event_param1`=0,`target_type`=9 WHERE `entryorguid`=9045 AND `id`=3; +UPDATE `smart_scripts` SET `event_type`=74,`target_type`=9 WHERE `event_type`=14 AND `event_param1`=0 AND `event_param2` > 0 AND `event_param2` < 100; +UPDATE `smart_scripts` SET `event_param1`=`event_param2`,`event_param2`=30 WHERE `event_type`=14 AND `event_param2` >= 100; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 65b1e6c331e..b4e18b66a69 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1401,7 +1401,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE || e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT || e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER || e.GetTargetType() == SMART_TARGET_ACTION_INVOKER || - e.GetTargetType() == SMART_TARGET_CLOSEST_ENEMY) + e.GetTargetType() == SMART_TARGET_CLOSEST_ENEMY || e.GetTargetType() == SMART_TARGET_CLOSEST_FRIENDLY) { ObjectList* targets = GetTargets(e, unit); if (!targets) @@ -2506,6 +2506,14 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* break; } + case SMART_TARGET_CLOSEST_FRIENDLY: + { + if (me) + if (Unit* target = DoFindClosestFriendlyInRange(e.target.closestFriendly.maxDist)) + l->push_back(target); + + break; + } case SMART_TARGET_POSITION: default: break; @@ -2623,7 +2631,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui return; Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealt.radius, e.event.friendlyHealt.hpDeficit); - if (!target) + if (!target || !target->IsInCombat()) return; ProcessTimedAction(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax, target); break; @@ -2940,6 +2948,55 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui ProcessAction(e, unit, var0); break; } + case SMART_EVENT_FRIENDLY_HEALTH_PCT: + { + if (!me || !me->IsInCombat()) + return; + + ObjectList* _targets = NULL; + + switch (e.GetTargetType()) + { + case SMART_TARGET_CREATURE_RANGE: + case SMART_TARGET_CREATURE_GUID: + case SMART_TARGET_CREATURE_DISTANCE: + case SMART_TARGET_CLOSEST_CREATURE: + case SMART_TARGET_CLOSEST_PLAYER: + case SMART_TARGET_PLAYER_RANGE: + case SMART_TARGET_PLAYER_DISTANCE: + _targets = GetTargets(e); + break; + default: + return; + } + + if (!_targets) + return; + + Unit* target = NULL; + + for (ObjectList::const_iterator itr = _targets->begin(); itr != _targets->end(); ++itr) + { + if (IsUnit(*itr) && me->IsFriendlyTo((*itr)->ToUnit()) && (*itr)->ToUnit()->IsAlive() && (*itr)->ToUnit()->IsInCombat()) + { + uint32 healthPct = uint32((*itr)->ToUnit()->GetHealthPct()); + + if (healthPct > e.event.friendlyHealtPct.maxHpPct || healthPct < e.event.friendlyHealtPct.minHpPct) + continue; + + target = (*itr)->ToUnit(); + break; + } + } + + delete _targets; + + if (!target) + return; + + ProcessTimedAction(e, e.event.friendlyHealtPct.repeatMin, e.event.friendlyHealtPct.repeatMax, target); + break; + } default: TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); break; @@ -3019,6 +3076,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) case SMART_EVENT_HAS_AURA: case SMART_EVENT_TARGET_BUFFED: case SMART_EVENT_IS_BEHIND_TARGET: + case SMART_EVENT_FRIENDLY_HEALTH_PCT: { ProcessEvent(e); if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) @@ -3324,6 +3382,18 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float ra cell.Visit(p, grid_creature_searcher, *me->GetMap(), *me, range); } +Unit* SmartScript::DoFindClosestFriendlyInRange(float range) +{ + if (!me) + return NULL; + + Unit* unit = NULL; + Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(me, me, range); + Trinity::UnitLastSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(me, unit, u_check); + me->VisitNearbyObject(range, searcher); + return unit; +} + void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry) { mTimedActionList.clear(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 6801c132331..b22f2d81b26 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -89,6 +89,7 @@ class SmartScript Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff); void DoFindFriendlyCC(std::list<Creature*>& _list, float range); void DoFindFriendlyMissingBuff(std::list<Creature*>& list, float range, uint32 spellid); + Unit* DoFindClosestFriendlyInRange(float range); void StoreTargetList(ObjectList* targets, uint32 id) { diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 6563aeec700..095440266f3 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -301,6 +301,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e) case SMART_TARGET_CLOSEST_GAMEOBJECT: case SMART_TARGET_CLOSEST_CREATURE: case SMART_TARGET_CLOSEST_ENEMY: + case SMART_TARGET_CLOSEST_FRIENDLY: case SMART_TARGET_STORED: break; default: @@ -544,6 +545,31 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; } + case SMART_EVENT_FRIENDLY_HEALTH_PCT: + if (!IsMinMaxValid(e, e.event.friendlyHealtPct.repeatMin, e.event.friendlyHealtPct.repeatMax)) + return false; + + if (e.event.friendlyHealtPct.maxHpPct > 100 || e.event.friendlyHealtPct.minHpPct > 100) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has pct value above 100, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + return false; + } + + switch (e.GetTargetType()) + { + case SMART_TARGET_CREATURE_RANGE: + case SMART_TARGET_CREATURE_GUID: + case SMART_TARGET_CREATURE_DISTANCE: + case SMART_TARGET_CLOSEST_CREATURE: + case SMART_TARGET_CLOSEST_PLAYER: + case SMART_TARGET_PLAYER_RANGE: + case SMART_TARGET_PLAYER_DISTANCE: + break; + default: + TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid target_type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType()); + return false; + } + break; case SMART_EVENT_GO_STATE_CHANGED: case SMART_EVENT_GO_EVENT_INFORM: case SMART_EVENT_TIMED_EVENT_TRIGGERED: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index e5f30a9709d..81336d0e0ca 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -156,8 +156,9 @@ enum SMART_EVENT SMART_EVENT_GO_EVENT_INFORM = 71, // eventId SMART_EVENT_ACTION_DONE = 72, // eventId (SharedDefines.EventId) SMART_EVENT_ON_SPELLCLICK = 73, // clicker (unit) + SMART_EVENT_FRIENDLY_HEALTH_PCT = 74, // minHpPct, maxHpPct, repeatMin, repeatMax - SMART_EVENT_END = 74 + SMART_EVENT_END = 75 }; struct SmartEvent @@ -364,6 +365,14 @@ struct SmartEvent struct { + uint32 minHpPct; + uint32 maxHpPct; + uint32 repeatMin; + uint32 repeatMax; + } friendlyHealtPct; + + struct + { uint32 param1; uint32 param2; uint32 param3; @@ -1002,7 +1011,9 @@ enum SMARTAI_TARGETS SMART_TARGET_OWNER_OR_SUMMONER = 23, // Unit's owner or summoner SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list SMART_TARGET_CLOSEST_ENEMY = 25, // maxDist - SMART_TARGET_END = 26 + SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist + + SMART_TARGET_END = 27 }; struct SmartTarget @@ -1091,6 +1102,11 @@ struct SmartTarget struct { + uint32 maxDist; + } closestFriendly; + + struct + { uint32 param1; uint32 param2; uint32 param3; @@ -1226,7 +1242,8 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] = {SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE }, - {SMART_EVENT_ON_SPELLCLICK, SMART_SCRIPT_TYPE_MASK_CREATURE } + {SMART_EVENT_ON_SPELLCLICK, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_FRIENDLY_HEALTH_PCT, SMART_SCRIPT_TYPE_MASK_CREATURE }, }; enum SmartEventFlags diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 0fb463f222c..52d4e5487ee 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1172,8 +1172,12 @@ bool SpellInfo::NeedsExplicitUnitTarget() const bool SpellInfo::NeedsToBeTriggeredByCaster() const { - if (NeedsExplicitUnitTarget() || Id == 96946 || Id == 101005) + if (AttributesCu & SPELL_ATTR0_CU_TRIGGERED_BY_CASTER) return true; + + if (NeedsExplicitUnitTarget()) + return true; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (Effects[i].IsEffect()) @@ -1183,6 +1187,7 @@ bool SpellInfo::NeedsToBeTriggeredByCaster() const return true; } } + return false; } @@ -1891,7 +1896,7 @@ uint32 SpellInfo::GetAllEffectsMechanicMask() const uint32 mask = 0; if (Mechanic) mask |= 1 << Mechanic; - for (int i = 0; i < MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (Effects[i].IsEffect() && Effects[i].Mechanic) mask |= 1 << Effects[i].Mechanic; return mask; @@ -1901,9 +1906,9 @@ uint32 SpellInfo::GetEffectMechanicMask(uint8 effIndex) const { uint32 mask = 0; if (Mechanic) - mask |= 1<< Mechanic; + mask |= 1 << Mechanic; if (Effects[effIndex].IsEffect() && Effects[effIndex].Mechanic) - mask |= 1<< Effects[effIndex].Mechanic; + mask |= 1 << Effects[effIndex].Mechanic; return mask; } @@ -1911,10 +1916,10 @@ uint32 SpellInfo::GetSpellMechanicMaskByEffectMask(uint32 effectMask) const { uint32 mask = 0; if (Mechanic) - mask |= 1<< Mechanic; - for (int i = 0; i < MAX_SPELL_EFFECTS; ++i) + mask |= 1 << Mechanic; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if ((effectMask & (1 << i)) && Effects[i].Mechanic) - mask |= 1<< Effects[i].Mechanic; + mask |= 1 << Effects[i].Mechanic; return mask; } diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 73d2ce3efcd..0ee8571196f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -179,7 +179,7 @@ enum SpellCustomAttributes SPELL_ATTR0_CU_CONE_LINE = 0x00000004, SPELL_ATTR0_CU_SHARE_DAMAGE = 0x00000008, SPELL_ATTR0_CU_NO_INITIAL_THREAT = 0x00000010, - SPELL_ATTR0_CU_NONE2 = 0x00000020, // UNUSED + SPELL_ATTR0_CU_TRIGGERED_BY_CASTER = 0x00000020, // @todo: need generic solution, some triggered spells will be casted by target instead of caster SPELL_ATTR0_CU_AURA_CC = 0x00000040, SPELL_ATTR0_CU_DIRECT_DAMAGE = 0x00000100, SPELL_ATTR0_CU_CHARGE = 0x00000200, diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index c6aba4853ee..cf694ff3348 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3047,6 +3047,11 @@ void SpellMgr::LoadSpellInfoCustomAttributes() break; case 72293: // Mark of the Fallen Champion (Deathbringer Saurfang) spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF0; + break; + case 38729: // Rod of Purification + case 96946: // Gaze of Occu'thar + case 101005: // Gaze of Occu'thar + spellInfo->AttributesCu |= SPELL_ATTR0_CU_TRIGGERED_BY_CASTER; break; default: break; |