aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_02_15_08_world_sai.sql9
-rw-r--r--sql/updates/world/2012_02_15_09_world_spell_proc_event.sql6
-rw-r--r--sql/updates/world/2012_02_16_00_world_conditions.sql12800
-rw-r--r--sql/updates/world/2012_02_16_01_world_conditions.sql3
-rw-r--r--sql/updates/world/2012_02_17_00_world_waypoints.sql77
-rw-r--r--sql/updates/world/2012_02_18_00_world_spell_script_names.sql69
-rw-r--r--sql/updates/world/2012_02_18_01_world_spell_dbc.sql3
-rw-r--r--sql/updates/world/2012_02_18_02_world_gossip.sql52
-rwxr-xr-xsrc/server/authserver/Server/RealmSocket.cpp2
-rwxr-xr-xsrc/server/authserver/Server/RealmSocket.h2
-rw-r--r--src/server/collision/BoundingIntervalHierarchyWrapper.h4
-rw-r--r--src/server/collision/DynamicTree.cpp5
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp9
-rw-r--r--src/server/collision/Models/GameObjectModel.cpp20
-rw-r--r--src/server/collision/RegularGrid.h4
-rwxr-xr-xsrc/server/game/AI/CoreAI/CombatAI.cpp2
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp40
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp185
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h18
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp6
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.h1
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp2
-rwxr-xr-xsrc/server/game/Entities/Item/Item.cpp37
-rwxr-xr-xsrc/server/game/Entities/Item/Item.h19
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp23
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h2
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp19
-rw-r--r--src/server/game/Entities/Vehicle/VehicleDefines.h2
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp2
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.h14
-rwxr-xr-xsrc/server/game/Groups/Group.cpp2
-rwxr-xr-xsrc/server/game/Handlers/AuctionHouseHandler.cpp12
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp1
-rwxr-xr-xsrc/server/game/Handlers/SpellHandler.cpp18
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.cpp2
-rwxr-xr-xsrc/server/game/Loot/LootMgr.cpp6
-rwxr-xr-xsrc/server/game/Maps/Map.cpp5
-rwxr-xr-xsrc/server/game/Movement/MotionMaster.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp3
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h5
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp13
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h5
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.cpp2
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.h2
-rw-r--r--src/server/game/Movement/Spline/MoveSplineFlag.h16
-rw-r--r--src/server/game/Movement/Spline/Spline.cpp2
-rw-r--r--src/server/game/Movement/Spline/Spline.h6
-rwxr-xr-xsrc/server/game/Quests/QuestDef.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp8
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp8
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp10
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp741
-rwxr-xr-xsrc/server/game/Spells/SpellScript.cpp10
-rwxr-xr-xsrc/server/game/Spells/SpellScript.h5
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp115
-rw-r--r--src/server/scripts/Kalimdor/silithus.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp10
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp10
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp7
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp41
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp63
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp67
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp55
-rw-r--r--src/server/scripts/Outland/blades_edge_mountains.cpp6
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp182
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp61
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp680
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp713
-rw-r--r--src/server/scripts/Spells/spell_item.cpp1806
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp140
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp500
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp50
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp1052
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp282
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp304
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp164
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp302
-rwxr-xr-xsrc/server/shared/Database/MySQLConnection.h7
-rwxr-xr-xsrc/server/worldserver/TCSoap/TCSoap.cpp2
83 files changed, 17525 insertions, 3427 deletions
diff --git a/sql/updates/world/2012_02_15_08_world_sai.sql b/sql/updates/world/2012_02_15_08_world_sai.sql
new file mode 100644
index 00000000000..ef49ff484f3
--- /dev/null
+++ b/sql/updates/world/2012_02_15_08_world_sai.sql
@@ -0,0 +1,9 @@
+SET @Pinata := 34632;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Pinata AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@Pinata, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 65788, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On death cast Pile of Candy'),
+(@Pinata, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On reset set react state passive');
+
+-- same faction of the GO that is spawned by spell 65788 (not sniffed)
+UPDATE `creature_template` SET `faction_A`=7,`faction_H`=7,`exp`=0,`AIName`='SmartAI' WHERE `entry`=@Pinata;
diff --git a/sql/updates/world/2012_02_15_09_world_spell_proc_event.sql b/sql/updates/world/2012_02_15_09_world_spell_proc_event.sql
new file mode 100644
index 00000000000..4811e5d66fe
--- /dev/null
+++ b/sql/updates/world/2012_02_15_09_world_spell_proc_event.sql
@@ -0,0 +1,6 @@
+-- Corrected proc of Misery
+DELETE FROM `spell_proc_event` WHERE `entry` IN (33191, 33192, 33193);
+INSERT INTO `spell_proc_event` VALUES
+(33191, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0),
+(33192, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0),
+(33193, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0);
diff --git a/sql/updates/world/2012_02_16_00_world_conditions.sql b/sql/updates/world/2012_02_16_00_world_conditions.sql
new file mode 100644
index 00000000000..a01792ef838
--- /dev/null
+++ b/sql/updates/world/2012_02_16_00_world_conditions.sql
@@ -0,0 +1,12800 @@
+CREATE TABLE `temp_convert_spells`
+(
+ `id` INT(11),
+ PRIMARY KEY (`id`)
+);
+
+# spells with EffectImplicitTarget In (6,21, 25) + spells having Targets & 1115534
+# those spells are the ones which require explicit unit target to cast
+INSERT INTO `temp_convert_spells` VALUES
+(5),
+(11),
+(12),
+(14),
+(15),
+(17),
+(25),
+(49),
+(50),
+(53),
+(56),
+(58),
+(59),
+(60),
+(61),
+(67),
+(68),
+(72),
+(75),
+(78),
+(89),
+(91),
+(96),
+(100),
+(101),
+(113),
+(116),
+(118),
+(131),
+(132),
+(133),
+(134),
+(139),
+(142),
+(143),
+(145),
+(172),
+(184),
+(205),
+(228),
+(246),
+(260),
+(271),
+(284),
+(285),
+(339),
+(348),
+(355),
+(370),
+(403),
+(408),
+(421),
+(453),
+(457),
+(467),
+(475),
+(512),
+(514),
+(526),
+(527),
+(528),
+(529),
+(530),
+(546),
+(548),
+(550),
+(552),
+(585),
+(589),
+(591),
+(592),
+(594),
+(596),
+(598),
+(600),
+(603),
+(605),
+(606),
+(633),
+(635),
+(639),
+(647),
+(676),
+(686),
+(689),
+(692),
+(694),
+(695),
+(699),
+(700),
+(701),
+(702),
+(703),
+(705),
+(707),
+(709),
+(710),
+(720),
+(731),
+(744),
+(745),
+(746),
+(770),
+(772),
+(774),
+(782),
+(785),
+(812),
+(835),
+(837),
+(845),
+(851),
+(853),
+(879),
+(915),
+(921),
+(930),
+(932),
+(943),
+(970),
+(974),
+(976),
+(980),
+(984),
+(988),
+(992),
+(996),
+(1004),
+(1010),
+(1014),
+(1026),
+(1035),
+(1042),
+(1044),
+(1058),
+(1062),
+(1075),
+(1079),
+(1082),
+(1088),
+(1090),
+(1094),
+(1098),
+(1106),
+(1108),
+(1120),
+(1121),
+(1126),
+(1130),
+(1139),
+(1152),
+(1159),
+(1194),
+(1196),
+(1210),
+(1214),
+(1225),
+(1228),
+(1234),
+(1241),
+(1243),
+(1244),
+(1245),
+(1249),
+(1250),
+(1251),
+(1266),
+(1267),
+(1329),
+(1330),
+(1350),
+(1364),
+(1373),
+(1413),
+(1430),
+(1446),
+(1459),
+(1460),
+(1461),
+(1462),
+(1464),
+(1467),
+(1472),
+(1473),
+(1474),
+(1475),
+(1481),
+(1485),
+(1490),
+(1495),
+(1513),
+(1515),
+(1516),
+(1536),
+(1579),
+(1588),
+(1604),
+(1608),
+(1609),
+(1650),
+(1664),
+(1665),
+(1666),
+(1669),
+(1671),
+(1672),
+(1714),
+(1715),
+(1752),
+(1753),
+(1754),
+(1755),
+(1756),
+(1757),
+(1758),
+(1759),
+(1760),
+(1766),
+(1767),
+(1768),
+(1769),
+(1770),
+(1776),
+(1777),
+(1795),
+(1796),
+(1797),
+(1798),
+(1800),
+(1809),
+(1810),
+(1811),
+(1822),
+(1823),
+(1824),
+(1831),
+(1833),
+(1852),
+(1906),
+(1908),
+(1943),
+(1950),
+(1966),
+(1978),
+(1991),
+(2000),
+(2020),
+(2021),
+(2050),
+(2052),
+(2053),
+(2054),
+(2055),
+(2060),
+(2061),
+(2070),
+(2090),
+(2091),
+(2094),
+(2096),
+(2098),
+(2110),
+(2118),
+(2119),
+(2124),
+(2125),
+(2136),
+(2137),
+(2138),
+(2139),
+(2141),
+(2142),
+(2143),
+(2147),
+(2148),
+(2154),
+(2155),
+(2275),
+(2280),
+(2313),
+(2372),
+(2373),
+(2400),
+(2425),
+(2442),
+(2443),
+(2444),
+(2446),
+(2552),
+(2589),
+(2590),
+(2591),
+(2601),
+(2602),
+(2606),
+(2607),
+(2608),
+(2609),
+(2610),
+(2626),
+(2629),
+(2630),
+(2633),
+(2634),
+(2636),
+(2637),
+(2643),
+(2647),
+(2649),
+(2650),
+(2653),
+(2691),
+(2764),
+(2767),
+(2782),
+(2791),
+(2800),
+(2816),
+(2817),
+(2818),
+(2819),
+(2834),
+(2850),
+(2855),
+(2860),
+(2871),
+(2880),
+(2893),
+(2908),
+(2912),
+(2941),
+(2944),
+(2948),
+(2949),
+(2969),
+(2972),
+(2973),
+(2974),
+(2995),
+(3007),
+(3009),
+(3010),
+(3011),
+(3018),
+(3029),
+(3034),
+(3043),
+(3044),
+(3105),
+(3108),
+(3110),
+(3120),
+(3121),
+(3130),
+(3131),
+(3132),
+(3137),
+(3140),
+(3145),
+(3147),
+(3148),
+(3150),
+(3205),
+(3206),
+(3207),
+(3229),
+(3233),
+(3234),
+(3237),
+(3242),
+(3243),
+(3246),
+(3247),
+(3252),
+(3261),
+(3263),
+(3267),
+(3268),
+(3279),
+(3280),
+(3286),
+(3332),
+(3355),
+(3356),
+(3358),
+(3360),
+(3387),
+(3388),
+(3393),
+(3396),
+(3405),
+(3409),
+(3427),
+(3429),
+(3436),
+(3442),
+(3446),
+(3465),
+(3466),
+(3472),
+(3510),
+(3514),
+(3539),
+(3542),
+(3551),
+(3553),
+(3571),
+(3578),
+(3583),
+(3584),
+(3586),
+(3602),
+(3603),
+(3604),
+(3606),
+(3607),
+(3609),
+(3627),
+(3635),
+(3636),
+(3650),
+(3674),
+(3715),
+(3716),
+(3747),
+(3812),
+(3911),
+(3912),
+(3913),
+(3921),
+(4011),
+(4039),
+(4040),
+(4041),
+(4058),
+(4060),
+(4089),
+(4090),
+(4091),
+(4101),
+(4102),
+(4130),
+(4131),
+(4132),
+(4150),
+(4159),
+(4164),
+(4165),
+(4166),
+(4167),
+(4168),
+(4169),
+(4209),
+(4221),
+(4240),
+(4243),
+(4244),
+(4262),
+(4280),
+(4281),
+(4282),
+(4285),
+(4286),
+(4294),
+(4316),
+(4362),
+(4423),
+(4500),
+(4504),
+(4505),
+(4506),
+(4538),
+(4630),
+(4659),
+(4805),
+(4877),
+(4940),
+(4961),
+(4962),
+(4974),
+(4979),
+(4980),
+(4984),
+(4987),
+(4996),
+(4997),
+(4998),
+(4999),
+(5000),
+(5003),
+(5019),
+(5025),
+(5103),
+(5105),
+(5116),
+(5133),
+(5137),
+(5138),
+(5143),
+(5144),
+(5145),
+(5164),
+(5165),
+(5171),
+(5176),
+(5177),
+(5178),
+(5179),
+(5180),
+(5185),
+(5186),
+(5187),
+(5188),
+(5189),
+(5195),
+(5196),
+(5201),
+(5208),
+(5211),
+(5213),
+(5221),
+(5232),
+(5234),
+(5246),
+(5255),
+(5259),
+(5260),
+(5263),
+(5271),
+(5276),
+(5306),
+(5308),
+(5320),
+(5321),
+(5322),
+(5323),
+(5324),
+(5325),
+(5337),
+(5374),
+(5375),
+(5376),
+(5401),
+(5413),
+(5416),
+(5422),
+(5424),
+(5433),
+(5480),
+(5503),
+(5507),
+(5508),
+(5509),
+(5513),
+(5514),
+(5547),
+(5565),
+(5566),
+(5567),
+(5570),
+(5588),
+(5589),
+(5595),
+(5597),
+(5598),
+(5614),
+(5615),
+(5648),
+(5649),
+(5676),
+(5679),
+(5696),
+(5697),
+(5703),
+(5726),
+(5727),
+(5739),
+(5760),
+(5781),
+(5782),
+(5862),
+(5884),
+(5917),
+(5918),
+(5938),
+(5940),
+(5951),
+(5967),
+(6000),
+(6016),
+(6027),
+(6028),
+(6041),
+(6060),
+(6061),
+(6063),
+(6064),
+(6065),
+(6066),
+(6074),
+(6075),
+(6076),
+(6077),
+(6078),
+(6121),
+(6128),
+(6130),
+(6132),
+(6136),
+(6142),
+(6144),
+(6146),
+(6178),
+(6199),
+(6203),
+(6205),
+(6213),
+(6215),
+(6217),
+(6222),
+(6223),
+(6245),
+(6252),
+(6253),
+(6254),
+(6255),
+(6257),
+(6273),
+(6277),
+(6278),
+(6304),
+(6327),
+(6346),
+(6348),
+(6349),
+(6350),
+(6351),
+(6352),
+(6353),
+(6357),
+(6358),
+(6359),
+(6360),
+(6362),
+(6409),
+(6435),
+(6460),
+(6465),
+(6466),
+(6483),
+(6484),
+(6509),
+(6530),
+(6531),
+(6533),
+(6546),
+(6547),
+(6548),
+(6552),
+(6554),
+(6555),
+(6572),
+(6574),
+(6576),
+(6580),
+(6581),
+(6595),
+(6607),
+(6647),
+(6655),
+(6660),
+(6664),
+(6685),
+(6713),
+(6716),
+(6719),
+(6726),
+(6728),
+(6730),
+(6742),
+(6743),
+(6744),
+(6745),
+(6746),
+(6747),
+(6748),
+(6751),
+(6753),
+(6754),
+(6756),
+(6760),
+(6761),
+(6762),
+(6766),
+(6767),
+(6768),
+(6770),
+(6774),
+(6778),
+(6780),
+(6785),
+(6787),
+(6788),
+(6789),
+(6795),
+(6798),
+(6800),
+(6807),
+(6808),
+(6809),
+(6814),
+(6866),
+(6870),
+(6873),
+(6894),
+(6907),
+(6909),
+(6917),
+(6922),
+(6927),
+(6942),
+(6946),
+(6949),
+(6950),
+(6951),
+(6957),
+(6958),
+(6960),
+(6963),
+(6965),
+(6979),
+(6980),
+(6984),
+(7001),
+(7033),
+(7054),
+(7057),
+(7068),
+(7079),
+(7081),
+(7084),
+(7092),
+(7093),
+(7098),
+(7099),
+(7101),
+(7102),
+(7105),
+(7120),
+(7122),
+(7124),
+(7125),
+(7127),
+(7140),
+(7145),
+(7154),
+(7159),
+(7160),
+(7162),
+(7211),
+(7266),
+(7288),
+(7289),
+(7290),
+(7295),
+(7321),
+(7322),
+(7329),
+(7357),
+(7365),
+(7367),
+(7369),
+(7372),
+(7373),
+(7379),
+(7384),
+(7386),
+(7399),
+(7400),
+(7402),
+(7405),
+(7414),
+(7415),
+(7416),
+(7439),
+(7482),
+(7485),
+(7588),
+(7621),
+(7638),
+(7641),
+(7645),
+(7646),
+(7648),
+(7651),
+(7655),
+(7656),
+(7712),
+(7714),
+(7715),
+(7716),
+(7717),
+(7718),
+(7719),
+(7736),
+(7761),
+(7763),
+(7764),
+(7799),
+(7800),
+(7801),
+(7802),
+(7806),
+(7807),
+(7808),
+(7809),
+(7810),
+(7811),
+(7813),
+(7814),
+(7815),
+(7816),
+(7821),
+(7829),
+(7853),
+(7874),
+(7875),
+(7876),
+(7877),
+(7878),
+(7879),
+(7880),
+(7881),
+(7882),
+(7883),
+(7884),
+(7885),
+(7887),
+(7891),
+(7896),
+(7901),
+(7914),
+(7922),
+(7925),
+(7926),
+(7927),
+(7932),
+(7933),
+(7938),
+(7947),
+(7951),
+(7967),
+(7992),
+(7994),
+(7997),
+(8004),
+(8008),
+(8010),
+(8012),
+(8014),
+(8016),
+(8026),
+(8028),
+(8029),
+(8034),
+(8037),
+(8040),
+(8042),
+(8044),
+(8045),
+(8046),
+(8050),
+(8052),
+(8053),
+(8056),
+(8058),
+(8068),
+(8070),
+(8091),
+(8092),
+(8094),
+(8095),
+(8096),
+(8097),
+(8098),
+(8099),
+(8100),
+(8101),
+(8102),
+(8103),
+(8104),
+(8105),
+(8106),
+(8112),
+(8113),
+(8114),
+(8115),
+(8116),
+(8117),
+(8118),
+(8119),
+(8120),
+(8121),
+(8129),
+(8137),
+(8138),
+(8139),
+(8140),
+(8151),
+(8208),
+(8211),
+(8221),
+(8222),
+(8242),
+(8246),
+(8255),
+(8256),
+(8257),
+(8272),
+(8275),
+(8277),
+(8282),
+(8288),
+(8289),
+(8292),
+(8295),
+(8312),
+(8313),
+(8314),
+(8318),
+(8319),
+(8344),
+(8345),
+(8346),
+(8347),
+(8352),
+(8353),
+(8355),
+(8362),
+(8363),
+(8365),
+(8379),
+(8380),
+(8382),
+(8383),
+(8384),
+(8385),
+(8391),
+(8400),
+(8401),
+(8402),
+(8406),
+(8407),
+(8408),
+(8412),
+(8413),
+(8414),
+(8415),
+(8416),
+(8417),
+(8425),
+(8426),
+(8428),
+(8440),
+(8441),
+(8442),
+(8444),
+(8445),
+(8446),
+(8447),
+(8448),
+(8449),
+(8452),
+(8453),
+(8456),
+(8459),
+(8460),
+(8463),
+(8464),
+(8493),
+(8496),
+(8497),
+(8552),
+(8554),
+(8555),
+(8595),
+(8598),
+(8600),
+(8613),
+(8615),
+(8616),
+(8617),
+(8618),
+(8619),
+(8620),
+(8621),
+(8623),
+(8624),
+(8627),
+(8629),
+(8631),
+(8632),
+(8633),
+(8637),
+(8639),
+(8640),
+(8643),
+(8645),
+(8646),
+(8647),
+(8649),
+(8650),
+(8654),
+(8673),
+(8676),
+(8680),
+(8682),
+(8685),
+(8689),
+(8699),
+(8716),
+(8721),
+(8724),
+(8725),
+(8733),
+(8735),
+(8788),
+(8806),
+(8818),
+(8820),
+(8903),
+(8905),
+(8907),
+(8910),
+(8914),
+(8921),
+(8924),
+(8925),
+(8926),
+(8927),
+(8928),
+(8929),
+(8936),
+(8938),
+(8939),
+(8940),
+(8941),
+(8946),
+(8947),
+(8949),
+(8950),
+(8951),
+(8955),
+(8972),
+(8983),
+(8992),
+(8994),
+(8998),
+(9000),
+(9005),
+(9007),
+(9034),
+(9053),
+(9057),
+(9080),
+(9159),
+(9176),
+(9234),
+(9268),
+(9275),
+(9347),
+(9373),
+(9454),
+(9455),
+(9456),
+(9459),
+(9462),
+(9472),
+(9473),
+(9474),
+(9481),
+(9482),
+(9483),
+(9484),
+(9485),
+(9487),
+(9488),
+(9492),
+(9493),
+(9532),
+(9552),
+(9574),
+(9591),
+(9612),
+(9613),
+(9614),
+(9654),
+(9658),
+(9672),
+(9734),
+(9735),
+(9739),
+(9745),
+(9750),
+(9752),
+(9756),
+(9758),
+(9771),
+(9775),
+(9786),
+(9789),
+(9790),
+(9791),
+(9796),
+(9806),
+(9823),
+(9824),
+(9826),
+(9827),
+(9829),
+(9830),
+(9833),
+(9834),
+(9835),
+(9839),
+(9840),
+(9841),
+(9849),
+(9850),
+(9852),
+(9853),
+(9856),
+(9857),
+(9858),
+(9866),
+(9867),
+(9875),
+(9876),
+(9880),
+(9881),
+(9884),
+(9885),
+(9888),
+(9889),
+(9892),
+(9894),
+(9896),
+(9901),
+(9904),
+(9910),
+(9912),
+(9949),
+(9977),
+(9991),
+(9999),
+(10055),
+(10056),
+(10060),
+(10073),
+(10101),
+(10136),
+(10141),
+(10142),
+(10143),
+(10146),
+(10147),
+(10148),
+(10149),
+(10150),
+(10151),
+(10156),
+(10157),
+(10158),
+(10162),
+(10163),
+(10164),
+(10171),
+(10172),
+(10175),
+(10176),
+(10178),
+(10179),
+(10180),
+(10181),
+(10188),
+(10189),
+(10190),
+(10194),
+(10195),
+(10196),
+(10197),
+(10198),
+(10199),
+(10200),
+(10203),
+(10204),
+(10205),
+(10206),
+(10207),
+(10208),
+(10209),
+(10210),
+(10211),
+(10212),
+(10217),
+(10218),
+(10221),
+(10222),
+(10224),
+(10226),
+(10227),
+(10231),
+(10239),
+(10244),
+(10245),
+(10246),
+(10277),
+(10308),
+(10310),
+(10312),
+(10313),
+(10314),
+(10321),
+(10326),
+(10328),
+(10329),
+(10346),
+(10370),
+(10371),
+(10373),
+(10391),
+(10392),
+(10412),
+(10413),
+(10414),
+(10435),
+(10436),
+(10444),
+(10445),
+(10447),
+(10448),
+(10452),
+(10458),
+(10466),
+(10467),
+(10468),
+(10472),
+(10473),
+(10577),
+(10578),
+(10605),
+(10617),
+(10651),
+(10653),
+(10657),
+(10659),
+(10661),
+(10663),
+(10689),
+(10730),
+(10767),
+(10768),
+(10769),
+(10771),
+(10833),
+(10838),
+(10839),
+(10843),
+(10847),
+(10851),
+(10855),
+(10863),
+(10872),
+(10892),
+(10893),
+(10894),
+(10898),
+(10899),
+(10900),
+(10901),
+(10908),
+(10909),
+(10915),
+(10916),
+(10917),
+(10921),
+(10927),
+(10928),
+(10929),
+(10933),
+(10934),
+(10937),
+(10938),
+(10945),
+(10946),
+(10947),
+(10955),
+(10957),
+(10958),
+(10960),
+(10961),
+(10963),
+(10964),
+(10965),
+(10966),
+(11014),
+(11016),
+(11020),
+(11021),
+(11027),
+(11084),
+(11085),
+(11131),
+(11132),
+(11196),
+(11197),
+(11198),
+(11203),
+(11204),
+(11205),
+(11267),
+(11268),
+(11269),
+(11273),
+(11274),
+(11275),
+(11279),
+(11280),
+(11281),
+(11285),
+(11286),
+(11289),
+(11290),
+(11293),
+(11294),
+(11297),
+(11299),
+(11300),
+(11303),
+(11335),
+(11336),
+(11337),
+(11353),
+(11354),
+(11362),
+(11366),
+(11374),
+(11391),
+(11397),
+(11409),
+(11428),
+(11430),
+(11431),
+(11436),
+(11442),
+(11443),
+(11444),
+(11446),
+(11469),
+(11470),
+(11471),
+(11512),
+(11519),
+(11520),
+(11522),
+(11525),
+(11528),
+(11538),
+(11539),
+(11545),
+(11564),
+(11565),
+(11566),
+(11567),
+(11572),
+(11573),
+(11574),
+(11578),
+(11584),
+(11585),
+(11595),
+(11596),
+(11597),
+(11600),
+(11601),
+(11604),
+(11605),
+(11608),
+(11609),
+(11610),
+(11612),
+(11639),
+(11640),
+(11641),
+(11642),
+(11650),
+(11658),
+(11659),
+(11660),
+(11661),
+(11665),
+(11667),
+(11668),
+(11671),
+(11672),
+(11675),
+(11699),
+(11700),
+(11707),
+(11708),
+(11711),
+(11712),
+(11713),
+(11719),
+(11721),
+(11722),
+(11725),
+(11726),
+(11762),
+(11763),
+(11772),
+(11773),
+(11774),
+(11775),
+(11776),
+(11777),
+(11778),
+(11779),
+(11780),
+(11781),
+(11782),
+(11783),
+(11784),
+(11785),
+(11786),
+(11787),
+(11791),
+(11820),
+(11821),
+(11824),
+(11825),
+(11835),
+(11836),
+(11839),
+(11877),
+(11879),
+(11885),
+(11886),
+(11887),
+(11888),
+(11889),
+(11918),
+(11920),
+(11921),
+(11922),
+(11960),
+(11962),
+(11963),
+(11971),
+(11972),
+(11974),
+(11976),
+(11977),
+(11978),
+(11980),
+(11981),
+(11985),
+(11986),
+(11994),
+(11998),
+(12021),
+(12023),
+(12024),
+(12039),
+(12054),
+(12057),
+(12058),
+(12096),
+(12097),
+(12098),
+(12118),
+(12127),
+(12128),
+(12130),
+(12131),
+(12160),
+(12161),
+(12162),
+(12166),
+(12167),
+(12170),
+(12174),
+(12175),
+(12176),
+(12177),
+(12178),
+(12179),
+(12181),
+(12242),
+(12245),
+(12246),
+(12248),
+(12251),
+(12279),
+(12280),
+(12289),
+(12294),
+(12355),
+(12461),
+(12466),
+(12471),
+(12479),
+(12480),
+(12484),
+(12485),
+(12486),
+(12491),
+(12492),
+(12493),
+(12494),
+(12505),
+(12509),
+(12510),
+(12521),
+(12522),
+(12523),
+(12524),
+(12525),
+(12526),
+(12531),
+(12538),
+(12540),
+(12541),
+(12542),
+(12545),
+(12548),
+(12551),
+(12553),
+(12555),
+(12578),
+(12579),
+(12654),
+(12657),
+(12668),
+(12675),
+(12693),
+(12699),
+(12705),
+(12721),
+(12723),
+(12738),
+(12739),
+(12742),
+(12747),
+(12798),
+(12809),
+(12821),
+(12824),
+(12825),
+(12826),
+(12850),
+(12868),
+(12885),
+(12888),
+(12890),
+(12998),
+(13003),
+(13005),
+(13006),
+(13009),
+(13013),
+(13022),
+(13029),
+(13044),
+(13099),
+(13119),
+(13120),
+(13138),
+(13140),
+(13142),
+(13180),
+(13181),
+(13218),
+(13222),
+(13223),
+(13224),
+(13278),
+(13279),
+(13281),
+(13298),
+(13318),
+(13319),
+(13321),
+(13322),
+(13323),
+(13325),
+(13326),
+(13327),
+(13338),
+(13339),
+(13340),
+(13341),
+(13342),
+(13374),
+(13375),
+(13398),
+(13424),
+(13438),
+(13439),
+(13440),
+(13441),
+(13442),
+(13443),
+(13444),
+(13445),
+(13446),
+(13459),
+(13480),
+(13482),
+(13486),
+(13490),
+(13491),
+(13496),
+(13518),
+(13519),
+(13524),
+(13526),
+(13527),
+(13528),
+(13530),
+(13534),
+(13549),
+(13550),
+(13551),
+(13552),
+(13553),
+(13554),
+(13555),
+(13566),
+(13567),
+(13579),
+(13583),
+(13584),
+(13585),
+(13608),
+(13619),
+(13692),
+(13728),
+(13729),
+(13737),
+(13738),
+(13748),
+(13752),
+(13797),
+(13860),
+(13864),
+(13878),
+(13880),
+(13884),
+(13897),
+(13901),
+(13902),
+(13907),
+(13921),
+(13952),
+(13953),
+(13977),
+(14030),
+(14032),
+(14033),
+(14034),
+(14053),
+(14087),
+(14099),
+(14102),
+(14103),
+(14105),
+(14106),
+(14109),
+(14110),
+(14112),
+(14118),
+(14119),
+(14120),
+(14122),
+(14126),
+(14129),
+(14130),
+(14134),
+(14145),
+(14156),
+(14157),
+(14160),
+(14178),
+(14180),
+(14183),
+(14189),
+(14200),
+(14247),
+(14251),
+(14253),
+(14260),
+(14261),
+(14262),
+(14263),
+(14264),
+(14265),
+(14266),
+(14269),
+(14270),
+(14271),
+(14278),
+(14281),
+(14282),
+(14283),
+(14284),
+(14285),
+(14286),
+(14287),
+(14288),
+(14289),
+(14290),
+(14298),
+(14299),
+(14300),
+(14301),
+(14308),
+(14309),
+(14323),
+(14324),
+(14325),
+(14326),
+(14327),
+(14331),
+(14443),
+(14515),
+(14516),
+(14517),
+(14518),
+(14537),
+(14752),
+(14792),
+(14795),
+(14818),
+(14819),
+(14867),
+(14868),
+(14873),
+(14874),
+(14875),
+(14890),
+(14892),
+(14893),
+(14894),
+(14895),
+(14897),
+(14902),
+(14903),
+(14914),
+(14916),
+(14917),
+(14918),
+(14919),
+(14920),
+(14921),
+(15037),
+(15039),
+(15040),
+(15042),
+(15043),
+(15057),
+(15065),
+(15089),
+(15090),
+(15095),
+(15096),
+(15117),
+(15120),
+(15122),
+(15123),
+(15124),
+(15128),
+(15187),
+(15207),
+(15208),
+(15211),
+(15228),
+(15229),
+(15230),
+(15232),
+(15234),
+(15235),
+(15236),
+(15238),
+(15241),
+(15242),
+(15247),
+(15248),
+(15249),
+(15250),
+(15254),
+(15257),
+(15261),
+(15262),
+(15263),
+(15264),
+(15265),
+(15266),
+(15267),
+(15277),
+(15279),
+(15280),
+(15283),
+(15284),
+(15288),
+(15305),
+(15306),
+(15331),
+(15332),
+(15342),
+(15343),
+(15344),
+(15346),
+(15357),
+(15359),
+(15362),
+(15363),
+(15366),
+(15398),
+(15407),
+(15451),
+(15471),
+(15472),
+(15487),
+(15493),
+(15495),
+(15496),
+(15497),
+(15498),
+(15499),
+(15500),
+(15501),
+(15505),
+(15530),
+(15534),
+(15535),
+(15536),
+(15537),
+(15539),
+(15547),
+(15549),
+(15570),
+(15572),
+(15574),
+(15575),
+(15580),
+(15581),
+(15582),
+(15583),
+(15586),
+(15587),
+(15592),
+(15598),
+(15605),
+(15607),
+(15608),
+(15610),
+(15611),
+(15612),
+(15614),
+(15615),
+(15616),
+(15617),
+(15618),
+(15619),
+(15620),
+(15621),
+(15643),
+(15651),
+(15652),
+(15653),
+(15654),
+(15655),
+(15656),
+(15657),
+(15659),
+(15661),
+(15662),
+(15664),
+(15665),
+(15667),
+(15691),
+(15692),
+(15695),
+(15698),
+(15699),
+(15702),
+(15708),
+(15712),
+(15713),
+(15729),
+(15730),
+(15732),
+(15734),
+(15735),
+(15736),
+(15749),
+(15752),
+(15753),
+(15784),
+(15785),
+(15790),
+(15791),
+(15793),
+(15795),
+(15797),
+(15798),
+(15801),
+(15802),
+(15848),
+(15850),
+(15859),
+(15860),
+(15876),
+(15878),
+(15968),
+(15969),
+(15970),
+(15976),
+(15980),
+(15981),
+(15982),
+(16000),
+(16001),
+(16006),
+(16007),
+(16029),
+(16031),
+(16033),
+(16034),
+(16044),
+(16045),
+(16050),
+(16053),
+(16067),
+(16071),
+(16075),
+(16095),
+(16100),
+(16101),
+(16128),
+(16143),
+(16144),
+(16145),
+(16168),
+(16170),
+(16172),
+(16176),
+(16177),
+(16186),
+(16231),
+(16235),
+(16236),
+(16237),
+(16240),
+(16243),
+(16247),
+(16249),
+(16333),
+(16336),
+(16343),
+(16344),
+(16351),
+(16352),
+(16353),
+(16366),
+(16373),
+(16375),
+(16391),
+(16392),
+(16393),
+(16400),
+(16401),
+(16402),
+(16403),
+(16405),
+(16406),
+(16407),
+(16408),
+(16409),
+(16410),
+(16411),
+(16412),
+(16413),
+(16414),
+(16415),
+(16427),
+(16429),
+(16430),
+(16431),
+(16433),
+(16448),
+(16449),
+(16451),
+(16454),
+(16455),
+(16456),
+(16458),
+(16460),
+(16461),
+(16472),
+(16495),
+(16496),
+(16498),
+(16508),
+(16509),
+(16511),
+(16527),
+(16528),
+(16530),
+(16536),
+(16549),
+(16552),
+(16553),
+(16554),
+(16555),
+(16561),
+(16564),
+(16565),
+(16568),
+(16569),
+(16570),
+(16573),
+(16583),
+(16587),
+(16588),
+(16603),
+(16608),
+(16610),
+(16612),
+(16614),
+(16618),
+(16627),
+(16628),
+(16636),
+(16697),
+(16707),
+(16708),
+(16709),
+(16711),
+(16712),
+(16713),
+(16714),
+(16716),
+(16722),
+(16782),
+(16783),
+(16784),
+(16788),
+(16790),
+(16793),
+(16798),
+(16799),
+(16804),
+(16805),
+(16827),
+(16828),
+(16829),
+(16830),
+(16831),
+(16832),
+(16844),
+(16856),
+(16857),
+(16868),
+(16869),
+(16871),
+(16898),
+(16908),
+(16921),
+(16922),
+(16927),
+(16928),
+(16953),
+(16979),
+(16997),
+(17008),
+(17009),
+(17011),
+(17012),
+(17013),
+(17105),
+(17134),
+(17137),
+(17138),
+(17139),
+(17140),
+(17141),
+(17142),
+(17143),
+(17144),
+(17146),
+(17147),
+(17148),
+(17149),
+(17150),
+(17151),
+(17153),
+(17156),
+(17157),
+(17158),
+(17159),
+(17160),
+(17165),
+(17168),
+(17170),
+(17171),
+(17172),
+(17173),
+(17174),
+(17175),
+(17183),
+(17194),
+(17195),
+(17198),
+(17201),
+(17213),
+(17227),
+(17230),
+(17233),
+(17234),
+(17238),
+(17243),
+(17244),
+(17246),
+(17253),
+(17255),
+(17256),
+(17257),
+(17258),
+(17259),
+(17260),
+(17261),
+(17273),
+(17274),
+(17276),
+(17281),
+(17284),
+(17287),
+(17289),
+(17290),
+(17292),
+(17293),
+(17307),
+(17308),
+(17311),
+(17312),
+(17313),
+(17314),
+(17315),
+(17330),
+(17331),
+(17333),
+(17334),
+(17347),
+(17348),
+(17353),
+(17364),
+(17368),
+(17393),
+(17405),
+(17407),
+(17434),
+(17435),
+(17439),
+(17445),
+(17451),
+(17452),
+(17470),
+(17483),
+(17484),
+(17492),
+(17494),
+(17496),
+(17500),
+(17503),
+(17504),
+(17505),
+(17506),
+(17509),
+(17510),
+(17511),
+(17529),
+(17547),
+(17607),
+(17608),
+(17609),
+(17610),
+(17611),
+(17613),
+(17615),
+(17620),
+(17630),
+(17633),
+(17639),
+(17648),
+(17649),
+(17672),
+(17682),
+(17692),
+(17734),
+(17736),
+(17738),
+(17744),
+(17745),
+(17749),
+(17753),
+(17754),
+(17755),
+(17776),
+(17777),
+(17794),
+(17797),
+(17798),
+(17799),
+(17800),
+(17843),
+(17855),
+(17856),
+(17857),
+(17859),
+(17860),
+(17863),
+(17877),
+(17883),
+(17919),
+(17920),
+(17921),
+(17922),
+(17923),
+(17924),
+(17925),
+(17926),
+(17939),
+(17943),
+(17944),
+(17946),
+(17948),
+(17950),
+(17961),
+(17962),
+(17963),
+(18070),
+(18072),
+(18075),
+(18077),
+(18078),
+(18081),
+(18082),
+(18083),
+(18084),
+(18085),
+(18086),
+(18088),
+(18089),
+(18090),
+(18091),
+(18092),
+(18101),
+(18103),
+(18104),
+(18105),
+(18106),
+(18107),
+(18108),
+(18111),
+(18112),
+(18118),
+(18138),
+(18145),
+(18149),
+(18151),
+(18152),
+(18153),
+(18159),
+(18164),
+(18165),
+(18172),
+(18173),
+(18187),
+(18197),
+(18199),
+(18200),
+(18202),
+(18203),
+(18204),
+(18205),
+(18206),
+(18208),
+(18209),
+(18210),
+(18211),
+(18214),
+(18217),
+(18223),
+(18266),
+(18267),
+(18270),
+(18276),
+(18278),
+(18289),
+(18347),
+(18362),
+(18367),
+(18368),
+(18375),
+(18381),
+(18387),
+(18389),
+(18390),
+(18395),
+(18396),
+(18398),
+(18425),
+(18469),
+(18476),
+(18498),
+(18502),
+(18503),
+(18543),
+(18545),
+(18557),
+(18561),
+(18562),
+(18608),
+(18610),
+(18631),
+(18632),
+(18633),
+(18647),
+(18649),
+(18651),
+(18652),
+(18654),
+(18656),
+(18657),
+(18658),
+(18663),
+(18670),
+(18702),
+(18761),
+(18763),
+(18796),
+(18798),
+(18802),
+(18805),
+(18807),
+(18809),
+(18812),
+(18813),
+(18817),
+(18819),
+(18833),
+(18867),
+(18868),
+(18869),
+(18870),
+(18871),
+(18945),
+(18952),
+(18958),
+(18968),
+(18972),
+(18980),
+(18988),
+(18996),
+(19027),
+(19128),
+(19130),
+(19131),
+(19132),
+(19133),
+(19134),
+(19136),
+(19179),
+(19196),
+(19213),
+(19244),
+(19260),
+(19276),
+(19277),
+(19278),
+(19279),
+(19280),
+(19306),
+(19319),
+(19362),
+(19386),
+(19391),
+(19393),
+(19395),
+(19397),
+(19411),
+(19434),
+(19437),
+(19439),
+(19444),
+(19445),
+(19446),
+(19447),
+(19448),
+(19450),
+(19452),
+(19460),
+(19463),
+(19469),
+(19471),
+(19472),
+(19476),
+(19481),
+(19486),
+(19501),
+(19503),
+(19505),
+(19512),
+(19548),
+(19595),
+(19597),
+(19632),
+(19633),
+(19637),
+(19639),
+(19642),
+(19643),
+(19644),
+(19647),
+(19648),
+(19650),
+(19652),
+(19653),
+(19654),
+(19658),
+(19661),
+(19662),
+(19663),
+(19664),
+(19674),
+(19675),
+(19676),
+(19677),
+(19678),
+(19679),
+(19680),
+(19681),
+(19682),
+(19683),
+(19684),
+(19685),
+(19686),
+(19687),
+(19688),
+(19689),
+(19692),
+(19693),
+(19694),
+(19696),
+(19697),
+(19699),
+(19700),
+(19701),
+(19725),
+(19727),
+(19728),
+(19729),
+(19730),
+(19731),
+(19734),
+(19736),
+(19737),
+(19738),
+(19739),
+(19740),
+(19742),
+(19750),
+(19755),
+(19767),
+(19770),
+(19771),
+(19775),
+(19776),
+(19777),
+(19779),
+(19785),
+(19797),
+(19801),
+(19816),
+(19820),
+(19834),
+(19835),
+(19836),
+(19837),
+(19838),
+(19850),
+(19852),
+(19853),
+(19854),
+(19869),
+(19872),
+(19874),
+(19881),
+(19901),
+(19931),
+(19938),
+(19939),
+(19940),
+(19941),
+(19942),
+(19943),
+(19970),
+(19971),
+(19972),
+(19973),
+(19974),
+(19975),
+(19983),
+(20000),
+(20004),
+(20005),
+(20006),
+(20019),
+(20066),
+(20170),
+(20184),
+(20185),
+(20186),
+(20187),
+(20211),
+(20217),
+(20220),
+(20221),
+(20223),
+(20228),
+(20233),
+(20236),
+(20240),
+(20243),
+(20252),
+(20253),
+(20271),
+(20276),
+(20279),
+(20294),
+(20295),
+(20297),
+(20298),
+(20367),
+(20368),
+(20369),
+(20370),
+(20371),
+(20372),
+(20373),
+(20374),
+(20410),
+(20420),
+(20424),
+(20425),
+(20463),
+(20467),
+(20473),
+(20474),
+(20475),
+(20477),
+(20508),
+(20511),
+(20534),
+(20535),
+(20536),
+(20537),
+(20539),
+(20541),
+(20543),
+(20547),
+(20559),
+(20560),
+(20564),
+(20565),
+(20569),
+(20586),
+(20604),
+(20605),
+(20614),
+(20615),
+(20616),
+(20617),
+(20618),
+(20623),
+(20625),
+(20627),
+(20629),
+(20630),
+(20647),
+(20655),
+(20656),
+(20657),
+(20658),
+(20660),
+(20661),
+(20662),
+(20663),
+(20664),
+(20665),
+(20666),
+(20668),
+(20677),
+(20678),
+(20679),
+(20682),
+(20684),
+(20685),
+(20688),
+(20690),
+(20691),
+(20692),
+(20695),
+(20696),
+(20698),
+(20700),
+(20714),
+(20720),
+(20726),
+(20733),
+(20735),
+(20736),
+(20740),
+(20751),
+(20787),
+(20788),
+(20790),
+(20791),
+(20792),
+(20793),
+(20795),
+(20797),
+(20800),
+(20801),
+(20802),
+(20804),
+(20805),
+(20806),
+(20807),
+(20808),
+(20811),
+(20812),
+(20815),
+(20816),
+(20819),
+(20820),
+(20821),
+(20822),
+(20823),
+(20824),
+(20825),
+(20826),
+(20829),
+(20830),
+(20831),
+(20832),
+(20869),
+(20882),
+(20883),
+(20893),
+(20900),
+(20901),
+(20902),
+(20903),
+(20904),
+(20909),
+(20910),
+(20911),
+(20929),
+(20930),
+(20989),
+(21008),
+(21027),
+(21030),
+(21047),
+(21049),
+(21050),
+(21055),
+(21056),
+(21059),
+(21060),
+(21062),
+(21063),
+(21064),
+(21066),
+(21067),
+(21068),
+(21072),
+(21074),
+(21077),
+(21081),
+(21100),
+(21128),
+(21140),
+(21141),
+(21150),
+(21151),
+(21159),
+(21162),
+(21163),
+(21164),
+(21170),
+(21179),
+(21183),
+(21187),
+(21330),
+(21332),
+(21335),
+(21337),
+(21343),
+(21356),
+(21357),
+(21368),
+(21369),
+(21372),
+(21388),
+(21390),
+(21398),
+(21401),
+(21402),
+(21463),
+(21464),
+(21465),
+(21541),
+(21542),
+(21543),
+(21546),
+(21549),
+(21551),
+(21552),
+(21553),
+(21647),
+(21654),
+(21667),
+(21668),
+(21669),
+(21670),
+(21731),
+(21732),
+(21734),
+(21735),
+(21737),
+(21745),
+(21787),
+(21794),
+(21807),
+(21829),
+(21832),
+(21834),
+(21835),
+(21840),
+(21847),
+(21866),
+(21889),
+(21892),
+(21898),
+(21912),
+(21939),
+(21949),
+(21952),
+(21953),
+(21960),
+(21961),
+(21971),
+(21979),
+(21987),
+(21990),
+(21992),
+(22009),
+(22012),
+(22048),
+(22068),
+(22088),
+(22108),
+(22109),
+(22110),
+(22111),
+(22112),
+(22113),
+(22114),
+(22115),
+(22116),
+(22117),
+(22118),
+(22119),
+(22120),
+(22121),
+(22127),
+(22128),
+(22167),
+(22168),
+(22187),
+(22189),
+(22207),
+(22227),
+(22272),
+(22273),
+(22274),
+(22284),
+(22289),
+(22290),
+(22291),
+(22312),
+(22335),
+(22336),
+(22355),
+(22357),
+(22371),
+(22373),
+(22411),
+(22412),
+(22414),
+(22415),
+(22416),
+(22418),
+(22423),
+(22426),
+(22427),
+(22428),
+(22429),
+(22433),
+(22438),
+(22482),
+(22565),
+(22568),
+(22570),
+(22572),
+(22574),
+(22575),
+(22582),
+(22591),
+(22592),
+(22639),
+(22641),
+(22646),
+(22651),
+(22661),
+(22662),
+(22666),
+(22667),
+(22677),
+(22678),
+(22682),
+(22687),
+(22689),
+(22690),
+(22691),
+(22692),
+(22695),
+(22709),
+(22713),
+(22715),
+(22742),
+(22744),
+(22745),
+(22751),
+(22752),
+(22784),
+(22785),
+(22799),
+(22800),
+(22814),
+(22816),
+(22817),
+(22818),
+(22820),
+(22822),
+(22823),
+(22827),
+(22828),
+(22829),
+(22856),
+(22858),
+(22859),
+(22864),
+(22883),
+(22885),
+(22886),
+(22887),
+(22893),
+(22901),
+(22907),
+(22909),
+(22911),
+(22916),
+(22919),
+(22920),
+(22935),
+(22947),
+(22950),
+(22951),
+(22959),
+(22968),
+(22993),
+(22994),
+(22995),
+(22997),
+(23015),
+(23038),
+(23059),
+(23064),
+(23065),
+(23073),
+(23102),
+(23104),
+(23106),
+(23114),
+(23115),
+(23122),
+(23123),
+(23124),
+(23125),
+(23135),
+(23139),
+(23153),
+(23154),
+(23155),
+(23169),
+(23170),
+(23174),
+(23205),
+(23206),
+(23224),
+(23256),
+(23262),
+(23267),
+(23268),
+(23275),
+(23278),
+(23298),
+(23301),
+(23304),
+(23333),
+(23335),
+(23337),
+(23340),
+(23359),
+(23379),
+(23380),
+(23381),
+(23391),
+(23392),
+(23402),
+(23416),
+(23417),
+(23451),
+(23452),
+(23454),
+(23460),
+(23490),
+(23491),
+(23493),
+(23504),
+(23505),
+(23546),
+(23552),
+(23567),
+(23568),
+(23569),
+(23577),
+(23580),
+(23590),
+(23592),
+(23601),
+(23604),
+(23605),
+(23620),
+(23621),
+(23622),
+(23623),
+(23625),
+(23626),
+(23627),
+(23658),
+(23661),
+(23675),
+(23687),
+(23693),
+(23694),
+(23695),
+(23696),
+(23699),
+(23702),
+(23735),
+(23736),
+(23737),
+(23738),
+(23765),
+(23766),
+(23767),
+(23768),
+(23769),
+(23774),
+(23775),
+(23786),
+(23848),
+(23850),
+(23853),
+(23859),
+(23860),
+(23862),
+(23865),
+(23881),
+(23892),
+(23893),
+(23894),
+(23895),
+(23921),
+(23922),
+(23923),
+(23924),
+(23925),
+(23947),
+(23948),
+(23952),
+(23953),
+(23958),
+(23959),
+(23960),
+(23961),
+(23962),
+(23963),
+(23964),
+(23967),
+(23970),
+(23978),
+(23979),
+(24002),
+(24003),
+(24016),
+(24017),
+(24020),
+(24023),
+(24042),
+(24049),
+(24053),
+(24061),
+(24064),
+(24097),
+(24109),
+(24111),
+(24131),
+(24132),
+(24133),
+(24134),
+(24135),
+(24178),
+(24179),
+(24185),
+(24187),
+(24193),
+(24199),
+(24201),
+(24208),
+(24210),
+(24212),
+(24213),
+(24238),
+(24239),
+(24241),
+(24248),
+(24251),
+(24253),
+(24254),
+(24257),
+(24259),
+(24261),
+(24267),
+(24274),
+(24275),
+(24300),
+(24306),
+(24314),
+(24315),
+(24316),
+(24317),
+(24327),
+(24331),
+(24332),
+(24333),
+(24335),
+(24336),
+(24337),
+(24339),
+(24341),
+(24374),
+(24378),
+(24379),
+(24388),
+(24393),
+(24394),
+(24407),
+(24408),
+(24412),
+(24413),
+(24414),
+(24423),
+(24435),
+(24458),
+(24466),
+(24530),
+(24573),
+(24577),
+(24578),
+(24579),
+(24583),
+(24585),
+(24586),
+(24587),
+(24596),
+(24600),
+(24601),
+(24611),
+(24617),
+(24618),
+(24619),
+(24637),
+(24640),
+(24648),
+(24649),
+(24668),
+(24671),
+(24672),
+(24674),
+(24680),
+(24684),
+(24685),
+(24686),
+(24690),
+(24705),
+(24708),
+(24709),
+(24710),
+(24711),
+(24712),
+(24713),
+(24714),
+(24715),
+(24723),
+(24725),
+(24726),
+(24727),
+(24730),
+(24732),
+(24735),
+(24736),
+(24740),
+(24742),
+(24745),
+(24747),
+(24750),
+(24751),
+(24752),
+(24753),
+(24755),
+(24757),
+(24759),
+(24761),
+(24762),
+(24766),
+(24767),
+(24769),
+(24771),
+(24773),
+(24776),
+(24785),
+(24787),
+(24791),
+(24792),
+(24793),
+(24802),
+(24803),
+(24816),
+(24817),
+(24819),
+(24824),
+(24825),
+(24826),
+(24829),
+(24831),
+(24832),
+(24844),
+(24857),
+(24872),
+(24873),
+(24875),
+(24923),
+(24928),
+(24935),
+(24937),
+(24942),
+(24950),
+(24951),
+(24952),
+(24953),
+(24954),
+(24955),
+(24957),
+(24960),
+(24961),
+(24962),
+(24963),
+(24964),
+(24965),
+(24966),
+(24974),
+(24975),
+(24976),
+(24977),
+(24982),
+(24993),
+(25006),
+(25008),
+(25009),
+(25010),
+(25011),
+(25012),
+(25021),
+(25022),
+(25025),
+(25028),
+(25050),
+(25051),
+(25052),
+(25054),
+(25055),
+(25058),
+(25104),
+(25139),
+(25140),
+(25143),
+(25165),
+(25174),
+(25185),
+(25187),
+(25189),
+(25190),
+(25191),
+(25208),
+(25210),
+(25212),
+(25213),
+(25217),
+(25218),
+(25221),
+(25222),
+(25225),
+(25231),
+(25233),
+(25234),
+(25235),
+(25236),
+(25241),
+(25242),
+(25245),
+(25246),
+(25248),
+(25251),
+(25258),
+(25262),
+(25263),
+(25266),
+(25269),
+(25272),
+(25273),
+(25274),
+(25275),
+(25281),
+(25282),
+(25286),
+(25288),
+(25290),
+(25291),
+(25292),
+(25294),
+(25295),
+(25297),
+(25298),
+(25299),
+(25300),
+(25302),
+(25304),
+(25306),
+(25307),
+(25308),
+(25309),
+(25311),
+(25312),
+(25314),
+(25315),
+(25316),
+(25345),
+(25349),
+(25363),
+(25364),
+(25367),
+(25368),
+(25371),
+(25372),
+(25373),
+(25375),
+(25383),
+(25384),
+(25387),
+(25389),
+(25391),
+(25396),
+(25420),
+(25424),
+(25433),
+(25439),
+(25442),
+(25448),
+(25449),
+(25454),
+(25457),
+(25462),
+(25464),
+(25465),
+(25467),
+(25471),
+(25488),
+(25497),
+(25501),
+(25504),
+(25514),
+(25515),
+(25530),
+(25531),
+(25595),
+(25602),
+(25603),
+(25605),
+(25645),
+(25646),
+(25650),
+(25651),
+(25652),
+(25668),
+(25671),
+(25673),
+(25677),
+(25678),
+(25686),
+(25710),
+(25712),
+(25721),
+(25725),
+(25742),
+(25748),
+(25755),
+(25760),
+(25761),
+(25762),
+(25771),
+(25772),
+(25777),
+(25778),
+(25779),
+(25781),
+(25788),
+(25800),
+(25802),
+(25803),
+(25806),
+(25807),
+(25808),
+(25809),
+(25810),
+(25811),
+(25816),
+(25821),
+(25838),
+(25840),
+(25843),
+(25845),
+(25847),
+(25848),
+(25852),
+(25854),
+(25856),
+(25861),
+(25902),
+(25903),
+(25911),
+(25912),
+(25913),
+(25914),
+(25947),
+(25992),
+(25995),
+(25997),
+(25999),
+(26001),
+(26004),
+(26005),
+(26006),
+(26007),
+(26008),
+(26012),
+(26013),
+(26017),
+(26035),
+(26044),
+(26050),
+(26077),
+(26078),
+(26079),
+(26081),
+(26082),
+(26090),
+(26095),
+(26097),
+(26098),
+(26100),
+(26108),
+(26125),
+(26126),
+(26134),
+(26141),
+(26143),
+(26170),
+(26181),
+(26194),
+(26195),
+(26196),
+(26197),
+(26198),
+(26206),
+(26207),
+(26211),
+(26218),
+(26226),
+(26233),
+(26258),
+(26259),
+(26275),
+(26281),
+(26282),
+(26339),
+(26350),
+(26363),
+(26364),
+(26365),
+(26366),
+(26367),
+(26368),
+(26369),
+(26370),
+(26371),
+(26372),
+(26374),
+(26375),
+(26377),
+(26406),
+(26408),
+(26409),
+(26410),
+(26412),
+(26414),
+(26415),
+(26419),
+(26446),
+(26448),
+(26470),
+(26476),
+(26548),
+(26556),
+(26561),
+(26565),
+(26572),
+(26584),
+(26601),
+(26610),
+(26613),
+(26616),
+(26622),
+(26623),
+(26624),
+(26625),
+(26636),
+(26639),
+(26641),
+(26649),
+(26654),
+(26663),
+(26679),
+(26688),
+(26693),
+(26740),
+(26742),
+(26748),
+(26791),
+(26796),
+(26799),
+(26800),
+(26839),
+(26861),
+(26862),
+(26863),
+(26864),
+(26865),
+(26866),
+(26867),
+(26884),
+(26890),
+(26899),
+(26923),
+(26924),
+(26968),
+(26978),
+(26979),
+(26980),
+(26981),
+(26982),
+(26984),
+(26985),
+(26986),
+(26987),
+(26988),
+(26989),
+(26990),
+(26992),
+(26995),
+(26996),
+(27000),
+(27001),
+(27002),
+(27003),
+(27004),
+(27005),
+(27006),
+(27007),
+(27008),
+(27010),
+(27013),
+(27014),
+(27016),
+(27019),
+(27021),
+(27024),
+(27030),
+(27031),
+(27047),
+(27048),
+(27049),
+(27050),
+(27051),
+(27060),
+(27065),
+(27067),
+(27068),
+(27069),
+(27070),
+(27071),
+(27072),
+(27073),
+(27074),
+(27075),
+(27078),
+(27079),
+(27126),
+(27132),
+(27135),
+(27136),
+(27137),
+(27138),
+(27140),
+(27142),
+(27154),
+(27174),
+(27175),
+(27176),
+(27177),
+(27180),
+(27187),
+(27189),
+(27209),
+(27210),
+(27211),
+(27215),
+(27216),
+(27217),
+(27218),
+(27219),
+(27220),
+(27223),
+(27224),
+(27228),
+(27243),
+(27254),
+(27255),
+(27258),
+(27261),
+(27263),
+(27267),
+(27270),
+(27274),
+(27275),
+(27276),
+(27277),
+(27281),
+(27286),
+(27288),
+(27290),
+(27360),
+(27375),
+(27376),
+(27378),
+(27379),
+(27380),
+(27381),
+(27384),
+(27385),
+(27386),
+(27387),
+(27389),
+(27390),
+(27391),
+(27392),
+(27393),
+(27395),
+(27396),
+(27397),
+(27398),
+(27441),
+(27448),
+(27486),
+(27526),
+(27527),
+(27532),
+(27541),
+(27547),
+(27548),
+(27549),
+(27550),
+(27552),
+(27553),
+(27554),
+(27555),
+(27556),
+(27557),
+(27559),
+(27565),
+(27567),
+(27571),
+(27572),
+(27573),
+(27576),
+(27577),
+(27580),
+(27581),
+(27582),
+(27584),
+(27605),
+(27606),
+(27608),
+(27609),
+(27611),
+(27613),
+(27615),
+(27620),
+(27624),
+(27626),
+(27632),
+(27633),
+(27634),
+(27635),
+(27636),
+(27637),
+(27638),
+(27640),
+(27648),
+(27655),
+(27662),
+(27673),
+(27677),
+(27686),
+(27752),
+(27754),
+(27755),
+(27756),
+(27760),
+(27765),
+(27794),
+(27806),
+(27814),
+(27819),
+(27841),
+(27849),
+(27852),
+(27860),
+(27861),
+(27863),
+(27864),
+(27865),
+(27868),
+(27873),
+(27874),
+(27891),
+(27907),
+(27909),
+(27910),
+(27915),
+(27919),
+(27931),
+(27937),
+(27983),
+(27991),
+(27992),
+(27994),
+(27995),
+(28030),
+(28099),
+(28133),
+(28147),
+(28149),
+(28167),
+(28169),
+(28239),
+(28251),
+(28252),
+(28253),
+(28254),
+(28255),
+(28256),
+(28257),
+(28258),
+(28259),
+(28260),
+(28261),
+(28262),
+(28263),
+(28265),
+(28271),
+(28272),
+(28276),
+(28287),
+(28293),
+(28299),
+(28301),
+(28303),
+(28306),
+(28308),
+(28310),
+(28314),
+(28318),
+(28319),
+(28320),
+(28321),
+(28329),
+(28336),
+(28337),
+(28342),
+(28350),
+(28351),
+(28375),
+(28393),
+(28394),
+(28396),
+(28397),
+(28410),
+(28412),
+(28418),
+(28419),
+(28420),
+(28428),
+(28431),
+(28434),
+(28439),
+(28444),
+(28445),
+(28467),
+(28470),
+(28478),
+(28516),
+(28522),
+(28597),
+(28601),
+(28608),
+(28614),
+(28624),
+(28674),
+(28676),
+(28678),
+(28684),
+(28685),
+(28689),
+(28690),
+(28691),
+(28692),
+(28696),
+(28698),
+(28702),
+(28715),
+(28718),
+(28720),
+(28722),
+(28723),
+(28724),
+(28734),
+(28750),
+(28772),
+(28776),
+(28783),
+(28788),
+(28790),
+(28791),
+(28793),
+(28795),
+(28810),
+(28824),
+(28825),
+(28826),
+(28827),
+(28836),
+(28839),
+(28858),
+(28859),
+(28872),
+(28873),
+(28880),
+(28882),
+(28883),
+(28887),
+(28896),
+(28899),
+(28900),
+(28901),
+(28902),
+(28913),
+(28969),
+(28993),
+(29001),
+(29002),
+(29003),
+(29006),
+(29044),
+(29054),
+(29058),
+(29060),
+(29098),
+(29117),
+(29126),
+(29127),
+(29128),
+(29129),
+(29134),
+(29135),
+(29136),
+(29137),
+(29138),
+(29139),
+(29151),
+(29155),
+(29157),
+(29158),
+(29160),
+(29164),
+(29166),
+(29168),
+(29170),
+(29175),
+(29182),
+(29185),
+(29188),
+(29194),
+(29196),
+(29198),
+(29228),
+(29290),
+(29295),
+(29300),
+(29306),
+(29314),
+(29317),
+(29319),
+(29320),
+(29341),
+(29362),
+(29364),
+(29380),
+(29386),
+(29395),
+(29405),
+(29407),
+(29408),
+(29425),
+(29426),
+(29427),
+(29428),
+(29435),
+(29436),
+(29443),
+(29473),
+(29487),
+(29492),
+(29494),
+(29495),
+(29497),
+(29500),
+(29502),
+(29515),
+(29516),
+(29519),
+(29522),
+(29528),
+(29539),
+(29540),
+(29543),
+(29544),
+(29546),
+(29555),
+(29560),
+(29561),
+(29562),
+(29563),
+(29564),
+(29567),
+(29570),
+(29572),
+(29574),
+(29575),
+(29576),
+(29577),
+(29578),
+(29580),
+(29581),
+(29582),
+(29583),
+(29585),
+(29586),
+(29587),
+(29607),
+(29609),
+(29638),
+(29639),
+(29640),
+(29641),
+(29644),
+(29646),
+(29647),
+(29652),
+(29653),
+(29655),
+(29661),
+(29665),
+(29666),
+(29667),
+(29670),
+(29673),
+(29675),
+(29676),
+(29677),
+(29679),
+(29684),
+(29690),
+(29703),
+(29704),
+(29707),
+(29711),
+(29712),
+(29716),
+(29722),
+(29765),
+(29768),
+(29815),
+(29832),
+(29845),
+(29847),
+(29848),
+(29850),
+(29879),
+(29881),
+(29896),
+(29901),
+(29903),
+(29906),
+(29907),
+(29909),
+(29915),
+(29916),
+(29917),
+(29925),
+(29926),
+(29927),
+(29928),
+(29930),
+(29953),
+(29954),
+(29955),
+(29956),
+(29964),
+(29990),
+(29991),
+(30010),
+(30013),
+(30014),
+(30016),
+(30019),
+(30022),
+(30036),
+(30039),
+(30044),
+(30050),
+(30053),
+(30055),
+(30069),
+(30070),
+(30077),
+(30081),
+(30099),
+(30100),
+(30102),
+(30103),
+(30104),
+(30105),
+(30108),
+(30112),
+(30113),
+(30115),
+(30121),
+(30127),
+(30128),
+(30130),
+(30131),
+(30151),
+(30153),
+(30164),
+(30173),
+(30175),
+(30177),
+(30178),
+(30180),
+(30194),
+(30195),
+(30197),
+(30198),
+(30202),
+(30213),
+(30218),
+(30219),
+(30223),
+(30238),
+(30253),
+(30269),
+(30270),
+(30271),
+(30280),
+(30285),
+(30324),
+(30330),
+(30335),
+(30351),
+(30353),
+(30356),
+(30357),
+(30358),
+(30383),
+(30395),
+(30400),
+(30401),
+(30402),
+(30404),
+(30405),
+(30412),
+(30421),
+(30422),
+(30423),
+(30424),
+(30430),
+(30433),
+(30435),
+(30448),
+(30449),
+(30451),
+(30455),
+(30459),
+(30463),
+(30464),
+(30465),
+(30466),
+(30467),
+(30468),
+(30471),
+(30474),
+(30478),
+(30479),
+(30481),
+(30493),
+(30495),
+(30500),
+(30501),
+(30504),
+(30505),
+(30507),
+(30512),
+(30520),
+(30528),
+(30530),
+(30545),
+(30546),
+(30601),
+(30605),
+(30606),
+(30607),
+(30608),
+(30609),
+(30614),
+(30615),
+(30619),
+(30621),
+(30637),
+(30638),
+(30639),
+(30641),
+(30643),
+(30646),
+(30647),
+(30648),
+(30651),
+(30652),
+(30653),
+(30654),
+(30661),
+(30686),
+(30687),
+(30688),
+(30689),
+(30691),
+(30695),
+(30719),
+(30736),
+(30740),
+(30751),
+(30753),
+(30755),
+(30756),
+(30768),
+(30817),
+(30822),
+(30830),
+(30832),
+(30838),
+(30839),
+(30846),
+(30849),
+(30850),
+(30854),
+(30875),
+(30876),
+(30877),
+(30878),
+(30888),
+(30889),
+(30890),
+(30900),
+(30901),
+(30909),
+(30910),
+(30923),
+(30926),
+(30932),
+(30936),
+(30937),
+(30942),
+(30943),
+(30944),
+(30945),
+(30967),
+(30971),
+(30977),
+(30980),
+(30981),
+(30984),
+(30986),
+(30989),
+(30990),
+(30992),
+(31008),
+(31009),
+(31012),
+(31015),
+(31016),
+(31018),
+(31022),
+(31041),
+(31042),
+(31043),
+(31046),
+(31069),
+(31117),
+(31125),
+(31139),
+(31249),
+(31257),
+(31262),
+(31263),
+(31270),
+(31271),
+(31272),
+(31274),
+(31275),
+(31279),
+(31280),
+(31281),
+(31282),
+(31284),
+(31286),
+(31287),
+(31288),
+(31289),
+(31290),
+(31292),
+(31295),
+(31296),
+(31305),
+(31306),
+(31312),
+(31316),
+(31319),
+(31330),
+(31334),
+(31337),
+(31339),
+(31345),
+(31366),
+(31367),
+(31368),
+(31376),
+(31378),
+(31381),
+(31387),
+(31389),
+(31390),
+(31394),
+(31397),
+(31399),
+(31400),
+(31401),
+(31402),
+(31404),
+(31405),
+(31406),
+(31407),
+(31410),
+(31415),
+(31416),
+(31417),
+(31418),
+(31419),
+(31420),
+(31423),
+(31425),
+(31426),
+(31427),
+(31436),
+(31445),
+(31446),
+(31457),
+(31464),
+(31477),
+(31481),
+(31486),
+(31513),
+(31516),
+(31535),
+(31547),
+(31551),
+(31552),
+(31553),
+(31566),
+(31589),
+(31595),
+(31596),
+(31600),
+(31601),
+(31602),
+(31604),
+(31609),
+(31610),
+(31618),
+(31620),
+(31622),
+(31623),
+(31626),
+(31627),
+(31629),
+(31651),
+(31662),
+(31664),
+(31703),
+(31705),
+(31707),
+(31709),
+(31713),
+(31715),
+(31717),
+(31718),
+(31721),
+(31724),
+(31729),
+(31733),
+(31734),
+(31739),
+(31740),
+(31741),
+(31742),
+(31743),
+(31747),
+(31751),
+(31754),
+(31758),
+(31759),
+(31764),
+(31766),
+(31772),
+(31779),
+(31782),
+(31784),
+(31789),
+(31790),
+(31803),
+(31804),
+(31807),
+(31808),
+(31810),
+(31811),
+(31812),
+(31813),
+(31814),
+(31815),
+(31816),
+(31819),
+(31827),
+(31843),
+(31863),
+(31864),
+(31865),
+(31893),
+(31898),
+(31907),
+(31911),
+(31916),
+(31923),
+(31935),
+(31939),
+(31942),
+(31946),
+(31948),
+(31955),
+(31956),
+(31961),
+(31965),
+(31966),
+(31971),
+(31972),
+(31973),
+(31975),
+(31976),
+(31977),
+(31978),
+(31984),
+(31988),
+(31994),
+(31996),
+(31999),
+(32000),
+(32001),
+(32002),
+(32004),
+(32005),
+(32006),
+(32009),
+(32010),
+(32011),
+(32012),
+(32013),
+(32015),
+(32017),
+(32018),
+(32019),
+(32020),
+(32021),
+(32022),
+(32024),
+(32025),
+(32026),
+(32039),
+(32049),
+(32055),
+(32056),
+(32063),
+(32065),
+(32071),
+(32076),
+(32077),
+(32080),
+(32082),
+(32092),
+(32093),
+(32094),
+(32095),
+(32103),
+(32104),
+(32105),
+(32110),
+(32120),
+(32125),
+(32126),
+(32129),
+(32131),
+(32132),
+(32133),
+(32139),
+(32154),
+(32168),
+(32175),
+(32176),
+(32190),
+(32197),
+(32202),
+(32211),
+(32224),
+(32231),
+(32247),
+(32248),
+(32261),
+(32268),
+(32270),
+(32300),
+(32306),
+(32315),
+(32317),
+(32319),
+(32320),
+(32321),
+(32323),
+(32325),
+(32328),
+(32329),
+(32330),
+(32337),
+(32338),
+(32346),
+(32361),
+(32363),
+(32364),
+(32369),
+(32370),
+(32376),
+(32378),
+(32379),
+(32386),
+(32388),
+(32389),
+(32390),
+(32391),
+(32405),
+(32414),
+(32415),
+(32416),
+(32417),
+(32418),
+(32422),
+(32428),
+(32430),
+(32431),
+(32441),
+(32445),
+(32474),
+(32491),
+(32546),
+(32550),
+(32578),
+(32583),
+(32588),
+(32593),
+(32594),
+(32595),
+(32605),
+(32606),
+(32639),
+(32643),
+(32645),
+(32652),
+(32654),
+(32666),
+(32674),
+(32675),
+(32677),
+(32678),
+(32679),
+(32682),
+(32683),
+(32684),
+(32689),
+(32690),
+(32691),
+(32693),
+(32699),
+(32700),
+(32707),
+(32709),
+(32716),
+(32721),
+(32733),
+(32734),
+(32735),
+(32736),
+(32738),
+(32739),
+(32740),
+(32741),
+(32742),
+(32747),
+(32748),
+(32749),
+(32751),
+(32752),
+(32759),
+(32769),
+(32770),
+(32771),
+(32772),
+(32774),
+(32778),
+(32779),
+(32784),
+(32797),
+(32829),
+(32830),
+(32831),
+(32835),
+(32846),
+(32858),
+(32860),
+(32862),
+(32863),
+(32864),
+(32889),
+(32897),
+(32901),
+(32902),
+(32903),
+(32904),
+(32905),
+(32906),
+(32907),
+(32908),
+(32909),
+(32913),
+(32915),
+(32916),
+(32917),
+(32919),
+(32921),
+(32922),
+(32924),
+(32926),
+(32935),
+(32940),
+(32950),
+(32959),
+(32960),
+(32962),
+(32967),
+(32969),
+(32971),
+(32984),
+(32996),
+(33031),
+(33040),
+(33044),
+(33045),
+(33047),
+(33049),
+(33051),
+(33055),
+(33056),
+(33068),
+(33069),
+(33072),
+(33073),
+(33074),
+(33077),
+(33078),
+(33079),
+(33080),
+(33081),
+(33082),
+(33086),
+(33096),
+(33098),
+(33126),
+(33129),
+(33130),
+(33144),
+(33173),
+(33175),
+(33196),
+(33197),
+(33198),
+(33206),
+(33227),
+(33230),
+(33246),
+(33247),
+(33324),
+(33326),
+(33331),
+(33335),
+(33346),
+(33360),
+(33382),
+(33383),
+(33385),
+(33387),
+(33389),
+(33392),
+(33401),
+(33404),
+(33417),
+(33419),
+(33462),
+(33463),
+(33480),
+(33482),
+(33483),
+(33487),
+(33493),
+(33502),
+(33526),
+(33527),
+(33528),
+(33529),
+(33534),
+(33535),
+(33542),
+(33552),
+(33553),
+(33554),
+(33619),
+(33620),
+(33625),
+(33626),
+(33628),
+(33631),
+(33632),
+(33640),
+(33641),
+(33643),
+(33659),
+(33661),
+(33665),
+(33684),
+(33688),
+(33689),
+(33698),
+(33699),
+(33700),
+(33709),
+(33723),
+(33728),
+(33731),
+(33745),
+(33750),
+(33763),
+(33768),
+(33781),
+(33786),
+(33787),
+(33789),
+(33792),
+(33793),
+(33794),
+(33813),
+(33824),
+(33825),
+(33827),
+(33832),
+(33833),
+(33837),
+(33844),
+(33849),
+(33850),
+(33865),
+(33871),
+(33876),
+(33878),
+(33899),
+(33907),
+(33910),
+(33911),
+(33912),
+(33913),
+(33914),
+(33925),
+(33938),
+(33947),
+(33951),
+(33960),
+(33964),
+(33969),
+(33970),
+(33975),
+(33982),
+(33983),
+(33985),
+(33986),
+(33987),
+(33988),
+(33989),
+(34014),
+(34020),
+(34025),
+(34036),
+(34071),
+(34073),
+(34083),
+(34087),
+(34088),
+(34089),
+(34092),
+(34093),
+(34095),
+(34097),
+(34099),
+(34107),
+(34108),
+(34110),
+(34112),
+(34113),
+(34120),
+(34130),
+(34132),
+(34135),
+(34138),
+(34139),
+(34143),
+(34149),
+(34150),
+(34163),
+(34171),
+(34172),
+(34176),
+(34177),
+(34213),
+(34214),
+(34215),
+(34216),
+(34217),
+(34218),
+(34219),
+(34232),
+(34243),
+(34259),
+(34298),
+(34344),
+(34345),
+(34346),
+(34347),
+(34348),
+(34351),
+(34352),
+(34353),
+(34354),
+(34357),
+(34361),
+(34363),
+(34366),
+(34370),
+(34379),
+(34389),
+(34390),
+(34391),
+(34394),
+(34400),
+(34411),
+(34412),
+(34413),
+(34414),
+(34415),
+(34416),
+(34417),
+(34418),
+(34419),
+(34423),
+(34425),
+(34428),
+(34432),
+(34437),
+(34438),
+(34439),
+(34445),
+(34446),
+(34447),
+(34451),
+(34463),
+(34490),
+(34510),
+(34520),
+(34578),
+(34580),
+(34587),
+(34613),
+(34614),
+(34615),
+(34616),
+(34618),
+(34620),
+(34625),
+(34626),
+(34629),
+(34637),
+(34639),
+(34640),
+(34641),
+(34643),
+(34644),
+(34645),
+(34650),
+(34653),
+(34654),
+(34655),
+(34661),
+(34665),
+(34672),
+(34694),
+(34695),
+(34696),
+(34697),
+(34709),
+(34714),
+(34715),
+(34719),
+(34722),
+(34745),
+(34752),
+(34784),
+(34786),
+(34787),
+(34788),
+(34789),
+(34793),
+(34794),
+(34797),
+(34798),
+(34799),
+(34800),
+(34802),
+(34809),
+(34811),
+(34812),
+(34820),
+(34824),
+(34828),
+(34829),
+(34841),
+(34852),
+(34856),
+(34875),
+(34879),
+(34881),
+(34883),
+(34886),
+(34889),
+(34891),
+(34893),
+(34906),
+(34907),
+(34913),
+(34914),
+(34916),
+(34917),
+(34920),
+(34922),
+(34924),
+(34925),
+(34930),
+(34931),
+(34940),
+(34941),
+(34942),
+(34945),
+(34969),
+(34974),
+(34975),
+(34976),
+(34984),
+(34996),
+(35004),
+(35010),
+(35011),
+(35012),
+(35013),
+(35033),
+(35034),
+(35039),
+(35047),
+(35049),
+(35054),
+(35055),
+(35056),
+(35062),
+(35065),
+(35066),
+(35067),
+(35069),
+(35071),
+(35072),
+(35088),
+(35089),
+(35092),
+(35096),
+(35101),
+(35105),
+(35106),
+(35107),
+(35112),
+(35115),
+(35117),
+(35120),
+(35144),
+(35147),
+(35161),
+(35178),
+(35179),
+(35180),
+(35182),
+(35183),
+(35185),
+(35189),
+(35195),
+(35201),
+(35207),
+(35229),
+(35231),
+(35234),
+(35238),
+(35243),
+(35244),
+(35263),
+(35267),
+(35273),
+(35280),
+(35290),
+(35291),
+(35292),
+(35293),
+(35294),
+(35295),
+(35313),
+(35314),
+(35316),
+(35317),
+(35318),
+(35321),
+(35323),
+(35325),
+(35326),
+(35328),
+(35329),
+(35331),
+(35332),
+(35333),
+(35334),
+(35335),
+(35339),
+(35346),
+(35353),
+(35371),
+(35376),
+(35377),
+(35382),
+(35387),
+(35389),
+(35392),
+(35395),
+(35401),
+(35410),
+(35412),
+(35424),
+(35460),
+(35466),
+(35472),
+(35473),
+(35493),
+(35499),
+(35501),
+(35506),
+(35507),
+(35510),
+(35511),
+(35514),
+(35518),
+(35519),
+(35556),
+(35570),
+(35621),
+(35686),
+(35718),
+(35727),
+(35728),
+(35735),
+(35741),
+(35742),
+(35748),
+(35759),
+(35760),
+(35771),
+(35772),
+(35780),
+(35783),
+(35839),
+(35846),
+(35851),
+(35853),
+(35857),
+(35871),
+(35873),
+(35877),
+(35913),
+(35914),
+(35916),
+(35918),
+(35919),
+(35920),
+(35927),
+(35928),
+(35932),
+(35944),
+(35945),
+(35946),
+(35949),
+(35954),
+(35955),
+(35963),
+(35964),
+(35965),
+(35966),
+(35967),
+(35968),
+(35969),
+(35970),
+(35971),
+(35972),
+(35973),
+(35974),
+(35975),
+(35976),
+(35977),
+(35978),
+(35979),
+(35980),
+(35981),
+(35982),
+(35983),
+(35984),
+(35985),
+(35986),
+(35987),
+(35988),
+(35989),
+(35990),
+(35997),
+(35998),
+(35999),
+(36002),
+(36020),
+(36021),
+(36023),
+(36025),
+(36033),
+(36052),
+(36054),
+(36073),
+(36088),
+(36093),
+(36094),
+(36095),
+(36099),
+(36100),
+(36102),
+(36115),
+(36123),
+(36138),
+(36140),
+(36141),
+(36145),
+(36152),
+(36153),
+(36170),
+(36173),
+(36176),
+(36181),
+(36207),
+(36208),
+(36224),
+(36227),
+(36228),
+(36237),
+(36238),
+(36246),
+(36247),
+(36250),
+(36276),
+(36277),
+(36279),
+(36288),
+(36295),
+(36296),
+(36299),
+(36310),
+(36312),
+(36314),
+(36328),
+(36332),
+(36333),
+(36339),
+(36340),
+(36341),
+(36342),
+(36343),
+(36344),
+(36345),
+(36348),
+(36380),
+(36398),
+(36399),
+(36401),
+(36402),
+(36404),
+(36414),
+(36415),
+(36416),
+(36417),
+(36433),
+(36434),
+(36435),
+(36436),
+(36438),
+(36439),
+(36441),
+(36447),
+(36448),
+(36457),
+(36458),
+(36461),
+(36464),
+(36469),
+(36470),
+(36475),
+(36478),
+(36482),
+(36483),
+(36488),
+(36500),
+(36507),
+(36508),
+(36509),
+(36516),
+(36517),
+(36518),
+(36527),
+(36534),
+(36536),
+(36538),
+(36539),
+(36540),
+(36541),
+(36554),
+(36558),
+(36570),
+(36571),
+(36578),
+(36586),
+(36590),
+(36594),
+(36601),
+(36604),
+(36606),
+(36608),
+(36609),
+(36612),
+(36622),
+(36623),
+(36624),
+(36625),
+(36627),
+(36628),
+(36632),
+(36638),
+(36641),
+(36642),
+(36645),
+(36646),
+(36647),
+(36650),
+(36655),
+(36656),
+(36659),
+(36664),
+(36671),
+(36677),
+(36678),
+(36679),
+(36710),
+(36711),
+(36712),
+(36713),
+(36714),
+(36732),
+(36739),
+(36778),
+(36779),
+(36780),
+(36781),
+(36787),
+(36789),
+(36791),
+(36796),
+(36801),
+(36805),
+(36806),
+(36807),
+(36810),
+(36812),
+(36814),
+(36822),
+(36825),
+(36831),
+(36832),
+(36833),
+(36836),
+(36838),
+(36839),
+(36840),
+(36841),
+(36842),
+(36843),
+(36844),
+(36863),
+(36864),
+(36866),
+(36872),
+(36876),
+(36877),
+(36886),
+(36891),
+(36894),
+(36905),
+(36906),
+(36909),
+(36913),
+(36914),
+(36916),
+(36917),
+(36919),
+(36920),
+(36921),
+(36924),
+(36927),
+(36929),
+(36947),
+(36956),
+(36957),
+(36965),
+(36966),
+(36971),
+(36972),
+(36974),
+(36979),
+(36980),
+(36983),
+(36984),
+(36986),
+(36987),
+(36988),
+(36990),
+(36991),
+(37027),
+(37028),
+(37030),
+(37031),
+(37054),
+(37057),
+(37067),
+(37073),
+(37074),
+(37082),
+(37089),
+(37104),
+(37110),
+(37111),
+(37112),
+(37113),
+(37121),
+(37122),
+(37123),
+(37126),
+(37132),
+(37133),
+(37136),
+(37138),
+(37154),
+(37156),
+(37162),
+(37176),
+(37208),
+(37216),
+(37221),
+(37249),
+(37250),
+(37251),
+(37252),
+(37254),
+(37255),
+(37257),
+(37259),
+(37260),
+(37271),
+(37272),
+(37273),
+(37274),
+(37275),
+(37276),
+(37277),
+(37320),
+(37321),
+(37322),
+(37323),
+(37328),
+(37329),
+(37330),
+(37331),
+(37332),
+(37334),
+(37335),
+(37359),
+(37361),
+(37369),
+(37372),
+(37387),
+(37389),
+(37412),
+(37417),
+(37421),
+(37450),
+(37455),
+(37456),
+(37460),
+(37462),
+(37463),
+(37470),
+(37479),
+(37486),
+(37500),
+(37506),
+(37511),
+(37527),
+(37532),
+(37537),
+(37540),
+(37548),
+(37551),
+(37552),
+(37554),
+(37563),
+(37566),
+(37572),
+(37577),
+(37578),
+(37579),
+(37580),
+(37581),
+(37589),
+(37591),
+(37592),
+(37596),
+(37597),
+(37599),
+(37602),
+(37621),
+(37628),
+(37629),
+(37630),
+(37632),
+(37634),
+(37646),
+(37647),
+(37654),
+(37661),
+(37662),
+(37664),
+(37667),
+(37668),
+(37675),
+(37681),
+(37685),
+(37695),
+(37700),
+(37711),
+(37717),
+(37718),
+(37719),
+(37727),
+(37749),
+(37770),
+(37777),
+(37778),
+(37798),
+(37800),
+(37801),
+(37802),
+(37803),
+(37804),
+(37805),
+(37806),
+(37807),
+(37808),
+(37809),
+(37810),
+(37811),
+(37813),
+(37823),
+(37834),
+(37838),
+(37839),
+(37840),
+(37841),
+(37847),
+(37850),
+(37851),
+(37856),
+(37862),
+(37865),
+(37867),
+(37871),
+(37892),
+(37894),
+(37906),
+(37908),
+(37910),
+(37921),
+(37922),
+(37930),
+(37933),
+(37937),
+(37940),
+(37945),
+(37946),
+(37950),
+(37956),
+(37958),
+(37962),
+(37965),
+(37967),
+(37968),
+(37972),
+(37973),
+(37974),
+(37975),
+(37978),
+(37979),
+(37986),
+(37988),
+(37992),
+(37998),
+(38002),
+(38007),
+(38009),
+(38010),
+(38023),
+(38024),
+(38025),
+(38027),
+(38029),
+(38030),
+(38032),
+(38034),
+(38035),
+(38047),
+(38048),
+(38051),
+(38052),
+(38053),
+(38056),
+(38058),
+(38059),
+(38063),
+(38065),
+(38066),
+(38067),
+(38074),
+(38075),
+(38076),
+(38078),
+(38083),
+(38084),
+(38085),
+(38093),
+(38094),
+(38095),
+(38107),
+(38109),
+(38113),
+(38120),
+(38122),
+(38125),
+(38127),
+(38129),
+(38133),
+(38134),
+(38135),
+(38136),
+(38145),
+(38146),
+(38147),
+(38148),
+(38149),
+(38153),
+(38154),
+(38155),
+(38167),
+(38177),
+(38178),
+(38182),
+(38183),
+(38187),
+(38193),
+(38203),
+(38204),
+(38205),
+(38208),
+(38209),
+(38210),
+(38213),
+(38223),
+(38226),
+(38233),
+(38234),
+(38238),
+(38239),
+(38240),
+(38243),
+(38245),
+(38246),
+(38252),
+(38253),
+(38254),
+(38259),
+(38260),
+(38262),
+(38263),
+(38264),
+(38265),
+(38267),
+(38274),
+(38275),
+(38276),
+(38277),
+(38279),
+(38280),
+(38285),
+(38295),
+(38310),
+(38313),
+(38324),
+(38328),
+(38329),
+(38330),
+(38333),
+(38338),
+(38340),
+(38342),
+(38344),
+(38363),
+(38366),
+(38370),
+(38372),
+(38374),
+(38377),
+(38378),
+(38383),
+(38386),
+(38387),
+(38391),
+(38400),
+(38401),
+(38441),
+(38446),
+(38461),
+(38465),
+(38470),
+(38474),
+(38495),
+(38496),
+(38505),
+(38509),
+(38510),
+(38520),
+(38523),
+(38526),
+(38534),
+(38535),
+(38538),
+(38543),
+(38554),
+(38556),
+(38557),
+(38558),
+(38559),
+(38560),
+(38561),
+(38562),
+(38563),
+(38564),
+(38565),
+(38566),
+(38567),
+(38568),
+(38569),
+(38570),
+(38572),
+(38580),
+(38582),
+(38584),
+(38585),
+(38586),
+(38588),
+(38591),
+(38595),
+(38598),
+(38606),
+(38616),
+(38617),
+(38621),
+(38625),
+(38626),
+(38628),
+(38630),
+(38631),
+(38634),
+(38636),
+(38641),
+(38643),
+(38645),
+(38657),
+(38658),
+(38661),
+(38663),
+(38669),
+(38692),
+(38697),
+(38699),
+(38704),
+(38708),
+(38721),
+(38723),
+(38731),
+(38739),
+(38742),
+(38753),
+(38760),
+(38762),
+(38764),
+(38765),
+(38767),
+(38768),
+(38770),
+(38772),
+(38775),
+(38777),
+(38791),
+(38797),
+(38798),
+(38801),
+(38804),
+(38806),
+(38807),
+(38808),
+(38815),
+(38816),
+(38817),
+(38821),
+(38822),
+(38823),
+(38824),
+(38825),
+(38826),
+(38827),
+(38846),
+(38848),
+(38849),
+(38851),
+(38852),
+(38858),
+(38859),
+(38861),
+(38863),
+(38864),
+(38875),
+(38879),
+(38880),
+(38881),
+(38882),
+(38883),
+(38884),
+(38887),
+(38894),
+(38895),
+(38896),
+(38897),
+(38899),
+(38904),
+(38907),
+(38909),
+(38913),
+(38914),
+(38915),
+(38918),
+(38919),
+(38921),
+(38923),
+(38926),
+(38930),
+(38935),
+(38940),
+(38941),
+(38942),
+(38943),
+(38945),
+(38946),
+(38950),
+(38952),
+(38959),
+(38967),
+(38971),
+(38985),
+(38986),
+(38987),
+(38988),
+(38989),
+(38990),
+(38992),
+(38995),
+(39000),
+(39002),
+(39006),
+(39009),
+(39015),
+(39016),
+(39017),
+(39019),
+(39020),
+(39021),
+(39022),
+(39023),
+(39025),
+(39026),
+(39029),
+(39032),
+(39039),
+(39044),
+(39046),
+(39047),
+(39053),
+(39054),
+(39058),
+(39060),
+(39061),
+(39062),
+(39064),
+(39065),
+(39066),
+(39068),
+(39069),
+(39070),
+(39076),
+(39077),
+(39078),
+(39079),
+(39083),
+(39087),
+(39097),
+(39098),
+(39099),
+(39101),
+(39116),
+(39119),
+(39120),
+(39121),
+(39122),
+(39123),
+(39125),
+(39129),
+(39135),
+(39136),
+(39145),
+(39153),
+(39157),
+(39159),
+(39160),
+(39164),
+(39165),
+(39171),
+(39172),
+(39174),
+(39176),
+(39182),
+(39192),
+(39196),
+(39197),
+(39198),
+(39202),
+(39204),
+(39207),
+(39210),
+(39212),
+(39214),
+(39215),
+(39226),
+(39229),
+(39230),
+(39252),
+(39258),
+(39262),
+(39267),
+(39268),
+(39270),
+(39271),
+(39285),
+(39293),
+(39297),
+(39299),
+(39309),
+(39322),
+(39328),
+(39329),
+(39332),
+(39337),
+(39339),
+(39349),
+(39367),
+(39371),
+(39378),
+(39386),
+(39396),
+(39412),
+(39413),
+(39415),
+(39419),
+(39435),
+(39436),
+(39445),
+(39449),
+(39456),
+(39457),
+(39460),
+(39474),
+(39475),
+(39476),
+(39477),
+(39512),
+(39513),
+(39528),
+(39529),
+(39544),
+(39560),
+(39566),
+(39574),
+(39582),
+(39587),
+(39590),
+(39592),
+(39595),
+(39600),
+(39609),
+(39621),
+(39622),
+(39661),
+(39665),
+(39668),
+(39669),
+(39670),
+(39674),
+(39675),
+(39676),
+(39697),
+(39703),
+(39794),
+(39796),
+(39810),
+(39812),
+(39826),
+(39830),
+(39835),
+(39837),
+(39838),
+(39857),
+(39865),
+(39883),
+(39886),
+(39901),
+(39904),
+(39908),
+(39920),
+(39928),
+(39945),
+(39948),
+(39955),
+(39956),
+(39967),
+(39972),
+(39979),
+(39980),
+(39995),
+(39996),
+(40011),
+(40019),
+(40032),
+(40041),
+(40055),
+(40057),
+(40063),
+(40066),
+(40071),
+(40074),
+(40081),
+(40084),
+(40086),
+(40097),
+(40099),
+(40102),
+(40109),
+(40119),
+(40123),
+(40124),
+(40146),
+(40157),
+(40165),
+(40166),
+(40167),
+(40173),
+(40185),
+(40191),
+(40193),
+(40197),
+(40198),
+(40199),
+(40220),
+(40225),
+(40227),
+(40228),
+(40239),
+(40248),
+(40251),
+(40254),
+(40259),
+(40279),
+(40290),
+(40293),
+(40303),
+(40310),
+(40311),
+(40312),
+(40313),
+(40317),
+(40321),
+(40322),
+(40325),
+(40327),
+(40334),
+(40337),
+(40339),
+(40344),
+(40346),
+(40347),
+(40348),
+(40351),
+(40356),
+(40357),
+(40358),
+(40363),
+(40366),
+(40367),
+(40368),
+(40384),
+(40385),
+(40392),
+(40400),
+(40406),
+(40411),
+(40412),
+(40413),
+(40414),
+(40415),
+(40416),
+(40420),
+(40423),
+(40427),
+(40429),
+(40430),
+(40431),
+(40434),
+(40449),
+(40450),
+(40471),
+(40472),
+(40481),
+(40486),
+(40489),
+(40491),
+(40493),
+(40497),
+(40504),
+(40505),
+(40507),
+(40508),
+(40509),
+(40525),
+(40536),
+(40542),
+(40554),
+(40560),
+(40563),
+(40564),
+(40565),
+(40569),
+(40571),
+(40581),
+(40585),
+(40595),
+(40597),
+(40602),
+(40604),
+(40605),
+(40608),
+(40616),
+(40620),
+(40633),
+(40635),
+(40639),
+(40641),
+(40643),
+(40645),
+(40646),
+(40651),
+(40652),
+(40671),
+(40672),
+(40685),
+(40726),
+(40728),
+(40736),
+(40739),
+(40740),
+(40742),
+(40751),
+(40758),
+(40770),
+(40772),
+(40777),
+(40778),
+(40787),
+(40796),
+(40801),
+(40810),
+(40814),
+(40822),
+(40827),
+(40835),
+(40837),
+(40838),
+(40842),
+(40843),
+(40844),
+(40846),
+(40856),
+(40859),
+(40860),
+(40861),
+(40864),
+(40872),
+(40873),
+(40876),
+(40877),
+(40881),
+(40886),
+(40888),
+(40890),
+(40892),
+(40893),
+(40894),
+(40895),
+(40901),
+(40903),
+(40906),
+(40909),
+(40917),
+(40926),
+(40928),
+(40930),
+(40935),
+(40945),
+(40951),
+(40954),
+(40958),
+(40964),
+(40965),
+(40968),
+(40969),
+(40970),
+(40972),
+(40976),
+(40991),
+(41001),
+(41003),
+(41028),
+(41029),
+(41032),
+(41035),
+(41044),
+(41047),
+(41050),
+(41052),
+(41054),
+(41055),
+(41060),
+(41063),
+(41065),
+(41069),
+(41070),
+(41072),
+(41075),
+(41080),
+(41082),
+(41083),
+(41084),
+(41092),
+(41093),
+(41103),
+(41109),
+(41115),
+(41116),
+(41121),
+(41137),
+(41139),
+(41152),
+(41169),
+(41170),
+(41171),
+(41177),
+(41178),
+(41179),
+(41180),
+(41182),
+(41183),
+(41184),
+(41186),
+(41187),
+(41188),
+(41189),
+(41190),
+(41192),
+(41197),
+(41198),
+(41213),
+(41214),
+(41225),
+(41226),
+(41227),
+(41228),
+(41229),
+(41230),
+(41231),
+(41238),
+(41241),
+(41247),
+(41250),
+(41255),
+(41256),
+(41259),
+(41264),
+(41265),
+(41270),
+(41272),
+(41278),
+(41279),
+(41280),
+(41281),
+(41283),
+(41291),
+(41299),
+(41302),
+(41332),
+(41334),
+(41335),
+(41336),
+(41338),
+(41345),
+(41346),
+(41351),
+(41352),
+(41353),
+(41355),
+(41360),
+(41363),
+(41368),
+(41370),
+(41372),
+(41373),
+(41374),
+(41375),
+(41377),
+(41378),
+(41383),
+(41384),
+(41388),
+(41389),
+(41390),
+(41392),
+(41394),
+(41395),
+(41396),
+(41407),
+(41410),
+(41411),
+(41419),
+(41421),
+(41426),
+(41439),
+(41440),
+(41442),
+(41448),
+(41450),
+(41451),
+(41456),
+(41461),
+(41467),
+(41468),
+(41470),
+(41471),
+(41472),
+(41473),
+(41483),
+(41484),
+(41485),
+(41486),
+(41487),
+(41489),
+(41490),
+(41491),
+(41492),
+(41519),
+(41526),
+(41528),
+(41533),
+(41540),
+(41543),
+(41544),
+(41546),
+(41547),
+(41548),
+(41549),
+(41558),
+(41559),
+(41563),
+(41564),
+(41565),
+(41567),
+(41568),
+(41571),
+(41578),
+(41579),
+(41580),
+(41581),
+(41586),
+(41588),
+(41592),
+(41596),
+(41597),
+(41598),
+(41601),
+(41621),
+(41622),
+(41625),
+(41626),
+(41633),
+(41637),
+(41911),
+(41914),
+(41916),
+(41917),
+(41926),
+(41931),
+(41932),
+(41933),
+(41936),
+(41937),
+(41939),
+(41940),
+(41957),
+(41958),
+(41959),
+(41960),
+(41961),
+(41964),
+(41965),
+(41978),
+(41980),
+(41984),
+(41985),
+(41990),
+(42002),
+(42003),
+(42013),
+(42018),
+(42020),
+(42021),
+(42024),
+(42025),
+(42053),
+(42058),
+(42129),
+(42131),
+(42132),
+(42133),
+(42139),
+(42142),
+(42144),
+(42149),
+(42150),
+(42152),
+(42161),
+(42165),
+(42169),
+(42185),
+(42203),
+(42246),
+(42299),
+(42313),
+(42315),
+(42319),
+(42320),
+(42322),
+(42324),
+(42325),
+(42326),
+(42328),
+(42329),
+(42330),
+(42331),
+(42332),
+(42333),
+(42337),
+(42349),
+(42360),
+(42363),
+(42368),
+(42369),
+(42370),
+(42371),
+(42372),
+(42380),
+(42382),
+(42383),
+(42384),
+(42385),
+(42389),
+(42395),
+(42396),
+(42397),
+(42399),
+(42400),
+(42401),
+(42402),
+(42411),
+(42414),
+(42426),
+(42434),
+(42435),
+(42441),
+(42443),
+(42447),
+(42455),
+(42463),
+(42476),
+(42483),
+(42485),
+(42486),
+(42488),
+(42489),
+(42502),
+(42512),
+(42514),
+(42516),
+(42518),
+(42535),
+(42537),
+(42540),
+(42560),
+(42561),
+(42574),
+(42579),
+(42580),
+(42583),
+(42587),
+(42611),
+(42628),
+(42632),
+(42633),
+(42634),
+(42635),
+(42653),
+(42658),
+(42670),
+(42671),
+(42672),
+(42696),
+(42702),
+(42710),
+(42711),
+(42717),
+(42719),
+(42721),
+(42724),
+(42725),
+(42730),
+(42733),
+(42739),
+(42740),
+(42741),
+(42746),
+(42747),
+(42756),
+(42762),
+(42767),
+(42772),
+(42780),
+(42781),
+(42782),
+(42783),
+(42785),
+(42789),
+(42790),
+(42791),
+(42793),
+(42799),
+(42802),
+(42803),
+(42804),
+(42811),
+(42826),
+(42832),
+(42833),
+(42834),
+(42841),
+(42842),
+(42843),
+(42846),
+(42853),
+(42858),
+(42859),
+(42867),
+(42869),
+(42870),
+(42872),
+(42873),
+(42878),
+(42879),
+(42880),
+(42889),
+(42890),
+(42891),
+(42894),
+(42895),
+(42896),
+(42897),
+(42902),
+(42903),
+(42904),
+(42907),
+(42908),
+(42913),
+(42914),
+(42953),
+(42964),
+(42972),
+(42978),
+(42995),
+(42999),
+(43003),
+(43004),
+(43006),
+(43036),
+(43037),
+(43043),
+(43044),
+(43058),
+(43061),
+(43063),
+(43064),
+(43065),
+(43067),
+(43075),
+(43077),
+(43083),
+(43084),
+(43086),
+(43087),
+(43090),
+(43093),
+(43094),
+(43097),
+(43100),
+(43103),
+(43104),
+(43107),
+(43108),
+(43122),
+(43123),
+(43125),
+(43128),
+(43130),
+(43131),
+(43132),
+(43133),
+(43137),
+(43138),
+(43140),
+(43150),
+(43151),
+(43153),
+(43156),
+(43157),
+(43159),
+(43178),
+(43187),
+(43191),
+(43192),
+(43193),
+(43194),
+(43195),
+(43196),
+(43197),
+(43198),
+(43199),
+(43202),
+(43205),
+(43206),
+(43225),
+(43228),
+(43235),
+(43243),
+(43245),
+(43246),
+(43256),
+(43259),
+(43260),
+(43261),
+(43262),
+(43267),
+(43268),
+(43270),
+(43273),
+(43286),
+(43287),
+(43288),
+(43292),
+(43297),
+(43298),
+(43299),
+(43300),
+(43301),
+(43303),
+(43305),
+(43309),
+(43315),
+(43325),
+(43330),
+(43334),
+(43337),
+(43340),
+(43341),
+(43345),
+(43346),
+(43347),
+(43348),
+(43352),
+(43353),
+(43354),
+(43356),
+(43357),
+(43358),
+(43359),
+(43361),
+(43362),
+(43364),
+(43365),
+(43368),
+(43370),
+(43379),
+(43380),
+(43381),
+(43384),
+(43393),
+(43398),
+(43399),
+(43409),
+(43410),
+(43411),
+(43413),
+(43415),
+(43416),
+(43417),
+(43419),
+(43427),
+(43428),
+(43433),
+(43435),
+(43439),
+(43441),
+(43445),
+(43451),
+(43456),
+(43461),
+(43469),
+(43470),
+(43471),
+(43472),
+(43473),
+(43474),
+(43475),
+(43477),
+(43483),
+(43484),
+(43488),
+(43489),
+(43492),
+(43495),
+(43496),
+(43497),
+(43501),
+(43505),
+(43507),
+(43511),
+(43512),
+(43515),
+(43516),
+(43517),
+(43518),
+(43519),
+(43520),
+(43522),
+(43523),
+(43524),
+(43525),
+(43526),
+(43528),
+(43529),
+(43532),
+(43535),
+(43543),
+(43545),
+(43553),
+(43556),
+(43560),
+(43564),
+(43565),
+(43567),
+(43569),
+(43571),
+(43572),
+(43574),
+(43575),
+(43577),
+(43578),
+(43579),
+(43581),
+(43584),
+(43585),
+(43586),
+(43591),
+(43592),
+(43593),
+(43612),
+(43613),
+(43619),
+(43621),
+(43622),
+(43644),
+(43646),
+(43648),
+(43649),
+(43650),
+(43651),
+(43660),
+(43661),
+(43663),
+(43665),
+(43666),
+(43667),
+(43671),
+(43673),
+(43680),
+(43682),
+(43683),
+(43684),
+(43690),
+(43693),
+(43695),
+(43701),
+(43709),
+(43714),
+(43715),
+(43720),
+(43726),
+(43727),
+(43728),
+(43729),
+(43732),
+(43746),
+(43767),
+(43769),
+(43785),
+(43786),
+(43789),
+(43794),
+(43795),
+(43799),
+(43804),
+(43807),
+(43809),
+(43821),
+(43834),
+(43869),
+(43895),
+(43903),
+(43906),
+(43923),
+(43928),
+(43931),
+(43932),
+(43933),
+(43937),
+(43941),
+(43948),
+(43951),
+(43952),
+(43969),
+(43971),
+(43974),
+(43976),
+(43984),
+(43988),
+(43993),
+(43996),
+(43997),
+(44000),
+(44005),
+(44008),
+(44015),
+(44016),
+(44030),
+(44031),
+(44038),
+(44053),
+(44078),
+(44079),
+(44081),
+(44082),
+(44089),
+(44093),
+(44095),
+(44120),
+(44121),
+(44126),
+(44127),
+(44137),
+(44138),
+(44139),
+(44141),
+(44142),
+(44144),
+(44148),
+(44149),
+(44152),
+(44156),
+(44159),
+(44164),
+(44165),
+(44168),
+(44169),
+(44170),
+(44171),
+(44173),
+(44174),
+(44176),
+(44181),
+(44185),
+(44188),
+(44189),
+(44202),
+(44211),
+(44212),
+(44216),
+(44219),
+(44220),
+(44221),
+(44222),
+(44223),
+(44237),
+(44241),
+(44242),
+(44247),
+(44248),
+(44256),
+(44258),
+(44262),
+(44267),
+(44268),
+(44271),
+(44274),
+(44280),
+(44285),
+(44286),
+(44289),
+(44294),
+(44304),
+(44308),
+(44310),
+(44318),
+(44319),
+(44323),
+(44325),
+(44327),
+(44328),
+(44332),
+(44339),
+(44351),
+(44357),
+(44358),
+(44361),
+(44364),
+(44368),
+(44370),
+(44382),
+(44407),
+(44408),
+(44415),
+(44424),
+(44425),
+(44429),
+(44430),
+(44454),
+(44455),
+(44457),
+(44464),
+(44473),
+(44477),
+(44478),
+(44479),
+(44481),
+(44482),
+(44503),
+(44504),
+(44512),
+(44518),
+(44519),
+(44525),
+(44530),
+(44532),
+(44533),
+(44534),
+(44536),
+(44541),
+(44542),
+(44547),
+(44553),
+(44563),
+(44564),
+(44572),
+(44577),
+(44583),
+(44586),
+(44600),
+(44602),
+(44606),
+(44614),
+(44617),
+(44618),
+(44619),
+(44620),
+(44622),
+(44639),
+(44640),
+(44641),
+(44642),
+(44654),
+(44657),
+(44658),
+(44685),
+(44732),
+(44753),
+(44755),
+(44765),
+(44780),
+(44781),
+(44787),
+(44788),
+(44789),
+(44790),
+(44791),
+(44796),
+(44808),
+(44811),
+(44812),
+(44813),
+(44817),
+(44818),
+(44823),
+(44843),
+(44848),
+(44868),
+(44871),
+(44872),
+(44876),
+(44881),
+(44934),
+(44937),
+(44945),
+(44956),
+(44957),
+(44961),
+(44966),
+(44985),
+(44997),
+(45012),
+(45017),
+(45023),
+(45026),
+(45029),
+(45031),
+(45036),
+(45055),
+(45064),
+(45071),
+(45075),
+(45088),
+(45089),
+(45090),
+(45096),
+(45101),
+(45102),
+(45105),
+(45108),
+(45110),
+(45113),
+(45123),
+(45124),
+(45129),
+(45130),
+(45133),
+(45134),
+(45141),
+(45145),
+(45185),
+(45189),
+(45192),
+(45195),
+(45197),
+(45199),
+(45200),
+(45204),
+(45205),
+(45206),
+(45209),
+(45214),
+(45215),
+(45221),
+(45228),
+(45235),
+(45251),
+(45256),
+(45269),
+(45271),
+(45274),
+(45276),
+(45280),
+(45284),
+(45286),
+(45287),
+(45288),
+(45289),
+(45290),
+(45291),
+(45292),
+(45293),
+(45294),
+(45295),
+(45296),
+(45297),
+(45298),
+(45299),
+(45300),
+(45301),
+(45302),
+(45314),
+(45321),
+(45324),
+(45327),
+(45328),
+(45334),
+(45337),
+(45344),
+(45350),
+(45352),
+(45353),
+(45356),
+(45362),
+(45409),
+(45417),
+(45419),
+(45420),
+(45421),
+(45425),
+(45428),
+(45429),
+(45430),
+(45442),
+(45444),
+(45447),
+(45456),
+(45458),
+(45462),
+(45463),
+(45468),
+(45469),
+(45472),
+(45476),
+(45477),
+(45485),
+(45487),
+(45491),
+(45493),
+(45497),
+(45504),
+(45505),
+(45507),
+(45509),
+(45511),
+(45516),
+(45524),
+(45534),
+(45537),
+(45543),
+(45544),
+(45573),
+(45576),
+(45577),
+(45578),
+(45580),
+(45587),
+(45588),
+(45589),
+(45590),
+(45600),
+(45603),
+(45604),
+(45611),
+(45625),
+(45627),
+(45628),
+(45629),
+(45632),
+(45639),
+(45645),
+(45646),
+(45647),
+(45648),
+(45649),
+(45650),
+(45659),
+(45660),
+(45661),
+(45664),
+(45693),
+(45696),
+(45716),
+(45717),
+(45719),
+(45724),
+(45725),
+(45730),
+(45739),
+(45742),
+(45744),
+(45748),
+(45773),
+(45777),
+(45778),
+(45798),
+(45799),
+(45800),
+(45803),
+(45804),
+(45815),
+(45820),
+(45833),
+(45837),
+(45854),
+(45866),
+(45873),
+(45874),
+(45875),
+(45889),
+(45897),
+(45898),
+(45899),
+(45900),
+(45902),
+(45906),
+(45913),
+(45919),
+(45924),
+(45926),
+(45931),
+(45940),
+(45943),
+(45946),
+(45947),
+(45964),
+(45967),
+(45975),
+(45980),
+(45981),
+(45983),
+(45989),
+(45992),
+(46010),
+(46012),
+(46014),
+(46015),
+(46016),
+(46023),
+(46027),
+(46028),
+(46029),
+(46031),
+(46032),
+(46033),
+(46035),
+(46042),
+(46043),
+(46044),
+(46045),
+(46047),
+(46049),
+(46057),
+(46062),
+(46065),
+(46067),
+(46070),
+(46074),
+(46080),
+(46081),
+(46083),
+(46084),
+(46092),
+(46093),
+(46098),
+(46099),
+(46101),
+(46104),
+(46119),
+(46145),
+(46152),
+(46153),
+(46155),
+(46161),
+(46164),
+(46166),
+(46167),
+(46180),
+(46181),
+(46182),
+(46183),
+(46187),
+(46188),
+(46189),
+(46190),
+(46191),
+(46192),
+(46194),
+(46198),
+(46200),
+(46202),
+(46206),
+(46221),
+(46231),
+(46232),
+(46239),
+(46260),
+(46266),
+(46276),
+(46279),
+(46280),
+(46283),
+(46285),
+(46288),
+(46291),
+(46292),
+(46305),
+(46315),
+(46323),
+(46331),
+(46333),
+(46341),
+(46357),
+(46361),
+(46362),
+(46364),
+(46365),
+(46366),
+(46368),
+(46380),
+(46381),
+(46394),
+(46406),
+(46411),
+(46420),
+(46421),
+(46422),
+(46429),
+(46430),
+(46432),
+(46433),
+(46434),
+(46440),
+(46443),
+(46444),
+(46447),
+(46448),
+(46449),
+(46459),
+(46460),
+(46466),
+(46468),
+(46469),
+(46479),
+(46480),
+(46481),
+(46483),
+(46485),
+(46486),
+(46487),
+(46543),
+(46550),
+(46556),
+(46557),
+(46558),
+(46559),
+(46560),
+(46561),
+(46562),
+(46563),
+(46566),
+(46567),
+(46568),
+(46572),
+(46579),
+(46580),
+(46582),
+(46587),
+(46590),
+(46591),
+(46595),
+(46598),
+(46602),
+(46607),
+(46611),
+(46612),
+(46613),
+(46614),
+(46615),
+(46616),
+(46617),
+(46618),
+(46620),
+(46621),
+(46624),
+(46629),
+(46630),
+(46641),
+(46642),
+(46651),
+(46654),
+(46661),
+(46664),
+(46665),
+(46667),
+(46671),
+(46672),
+(46673),
+(46674),
+(46677),
+(46681),
+(46686),
+(46691),
+(46693),
+(46696),
+(46702),
+(46704),
+(46709),
+(46711),
+(46716),
+(46717),
+(46718),
+(46719),
+(46720),
+(46721),
+(46722),
+(46723),
+(46724),
+(46725),
+(46726),
+(46727),
+(46728),
+(46729),
+(46730),
+(46731),
+(46734),
+(46745),
+(46762),
+(46764),
+(46770),
+(46772),
+(46773),
+(46787),
+(46791),
+(46801),
+(46813),
+(46816),
+(46824),
+(46825),
+(46826),
+(46841),
+(46845),
+(46846),
+(46856),
+(46857),
+(46877),
+(46879),
+(46880),
+(46887),
+(46906),
+(46956),
+(46960),
+(46962),
+(46978),
+(46982),
+(46983),
+(46987),
+(46988),
+(46990),
+(47001),
+(47003),
+(47009),
+(47011),
+(47012),
+(47014),
+(47020),
+(47021),
+(47028),
+(47029),
+(47033),
+(47034),
+(47042),
+(47043),
+(47057),
+(47059),
+(47062),
+(47063),
+(47064),
+(47066),
+(47068),
+(47069),
+(47070),
+(47071),
+(47072),
+(47074),
+(47076),
+(47077),
+(47079),
+(47081),
+(47084),
+(47093),
+(47096),
+(47098),
+(47107),
+(47117),
+(47122),
+(47139),
+(47143),
+(47144),
+(47145),
+(47146),
+(47148),
+(47149),
+(47151),
+(47152),
+(47153),
+(47155),
+(47156),
+(47157),
+(47158),
+(47160),
+(47161),
+(47162),
+(47163),
+(47164),
+(47165),
+(47166),
+(47168),
+(47171),
+(47173),
+(47176),
+(47206),
+(47208),
+(47219),
+(47244),
+(47248),
+(47249),
+(47257),
+(47272),
+(47277),
+(47282),
+(47293),
+(47299),
+(47305),
+(47307),
+(47308),
+(47316),
+(47321),
+(47322),
+(47323),
+(47326),
+(47333),
+(47334),
+(47337),
+(47338),
+(47339),
+(47340),
+(47345),
+(47380),
+(47382),
+(47390),
+(47392),
+(47394),
+(47403),
+(47405),
+(47410),
+(47413),
+(47414),
+(47422),
+(47424),
+(47431),
+(47432),
+(47442),
+(47447),
+(47449),
+(47450),
+(47451),
+(47453),
+(47465),
+(47467),
+(47468),
+(47470),
+(47471),
+(47472),
+(47474),
+(47475),
+(47476),
+(47480),
+(47481),
+(47482),
+(47485),
+(47486),
+(47487),
+(47488),
+(47489),
+(47497),
+(47498),
+(47504),
+(47516),
+(47517),
+(47519),
+(47520),
+(47528),
+(47530),
+(47534),
+(47540),
+(47541),
+(47550),
+(47575),
+(47601),
+(47604),
+(47610),
+(47611),
+(47614),
+(47629),
+(47632),
+(47633),
+(47635),
+(47637),
+(47664),
+(47665),
+(47673),
+(47674),
+(47676),
+(47679),
+(47689),
+(47695),
+(47697),
+(47698),
+(47700),
+(47702),
+(47703),
+(47718),
+(47721),
+(47722),
+(47723),
+(47724),
+(47729),
+(47739),
+(47740),
+(47741),
+(47744),
+(47749),
+(47751),
+(47753),
+(47757),
+(47758),
+(47761),
+(47767),
+(47768),
+(47777),
+(47778),
+(47780),
+(47781),
+(47782),
+(47783),
+(47785),
+(47788),
+(47808),
+(47809),
+(47810),
+(47811),
+(47812),
+(47813),
+(47814),
+(47815),
+(47824),
+(47825),
+(47826),
+(47827),
+(47835),
+(47836),
+(47837),
+(47838),
+(47841),
+(47843),
+(47848),
+(47850),
+(47851),
+(47852),
+(47853),
+(47855),
+(47857),
+(47859),
+(47860),
+(47863),
+(47864),
+(47865),
+(47867),
+(47902),
+(47914),
+(47917),
+(47920),
+(47926),
+(47928),
+(47930),
+(47938),
+(47948),
+(47960),
+(47961),
+(47962),
+(47964),
+(47968),
+(47976),
+(47984),
+(47991),
+(47992),
+(47993),
+(47994),
+(47995),
+(47996),
+(48011),
+(48013),
+(48039),
+(48045),
+(48046),
+(48047),
+(48048),
+(48053),
+(48060),
+(48062),
+(48063),
+(48065),
+(48066),
+(48067),
+(48068),
+(48070),
+(48071),
+(48072),
+(48073),
+(48084),
+(48085),
+(48098),
+(48099),
+(48100),
+(48101),
+(48102),
+(48103),
+(48104),
+(48105),
+(48119),
+(48120),
+(48122),
+(48123),
+(48124),
+(48125),
+(48126),
+(48127),
+(48130),
+(48132),
+(48133),
+(48134),
+(48135),
+(48137),
+(48140),
+(48147),
+(48155),
+(48156),
+(48157),
+(48158),
+(48159),
+(48160),
+(48161),
+(48163),
+(48164),
+(48165),
+(48169),
+(48181),
+(48184),
+(48187),
+(48192),
+(48208),
+(48210),
+(48232),
+(48245),
+(48249),
+(48250),
+(48261),
+(48262),
+(48264),
+(48267),
+(48268),
+(48282),
+(48283),
+(48285),
+(48286),
+(48287),
+(48288),
+(48290),
+(48291),
+(48292),
+(48296),
+(48298),
+(48299),
+(48300),
+(48301),
+(48307),
+(48309),
+(48310),
+(48316),
+(48330),
+(48334),
+(48360),
+(48365),
+(48374),
+(48376),
+(48377),
+(48378),
+(48400),
+(48417),
+(48423),
+(48424),
+(48440),
+(48441),
+(48442),
+(48443),
+(48450),
+(48451),
+(48459),
+(48461),
+(48462),
+(48463),
+(48464),
+(48465),
+(48468),
+(48469),
+(48479),
+(48480),
+(48489),
+(48490),
+(48491),
+(48504),
+(48532),
+(48533),
+(48540),
+(48541),
+(48542),
+(48543),
+(48548),
+(48549),
+(48563),
+(48564),
+(48565),
+(48566),
+(48567),
+(48568),
+(48569),
+(48570),
+(48571),
+(48572),
+(48573),
+(48574),
+(48575),
+(48576),
+(48577),
+(48578),
+(48579),
+(48583),
+(48585),
+(48598),
+(48599),
+(48601),
+(48603),
+(48606),
+(48617),
+(48622),
+(48628),
+(48637),
+(48638),
+(48639),
+(48640),
+(48648),
+(48652),
+(48656),
+(48657),
+(48658),
+(48659),
+(48660),
+(48661),
+(48662),
+(48663),
+(48664),
+(48665),
+(48666),
+(48667),
+(48668),
+(48669),
+(48671),
+(48672),
+(48673),
+(48674),
+(48675),
+(48676),
+(48678),
+(48679),
+(48680),
+(48689),
+(48690),
+(48691),
+(48693),
+(48696),
+(48697),
+(48698),
+(48699),
+(48700),
+(48712),
+(48714),
+(48737),
+(48738),
+(48746),
+(48747),
+(48749),
+(48750),
+(48752),
+(48753),
+(48754),
+(48755),
+(48756),
+(48759),
+(48760),
+(48765),
+(48770),
+(48772),
+(48774),
+(48775),
+(48781),
+(48782),
+(48784),
+(48785),
+(48788),
+(48800),
+(48801),
+(48802),
+(48805),
+(48806),
+(48812),
+(48813),
+(48815),
+(48820),
+(48821),
+(48822),
+(48823),
+(48824),
+(48825),
+(48826),
+(48827),
+(48828),
+(48829),
+(48830),
+(48831),
+(48832),
+(48845),
+(48850),
+(48851),
+(48852),
+(48854),
+(48862),
+(48871),
+(48872),
+(48873),
+(48876),
+(48877),
+(48878),
+(48880),
+(48881),
+(48883),
+(48895),
+(48917),
+(48920),
+(48931),
+(48932),
+(48935),
+(48936),
+(48953),
+(48960),
+(48974),
+(48981),
+(48984),
+(48995),
+(48996),
+(48998),
+(48999),
+(49000),
+(49001),
+(49005),
+(49009),
+(49010),
+(49011),
+(49012),
+(49020),
+(49021),
+(49026),
+(49028),
+(49029),
+(49037),
+(49044),
+(49045),
+(49047),
+(49048),
+(49049),
+(49050),
+(49051),
+(49052),
+(49053),
+(49054),
+(49078),
+(49084),
+(49089),
+(49090),
+(49091),
+(49092),
+(49093),
+(49099),
+(49106),
+(49110),
+(49111),
+(49113),
+(49119),
+(49124),
+(49125),
+(49127),
+(49138),
+(49143),
+(49158),
+(49161),
+(49165),
+(49177),
+(49184),
+(49204),
+(49206),
+(49213),
+(49215),
+(49230),
+(49231),
+(49232),
+(49233),
+(49235),
+(49236),
+(49237),
+(49238),
+(49239),
+(49240),
+(49242),
+(49243),
+(49256),
+(49257),
+(49266),
+(49267),
+(49268),
+(49269),
+(49270),
+(49271),
+(49272),
+(49273),
+(49275),
+(49276),
+(49278),
+(49279),
+(49282),
+(49283),
+(49284),
+(49288),
+(49294),
+(49296),
+(49298),
+(49305),
+(49309),
+(49312),
+(49317),
+(49323),
+(49324),
+(49348),
+(49349),
+(49353),
+(49354),
+(49362),
+(49363),
+(49364),
+(49372),
+(49376),
+(49381),
+(49383),
+(49387),
+(49404),
+(49406),
+(49418),
+(49427),
+(49429),
+(49433),
+(49439),
+(49446),
+(49453),
+(49454),
+(49459),
+(49463),
+(49466),
+(49481),
+(49482),
+(49485),
+(49500),
+(49501),
+(49511),
+(49512),
+(49527),
+(49537),
+(49544),
+(49546),
+(49547),
+(49549),
+(49560),
+(49576),
+(49584),
+(49587),
+(49592),
+(49613),
+(49616),
+(49617),
+(49624),
+(49637),
+(49639),
+(49641),
+(49644),
+(49675),
+(49678),
+(49680),
+(49681),
+(49686),
+(49690),
+(49696),
+(49704),
+(49705),
+(49706),
+(49708),
+(49710),
+(49711),
+(49712),
+(49715),
+(49718),
+(49719),
+(49720),
+(49723),
+(49729),
+(49734),
+(49742),
+(49747),
+(49749),
+(49753),
+(49755),
+(49758),
+(49759),
+(49771),
+(49776),
+(49797),
+(49799),
+(49800),
+(49802),
+(49803),
+(49804),
+(49805),
+(49806),
+(49830),
+(49836),
+(49840),
+(49841),
+(49843),
+(49846),
+(49848),
+(49859),
+(49861),
+(49863),
+(49865),
+(49891),
+(49892),
+(49893),
+(49894),
+(49895),
+(49896),
+(49897),
+(49903),
+(49904),
+(49906),
+(49909),
+(49913),
+(49914),
+(49915),
+(49916),
+(49917),
+(49918),
+(49919),
+(49920),
+(49921),
+(49922),
+(49923),
+(49924),
+(49926),
+(49927),
+(49928),
+(49929),
+(49930),
+(49935),
+(49942),
+(49945),
+(49956),
+(49961),
+(49965),
+(49966),
+(49967),
+(49968),
+(49969),
+(49970),
+(49971),
+(49972),
+(49973),
+(49974),
+(49975),
+(49978),
+(49980),
+(49981),
+(49985),
+(49986),
+(49987),
+(49989),
+(49991),
+(49993),
+(49994),
+(49995),
+(49996),
+(49997),
+(49998),
+(49999),
+(50004),
+(50006),
+(50015),
+(50021),
+(50027),
+(50028),
+(50035),
+(50038),
+(50046),
+(50047),
+(50050),
+(50052),
+(50064),
+(50066),
+(50073),
+(50075),
+(50084),
+(50086),
+(50089),
+(50090),
+(50091),
+(50092),
+(50094),
+(50100),
+(50101),
+(50102),
+(50104),
+(50135),
+(50144),
+(50145),
+(50146),
+(50156),
+(50165),
+(50169),
+(50183),
+(50184),
+(50185),
+(50188),
+(50196),
+(50198),
+(50205),
+(50206),
+(50207),
+(50217),
+(50231),
+(50232),
+(50234),
+(50245),
+(50251),
+(50252),
+(50255),
+(50256),
+(50257),
+(50259),
+(50265),
+(50271),
+(50273),
+(50276),
+(50282),
+(50287),
+(50288),
+(50289),
+(50290),
+(50291),
+(50293),
+(50295),
+(50299),
+(50301),
+(50303),
+(50305),
+(50306),
+(50307),
+(50319),
+(50323),
+(50328),
+(50335),
+(50341),
+(50343),
+(50344),
+(50347),
+(50349),
+(50356),
+(50361),
+(50370),
+(50375),
+(50377),
+(50378),
+(50379),
+(50380),
+(50400),
+(50401),
+(50402),
+(50403),
+(50405),
+(50406),
+(50410),
+(50411),
+(50412),
+(50424),
+(50431),
+(50432),
+(50434),
+(50435),
+(50436),
+(50437),
+(50439),
+(50445),
+(50454),
+(50455),
+(50456),
+(50459),
+(50462),
+(50463),
+(50464),
+(50477),
+(50478),
+(50479),
+(50484),
+(50498),
+(50499),
+(50500),
+(50504),
+(50508),
+(50509),
+(50510),
+(50511),
+(50512),
+(50517),
+(50518),
+(50519),
+(50521),
+(50523),
+(50533),
+(50534),
+(50536),
+(50537),
+(50538),
+(50541),
+(50545),
+(50550),
+(50559),
+(50566),
+(50572),
+(50573),
+(50578),
+(50581),
+(50582),
+(50588),
+(50597),
+(50629),
+(50631),
+(50633),
+(50634),
+(50635),
+(50638),
+(50655),
+(50658),
+(50659),
+(50660),
+(50661),
+(50662),
+(50663),
+(50666),
+(50668),
+(50673),
+(50675),
+(50679),
+(50688),
+(50691),
+(50693),
+(50701),
+(50704),
+(50705),
+(50706),
+(50721),
+(50725),
+(50729),
+(50731),
+(50732),
+(50733),
+(50737),
+(50739),
+(50740),
+(50744),
+(50761),
+(50770),
+(50773),
+(50782),
+(50783),
+(50796),
+(50797),
+(50799),
+(50804),
+(50818),
+(50820),
+(50821),
+(50830),
+(50832),
+(50834),
+(50842),
+(50843),
+(50844),
+(50845),
+(50846),
+(50853),
+(50854),
+(50859),
+(50861),
+(50874),
+(50876),
+(50894),
+(50895),
+(50900),
+(50905),
+(50907),
+(50914),
+(50918),
+(50919),
+(50923),
+(50924),
+(50926),
+(50927),
+(50978),
+(50979),
+(50992),
+(50997),
+(51011),
+(51015),
+(51016),
+(51018),
+(51020),
+(51026),
+(51035),
+(51037),
+(51046),
+(51054),
+(51055),
+(51057),
+(51059),
+(51062),
+(51064),
+(51067),
+(51069),
+(51072),
+(51077),
+(51079),
+(51081),
+(51083),
+(51085),
+(51087),
+(51089),
+(51091),
+(51093),
+(51095),
+(51097),
+(51100),
+(51102),
+(51105),
+(51107),
+(51111),
+(51120),
+(51121),
+(51131),
+(51134),
+(51135),
+(51137),
+(51154),
+(51156),
+(51157),
+(51165),
+(51187),
+(51196),
+(51197),
+(51198),
+(51199),
+(51200),
+(51203),
+(51216),
+(51220),
+(51221),
+(51226),
+(51227),
+(51228),
+(51229),
+(51232),
+(51233),
+(51235),
+(51236),
+(51240),
+(51243),
+(51258),
+(51259),
+(51270),
+(51272),
+(51275),
+(51279),
+(51285),
+(51287),
+(51290),
+(51292),
+(51298),
+(51305),
+(51308),
+(51310),
+(51315),
+(51316),
+(51325),
+(51326),
+(51327),
+(51328),
+(51330),
+(51334),
+(51339),
+(51340),
+(51354),
+(51356),
+(51363),
+(51365),
+(51372),
+(51382),
+(51399),
+(51409),
+(51410),
+(51411),
+(51413),
+(51416),
+(51417),
+(51418),
+(51419),
+(51423),
+(51424),
+(51425),
+(51426),
+(51427),
+(51428),
+(51429),
+(51430),
+(51431),
+(51432),
+(51440),
+(51442),
+(51446),
+(51447),
+(51454),
+(51460),
+(51467),
+(51484),
+(51489),
+(51491),
+(51492),
+(51495),
+(51496),
+(51500),
+(51502),
+(51503),
+(51504),
+(51505),
+(51506),
+(51509),
+(51514),
+(51515),
+(51573),
+(51580),
+(51584),
+(51585),
+(51586),
+(51587),
+(51588),
+(51591),
+(51592),
+(51593),
+(51596),
+(51598),
+(51601),
+(51608),
+(51609),
+(51610),
+(51613),
+(51614),
+(51618),
+(51656),
+(51657),
+(51658),
+(51659),
+(51662),
+(51675),
+(51676),
+(51677),
+(51680),
+(51693),
+(51695),
+(51699),
+(51714),
+(51718),
+(51722),
+(51724),
+(51726),
+(51728),
+(51732),
+(51734),
+(51735),
+(51736),
+(51740),
+(51751),
+(51756),
+(51757),
+(51772),
+(51775),
+(51776),
+(51778),
+(51779),
+(51786),
+(51787),
+(51797),
+(51798),
+(51799),
+(51803),
+(51804),
+(51808),
+(51809),
+(51811),
+(51818),
+(51827),
+(51830),
+(51842),
+(51844),
+(51853),
+(51854),
+(51855),
+(51856),
+(51857),
+(51863),
+(51864),
+(51872),
+(51875),
+(51876),
+(51877),
+(51878),
+(51879),
+(51886),
+(51888),
+(51889),
+(51893),
+(51894),
+(51895),
+(51897),
+(51898),
+(51899),
+(51901),
+(51909),
+(51912),
+(51917),
+(51918),
+(51919),
+(51920),
+(51926),
+(51934),
+(51935),
+(51936),
+(51937),
+(51940),
+(51945),
+(51949),
+(51951),
+(51961),
+(51962),
+(51963),
+(51968),
+(51973),
+(51976),
+(51979),
+(51981),
+(51989),
+(51990),
+(51997),
+(51998),
+(51999),
+(52000),
+(52004),
+(52005),
+(52007),
+(52008),
+(52014),
+(52025),
+(52026),
+(52030),
+(52032),
+(52042),
+(52043),
+(52045),
+(52053),
+(52069),
+(52078),
+(52082),
+(52083),
+(52086),
+(52088),
+(52090),
+(52108),
+(52125),
+(52139),
+(52149),
+(52157),
+(52160),
+(52163),
+(52167),
+(52169),
+(52171),
+(52187),
+(52194),
+(52196),
+(52198),
+(52199),
+(52206),
+(52207),
+(52209),
+(52210),
+(52212),
+(52217),
+(52219),
+(52221),
+(52223),
+(52224),
+(52228),
+(52229),
+(52230),
+(52251),
+(52252),
+(52253),
+(52256),
+(52261),
+(52263),
+(52265),
+(52267),
+(52270),
+(52280),
+(52282),
+(52292),
+(52307),
+(52312),
+(52318),
+(52327),
+(52328),
+(52334),
+(52345),
+(52346),
+(52352),
+(52353),
+(52355),
+(52356),
+(52359),
+(52360),
+(52361),
+(52364),
+(52372),
+(52373),
+(52374),
+(52375),
+(52383),
+(52389),
+(52391),
+(52401),
+(52402),
+(52415),
+(52425),
+(52428),
+(52430),
+(52431),
+(52433),
+(52444),
+(52445),
+(52447),
+(52460),
+(52463),
+(52465),
+(52466),
+(52468),
+(52469),
+(52471),
+(52472),
+(52473),
+(52474),
+(52475),
+(52476),
+(52486),
+(52487),
+(52496),
+(52498),
+(52499),
+(52501),
+(52502),
+(52504),
+(52506),
+(52511),
+(52515),
+(52519),
+(52521),
+(52522),
+(52527),
+(52532),
+(52534),
+(52536),
+(52537),
+(52538),
+(52540),
+(52542),
+(52544),
+(52545),
+(52546),
+(52547),
+(52548),
+(52549),
+(52554),
+(52566),
+(52577),
+(52581),
+(52583),
+(52586),
+(52587),
+(52591),
+(52594),
+(52595),
+(52596),
+(52600),
+(52601),
+(52604),
+(52608),
+(52609),
+(52610),
+(52613),
+(52620),
+(52631),
+(52633),
+(52643),
+(52644),
+(52655),
+(52657),
+(52658),
+(52660),
+(52672),
+(52675),
+(52680),
+(52684),
+(52695),
+(52696),
+(52699),
+(52700),
+(52702),
+(52705),
+(52708),
+(52709),
+(52711),
+(52713),
+(52715),
+(52718),
+(52719),
+(52721),
+(52722),
+(52737),
+(52740),
+(52741),
+(52743),
+(52751),
+(52752),
+(52754),
+(52755),
+(52758),
+(52761),
+(52762),
+(52764),
+(52771),
+(52772),
+(52773),
+(52778),
+(52781),
+(52782),
+(52784),
+(52789),
+(52794),
+(52806),
+(52807),
+(52813),
+(52814),
+(52818),
+(52825),
+(52835),
+(52839),
+(52851),
+(52856),
+(52859),
+(52862),
+(52863),
+(52864),
+(52871),
+(52872),
+(52873),
+(52883),
+(52885),
+(52889),
+(52890),
+(52904),
+(52905),
+(52909),
+(52921),
+(52926),
+(52931),
+(52932),
+(52939),
+(52943),
+(52986),
+(52987),
+(52988),
+(52992),
+(52994),
+(52996),
+(53001),
+(53002),
+(53003),
+(53005),
+(53006),
+(53007),
+(53019),
+(53023),
+(53027),
+(53031),
+(53033),
+(53043),
+(53044),
+(53045),
+(53051),
+(53058),
+(53059),
+(53060),
+(53062),
+(53068),
+(53069),
+(53070),
+(53072),
+(53073),
+(53085),
+(53086),
+(53087),
+(53088),
+(53089),
+(53094),
+(53098),
+(53099),
+(53100),
+(53101),
+(53102),
+(53108),
+(53109),
+(53111),
+(53116),
+(53141),
+(53145),
+(53148),
+(53150),
+(53153),
+(53158),
+(53174),
+(53191),
+(53193),
+(53194),
+(53195),
+(53208),
+(53209),
+(53214),
+(53254),
+(53271),
+(53288),
+(53289),
+(53301),
+(53307),
+(53308),
+(53310),
+(53311),
+(53313),
+(53314),
+(53317),
+(53318),
+(53322),
+(53326),
+(53327),
+(53329),
+(53330),
+(53332),
+(53333),
+(53335),
+(53338),
+(53339),
+(53340),
+(53346),
+(53351),
+(53352),
+(53353),
+(53357),
+(53359),
+(53364),
+(53366),
+(53372),
+(53388),
+(53394),
+(53395),
+(53396),
+(53402),
+(53404),
+(53407),
+(53408),
+(53418),
+(53422),
+(53424),
+(53425),
+(53431),
+(53435),
+(53437),
+(53438),
+(53442),
+(53449),
+(53460),
+(53477),
+(53480),
+(53492),
+(53493),
+(53498),
+(53499),
+(53508),
+(53509),
+(53526),
+(53528),
+(53529),
+(53532),
+(53533),
+(53534),
+(53536),
+(53537),
+(53538),
+(53540),
+(53542),
+(53543),
+(53544),
+(53545),
+(53546),
+(53547),
+(53548),
+(53549),
+(53550),
+(53558),
+(53559),
+(53560),
+(53561),
+(53562),
+(53564),
+(53565),
+(53566),
+(53567),
+(53568),
+(53571),
+(53572),
+(53573),
+(53574),
+(53575),
+(53578),
+(53579),
+(53580),
+(53581),
+(53582),
+(53584),
+(53586),
+(53587),
+(53588),
+(53589),
+(53595),
+(53600),
+(53601),
+(53617),
+(53618),
+(53625),
+(53629),
+(53631),
+(53633),
+(53638),
+(53639),
+(53652),
+(53653),
+(53654),
+(53659),
+(53669),
+(53697),
+(53704),
+(53719),
+(53726),
+(53733),
+(53739),
+(53742),
+(53769),
+(53772),
+(53786),
+(53788),
+(53799),
+(53807),
+(53809),
+(53810),
+(53815),
+(53821),
+(53824),
+(54016),
+(54028),
+(54029),
+(54035),
+(54039),
+(54042),
+(54049),
+(54050),
+(54051),
+(54052),
+(54053),
+(54060),
+(54063),
+(54068),
+(54070),
+(54071),
+(54074),
+(54075),
+(54076),
+(54077),
+(54078),
+(54079),
+(54080),
+(54092),
+(54094),
+(54095),
+(54096),
+(54113),
+(54121),
+(54126),
+(54129),
+(54132),
+(54135),
+(54158),
+(54169),
+(54172),
+(54175),
+(54183),
+(54185),
+(54188),
+(54190),
+(54191),
+(54195),
+(54196),
+(54198),
+(54203),
+(54216),
+(54226),
+(54235),
+(54237),
+(54238),
+(54249),
+(54260),
+(54261),
+(54273),
+(54283),
+(54284),
+(54290),
+(54299),
+(54303),
+(54309),
+(54311),
+(54315),
+(54316),
+(54319),
+(54321),
+(54324),
+(54331),
+(54334),
+(54335),
+(54337),
+(54338),
+(54339),
+(54340),
+(54345),
+(54350),
+(54361),
+(54376),
+(54378),
+(54380),
+(54387),
+(54393),
+(54394),
+(54395),
+(54396),
+(54399),
+(54416),
+(54417),
+(54429),
+(54431),
+(54433),
+(54451),
+(54453),
+(54458),
+(54459),
+(54460),
+(54468),
+(54470),
+(54479),
+(54485),
+(54487),
+(54491),
+(54495),
+(54498),
+(54499),
+(54502),
+(54504),
+(54507),
+(54511),
+(54514),
+(54518),
+(54521),
+(54525),
+(54526),
+(54527),
+(54531),
+(54532),
+(54540),
+(54549),
+(54565),
+(54573),
+(54576),
+(54577),
+(54578),
+(54587),
+(54588),
+(54593),
+(54594),
+(54602),
+(54604),
+(54609),
+(54610),
+(54611),
+(54612),
+(54613),
+(54615),
+(54616),
+(54617),
+(54618),
+(54619),
+(54620),
+(54622),
+(54624),
+(54630),
+(54631),
+(54632),
+(54634),
+(54640),
+(54644),
+(54646),
+(54648),
+(54651),
+(54660),
+(54662),
+(54663),
+(54667),
+(54668),
+(54673),
+(54675),
+(54677),
+(54679),
+(54680),
+(54688),
+(54689),
+(54694),
+(54702),
+(54703),
+(54704),
+(54706),
+(54708),
+(54709),
+(54716),
+(54719),
+(54723),
+(54755),
+(54757),
+(54761),
+(54770),
+(54772),
+(54781),
+(54785),
+(54788),
+(54790),
+(54791),
+(54794),
+(54799),
+(54801),
+(54804),
+(54805),
+(54820),
+(54822),
+(54823),
+(54843),
+(54846),
+(54880),
+(54881),
+(54882),
+(54883),
+(54884),
+(54885),
+(54886),
+(54887),
+(54900),
+(54906),
+(54908),
+(54919),
+(54920),
+(54932),
+(54933),
+(54951),
+(54956),
+(54957),
+(54958),
+(54965),
+(54970),
+(54971),
+(54973),
+(54974),
+(54975),
+(54976),
+(54977),
+(54982),
+(54983),
+(54986),
+(54987),
+(54992),
+(54997),
+(55006),
+(55007),
+(55008),
+(55009),
+(55021),
+(55029),
+(55039),
+(55041),
+(55046),
+(55050),
+(55051),
+(55054),
+(55065),
+(55066),
+(55069),
+(55070),
+(55071),
+(55074),
+(55075),
+(55078),
+(55079),
+(55090),
+(55093),
+(55095),
+(55102),
+(55104),
+(55144),
+(55160),
+(55168),
+(55196),
+(55209),
+(55210),
+(55216),
+(55217),
+(55218),
+(55219),
+(55220),
+(55224),
+(55225),
+(55226),
+(55240),
+(55241),
+(55253),
+(55255),
+(55258),
+(55259),
+(55260),
+(55261),
+(55262),
+(55263),
+(55264),
+(55265),
+(55268),
+(55269),
+(55270),
+(55271),
+(55274),
+(55276),
+(55277),
+(55281),
+(55284),
+(55313),
+(55314),
+(55317),
+(55318),
+(55319),
+(55320),
+(55321),
+(55322),
+(55324),
+(55331),
+(55334),
+(55346),
+(55348),
+(55359),
+(55360),
+(55363),
+(55364),
+(55411),
+(55412),
+(55416),
+(55424),
+(55425),
+(55430),
+(55469),
+(55470),
+(55482),
+(55483),
+(55484),
+(55485),
+(55487),
+(55488),
+(55489),
+(55490),
+(55491),
+(55492),
+(55495),
+(55496),
+(55497),
+(55498),
+(55499),
+(55504),
+(55505),
+(55506),
+(55507),
+(55508),
+(55509),
+(55511),
+(55520),
+(55521),
+(55530),
+(55536),
+(55549),
+(55550),
+(55555),
+(55556),
+(55557),
+(55567),
+(55568),
+(55569),
+(55579),
+(55581),
+(55582),
+(55597),
+(55598),
+(55599),
+(55602),
+(55604),
+(55605),
+(55613),
+(55622),
+(55624),
+(55625),
+(55643),
+(55645),
+(55646),
+(55648),
+(55652),
+(55659),
+(55700),
+(55703),
+(55704),
+(55716),
+(55719),
+(55728),
+(55736),
+(55748),
+(55749),
+(55750),
+(55751),
+(55752),
+(55753),
+(55754),
+(55756),
+(55770),
+(55771),
+(55772),
+(55778),
+(55779),
+(55780),
+(55781),
+(55790),
+(55797),
+(55802),
+(55804),
+(55809),
+(55813),
+(55815),
+(55818),
+(55823),
+(55824),
+(55838),
+(55840),
+(55841),
+(55864),
+(55874),
+(55877),
+(55880),
+(55890),
+(55894),
+(55929),
+(55931),
+(55932),
+(55933),
+(55935),
+(55936),
+(55937),
+(55939),
+(55951),
+(55958),
+(55959),
+(55960),
+(55962),
+(55963),
+(55968),
+(55973),
+(55978),
+(55981),
+(55982),
+(55983),
+(55984),
+(56033),
+(56036),
+(56038),
+(56046),
+(56061),
+(56071),
+(56072),
+(56090),
+(56091),
+(56092),
+(56098),
+(56104),
+(56106),
+(56107),
+(56112),
+(56113),
+(56115),
+(56122),
+(56123),
+(56125),
+(56127),
+(56130),
+(56131),
+(56132),
+(56138),
+(56139),
+(56141),
+(56143),
+(56144),
+(56147),
+(56149),
+(56160),
+(56161),
+(56185),
+(56190),
+(56191),
+(56198),
+(56200),
+(56211),
+(56222),
+(56223),
+(56230),
+(56236),
+(56239),
+(56252),
+(56254),
+(56260),
+(56277),
+(56287),
+(56305),
+(56320),
+(56326),
+(56329),
+(56331),
+(56332),
+(56346),
+(56351),
+(56352),
+(56361),
+(56362),
+(56379),
+(56404),
+(56405),
+(56411),
+(56425),
+(56426),
+(56430),
+(56433),
+(56434),
+(56440),
+(56442),
+(56444),
+(56447),
+(56448),
+(56485),
+(56491),
+(56506),
+(56513),
+(56515),
+(56517),
+(56520),
+(56521),
+(56525),
+(56536),
+(56537),
+(56539),
+(56545),
+(56557),
+(56559),
+(56562),
+(56564),
+(56565),
+(56581),
+(56582),
+(56584),
+(56586),
+(56603),
+(56605),
+(56606),
+(56607),
+(56609),
+(56624),
+(56626),
+(56627),
+(56628),
+(56629),
+(56630),
+(56631),
+(56640),
+(56641),
+(56645),
+(56659),
+(56662),
+(56664),
+(56666),
+(56668),
+(56670),
+(56671),
+(56672),
+(56678),
+(56685),
+(56687),
+(56698),
+(56699),
+(56701),
+(56707),
+(56715),
+(56718),
+(56719),
+(56720),
+(56721),
+(56727),
+(56728),
+(56729),
+(56730),
+(56731),
+(56734),
+(56753),
+(56754),
+(56755),
+(56760),
+(56761),
+(56770),
+(56771),
+(56772),
+(56773),
+(56774),
+(56775),
+(56776),
+(56777),
+(56780),
+(56781),
+(56785),
+(56790),
+(56791),
+(56795),
+(56796),
+(56797),
+(56815),
+(56854),
+(56860),
+(56861),
+(56862),
+(56891),
+(56893),
+(56896),
+(56898),
+(56902),
+(56903),
+(56905),
+(56906),
+(56907),
+(56909),
+(56917),
+(56918),
+(56919),
+(56920),
+(56921),
+(56922),
+(56923),
+(56925),
+(56933),
+(56937),
+(56938),
+(56939),
+(56940),
+(56966),
+(56969),
+(57049),
+(57050),
+(57052),
+(57053),
+(57058),
+(57062),
+(57063),
+(57089),
+(57090),
+(57094),
+(57095),
+(57108),
+(57118),
+(57143),
+(57292),
+(57305),
+(57323),
+(57337),
+(57346),
+(57347),
+(57369),
+(57374),
+(57376),
+(57380),
+(57384),
+(57386),
+(57388),
+(57389),
+(57390),
+(57391),
+(57392),
+(57393),
+(57395),
+(57397),
+(57402),
+(57407),
+(57411),
+(57413),
+(57420),
+(57454),
+(57456),
+(57461),
+(57464),
+(57465),
+(57466),
+(57473),
+(57480),
+(57486),
+(57487),
+(57488),
+(57490),
+(57506),
+(57507),
+(57528),
+(57530),
+(57536),
+(57537),
+(57547),
+(57548),
+(57553),
+(57554),
+(57556),
+(57573),
+(57580),
+(57582),
+(57587),
+(57589),
+(57590),
+(57593),
+(57594),
+(57596),
+(57599),
+(57601),
+(57602),
+(57603),
+(57615),
+(57616),
+(57617),
+(57620),
+(57628),
+(57635),
+(57640),
+(57641),
+(57644),
+(57645),
+(57647),
+(57648),
+(57651),
+(57657),
+(57661),
+(57665),
+(57670),
+(57671),
+(57677),
+(57679),
+(57723),
+(57724),
+(57725),
+(57745),
+(57755),
+(57759),
+(57765),
+(57766),
+(57767),
+(57770),
+(57774),
+(57775),
+(57777),
+(57778),
+(57779),
+(57780),
+(57781),
+(57783),
+(57785),
+(57787),
+(57789),
+(57790),
+(57795),
+(57799),
+(57802),
+(57807),
+(57808),
+(57823),
+(57825),
+(57833),
+(57834),
+(57838),
+(57841),
+(57842),
+(57845),
+(57846),
+(57860),
+(57863),
+(57864),
+(57871),
+(57874),
+(57888),
+(57896),
+(57897),
+(57906),
+(57908),
+(57914),
+(57921),
+(57922),
+(57941),
+(57949),
+(57951),
+(57964),
+(57965),
+(57969),
+(57970),
+(57974),
+(57975),
+(57981),
+(57984),
+(57992),
+(57993),
+(57994),
+(58012),
+(58021),
+(58025),
+(58044),
+(58054),
+(58061),
+(58062),
+(58071),
+(58106),
+(58117),
+(58118),
+(58119),
+(58151),
+(58154),
+(58179),
+(58180),
+(58181),
+(58183),
+(58184),
+(58187),
+(58194),
+(58203),
+(58204),
+(58205),
+(58207),
+(58208),
+(58209),
+(58210),
+(58211),
+(58212),
+(58213),
+(58214),
+(58215),
+(58216),
+(58217),
+(58218),
+(58219),
+(58220),
+(58221),
+(58222),
+(58223),
+(58224),
+(58230),
+(58270),
+(58282),
+(58283),
+(58349),
+(58351),
+(58352),
+(58371),
+(58373),
+(58412),
+(58418),
+(58419),
+(58420),
+(58421),
+(58438),
+(58448),
+(58449),
+(58450),
+(58451),
+(58452),
+(58453),
+(58456),
+(58457),
+(58459),
+(58460),
+(58461),
+(58462),
+(58464),
+(58466),
+(58471),
+(58475),
+(58494),
+(58504),
+(58505),
+(58508),
+(58509),
+(58510),
+(58511),
+(58513),
+(58514),
+(58516),
+(58517),
+(58518),
+(58519),
+(58520),
+(58526),
+(58529),
+(58531),
+(58534),
+(58535),
+(58537),
+(58544),
+(58548),
+(58561),
+(58563),
+(58564),
+(58566),
+(58567),
+(58597),
+(58604),
+(58605),
+(58607),
+(58608),
+(58609),
+(58610),
+(58611),
+(58612),
+(58617),
+(58619),
+(58621),
+(58622),
+(58624),
+(58628),
+(58632),
+(58633),
+(58642),
+(58644),
+(58660),
+(58663),
+(58664),
+(58665),
+(58666),
+(58667),
+(58678),
+(58681),
+(58683),
+(58684),
+(58691),
+(58700),
+(58701),
+(58702),
+(58743),
+(58747),
+(58758),
+(58769),
+(58770),
+(58772),
+(58781),
+(58782),
+(58786),
+(58787),
+(58788),
+(58797),
+(58798),
+(58799),
+(58810),
+(58811),
+(58814),
+(58815),
+(58816),
+(58817),
+(58822),
+(58823),
+(58827),
+(58829),
+(58830),
+(58839),
+(58840),
+(58843),
+(58844),
+(58845),
+(58847),
+(58849),
+(58850),
+(58855),
+(58859),
+(58861),
+(58867),
+(58879),
+(58890),
+(58896),
+(58898),
+(58902),
+(58905),
+(58912),
+(58913),
+(58915),
+(58919),
+(58921),
+(58922),
+(58935),
+(58940),
+(58941),
+(58953),
+(58955),
+(58959),
+(58961),
+(58966),
+(58967),
+(58969),
+(58971),
+(58972),
+(58973),
+(58976),
+(58978),
+(58980),
+(58981),
+(58987),
+(58988),
+(58989),
+(58991),
+(58996),
+(59001),
+(59006),
+(59007),
+(59011),
+(59013),
+(59016),
+(59017),
+(59019),
+(59020),
+(59021),
+(59023),
+(59024),
+(59025),
+(59034),
+(59035),
+(59039),
+(59040),
+(59044),
+(59047),
+(59050),
+(59051),
+(59060),
+(59064),
+(59065),
+(59069),
+(59079),
+(59080),
+(59081),
+(59082),
+(59083),
+(59085),
+(59100),
+(59102),
+(59104),
+(59105),
+(59106),
+(59109),
+(59110),
+(59111),
+(59114),
+(59119),
+(59121),
+(59124),
+(59130),
+(59131),
+(59132),
+(59133),
+(59134),
+(59138),
+(59142),
+(59144),
+(59146),
+(59147),
+(59148),
+(59150),
+(59151),
+(59153),
+(59155),
+(59160),
+(59161),
+(59163),
+(59164),
+(59165),
+(59166),
+(59167),
+(59168),
+(59169),
+(59170),
+(59171),
+(59172),
+(59178),
+(59179),
+(59180),
+(59182),
+(59185),
+(59186),
+(59187),
+(59191),
+(59192),
+(59199),
+(59209),
+(59210),
+(59211),
+(59215),
+(59220),
+(59223),
+(59225),
+(59226),
+(59228),
+(59233),
+(59235),
+(59237),
+(59239),
+(59241),
+(59242),
+(59243),
+(59244),
+(59246),
+(59247),
+(59248),
+(59249),
+(59251),
+(59252),
+(59254),
+(59256),
+(59257),
+(59259),
+(59260),
+(59261),
+(59262),
+(59263),
+(59264),
+(59265),
+(59268),
+(59269),
+(59270),
+(59271),
+(59273),
+(59280),
+(59288),
+(59290),
+(59300),
+(59304),
+(59318),
+(59319),
+(59324),
+(59325),
+(59329),
+(59330),
+(59331),
+(59342),
+(59343),
+(59344),
+(59346),
+(59347),
+(59348),
+(59350),
+(59351),
+(59352),
+(59355),
+(59357),
+(59359),
+(59361),
+(59362),
+(59364),
+(59367),
+(59371),
+(59373),
+(59374),
+(59376),
+(59381),
+(59389),
+(59391),
+(59392),
+(59395),
+(59397),
+(59398),
+(59399),
+(59400),
+(59401),
+(59402),
+(59408),
+(59409),
+(59412),
+(59413),
+(59423),
+(59432),
+(59434),
+(59439),
+(59444),
+(59448),
+(59455),
+(59460),
+(59467),
+(59468),
+(59471),
+(59482),
+(59485),
+(59513),
+(59515),
+(59517),
+(59519),
+(59520),
+(59525),
+(59530),
+(59542),
+(59543),
+(59544),
+(59545),
+(59547),
+(59548),
+(59557),
+(59558),
+(59563),
+(59575),
+(59577),
+(59590),
+(59593),
+(59594),
+(59599),
+(59603),
+(59604),
+(59605),
+(59606),
+(59607),
+(59608),
+(59610),
+(59611),
+(59616),
+(59617),
+(59633),
+(59634),
+(59637),
+(59638),
+(59651),
+(59653),
+(59656),
+(59661),
+(59663),
+(59679),
+(59682),
+(59683),
+(59684),
+(59685),
+(59691),
+(59695),
+(59696),
+(59700),
+(59703),
+(59710),
+(59712),
+(59713),
+(59715),
+(59716),
+(59717),
+(59718),
+(59723),
+(59727),
+(59735),
+(59736),
+(59742),
+(59743),
+(59746),
+(59750),
+(59760),
+(59762),
+(59763),
+(59765),
+(59766),
+(59767),
+(59769),
+(59779),
+(59795),
+(59805),
+(59812),
+(59813),
+(59814),
+(59815),
+(59817),
+(59823),
+(59826),
+(59827),
+(59832),
+(59839),
+(59840),
+(59841),
+(59844),
+(59846),
+(59851),
+(59852),
+(59855),
+(59856),
+(59863),
+(59864),
+(59877),
+(59879),
+(59881),
+(59882),
+(59883),
+(59884),
+(59885),
+(59886),
+(59894),
+(59901),
+(59921),
+(59963),
+(59965),
+(59972),
+(59974),
+(59978),
+(59982),
+(59984),
+(59985),
+(59986),
+(59987),
+(59988),
+(59989),
+(59991),
+(59992),
+(59993),
+(59994),
+(59997),
+(59999),
+(60003),
+(60004),
+(60005),
+(60006),
+(60008),
+(60009),
+(60011),
+(60012),
+(60013),
+(60015),
+(60016),
+(60017),
+(60018),
+(60032),
+(60035),
+(60039),
+(60041),
+(60043),
+(60051),
+(60052),
+(60053),
+(60067),
+(60073),
+(60076),
+(60078),
+(60079),
+(60080),
+(60085),
+(60089),
+(60100),
+(60103),
+(60106),
+(60107),
+(60111),
+(60112),
+(60115),
+(60117),
+(60122),
+(60123),
+(60127),
+(60129),
+(60181),
+(60183),
+(60186),
+(60194),
+(60195),
+(60197),
+(60203),
+(60204),
+(60210),
+(60211),
+(60212),
+(60229),
+(60233),
+(60234),
+(60235),
+(60236),
+(60239),
+(60241),
+(60300),
+(60307),
+(60309),
+(60339),
+(60351),
+(60352),
+(60428),
+(60431),
+(60432),
+(60433),
+(60440),
+(60443),
+(60446),
+(60447),
+(60450),
+(60452),
+(60453),
+(60472),
+(60474),
+(60483),
+(60488),
+(60500),
+(60504),
+(60505),
+(60506),
+(60518),
+(60526),
+(60530),
+(60540),
+(60541),
+(60542),
+(60578),
+(60580),
+(60585),
+(60588),
+(60590),
+(60626),
+(60642),
+(60644),
+(60646),
+(60654),
+(60672),
+(60678),
+(60682),
+(60683),
+(60699),
+(60708),
+(60742),
+(60753),
+(60781),
+(60782),
+(60784),
+(60785),
+(60786),
+(60790),
+(60802),
+(60803),
+(60805),
+(60809),
+(60814),
+(60817),
+(60842),
+(60844),
+(60850),
+(60856),
+(60857),
+(60859),
+(60868),
+(60869),
+(60870),
+(60871),
+(60872),
+(60873),
+(60876),
+(60880),
+(60882),
+(60890),
+(60896),
+(60897),
+(60898),
+(60899),
+(60900),
+(60901),
+(60905),
+(60906),
+(60917),
+(60918),
+(60924),
+(60926),
+(60927),
+(60930),
+(60932),
+(60935),
+(60940),
+(60941),
+(60944),
+(60945),
+(60946),
+(60947),
+(60949),
+(60950),
+(60951),
+(60952),
+(60954),
+(60959),
+(60961),
+(60962),
+(60963),
+(60965),
+(60968),
+(60972),
+(60973),
+(60979),
+(60980),
+(60981),
+(60982),
+(60983),
+(60988),
+(60991),
+(60995),
+(61001),
+(61005),
+(61006),
+(61016),
+(61018),
+(61024),
+(61025),
+(61029),
+(61034),
+(61036),
+(61039),
+(61041),
+(61042),
+(61046),
+(61048),
+(61051),
+(61064),
+(61070),
+(61077),
+(61080),
+(61083),
+(61087),
+(61091),
+(61094),
+(61100),
+(61101),
+(61103),
+(61109),
+(61110),
+(61111),
+(61115),
+(61123),
+(61124),
+(61127),
+(61129),
+(61133),
+(61140),
+(61143),
+(61159),
+(61160),
+(61162),
+(61164),
+(61166),
+(61168),
+(61171),
+(61172),
+(61173),
+(61176),
+(61178),
+(61182),
+(61186),
+(61187),
+(61191),
+(61193),
+(61194),
+(61195),
+(61196),
+(61197),
+(61198),
+(61209),
+(61211),
+(61213),
+(61215),
+(61218),
+(61223),
+(61226),
+(61242),
+(61243),
+(61244),
+(61253),
+(61259),
+(61260),
+(61263),
+(61269),
+(61272),
+(61281),
+(61282),
+(61286),
+(61287),
+(61291),
+(61295),
+(61296),
+(61299),
+(61300),
+(61301),
+(61302),
+(61305),
+(61314),
+(61319),
+(61320),
+(61326),
+(61327),
+(61343),
+(61344),
+(61347),
+(61352),
+(61358),
+(61372),
+(61373),
+(61374),
+(61375),
+(61380),
+(61381),
+(61382),
+(61385),
+(61395),
+(61398),
+(61399),
+(61409),
+(61411),
+(61415),
+(61419),
+(61420),
+(61421),
+(61423),
+(61424),
+(61443),
+(61445),
+(61448),
+(61454),
+(61457),
+(61461),
+(61466),
+(61474),
+(61479),
+(61480),
+(61486),
+(61490),
+(61491),
+(61493),
+(61507),
+(61511),
+(61512),
+(61515),
+(61528),
+(61545),
+(61549),
+(61550),
+(61552),
+(61554),
+(61556),
+(61558),
+(61561),
+(61562),
+(61563),
+(61565),
+(61567),
+(61569),
+(61572),
+(61579),
+(61584),
+(61590),
+(61592),
+(61593),
+(61596),
+(61597),
+(61599),
+(61600),
+(61601),
+(61604),
+(61606),
+(61607),
+(61613),
+(61621),
+(61623),
+(61624),
+(61626),
+(61627),
+(61628),
+(61634),
+(61635),
+(61662),
+(61663),
+(61666),
+(61667),
+(61668),
+(61676),
+(61685),
+(61696),
+(61705),
+(61712),
+(61716),
+(61721),
+(61728),
+(61729),
+(61730),
+(61733),
+(61747),
+(61767),
+(61780),
+(61781),
+(61789),
+(61791),
+(61793),
+(61794),
+(61795),
+(61796),
+(61797),
+(61798),
+(61799),
+(61800),
+(61801),
+(61802),
+(61804),
+(61805),
+(61806),
+(61807),
+(61808),
+(61815),
+(61817),
+(61819),
+(61821),
+(61822),
+(61823),
+(61824),
+(61825),
+(61832),
+(61833),
+(61834),
+(61835),
+(61836),
+(61837),
+(61838),
+(61839),
+(61840),
+(61841),
+(61842),
+(61843),
+(61844),
+(61845),
+(61849),
+(61857),
+(61859),
+(61862),
+(61866),
+(61868),
+(61870),
+(61873),
+(61879),
+(61880),
+(61881),
+(61888),
+(61893),
+(61895),
+(61896),
+(61897),
+(61903),
+(61909),
+(61911),
+(61912),
+(61923),
+(61924),
+(61925),
+(61926),
+(61927),
+(61928),
+(61929),
+(61965),
+(61967),
+(61973),
+(61998),
+(62014),
+(62026),
+(62030),
+(62036),
+(62053),
+(62063),
+(62078),
+(62089),
+(62103),
+(62105),
+(62117),
+(62118),
+(62119),
+(62120),
+(62121),
+(62122),
+(62124),
+(62128),
+(62129),
+(62130),
+(62131),
+(62138),
+(62167),
+(62169),
+(62195),
+(62198),
+(62204),
+(62225),
+(62226),
+(62249),
+(62250),
+(62261),
+(62264),
+(62265),
+(62280),
+(62292),
+(62298),
+(62305),
+(62309),
+(62310),
+(62312),
+(62315),
+(62316),
+(62317),
+(62318),
+(62322),
+(62326),
+(62327),
+(62328),
+(62331),
+(62332),
+(62333),
+(62334),
+(62335),
+(62342),
+(62347),
+(62354),
+(62356),
+(62368),
+(62372),
+(62373),
+(62382),
+(62395),
+(62401),
+(62402),
+(62415),
+(62417),
+(62418),
+(62420),
+(62441),
+(62442),
+(62443),
+(62444),
+(62445),
+(62446),
+(62455),
+(62456),
+(62466),
+(62479),
+(62482),
+(62503),
+(62507),
+(62526),
+(62531),
+(62536),
+(62540),
+(62544),
+(62554),
+(62563),
+(62575),
+(62581),
+(62583),
+(62589),
+(62601),
+(62607),
+(62608),
+(62611),
+(62613),
+(62614),
+(62626),
+(62638),
+(62648),
+(62649),
+(62653),
+(62658),
+(62672),
+(62673),
+(62707),
+(62708),
+(62711),
+(62717),
+(62722),
+(62726),
+(62732),
+(62767),
+(62768),
+(62769),
+(62793),
+(62796),
+(62806),
+(62832),
+(62836),
+(62844),
+(62845),
+(62846),
+(62854),
+(62855),
+(62863),
+(62867),
+(62874),
+(62875),
+(62881),
+(62900),
+(62901),
+(62902),
+(62903),
+(62904),
+(62928),
+(62935),
+(62938),
+(62939),
+(62960),
+(62961),
+(62989),
+(62997),
+(62998),
+(63003),
+(63010),
+(63012),
+(63028),
+(63034),
+(63035),
+(63036),
+(63047),
+(63082),
+(63094),
+(63103),
+(63104),
+(63105),
+(63111),
+(63112),
+(63120),
+(63124),
+(63125),
+(63126),
+(63127),
+(63134),
+(63136),
+(63138),
+(63147),
+(63151),
+(63169),
+(63171),
+(63172),
+(63174),
+(63175),
+(63177),
+(63178),
+(63179),
+(63180),
+(63183),
+(63184),
+(63185),
+(63216),
+(63221),
+(63226),
+(63228),
+(63233),
+(63240),
+(63242),
+(63259),
+(63276),
+(63278),
+(63301),
+(63311),
+(63313),
+(63314),
+(63315),
+(63316),
+(63336),
+(63337),
+(63338),
+(63344),
+(63345),
+(63356),
+(63359),
+(63361),
+(63362),
+(63363),
+(63380),
+(63382),
+(63413),
+(63416),
+(63418),
+(63459),
+(63462),
+(63463),
+(63464),
+(63465),
+(63466),
+(63468),
+(63477),
+(63479),
+(63487),
+(63493),
+(63494),
+(63495),
+(63511),
+(63518),
+(63519),
+(63529),
+(63535),
+(63536),
+(63544),
+(63549),
+(63550),
+(63551),
+(63553),
+(63556),
+(63559),
+(63562),
+(63564),
+(63569),
+(63571),
+(63573),
+(63575),
+(63599),
+(63605),
+(63612),
+(63615),
+(63619),
+(63652),
+(63653),
+(63654),
+(63655),
+(63661),
+(63668),
+(63669),
+(63670),
+(63671),
+(63672),
+(63673),
+(63675),
+(63678),
+(63685),
+(63689),
+(63691),
+(63699),
+(63700),
+(63716),
+(63728),
+(63736),
+(63738),
+(63754),
+(63755),
+(63759),
+(63760),
+(63789),
+(63803),
+(63804),
+(63809),
+(63815),
+(63823),
+(63825),
+(63827),
+(63845),
+(63846),
+(63852),
+(63861),
+(63913),
+(63914),
+(63915),
+(63916),
+(63917),
+(63918),
+(63919),
+(63920),
+(63921),
+(63922),
+(63923),
+(63931),
+(63980),
+(63989),
+(63993),
+(63995),
+(63997),
+(63998),
+(64003),
+(64005),
+(64006),
+(64014),
+(64024),
+(64025),
+(64026),
+(64027),
+(64028),
+(64029),
+(64030),
+(64031),
+(64032),
+(64034),
+(64036),
+(64039),
+(64044),
+(64058),
+(64065),
+(64085),
+(64090),
+(64097),
+(64102),
+(64104),
+(64107),
+(64113),
+(64114),
+(64115),
+(64119),
+(64123),
+(64128),
+(64134),
+(64136),
+(64138),
+(64142),
+(64151),
+(64152),
+(64153),
+(64156),
+(64157),
+(64159),
+(64160),
+(64186),
+(64204),
+(64211),
+(64212),
+(64213),
+(64215),
+(64230),
+(64269),
+(64324),
+(64328),
+(64330),
+(64331),
+(64332),
+(64333),
+(64334),
+(64335),
+(64336),
+(64337),
+(64338),
+(64339),
+(64342),
+(64346),
+(64363),
+(64365),
+(64367),
+(64374),
+(64375),
+(64376),
+(64377),
+(64380),
+(64382),
+(64387),
+(64388),
+(64390),
+(64391),
+(64395),
+(64396),
+(64412),
+(64413),
+(64429),
+(64430),
+(64442),
+(64467),
+(64478),
+(64496),
+(64499),
+(64501),
+(64507),
+(64528),
+(64529),
+(64535),
+(64542),
+(64552),
+(64580),
+(64583),
+(64588),
+(64590),
+(64591),
+(64592),
+(64595),
+(64627),
+(64637),
+(64638),
+(64640),
+(64646),
+(64647),
+(64648),
+(64649),
+(64654),
+(64665),
+(64666),
+(64667),
+(64668),
+(64669),
+(64674),
+(64682),
+(64686),
+(64692),
+(64696),
+(64698),
+(64699),
+(64705),
+(64719),
+(64740),
+(64757),
+(64758),
+(64759),
+(64766),
+(64768),
+(64771),
+(64773),
+(64776),
+(64780),
+(64787),
+(64795),
+(64798),
+(64801),
+(64806),
+(64807),
+(64821),
+(64841),
+(64870),
+(64874),
+(64876),
+(64888),
+(64891),
+(64903),
+(64909),
+(64918),
+(64930),
+(64953),
+(64967),
+(64970),
+(64971),
+(64974),
+(64978),
+(64991),
+(65030),
+(65031),
+(65033),
+(65035),
+(65036),
+(65038),
+(65039),
+(65040),
+(65042),
+(65054),
+(65055),
+(65056),
+(65057),
+(65058),
+(65059),
+(65061),
+(65062),
+(65071),
+(65080),
+(65081),
+(65104),
+(65111),
+(65113),
+(65122),
+(65123),
+(65131),
+(65133),
+(65147),
+(65162),
+(65201),
+(65210),
+(65240),
+(65266),
+(65280),
+(65343),
+(65351),
+(65359),
+(65360),
+(65374),
+(65378),
+(65379),
+(65386),
+(65391),
+(65392),
+(65403),
+(65431),
+(65488),
+(65490),
+(65492),
+(65502),
+(65503),
+(65512),
+(65513),
+(65516),
+(65531),
+(65532),
+(65541),
+(65542),
+(65545),
+(65546),
+(65564),
+(65565),
+(65575),
+(65576),
+(65577),
+(65634),
+(65635),
+(65636),
+(65647),
+(65648),
+(65693),
+(65694),
+(65703),
+(65720),
+(65722),
+(65723),
+(65728),
+(65729),
+(65744),
+(65754),
+(65775),
+(65778),
+(65782),
+(65790),
+(65791),
+(65799),
+(65801),
+(65807),
+(65809),
+(65810),
+(65812),
+(65813),
+(65814),
+(65815),
+(65819),
+(65820),
+(65821),
+(65825),
+(65826),
+(65854),
+(65855),
+(65856),
+(65857),
+(65859),
+(65862),
+(65863),
+(65866),
+(65867),
+(65868),
+(65877),
+(65878),
+(65881),
+(65883),
+(65918),
+(65924),
+(65926),
+(65927),
+(65929),
+(65930),
+(65931),
+(65934),
+(65935),
+(65936),
+(65940),
+(65941),
+(65954),
+(65957),
+(65960),
+(65962),
+(65970),
+(65971),
+(65972),
+(65973),
+(65974),
+(65978),
+(65987),
+(65998),
+(66003),
+(66005),
+(66007),
+(66008),
+(66009),
+(66012),
+(66017),
+(66018),
+(66019),
+(66020),
+(66021),
+(66042),
+(66043),
+(66045),
+(66047),
+(66053),
+(66054),
+(66055),
+(66056),
+(66057),
+(66063),
+(66065),
+(66066),
+(66067),
+(66068),
+(66069),
+(66070),
+(66072),
+(66075),
+(66079),
+(66081),
+(66093),
+(66095),
+(66097),
+(66099),
+(66100),
+(66104),
+(66109),
+(66112),
+(66113),
+(66114),
+(66115),
+(66116),
+(66125),
+(66126),
+(66134),
+(66154),
+(66177),
+(66188),
+(66196),
+(66197),
+(66198),
+(66206),
+(66207),
+(66209),
+(66213),
+(66215),
+(66216),
+(66217),
+(66236),
+(66237),
+(66240),
+(66243),
+(66244),
+(66245),
+(66250),
+(66259),
+(66260),
+(66261),
+(66262),
+(66265),
+(66283),
+(66285),
+(66290),
+(66291),
+(66292),
+(66293),
+(66294),
+(66295),
+(66313),
+(66326),
+(66331),
+(66334),
+(66342),
+(66359),
+(66377),
+(66378),
+(66407),
+(66408),
+(66409),
+(66410),
+(66417),
+(66420),
+(66423),
+(66425),
+(66457),
+(66460),
+(66461),
+(66474),
+(66477),
+(66479),
+(66480),
+(66481),
+(66489),
+(66493),
+(66516),
+(66528),
+(66532),
+(66533),
+(66536),
+(66537),
+(66538),
+(66548),
+(66549),
+(66588),
+(66592),
+(66593),
+(66594),
+(66595),
+(66596),
+(66613),
+(66619),
+(66620),
+(66629),
+(66638),
+(66666),
+(66668),
+(66669),
+(66686),
+(66687),
+(66688),
+(66689),
+(66716),
+(66717),
+(66719),
+(66733),
+(66735),
+(66736),
+(66742),
+(66744),
+(66765),
+(66770),
+(66773),
+(66777),
+(66784),
+(66796),
+(66797),
+(66809),
+(66813),
+(66823),
+(66824),
+(66863),
+(66867),
+(66869),
+(66879),
+(66880),
+(66887),
+(66888),
+(66890),
+(66891),
+(66892),
+(66899),
+(66903),
+(66904),
+(66922),
+(66940),
+(66941),
+(66950),
+(66951),
+(66952),
+(66953),
+(66954),
+(66955),
+(66957),
+(66958),
+(66959),
+(66960),
+(66961),
+(66962),
+(66963),
+(66964),
+(66965),
+(66972),
+(66973),
+(66974),
+(66975),
+(66976),
+(66977),
+(66978),
+(66979),
+(66988),
+(66989),
+(66990),
+(66991),
+(66992),
+(66994),
+(67029),
+(67030),
+(67031),
+(67033),
+(67035),
+(67049),
+(67050),
+(67051),
+(67073),
+(67074),
+(67075),
+(67088),
+(67089),
+(67090),
+(67097),
+(67098),
+(67099),
+(67114),
+(67148),
+(67229),
+(67235),
+(67237),
+(67247),
+(67252),
+(67253),
+(67280),
+(67289),
+(67290),
+(67309),
+(67310),
+(67311),
+(67312),
+(67313),
+(67314),
+(67324),
+(67325),
+(67330),
+(67331),
+(67333),
+(67366),
+(67372),
+(67373),
+(67387),
+(67390),
+(67477),
+(67478),
+(67479),
+(67480),
+(67481),
+(67485),
+(67518),
+(67519),
+(67528),
+(67529),
+(67530),
+(67531),
+(67532),
+(67533),
+(67534),
+(67540),
+(67542),
+(67550),
+(67554),
+(67560),
+(67573),
+(67574),
+(67577),
+(67606),
+(67607),
+(67608),
+(67612),
+(67613),
+(67614),
+(67618),
+(67619),
+(67620),
+(67624),
+(67625),
+(67626),
+(67632),
+(67633),
+(67634),
+(67650),
+(67651),
+(67652),
+(67654),
+(67655),
+(67656),
+(67674),
+(67675),
+(67676),
+(67678),
+(67679),
+(67680),
+(67686),
+(67703),
+(67708),
+(67709),
+(67710),
+(67714),
+(67718),
+(67719),
+(67721),
+(67722),
+(67724),
+(67725),
+(67730),
+(67745),
+(67749),
+(67760),
+(67767),
+(67772),
+(67773),
+(67774),
+(67793),
+(67799),
+(67810),
+(67811),
+(67817),
+(67818),
+(67819),
+(67821),
+(67823),
+(67830),
+(67834),
+(67835),
+(67836),
+(67837),
+(67838),
+(67846),
+(67847),
+(67861),
+(67862),
+(67863),
+(67878),
+(67879),
+(67880),
+(67881),
+(67882),
+(67883),
+(67884),
+(67885),
+(67891),
+(67892),
+(67905),
+(67906),
+(67907),
+(67929),
+(67930),
+(67931),
+(67932),
+(67933),
+(67934),
+(67935),
+(67936),
+(67937),
+(67938),
+(67939),
+(67940),
+(67941),
+(67942),
+(67943),
+(67944),
+(67945),
+(67946),
+(67947),
+(67948),
+(67949),
+(67951),
+(67952),
+(67953),
+(67957),
+(67958),
+(67959),
+(67965),
+(67966),
+(67967),
+(67968),
+(67969),
+(67970),
+(67971),
+(67972),
+(67973),
+(67977),
+(67978),
+(67979),
+(67980),
+(67981),
+(67982),
+(67983),
+(67984),
+(67985),
+(67988),
+(67989),
+(67990),
+(67991),
+(67992),
+(67993),
+(67994),
+(67995),
+(67996),
+(67997),
+(67998),
+(67999),
+(68003),
+(68004),
+(68005),
+(68008),
+(68009),
+(68010),
+(68011),
+(68012),
+(68013),
+(68014),
+(68015),
+(68016),
+(68017),
+(68018),
+(68019),
+(68023),
+(68024),
+(68025),
+(68026),
+(68027),
+(68028),
+(68032),
+(68033),
+(68034),
+(68035),
+(68036),
+(68037),
+(68038),
+(68039),
+(68040),
+(68042),
+(68043),
+(68044),
+(68055),
+(68073),
+(68077),
+(68078),
+(68081),
+(68088),
+(68089),
+(68090),
+(68091),
+(68092),
+(68093),
+(68094),
+(68095),
+(68096),
+(68100),
+(68101),
+(68102),
+(68106),
+(68107),
+(68108),
+(68109),
+(68110),
+(68111),
+(68112),
+(68113),
+(68114),
+(68115),
+(68116),
+(68117),
+(68118),
+(68119),
+(68120),
+(68123),
+(68124),
+(68125),
+(68130),
+(68133),
+(68134),
+(68135),
+(68136),
+(68137),
+(68138),
+(68139),
+(68140),
+(68141),
+(68148),
+(68149),
+(68150),
+(68151),
+(68152),
+(68153),
+(68154),
+(68155),
+(68156),
+(68157),
+(68158),
+(68159),
+(68272),
+(68282),
+(68284),
+(68301),
+(68306),
+(68307),
+(68310),
+(68311),
+(68313),
+(68315),
+(68317),
+(68318),
+(68319),
+(68321),
+(68328),
+(68333),
+(68334),
+(68340),
+(68341),
+(68350),
+(68357),
+(68362),
+(68363),
+(68364),
+(68365),
+(68372),
+(68391),
+(68415),
+(68458),
+(68472),
+(68478),
+(68479),
+(68498),
+(68501),
+(68502),
+(68503),
+(68504),
+(68505),
+(68550),
+(68551),
+(68586),
+(68587),
+(68588),
+(68607),
+(68621),
+(68622),
+(68623),
+(68624),
+(68625),
+(68626),
+(68627),
+(68628),
+(68629),
+(68727),
+(68753),
+(68754),
+(68755),
+(68756),
+(68757),
+(68758),
+(68762),
+(68763),
+(68764),
+(68778),
+(68781),
+(68782),
+(68783),
+(68784),
+(68788),
+(68799),
+(68812),
+(68834),
+(68839),
+(68841),
+(68843),
+(68868),
+(68879),
+(68884),
+(68900),
+(68915),
+(68927),
+(68934),
+(68948),
+(68966),
+(68971),
+(68980),
+(68982),
+(68984),
+(68985),
+(68991),
+(69000),
+(69003),
+(69021),
+(69023),
+(69028),
+(69034),
+(69038),
+(69051),
+(69058),
+(69063),
+(69065),
+(69066),
+(69067),
+(69068),
+(69088),
+(69091),
+(69124),
+(69128),
+(69130),
+(69131),
+(69133),
+(69137),
+(69138),
+(69153),
+(69155),
+(69156),
+(69158),
+(69160),
+(69172),
+(69180),
+(69181),
+(69189),
+(69190),
+(69198),
+(69200),
+(69209),
+(69210),
+(69211),
+(69212),
+(69218),
+(69222),
+(69232),
+(69243),
+(69246),
+(69274),
+(69275),
+(69276),
+(69285),
+(69308),
+(69342),
+(69352),
+(69387),
+(69389),
+(69391),
+(69397),
+(69398),
+(69403),
+(69404),
+(69405),
+(69406),
+(69409),
+(69410),
+(69416),
+(69420),
+(69427),
+(69438),
+(69445),
+(69455),
+(69483),
+(69489),
+(69492),
+(69496),
+(69497),
+(69498),
+(69499),
+(69500),
+(69501),
+(69503),
+(69504),
+(69520),
+(69528),
+(69542),
+(69543),
+(69544),
+(69548),
+(69563),
+(69564),
+(69566),
+(69567),
+(69569),
+(69570),
+(69572),
+(69573),
+(69574),
+(69576),
+(69577),
+(69578),
+(69579),
+(69581),
+(69583),
+(69603),
+(69617),
+(69623),
+(69627),
+(69633),
+(69644),
+(69651),
+(69668),
+(69672),
+(69673),
+(69675),
+(69681),
+(69692),
+(69693),
+(69696),
+(69699),
+(69710),
+(69722),
+(69724),
+(69726),
+(69729),
+(69730),
+(69731),
+(69733),
+(69734),
+(69771),
+(69772),
+(69779),
+(69828),
+(69837),
+(69856),
+(69861),
+(69866),
+(69869),
+(69871),
+(69882),
+(69889),
+(69891),
+(69892),
+(69893),
+(69896),
+(69898),
+(69899),
+(69902),
+(69903),
+(69906),
+(69910),
+(69911),
+(69912),
+(69916),
+(69917),
+(69920),
+(69923),
+(69926),
+(69927),
+(69933),
+(69956),
+(69958),
+(69961),
+(69963),
+(69967),
+(69968),
+(69969),
+(69970),
+(69972),
+(69973),
+(69974),
+(69975),
+(69984),
+(69989),
+(70002),
+(70043),
+(70070),
+(70074),
+(70080),
+(70110),
+(70119),
+(70122),
+(70126),
+(70141),
+(70144),
+(70153),
+(70161),
+(70162),
+(70182),
+(70183),
+(70191),
+(70192),
+(70196),
+(70205),
+(70208),
+(70211),
+(70213),
+(70227),
+(70269),
+(70270),
+(70271),
+(70273),
+(70275),
+(70276),
+(70277),
+(70278),
+(70279),
+(70280),
+(70281),
+(70282),
+(70285),
+(70289),
+(70292),
+(70296),
+(70302),
+(70304),
+(70308),
+(70309),
+(70320),
+(70322),
+(70327),
+(70333),
+(70337),
+(70355),
+(70361),
+(70381),
+(70386),
+(70387),
+(70388),
+(70391),
+(70393),
+(70396),
+(70400),
+(70408),
+(70409),
+(70410),
+(70423),
+(70428),
+(70429),
+(70432),
+(70435),
+(70437),
+(70445),
+(70449),
+(70451),
+(70453),
+(70495),
+(70510),
+(70516),
+(70525),
+(70538),
+(70539),
+(70540),
+(70542),
+(70583),
+(70594),
+(70599),
+(70616),
+(70639),
+(70640),
+(70645),
+(70646),
+(70648),
+(70653),
+(70656),
+(70659),
+(70698),
+(70746),
+(70751),
+(70754),
+(70772),
+(70781),
+(70802),
+(70809),
+(70821),
+(70838),
+(70856),
+(70857),
+(70858),
+(70859),
+(70860),
+(70861),
+(70864),
+(70867),
+(70886),
+(70890),
+(70895),
+(70896),
+(70897),
+(70906),
+(70917),
+(70923),
+(70928),
+(70929),
+(70942),
+(70946),
+(70964),
+(70965),
+(70971),
+(70972),
+(70973),
+(70974),
+(70980),
+(71003),
+(71004),
+(71005),
+(71006),
+(71020),
+(71021),
+(71023),
+(71038),
+(71040),
+(71041),
+(71087),
+(71089),
+(71090),
+(71103),
+(71107),
+(71108),
+(71112),
+(71116),
+(71117),
+(71119),
+(71120),
+(71121),
+(71124),
+(71126),
+(71127),
+(71129),
+(71130),
+(71131),
+(71133),
+(71135),
+(71136),
+(71138),
+(71140),
+(71141),
+(71142),
+(71143),
+(71144),
+(71145),
+(71146),
+(71148),
+(71153),
+(71154),
+(71155),
+(71157),
+(71163),
+(71164),
+(71169),
+(71203),
+(71204),
+(71237),
+(71248),
+(71253),
+(71254),
+(71257),
+(71264),
+(71289),
+(71291),
+(71296),
+(71297),
+(71298),
+(71316),
+(71317),
+(71318),
+(71319),
+(71326),
+(71327),
+(71328),
+(71330),
+(71331),
+(71335),
+(71339),
+(71340),
+(71350),
+(71361),
+(71362),
+(71363),
+(71392),
+(71405),
+(71410),
+(71420),
+(71433),
+(71434),
+(71443),
+(71446),
+(71450),
+(71459),
+(71462),
+(71466),
+(71473),
+(71475),
+(71476),
+(71477),
+(71478),
+(71479),
+(71480),
+(71488),
+(71489),
+(71490),
+(71500),
+(71501),
+(71504),
+(71510),
+(71512),
+(71522),
+(71532),
+(71533),
+(71539),
+(71544),
+(71546),
+(71547),
+(71548),
+(71549),
+(71551),
+(71552),
+(71553),
+(71554),
+(71590),
+(71591),
+(71594),
+(71595),
+(71607),
+(71623),
+(71624),
+(71625),
+(71626),
+(71646),
+(71647),
+(71686),
+(71687),
+(71688),
+(71713),
+(71715),
+(71726),
+(71727),
+(71728),
+(71729),
+(71738),
+(71745),
+(71748),
+(71750),
+(71752),
+(71757),
+(71758),
+(71759),
+(71760),
+(71778),
+(71779),
+(71780),
+(71781),
+(71782),
+(71783),
+(71784),
+(71785),
+(71786),
+(71788),
+(71789),
+(71801),
+(71806),
+(71807),
+(71815),
+(71818),
+(71819),
+(71820),
+(71821),
+(71822),
+(71823),
+(71824),
+(71825),
+(71834),
+(71838),
+(71839),
+(71841),
+(71842),
+(71847),
+(71864),
+(71866),
+(71874),
+(71879),
+(71909),
+(71923),
+(71924),
+(71925),
+(71926),
+(71927),
+(71928),
+(71930),
+(71931),
+(71932),
+(71933),
+(71934),
+(71936),
+(71937),
+(71938),
+(71951),
+(71954),
+(71955),
+(71972),
+(71988),
+(72004),
+(72005),
+(72007),
+(72008),
+(72010),
+(72021),
+(72022),
+(72023),
+(72024),
+(72057),
+(72065),
+(72066),
+(72098),
+(72106),
+(72120),
+(72121),
+(72123),
+(72124),
+(72133),
+(72163),
+(72164),
+(72166),
+(72167),
+(72171),
+(72194),
+(72196),
+(72198),
+(72208),
+(72211),
+(72218),
+(72219),
+(72222),
+(72231),
+(72258),
+(72264),
+(72265),
+(72266),
+(72267),
+(72268),
+(72269),
+(72293),
+(72301),
+(72302),
+(72303),
+(72304),
+(72313),
+(72318),
+(72319),
+(72321),
+(72322),
+(72324),
+(72326),
+(72327),
+(72329),
+(72330),
+(72333),
+(72334),
+(72335),
+(72336),
+(72360),
+(72366),
+(72367),
+(72368),
+(72369),
+(72373),
+(72400),
+(72409),
+(72410),
+(72421),
+(72422),
+(72423),
+(72424),
+(72426),
+(72427),
+(72434),
+(72437),
+(72447),
+(72448),
+(72449),
+(72451),
+(72453),
+(72457),
+(72463),
+(72465),
+(72484),
+(72485),
+(72486),
+(72487),
+(72488),
+(72489),
+(72490),
+(72491),
+(72492),
+(72501),
+(72502),
+(72503),
+(72504),
+(72531),
+(72539),
+(72540),
+(72541),
+(72551),
+(72552),
+(72553),
+(72556),
+(72558),
+(72566),
+(72567),
+(72568),
+(72569),
+(72570),
+(72571),
+(72586),
+(72588),
+(72590),
+(72597),
+(72613),
+(72617),
+(72645),
+(72671),
+(72672),
+(72688),
+(72728),
+(72756),
+(72796),
+(72797),
+(72798),
+(72804),
+(72805),
+(72806),
+(72809),
+(72810),
+(72811),
+(72847),
+(72848),
+(72865),
+(72875),
+(72876),
+(72879),
+(72883),
+(72898),
+(72901),
+(72930),
+(72960),
+(72961),
+(72963),
+(72964),
+(72965),
+(72966),
+(72967),
+(72985),
+(72995),
+(73003),
+(73040),
+(73075),
+(73076),
+(73079),
+(73395),
+(73412),
+(73488),
+(73489),
+(73491),
+(73492),
+(73499),
+(73536),
+(73574),
+(73712),
+(73771),
+(73772),
+(73782),
+(73783),
+(73784),
+(73788),
+(73789),
+(73790),
+(73797),
+(73798),
+(73799),
+(73830),
+(73832),
+(73833),
+(73879),
+(73896),
+(73906),
+(73912),
+(73913),
+(73914),
+(73943),
+(73952),
+(73985),
+(74035),
+(74046),
+(74062),
+(74080),
+(74111),
+(74162),
+(74163),
+(74164),
+(74166),
+(74184),
+(74185),
+(74222),
+(74307),
+(74325),
+(74326),
+(74327),
+(74347),
+(74367),
+(74394),
+(74395),
+(74403),
+(74404),
+(74413),
+(74414),
+(74417),
+(74421),
+(74422),
+(74424),
+(74438),
+(74445),
+(74451),
+(74453),
+(74454),
+(74470),
+(74485),
+(74502),
+(74506),
+(74507),
+(74524),
+(74562),
+(74710),
+(74749),
+(74762),
+(74768),
+(74772),
+(74774),
+(74792),
+(74797),
+(74807),
+(74812),
+(74904),
+(74905),
+(74913),
+(74978),
+(74982),
+(75055),
+(75058),
+(75082),
+(75086),
+(75088),
+(75102),
+(75159),
+(75160),
+(75161),
+(75163),
+(75168),
+(75182),
+(75185),
+(75186),
+(75188),
+(75209),
+(75213),
+(75234),
+(75314),
+(75327),
+(75329),
+(75330),
+(75331),
+(75332),
+(75362),
+(75366),
+(75367),
+(75382),
+(75383),
+(75384),
+(75412),
+(75419),
+(75421),
+(75422),
+(75423),
+(75434),
+(75459),
+(75493),
+(75494),
+(75648),
+(75731),
+(75760),
+(75780),
+(75888),
+(75889),
+(75953),
+(76096),
+(76221),
+(79187),
+(79397);
+CREATE TABLE `temp_cond_vals`
+(
+ `spellId` INT(11),
+ `elseGroup` INT(11) AUTO_INCREMENT,
+ `entry` INT(11),
+ `dead` INT(11),
+ `errorTextId` INT(11),
+ `comment` VARCHAR(255),
+ PRIMARY KEY (`spellId`, `elseGroup`)
+) ENGINE=MYISAM;
+
+CREATE TABLE `temp_item_spell`
+(
+ `itemId` INT(11),
+ `spellId` INT(11),
+ PRIMARY KEY (`itemId`, `spellId`)
+);
+
+CREATE TABLE `temp_item`
+(
+ `itemId` INT(11),
+ PRIMARY KEY (`itemId`)
+);
+
+INSERT INTO `temp_item` SELECT DISTINCT `SourceEntry` FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18;
+INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_1` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_1` IN (SELECT * FROM `temp_convert_spells`);
+INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_2` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_2` IN (SELECT * FROM `temp_convert_spells`);
+INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_3` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_3` IN (SELECT * FROM `temp_convert_spells`);
+INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_4` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_4` IN (SELECT * FROM `temp_convert_spells`);
+INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_5` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_5` IN (SELECT * FROM `temp_convert_spells`);
+
+INSERT INTO `temp_cond_vals` (`spellId`, `entry`, `dead`, `errorTextId`, `comment`) SELECT DISTINCT (SELECT `spellId` FROM `temp_item_spell` WHERE `itemId` = `SourceEntry`), `ConditionValue2`, (`ConditionValue1` - 1), `ErrorTextId`, `Comment` FROM `conditions`
+WHERE `SourceTypeOrReferenceId` = 18;
+
+#use CONDITION_OBJECT_ENTRY instead of CONDITION_ITEM_TARGET
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`)
+SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 31, 1, 3, `entry`, 0, 0, `errorTextId`, `comment` FROM `temp_cond_vals`;
+#for CONDITION_ITEM_TARGET with ConditionValue1 = DEAD we're adding !CONDITION_ALIVE as a second requirement
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`)
+SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 36, 1, 0, 0, 0, 1, `errorTextId`, `comment` FROM `temp_cond_vals` WHERE `dead`;
+#remove entries which could be converted by this sql
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18 AND `SourceEntry` IN (SELECT `itemId` FROM `temp_item_spell`);
+DROP TABLE `temp_convert_spells`;
+DROP TABLE `temp_cond_vals`;
+DROP TABLE `temp_item_spell`;
+DROP TABLE `temp_item`;
+
+ALTER TABLE conditions DROP PRIMARY KEY;
+ALTER TABLE conditions ADD PRIMARY KEY (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`);
diff --git a/sql/updates/world/2012_02_16_01_world_conditions.sql b/sql/updates/world/2012_02_16_01_world_conditions.sql
new file mode 100644
index 00000000000..4bcf997b8e4
--- /dev/null
+++ b/sql/updates/world/2012_02_16_01_world_conditions.sql
@@ -0,0 +1,3 @@
+UPDATE `conditions` SET ConditionValue3 = 0, ConditionTarget = 1 WHERE ConditionTypeOrReference = 1 AND ConditionValue3 = 1;
+UPDATE `conditions` SET ConditionTypeOrReference = 31, ConditionValue2 = ConditionValue1, ConditionValue1 = 3, ConditionTarget = 1 WHERE ConditionTypeOrReference = 19;
+UPDATE `conditions` SET ConditionTypeOrReference = 38, ConditionValue2 = 4, ConditionTarget = 1 WHERE ConditionTypeOrReference = 20;
diff --git a/sql/updates/world/2012_02_17_00_world_waypoints.sql b/sql/updates/world/2012_02_17_00_world_waypoints.sql
new file mode 100644
index 00000000000..1cff86f5d51
--- /dev/null
+++ b/sql/updates/world/2012_02_17_00_world_waypoints.sql
@@ -0,0 +1,77 @@
+-- Pathing for Eye of Thrallmar
+SET @NPC :=57585;
+SET @PATH :=@NPC*10;
+UPDATE `creature` SET `position_x`=203.191,`position_y`=2850.286,`position_z`=160.4257,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1);
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,197.9876,2842.495,160.4257,0,0,0,100,0),
+(@PATH,2,212.5493,2807.971,174.2035,0,0,0,100,0),
+(@PATH,3,244.0748,2812.302,156.8424,0,0,0,100,0),
+(@PATH,4,262.963,2839.935,173.5923,0,0,0,100,0),
+(@PATH,5,249.0294,2865.575,155.9257,0,0,0,100,0),
+(@PATH,6,223.3671,2870.441,169.5924,0,0,0,100,0),
+(@PATH,7,203.191,2850.286,160.4257,0,0,0,100,0);
+
+-- Pathing for Eye of Thrallmar
+SET @NPC :=57586;
+SET @PATH :=@NPC*10;
+UPDATE `creature` SET `position_x`=210.6249,`position_y`=2809.285,`position_z`=208.7277,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1);
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,213.0469,2809.036,207.1722,0,0,0,100,0),
+(@PATH,2,223.5349,2797.282,213.4777,0,0,0,100,0),
+(@PATH,3,238.895,2805.732,213.4777,0,0,0,100,0),
+(@PATH,4,252.788,2818.183,213.4777,0,0,0,100,0),
+(@PATH,5,255.2734,2839.056,213.4777,0,0,0,100,0),
+(@PATH,6,245.0219,2851.84,213.4777,0,0,0,100,0),
+(@PATH,7,229.2117,2860.19,213.4777,0,0,0,100,0),
+(@PATH,8,213.6996,2851.376,206.5887,0,0,0,100,0),
+(@PATH,9,204.457,2828.248,199.6443,0,0,0,100,0),
+(@PATH,10,212.4397,2807.455,199.6443,0,0,0,100,0),
+(@PATH,11,241.3802,2813.464,199.6443,0,0,0,100,0),
+(@PATH,12,249.7797,2829.964,199.6443,0,0,0,100,0),
+(@PATH,13,244.951,2854.129,199.6443,0,0,0,100,0),
+(@PATH,14,221.8344,2856.781,199.6443,0,0,0,100,0),
+(@PATH,15,210.7503,2837.578,199.6443,0,0,0,100,0),
+(@PATH,16,210.6249,2809.285,208.7277,0,0,0,100,0);
+
+-- Pathing for Eye of Thrallmar
+SET @NPC :=57587;
+SET @PATH :=@NPC*10;
+UPDATE `creature` SET `position_x`=236.1859,`position_y`=2813.747,`position_z`=200.9708,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1);
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,241.7692,2815.284,200.8042,0,0,0,100,0),
+(@PATH,2,255.8273,2833.317,201.443,0,0,0,100,0),
+(@PATH,3,247.4309,2853.592,205.1653,0,0,0,100,0),
+(@PATH,4,223.9901,2858.107,208.5819,0,0,0,100,0),
+(@PATH,5,208.0596,2843.793,192.3596,0,0,0,100,0),
+(@PATH,6,213.9734,2816.793,188.4153,0,0,0,100,0),
+(@PATH,7,236.1859,2813.747,200.9708,0,0,0,100,0);
+
+-- Pathing for Eye of Thrallmar
+SET @NPC :=57588;
+SET @PATH :=@NPC*10;
+UPDATE `creature` SET `position_x`=245.9259,`position_y`=2829.09,`position_z`=177.804,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1);
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,251.6207,2841.322,177.804,0,0,0,100,0),
+(@PATH,2,241.4914,2859.113,169.6652,0,0,0,100,0),
+(@PATH,3,214.9913,2858.249,176.3595,0,0,0,100,0),
+(@PATH,4,210.2245,2836.028,169.7762,0,0,0,100,0),
+(@PATH,5,225.7556,2822.145,169.9707,0,0,0,100,0),
+(@PATH,6,237.9712,2823.874,170.1096,0,0,0,100,0),
+(@PATH,7,245.9259,2829.09,177.804,0,0,0,100,0);
+
+DELETE FROM `creature` WHERE `guid`=57589;
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=16598;
+
+
diff --git a/sql/updates/world/2012_02_18_00_world_spell_script_names.sql b/sql/updates/world/2012_02_18_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..993fe3a2f38
--- /dev/null
+++ b/sql/updates/world/2012_02_18_00_world_spell_script_names.sql
@@ -0,0 +1,69 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` in (-100,-12162,13567,17251,23019,23448,23453,25860,28089,29200,29858,30458,30507,31225,35745,37674,39090,39093,39096,42784,43723,44875,47170,49357,50243,51582,51961,52759,52845,53808,54171,54577,55004,64385,-1464,-5308,12809,23881,-1454,-50286,8171,52041,52046,52047,52048,52049,52050,52059,52060,52061,52031,52033,52034,52035,52036,58778,58779,58780,60103,-49998,-66188,-47541,52375,59134,-62900,49560,62324,31890);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-100,'spell_warr_charge'),
+(-12162,'spell_warr_deep_wounds'),
+(13567,'spell_gen_dummy_trigger'),
+(17251,'spell_gen_spirit_healer_res'),
+(23019,'spell_item_crystal_prison_dummy_dnd'),
+(23448,'spell_gen_gadgetzan_transporter_backfire'),
+(23453,'spell_gen_gnomish_transporter'),
+(25860,'spell_item_reindeer_transformation'),
+(28089,'spell_thaddius_polarity_shift'),
+(29200,'spell_item_purify_helboar_meat'),
+(29858,'spell_warl_soulshatter'),
+(30458,'spell_item_nigh_invulnerability'),
+(30507,'spell_item_poultryizer'),
+(31225,'spell_item_shimmering_vessel'),
+(35745,'spell_item_socrethars_stone'),
+(37674,'spell_gen_chaos_blast'),
+(39090,'spell_capacitus_polarity_charge'),
+(39093,'spell_capacitus_polarity_charge'),
+(39096,'spell_capacitus_polarity_shift'),
+(42784,'spell_astromancer_wrath_of_the_astromancer'),
+(43723,'spell_item_demon_broiled_surprise'),
+(44875,'spell_item_complete_raptor_capture'),
+(47170,'spell_item_impale_leviroth'),
+(49357,'spell_item_brewfest_mount_transformation'),
+(50243,'spell_item_teach_language'),
+(51582,'spell_item_rocket_boots'),
+(51961,'spell_item_chicken_cover'),
+(52759,'spell_sha_ancestral_awakening_proc'),
+(52845,'spell_item_brewfest_mount_transformation'),
+(53808,'spell_item_pygmy_oil'),
+(54577,'spell_item_uded'),
+(54171,'spell_pal_divine_storm_dummy'),
+(55004,'spell_item_nitro_boots'),
+(64385,'spell_item_unusual_compass'),
+(-1464,'spell_warr_slam'),
+(-5308,'spell_warr_execute'),
+(12809,'spell_warr_concussion_blow'),
+(23881,'spell_warr_bloodthirst'),
+(-1454,'spell_warl_life_tap'),
+(-50286,'spell_dru_starfall_dummy'),
+(8171,'spell_sha_cleansing_totem_pulse'),
+(52041,'spell_sha_healing_stream_totem'),
+(52046,'spell_sha_healing_stream_totem'),
+(52047,'spell_sha_healing_stream_totem'),
+(52048,'spell_sha_healing_stream_totem'),
+(52049,'spell_sha_healing_stream_totem'),
+(52050,'spell_sha_healing_stream_totem'),
+(52059,'spell_sha_healing_stream_totem'),
+(52060,'spell_sha_healing_stream_totem'),
+(52061,'spell_sha_healing_stream_totem'),
+(52031,'spell_sha_mana_spring_totem'),
+(52033,'spell_sha_mana_spring_totem'),
+(52034,'spell_sha_mana_spring_totem'),
+(52035,'spell_sha_mana_spring_totem'),
+(52036,'spell_sha_mana_spring_totem'),
+(58778,'spell_sha_mana_spring_totem'),
+(58779,'spell_sha_mana_spring_totem'),
+(58780,'spell_sha_mana_spring_totem'),
+(60103,'spell_sha_lava_lash'),
+(-49998,'spell_dk_death_strike'),
+(-66188,'spell_dk_death_strike'),
+(-47541,'spell_dk_death_coil'),
+(52375,'spell_dk_death_coil'),
+(59134,'spell_dk_death_coil'),
+(-62900,'spell_dk_death_coil'),
+(49560,'spell_dk_death_grip'),
+(62324,'spell_vehicle_throw_passenger');
diff --git a/sql/updates/world/2012_02_18_01_world_spell_dbc.sql b/sql/updates/world/2012_02_18_01_world_spell_dbc.sql
new file mode 100644
index 00000000000..b343399d7f2
--- /dev/null
+++ b/sql/updates/world/2012_02_18_01_world_spell_dbc.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_dbc` WHERE `id`=31980;
+INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES
+(31980,0,0,328064,1024,4,268894208,0,0,0,0,0,0,0,1,0,0,101,0,0,14,14,0,13,0,-1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,15,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,0,1,0,0,0,1,"Righteous Defense Trigger Spell");
diff --git a/sql/updates/world/2012_02_18_02_world_gossip.sql b/sql/updates/world/2012_02_18_02_world_gossip.sql
new file mode 100644
index 00000000000..c72532e3f21
--- /dev/null
+++ b/sql/updates/world/2012_02_18_02_world_gossip.sql
@@ -0,0 +1,52 @@
+-- Gossip for Lore Keeper of Norgannon "Uldaman" for quest 2278 "The Platinum Discs"
+UPDATE `creature_template` SET `gossip_menu_id`=562 WHERE `entry`=7172;
+
+-- SAI for Lore Keeper of Norgannon
+SET @ENTRY := 7172;
+UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,1,62,0,100,0,576,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Lore Keeper of Norgannon - On gossip option select - close gossip'),
+(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,26,2278,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Lore Keeper of Norgannon - On gossip option select - give quest credit');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=562 AND `SourceEntry`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,562,0,0,9,2278,0,0,0,'','Show gossip option if player has quest 2278 but not complete');
+
+DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 561 AND 576;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(561,1080),
+(562,1079),
+(563,1081),
+(564,1082),
+(565,1083),
+(566,1084),
+(567,1085),
+(568,1086),
+(569,1087),
+(570,1088),
+(571,1089),
+(572,1090),
+(573,1091),
+(574,1092),
+(575,1093),
+(576,1094);
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 561 AND 576;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES
+(561,0,0,'What is a "subterranean being matrix"?',1,1,563,0,0,0,''),
+(562,0,0,'Who are the Earthen?',1,1,561,0,0,0,''),
+(563,0,0,'What are the anomalies you speak of?',1,1,564,0,0,0,''),
+(564,0,0,'What is a "resilient foundation of construction"?',1,1,565,0,0,0,''),
+(565,0,0,'So... the Earthen were made out of stone?',1,1,566,0,0,0,''),
+(566,0,0,'Anything else I should know about the Earthen?',1,1,567,0,0,0,''),
+(567,0,0,'I think I understand the Creators'' design intent for the Earthen now. What are the Earthen''s anomalies that you spoke of earlier?',1,1,568,0,0,0,''),
+(568,0,0,'What high-stress environments would cause the Earthen to destabilize?',1,1,569,0,0,0,''),
+(569,0,0,'What happens when the Earthen destabilize?',1,1,570,0,0,0,''),
+(570,0,0,'Troggs?! Are the troggs you mention the same as the ones in the world today?',1,1,571,0,0,0,''),
+(571,0,0,'You mentioned two results when the Earthen destabilize. What is the second?',1,1,572,0,0,0,''),
+(572,0,0,'Dwarves!!! Now you''re telling me that dwarves originally came from the Earthen?!',1,1,573,0,0,0,''),
+(573,0,0,'These dwarves are the same ones today, yes? Do dwarves maintain any other links to the Earthen?',1,1,574,0,0,0,''),
+(574,0,0,'Who are the Creators?',1,1,575,0,0,0,''),
+(575,0,0,'This is a lot to think about.',1,1,576,0,0,0,''),
+(576,0,0,'I will access the discs now.',1,1,0,0,0,0,''); \ No newline at end of file
diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp
index 72c36fc6646..e839457d1c9 100755
--- a/src/server/authserver/Server/RealmSocket.cpp
+++ b/src/server/authserver/Server/RealmSocket.cpp
@@ -95,7 +95,7 @@ const std::string& RealmSocket::getRemoteAddress(void) const
return _remoteAddress;
}
-const uint16 RealmSocket::getRemotePort(void) const
+uint16 RealmSocket::getRemotePort(void) const
{
return _remotePort;
}
diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h
index 9dbd0a4aafb..c03a0e3ad1e 100755
--- a/src/server/authserver/Server/RealmSocket.h
+++ b/src/server/authserver/Server/RealmSocket.h
@@ -55,7 +55,7 @@ public:
const std::string& getRemoteAddress(void) const;
- const uint16 getRemotePort(void) const;
+ uint16 getRemotePort(void) const;
virtual int open(void *);
diff --git a/src/server/collision/BoundingIntervalHierarchyWrapper.h b/src/server/collision/BoundingIntervalHierarchyWrapper.h
index e54a4e653a1..e2252ca60c8 100644
--- a/src/server/collision/BoundingIntervalHierarchyWrapper.h
+++ b/src/server/collision/BoundingIntervalHierarchyWrapper.h
@@ -34,7 +34,7 @@ class BIHWrap
const T* const* objects;
RayCallback& _callback;
- MDLCallback(RayCallback& callback, const T* const* objects_array ) : _callback(callback), objects(objects_array){}
+ MDLCallback(RayCallback& callback, const T* const* objects_array ) : objects(objects_array), _callback(callback) {}
bool operator() (const Ray& ray, uint32 Idx, float& MaxDist, bool /*stopAtFirst*/)
{
@@ -106,4 +106,4 @@ public:
}
};
-#endif // _BIH_WRAP \ No newline at end of file
+#endif // _BIH_WRAP
diff --git a/src/server/collision/DynamicTree.cpp b/src/server/collision/DynamicTree.cpp
index 89e76d426fe..ebb46614a20 100644
--- a/src/server/collision/DynamicTree.cpp
+++ b/src/server/collision/DynamicTree.cpp
@@ -43,10 +43,11 @@ template<> struct BoundsTrait< GameObjectModel> {
static void getBounds2(const GameObjectModel* g, G3D::AABox& out) { out = g->getBounds();}
};
+/*
static bool operator == (const GameObjectModel& mdl, const GameObjectModel& mdl2){
return &mdl == &mdl2;
}
-
+*/
int valuesPerNode = 5, numMeanSplits = 3;
@@ -251,4 +252,4 @@ float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist,
return v.z - maxSearchDist;
else
return -G3D::inf();
-} \ No newline at end of file
+}
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index 62968e4dedd..cfd50c318df 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -344,16 +344,15 @@ namespace VMAP
char buff[500];
while (!feof(model_list))
{
- fread(&displayId,sizeof(uint32),1,model_list);
- fread(&name_length,sizeof(uint32),1,model_list);
-
- if (name_length >= sizeof(buff))
+ if (fread(&displayId, sizeof(uint32), 1, model_list) != 1
+ || fread(&name_length, sizeof(uint32), 1, model_list) != 1
+ || name_length >= sizeof(buff)
+ || fread(&buff, sizeof(char), name_length, model_list) != name_length)
{
std::cout << "\nFile 'temp_gameobject_models' seems to be corrupted" << std::endl;
break;
}
- fread(&buff,sizeof(char),name_length,model_list);
std::string model_name(buff, name_length);
WorldModel_Raw raw_model;
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp
index 5ad984fcb4b..4c0a344f868 100644
--- a/src/server/collision/Models/GameObjectModel.cpp
+++ b/src/server/collision/Models/GameObjectModel.cpp
@@ -36,7 +36,7 @@ using G3D::AABox;
struct GameobjectModelData
{
GameobjectModelData(const std::string& name_, const AABox& box) :
- name(name_), bound(box) {}
+ bound(box), name(name_) {}
AABox bound;
std::string name;
@@ -55,20 +55,18 @@ void LoadGameObjectModelList()
char buff[500];
while (!feof(model_list_file))
{
- fread(&displayId,sizeof(uint32),1,model_list_file);
- fread(&name_length,sizeof(uint32),1,model_list_file);
-
- if (name_length >= sizeof(buff))
+ Vector3 v1, v2;
+ if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1
+ || fread(&name_length, sizeof(uint32), 1, model_list_file) != 1
+ || name_length >= sizeof(buff)
+ || fread(&buff, sizeof(char), name_length, model_list_file) != name_length
+ || fread(&v1, sizeof(Vector3), 1, model_list_file) != 1
+ || fread(&v2, sizeof(Vector3), 1, model_list_file) != 1)
{
printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS);
break;
}
- fread(&buff, sizeof(char), name_length,model_list_file);
- Vector3 v1, v2;
- fread(&v1, sizeof(Vector3), 1, model_list_file);
- fread(&v2, sizeof(Vector3), 1, model_list_file);
-
model_list.insert
(
ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) )
@@ -172,4 +170,4 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto
MaxDist = distance;
}
return hit;
-} \ No newline at end of file
+}
diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h
index be61504bc65..2c11b1c257d 100644
--- a/src/server/collision/RegularGrid.h
+++ b/src/server/collision/RegularGrid.h
@@ -17,7 +17,7 @@ using G3D::Ray;
template<class Node>
struct NodeCreator{
- static Node * makeNode(int x, int y) { return new Node();}
+ static Node * makeNode(int /*x*/, int /*y*/) { return new Node();}
};
template<class T,
@@ -215,4 +215,4 @@ public:
#undef CELL_SIZE
#undef HGRID_MAP_SIZE
-#endif \ No newline at end of file
+#endif
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index d8def36f999..86f2c6a28b7 100755
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -326,7 +326,7 @@ void VehicleAI::CheckConditions(const uint32 diff)
{
if (Player* player = passenger->ToPlayer())
{
- if (!sConditionMgr->IsObjectMeetToConditions(player, conditions))
+ if (!sConditionMgr->IsObjectMeetToConditions(player, me, conditions))
{
player->ExitVehicle();
return;//check other pessanger in next tick
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index e7504b4ddd2..a2e958d680f 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -648,37 +648,37 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
}
//this function inserts to WorldPacket auction's data
-bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
+bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
{
- Item* pItem = sAuctionMgr->GetAItem(item_guidlow);
- if (!pItem)
+ Item* item = sAuctionMgr->GetAItem(item_guidlow);
+ if (!item)
{
- sLog->outError("auction to item, that doesn't exist !!!!");
+ sLog->outError("AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow);
return false;
}
data << uint32(Id);
- data << uint32(pItem->GetEntry());
+ data << uint32(item->GetEntry());
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; ++i)
{
- data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i)));
- data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i)));
- data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
+ data << uint32(item->GetEnchantmentId(EnchantmentSlot(i)));
+ data << uint32(item->GetEnchantmentDuration(EnchantmentSlot(i)));
+ data << uint32(item->GetEnchantmentCharges(EnchantmentSlot(i)));
}
- data << int32(pItem->GetItemRandomPropertyId()); //random item property id
- data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor
- data << uint32(pItem->GetCount()); //item->count
- data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF
- data << uint32(0); //Unknown
- data << uint64(owner); //Auction->owner
- data << uint32(startbid); //Auction->startbid (not sure if useful)
+ data << int32(item->GetItemRandomPropertyId()); // Random item property id
+ data << uint32(item->GetItemSuffixFactor()); // SuffixFactor
+ data << uint32(item->GetCount()); // item->count
+ data << uint32(item->GetSpellCharges()); // item->charge FFFFFFF
+ data << uint32(0); // Unknown
+ data << uint64(owner); // Auction->owner
+ data << uint32(startbid); // Auction->startbid (not sure if useful)
data << uint32(bid ? GetAuctionOutBid() : 0);
- //minimal outbid
- data << uint32(buyout); //auction->buyout
- data << uint32((expire_time-time(NULL))*IN_MILLISECONDS);//time left
- data << uint64(bidder); //auction->bidder current
- data << uint32(bid); //current bid
+ // Minimal outbid
+ data << uint32(buyout); // Auction->buyout
+ data << uint32((expire_time - time(NULL)) * IN_MILLISECONDS); // time left
+ data << uint64(bidder); // auction->bidder current
+ data << uint32(bid); // current bid
return true;
}
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index bcdc6c26524..320a02a30ed 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -40,7 +40,6 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
return false;
}
bool condMeets = false;
- bool sendErrorMsg = false;
switch (ConditionType)
{
case CONDITION_NONE:
@@ -49,15 +48,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
case CONDITION_AURA:
{
if (Unit* unit = object->ToUnit())
- {
- if (!ConditionValue3)
- condMeets = unit->HasAuraEffect(ConditionValue1, ConditionValue2);
- else if (Player* player = unit->ToPlayer())
- {
- if (Unit* target = player->GetSelectedUnit())
- condMeets = target->HasAuraEffect(ConditionValue1, ConditionValue2);
- }
- }
+ condMeets = unit->HasAuraEffect(ConditionValue1, ConditionValue2);
break;
}
case CONDITION_ITEM:
@@ -165,49 +156,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
case CONDITION_SPELL_SCRIPT_TARGET:
condMeets = true;//spell target condition is handled in spellsystem, here it is always true
break;
- case CONDITION_CREATURE_TARGET:
- {
- if (Player* player = object->ToPlayer())
- {
- Unit* target = player->GetSelectedUnit();
- if (target)
- if (Creature* cTarget = target->ToCreature())
- if (cTarget->GetEntry() == ConditionValue1)
- condMeets = true;
- }
- break;
- }
- case CONDITION_TARGET_HEALTH_BELOW_PCT:
- {
- if (Player* player = object->ToPlayer())
- {
- Unit* target = player->GetSelectedUnit();
- if (target)
- condMeets = !target->HealthAbovePct(ConditionValue1);
- break;
- }
- }
- case CONDITION_TARGET_RANGE:
- {
- if (Player* player = object->ToPlayer())
- {
- if (Unit* target = player->GetSelectedUnit())
- if (player->GetDistance(target) >= ConditionValue1 && (!ConditionValue2 || player->GetDistance(target) <= ConditionValue2))
- condMeets = true;
- }
- break;
- }
case CONDITION_MAPID:
condMeets = object->GetMapId() == ConditionValue1;
break;
case CONDITION_AREAID:
condMeets = object->GetAreaId() == ConditionValue1;
break;
- case CONDITION_ITEM_TARGET:
- {
- condMeets = true; //handled in Item::IsTargetValidForItemUse
- break;
- }
case CONDITION_SPELL:
{
if (Player* player = object->ToPlayer())
@@ -343,6 +297,10 @@ uint32 Condition::GetMaxAvailableConditionTargets()
switch(SourceType)
{
case CONDITION_SOURCE_TYPE_SPELL:
+ case CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE:
+ case CONDITION_SOURCE_TYPE_VEHICLE_SPELL:
+ case CONDITION_SOURCE_TYPE_GOSSIP_MENU:
+ case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION:
return 2;
case CONDITION_SOURCE_TYPE_SMART_EVENT:
return 2;
@@ -418,6 +376,12 @@ bool ConditionMgr::IsObjectMeetToConditions(WorldObject* object, ConditionList c
return IsObjectMeetToConditions(srcInfo, conditions);
}
+bool ConditionMgr::IsObjectMeetToConditions(WorldObject* object1, WorldObject* object2, ConditionList const& conditions)
+{
+ ConditionSourceInfo srcInfo = ConditionSourceInfo(object1, object2);
+ return IsObjectMeetToConditions(srcInfo, conditions);
+}
+
bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, ConditionList const& conditions)
{
if (conditions.empty())
@@ -543,6 +507,9 @@ void ConditionMgr::LoadConditions(bool isReload)
if (iConditionTypeOrReference >= 0)
cond->ConditionType = ConditionTypes(iConditionTypeOrReference);
+ if (iSourceTypeOrReferenceId >= 0)
+ cond->SourceType = ConditionSourceType(iSourceTypeOrReferenceId);
+
if (iConditionTypeOrReference < 0)//it has a reference
{
if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skip
@@ -591,8 +558,6 @@ void ConditionMgr::LoadConditions(bool isReload)
continue;
}//end of reference templates
- cond->SourceType = ConditionSourceType(iSourceTypeOrReferenceId);
-
//if not a reference and SourceType is invalid, skip
if (iConditionTypeOrReference >= 0 && !isSourceTypeValid(cond))
{
@@ -758,7 +723,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond)
{
for (GossipMenusContainer::iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr)
{
- if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == cond->SourceEntry)
+ if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == uint32(cond->SourceEntry))
{
(*itr).second.conditions.push_back(cond);
return true;
@@ -777,7 +742,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond)
{
for (GossipMenuItemsContainer::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
{
- if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == cond->SourceEntry)
+ if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == uint32(cond->SourceEntry))
{
(*itr).second.Conditions.push_back(cond);
return true;
@@ -1082,50 +1047,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
}
break;
}
- case CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET:
- {
- if (cond->ConditionType != CONDITION_ITEM_TARGET)
- {
- sLog->outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_ITEM_TARGET(24) is valid for CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET(18), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
- return false;
- }
-
- ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
- if (!pItemProto)
- {
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->SourceEntry);
- return false;
- }
-
- bool bIsItemSpellValid = false;
- for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
- {
- if (SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(pItemProto->Spells[i].SpellId))
- {
- if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
- pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
- {
- ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, pSpellInfo->Id);//script loading is done before item target loading
- if (!conditions.empty())
- break;
-
- if (pSpellInfo->NeedsExplicitUnitTarget())
- {
- bIsItemSpellValid = true;
- break;
- }
- }
- }
- }
-
- if (!bIsItemSpellValid)
- {
- sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't allow caster to select a unit target"
- ", or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->SourceEntry);
- break;
- }
- break;
- }
case CONDITION_SOURCE_TYPE_QUEST_ACCEPT:
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
{
@@ -1153,6 +1074,9 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
return false;
}
break;
+ case CONDITION_SOURCE_TYPE_UNUSED_18:
+ sLog->outErrorDb("Found SourceTypeOrReferenceId = CONDITION_SOURCE_TYPE_UNUSED_18 in `conditions` table - ignoring");
+ return false;
case CONDITION_SOURCE_TYPE_GOSSIP_MENU:
case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION:
case CONDITION_SOURCE_TYPE_SMART_EVENT:
@@ -1192,6 +1116,8 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
sLog->outErrorDb("Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->ConditionValue2);
return false;
}
+ if (cond->ConditionValue3)
+ sLog->outErrorDb("Aura condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ITEM:
@@ -1405,45 +1331,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
break;
}
- case CONDITION_CREATURE_TARGET:
- {
- if (!cond->ConditionValue1 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue1))
- {
- sLog->outErrorDb("CreatureTarget condition has non existing creature template entry (%u) as target, skipped", cond->ConditionValue1);
- return false;
- }
-
- if (cond->ConditionValue2)
- sLog->outErrorDb("CreatureTarget condition has useless data in value2 (%u)!", cond->ConditionValue2);
- if (cond->ConditionValue3)
- sLog->outErrorDb("CreatureTarget condition has useless data in value3 (%u)!", cond->ConditionValue3);
- break;
- }
- case CONDITION_TARGET_HEALTH_BELOW_PCT:
- {
- if (cond->ConditionValue1 > 100)
- {
- sLog->outErrorDb("TargetHealthBelowPct condition has invalid data in value1 (%u), skipped", cond->ConditionValue1);
- return false;
- }
-
- if (cond->ConditionValue2)
- sLog->outErrorDb("TargetHealthBelowPct condition has useless data in value2 (%u)!", cond->ConditionValue2);
- if (cond->ConditionValue3)
- sLog->outErrorDb("TargetHealthBelowPct condition has useless data in value3 (%u)!", cond->ConditionValue3);
- break;
- }
- case CONDITION_TARGET_RANGE:
- {
- if (cond->ConditionValue2 && cond->ConditionValue2 < cond->ConditionValue1)//maxDist can be 0 for infinit max range
- {
- sLog->outErrorDb("TargetRange condition has max distance closer then min distance, skipped");
- return false;
- }
- if (cond->ConditionValue3)
- sLog->outErrorDb("TargetRange condition has useless data in value3 (%u)!", cond->ConditionValue3);
- break;
- }
case CONDITION_MAPID:
{
MapEntry const* me = sMapStore.LookupEntry(cond->ConditionValue1);
@@ -1459,24 +1346,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
sLog->outErrorDb("Map condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
- case CONDITION_ITEM_TARGET:
- {
- if (!cond->ConditionValue1 || cond->ConditionValue1 > MAX_ITEM_REQ_TARGET_TYPE)
- {
- sLog->outErrorDb("ItemTarget condition has incorrect target type (%u), skipped", cond->ConditionValue1);
- return false;
- }
-
- if (!cond->ConditionValue2 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue2))
- {
- sLog->outErrorDb("ItemTarget condition has non existing creature template entry (%u) as target, skipped", cond->ConditionValue2);
- return false;
- }
-
- if (cond->ConditionValue3)
- sLog->outErrorDb("ItemTarget condition has useless data in value3 (%u)!", cond->ConditionValue3);
- break;
- }
case CONDITION_SPELL:
{
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
@@ -1702,6 +1571,18 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
+ case CONDITION_UNUSED_19:
+ sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
+ return false;
+ case CONDITION_UNUSED_20:
+ sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
+ return false;
+ case CONDITION_UNUSED_21:
+ sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
+ return false;
+ case CONDITION_UNUSED_24:
+ sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
+ return false;
default:
break;
}
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index dc204ccd0ec..79a2122ae29 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -49,12 +49,12 @@ enum ConditionTypes
CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race
CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete
CONDITION_SPELL_SCRIPT_TARGET = 18, // SpellScriptTargetType, TargetEntry, 0
- CONDITION_CREATURE_TARGET = 19, // creature entry 0 0 true if current target is creature with value1 entry
- CONDITION_TARGET_HEALTH_BELOW_PCT = 20, // 0-100 0 0 true if target's health is below value1 percent, false if over or no target
- CONDITION_TARGET_RANGE = 21, // minDistance maxDist 0 true if target is closer then minDist and further then maxDist or if max is 0 then max dist is infinit
+ CONDITION_UNUSED_19 = 19, //
+ CONDITION_UNUSED_20 = 20, //
+ CONDITION_UNUSED_21 = 21, //
CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
- CONDITION_ITEM_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0
+ CONDITION_UNUSED_24 = 24, //
CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell
CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask
CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement)
@@ -92,7 +92,7 @@ enum ConditionSourceType
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15,
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16,
CONDITION_SOURCE_TYPE_SPELL = 17,
- CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18,
+ CONDITION_SOURCE_TYPE_UNUSED_18 = 18,
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20,
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21,
@@ -199,6 +199,7 @@ class ConditionMgr
ConditionList GetConditionReferences(uint32 refId);
bool IsObjectMeetToConditions(WorldObject* object, ConditionList const& conditions);
+ bool IsObjectMeetToConditions(WorldObject* object1, WorldObject* object2, ConditionList const& conditions);
bool IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, ConditionList const& conditions);
ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry);
ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType);
@@ -254,10 +255,11 @@ template <class T> bool CompareValues(ComparisionType type, T val1, T val2)
return val1 >= val2;
case COMP_TYPE_LOW_EQ:
return val1 <= val2;
+ default:
+ // incorrect parameter
+ ASSERT(false);
+ return false;
}
- // incorrect parameter
- ASSERT(false);
- return false;
}
#define sConditionMgr ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance()
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index cbd0922118c..3dfa1cece61 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -141,11 +141,11 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
Creature::Creature(bool isWorldObject): Unit(isWorldObject), MapCreature(),
lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLowGUID(0),
-m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0),
+m_PlayerDamageReq(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0),
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false),
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
-m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL), m_path_id(0)
+m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL)
{
m_regenTimer = CREATURE_REGEN_INTERVAL;
m_valuesCount = UNIT_END;
@@ -1415,7 +1415,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
return false;
-
+
// Do not attack non-combat pets
if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
return false;
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 1e360342852..bfe186329e1 100755
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -721,7 +721,6 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
static float _GetHealthMod(int32 Rank);
- uint32 m_lootMoney;
uint64 m_lootRecipient;
uint32 m_lootRecipientGroup;
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 41e0b8e054b..a06cee891e7 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -33,7 +33,7 @@
#include "GameObjectModel.h"
#include "DynamicTree.h"
-GameObject::GameObject() : WorldObject(false), m_goValue(new GameObjectValue), m_AI(NULL), m_model(NULL)
+GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new GameObjectValue), m_AI(NULL)
{
m_objectType |= TYPEMASK_GAMEOBJECT;
m_objectTypeId = TYPEID_GAMEOBJECT;
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index f303f7bf877..70b81593b56 100755
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -870,24 +870,6 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
return true;
}
-bool Item::IsTargetValidForItemUse(Unit* pUnitTarget)
-{
- ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET, GetTemplate()->ItemId);
- if (conditions.empty())
- return true;
-
- if (!pUnitTarget)
- return false;
-
- for (ConditionList::const_iterator itr = conditions.begin(); itr != conditions.end(); ++itr)
- {
- ItemRequiredTarget irt(ItemRequiredTargetType((*itr)->ConditionValue1), (*itr)->ConditionValue2);
- if (irt.IsFitToRequirements(pUnitTarget))
- return true;
- }
- return false;
-}
-
void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges)
{
// Better lost small time at check in comparison lost time at item save to DB.
@@ -1092,25 +1074,6 @@ bool Item::IsBindedNotWith(Player const* player) const
return true;
}
-bool ItemRequiredTarget::IsFitToRequirements(Unit* pUnitTarget) const
-{
- if (pUnitTarget->GetTypeId() != TYPEID_UNIT)
- return false;
-
- if (pUnitTarget->GetEntry() != m_uiTargetEntry)
- return false;
-
- switch (m_uiType)
- {
- case ITEM_TARGET_TYPE_CREATURE:
- return pUnitTarget->isAlive();
- case ITEM_TARGET_TYPE_DEAD:
- return !pUnitTarget->isAlive();
- default:
- return false;
- }
-}
-
void Item::BuildUpdate(UpdateDataMapType& data_map)
{
if (Player* owner = GetOwner())
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index 0960a3e5563..3a197a8347f 100755
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -201,26 +201,8 @@ enum ItemUpdateState
ITEM_REMOVED = 3
};
-enum ItemRequiredTargetType
-{
- ITEM_TARGET_TYPE_CREATURE = 1,
- ITEM_TARGET_TYPE_DEAD = 2
-};
-
-#define MAX_ITEM_REQ_TARGET_TYPE 2
-
#define MAX_ITEM_SPELLS 5
-struct ItemRequiredTarget
-{
- ItemRequiredTarget(ItemRequiredTargetType uiType, uint32 uiTargetEntry) : m_uiType(uiType), m_uiTargetEntry(uiTargetEntry) {}
- ItemRequiredTargetType m_uiType;
- uint32 m_uiTargetEntry;
-
- // helpers
- bool IsFitToRequirements(Unit* pUnitTarget) const;
-};
-
bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
class Item : public Object
@@ -268,7 +250,6 @@ class Item : public Object
uint32 GetEnchantRequiredLevel() const;
bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
- bool IsTargetValidForItemUse(Unit* pUnitTarget);
bool IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) const;
bool GemsFitSockets() const;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 64b0e542467..941d898c1fb 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -434,9 +434,9 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/)
// 5. Credit instance encounter.
KillRewarder::KillRewarder(Player* killer, Unit* victim, bool isBattleGround) :
// 1. Initialize internal variables to default values.
- _killer(killer), _victim(victim), _isBattleGround(isBattleGround),
- _isPvP(false), _group(killer->GetGroup()), _groupRate(1.0f),
- _maxLevel(0), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _isFullXP(false), _xp(0)
+ _killer(killer), _victim(victim), _group(killer->GetGroup()),
+ _groupRate(1.0f), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _xp(0),
+ _isFullXP(false), _maxLevel(0), _isBattleGround(isBattleGround), _isPvP(false)
{
// mark the credit as pvp if victim is player
if (victim->GetTypeId() == TYPEID_PLAYER)
@@ -11830,7 +11830,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
Map const* map = lootedObject->GetMap();
if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true))
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
- if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty())
+ if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty())
lootedObjectInDungeon = true;
if (!lootedObjectInDungeon)
@@ -12024,7 +12024,6 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
return NULL;
Item* lastItem = pItem;
- uint32 entry = pItem->GetEntry();
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();)
{
uint16 pos = itr->pos;
@@ -14089,7 +14088,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
for (GossipMenuItemsContainer::const_iterator itr = menuItemBounds.first; itr != menuItemBounds.second; ++itr)
{
bool canTalk = true;
- if (!sConditionMgr->IsObjectMeetToConditions(this, itr->second.Conditions))
+ if (!sConditionMgr->IsObjectMeetToConditions(this, source, itr->second.Conditions))
continue;
if (source->GetTypeId() == TYPEID_UNIT)
@@ -14233,7 +14232,7 @@ void Player::SendPreparedGossip(WorldObject* source)
uint32 textId = GetGossipTextId(source);
if (uint32 menuId = PlayerTalkClass->GetGossipMenu().GetMenuId())
- textId = GetGossipTextId(menuId);
+ textId = GetGossipTextId(menuId, source);
PlayerTalkClass->SendGossipMenu(textId, source->GetGUID());
}
@@ -14378,10 +14377,10 @@ uint32 Player::GetGossipTextId(WorldObject* source)
if (!source)
return DEFAULT_GOSSIP_MESSAGE;
- return GetGossipTextId(GetDefaultGossipMenuForSource(source));
+ return GetGossipTextId(GetDefaultGossipMenuForSource(source), source);
}
-uint32 Player::GetGossipTextId(uint32 menuId)
+uint32 Player::GetGossipTextId(uint32 menuId, WorldObject* source)
{
uint32 textId = DEFAULT_GOSSIP_MESSAGE;
@@ -14391,8 +14390,10 @@ uint32 Player::GetGossipTextId(uint32 menuId)
GossipMenusMapBounds menuBounds = sObjectMgr->GetGossipMenusMapBounds(menuId);
for (GossipMenusContainer::const_iterator itr = menuBounds.first; itr != menuBounds.second; ++itr)
- if (sConditionMgr->IsObjectMeetToConditions(this, itr->second.conditions))
+ {
+ if (sConditionMgr->IsObjectMeetToConditions(this, source, itr->second.conditions))
textId = itr->second.text_id;
+ }
return textId;
}
@@ -19862,7 +19863,7 @@ void Player::VehicleSpellInitialize()
}
ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(veh->GetEntry(), spellId);
- if (!sConditionMgr->IsObjectMeetToConditions(this, conditions))
+ if (!sConditionMgr->IsObjectMeetToConditions(this, veh, conditions))
{
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId);
data << uint16(0) << uint8(0) << uint8(i+8);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 0fb2a6fb75d..7f08f03b5f8 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1383,7 +1383,7 @@ class Player : public Unit, public GridObject<Player>
void SendPreparedGossip(WorldObject* source);
void OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 menuId);
- uint32 GetGossipTextId(uint32 menuId);
+ uint32 GetGossipTextId(uint32 menuId, WorldObject* source);
uint32 GetGossipTextId(WorldObject* source);
static uint32 GetDefaultGossipMenuForSource(WorldObject* source);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 04eab0b7d56..4670a976e42 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -146,9 +146,10 @@ _hitMask(hitMask), _spell(spell), _damageInfo(damageInfo), _healInfo(healInfo)
#endif
Unit::Unit(bool isWorldObject): WorldObject(isWorldObject),
m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(false),
-m_ControlledByPlayer(false), i_AI(NULL), i_disabledAI(NULL), m_procDeep(0),
-m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this), m_vehicle(NULL),
-m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this), movespline(new Movement::MoveSpline())
+m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL),
+i_disabledAI(NULL), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(this),
+m_ThreatManager(this), m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
+m_HostileRefManager(this)
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -7010,8 +7011,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
- || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
- || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
+ || (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
+ || (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
return false;
// Now compute real proc chance...
@@ -7307,8 +7308,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
Player* player = ToPlayer();
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
- || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
- || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
+ || (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
+ || (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
return false;
float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f));
@@ -9767,6 +9768,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
{
// Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
+
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE))
ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL, true);
}
@@ -12163,7 +12165,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
if (FactionTemplateEntry const* factionTemplate = creature->getFactionTemplateEntry())
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
- if (repState->Flags & FACTION_FLAG_PEACE_FORCED)
+ if (!(repState->Flags & FACTION_FLAG_AT_WAR))
return false;
}
}
@@ -12685,7 +12687,6 @@ void Unit::setDeathState(DeathState s)
{
// death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that
// it can be used to check creation of death items (such as soul shards).
- DeathState oldDeathState = m_deathState;
m_deathState = s;
if (s != ALIVE && s != JUST_ALIVED)
diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h
index 57d9204ad1c..df34a61d444 100644
--- a/src/server/game/Entities/Vehicle/VehicleDefines.h
+++ b/src/server/game/Entities/Vehicle/VehicleDefines.h
@@ -63,7 +63,7 @@ struct VehicleSeat
struct VehicleAccessory
{
VehicleAccessory(uint32 entry, int8 seatId, bool isMinion, uint8 summonType, uint32 summonTime) :
- AccessoryEntry(entry), SeatId(seatId), IsMinion(isMinion), SummonedType(summonType), SummonTime(summonTime) {}
+ AccessoryEntry(entry), IsMinion(isMinion), SummonTime(summonTime), SeatId(seatId), SummonedType(summonType) {}
uint32 AccessoryEntry;
uint32 IsMinion;
uint32 SummonTime;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 2feb2eddf76..e93bd209fcd 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -6701,7 +6701,7 @@ void ObjectMgr::LoadCorpses()
PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES));
if (!result)
{
- sLog->outString(">> Loaded 0 corpses. DB table `pet_name_generation` is empty.");
+ sLog->outString(">> Loaded 0 corpses. DB table `corpse` is empty.");
sLog->outString();
return;
}
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 4112711ad3c..12e3fda0484 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -530,26 +530,24 @@ namespace Trinity
class RaiseDeadObjectCheck
{
public:
- RaiseDeadObjectCheck(Unit* source, float range) : _source(source), i_range(range) {}
+ RaiseDeadObjectCheck(Unit* source, float range) : _source(source), _range(range) {}
bool operator()(Creature* u)
{
if (_source->GetTypeId() != TYPEID_PLAYER || !((Player*)_source)->isHonorOrXPTarget(u) ||
- u->getDeathState() != CORPSE ||
+ u->getDeathState() != CORPSE ||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0 ||
(u->GetDisplayId() != u->GetNativeDisplayId()))
return false;
- return _source->IsWithinDistInMap(u, i_range);
+ return _source->IsWithinDistInMap(u, _range);
}
-
bool operator()(Player* u)
{
if (_source == u || _source->GetTypeId() != TYPEID_PLAYER || !((Player*)_source)->isHonorOrXPTarget(u) ||
u->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) || u->isInFlight() || !u->isDead() ||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0)
return false;
-
- return _source->IsWithinDistInMap(u, i_range);
+ return _source->IsWithinDistInMap(u, _range);
}
bool operator()(Corpse* u)
@@ -557,12 +555,12 @@ namespace Trinity
if (_source->GetTypeId() != TYPEID_PLAYER || u->GetType() == CORPSE_BONES)
return false;
- return _source->IsWithinDistInMap(u, i_range);
+ return _source->IsWithinDistInMap(u, _range);
}
template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
private:
Unit* const _source;
- float i_range;
+ float _range;
};
class ExplodeCorpseObjectCheck
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index b31b632e963..b24b5be014a 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -554,7 +554,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
{
Player* Leader = ObjectAccessor::FindPlayer(GetLeaderGUID());
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(sLFGMgr->GetDungeon(GetGUID()));
- if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != dungeon->map) || !dungeon)
+ if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != uint32(dungeon->map)) || !dungeon)
{
Disband();
return false;
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index fc87d3ed8d6..5a5ae0325e3 100755
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -123,6 +123,12 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
uint64 itemGUIDs[MAX_AUCTION_ITEMS]; // 160 slot = 4x 36 slot bag + backpack 16 slot
uint32 count[MAX_AUCTION_ITEMS];
+ if (itemsCount > MAX_AUCTION_ITEMS)
+ {
+ SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
+ return;
+ }
+
for (uint32 i = 0; i < itemsCount; ++i)
{
recv_data >> itemGUIDs[i];
@@ -153,12 +159,6 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
return;
}
- if (itemsCount > MAX_AUCTION_ITEMS)
- {
- SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
- return;
- }
-
etime *= MINUTE;
switch(etime)
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 310bda92739..d677424496a 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -615,6 +615,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
}
Player newChar(this);
+ newChar.GetMotionMaster()->Initialize();
if (!newChar.Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PLAYER), createInfo))
{
// Player not create (race/class/etc problem?)
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index b8908d0f9f9..9ea0e124112 100755
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -165,24 +165,6 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
targets.Read(recvPacket, pUser);
HandleClientCastFlags(recvPacket, castFlags, targets);
- if (!pItem->IsTargetValidForItemUse(targets.GetUnitTarget()))
- {
- // free gray item after use fail
- pUser->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
-
- // send spell error
- if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
- {
- // for implicit area/coord target spells
- if (!targets.GetUnitTarget())
- Spell::SendCastResult(_player, spellInfo, castCount, SPELL_FAILED_NO_VALID_TARGETS);
- // for explicit target spells
- else
- Spell::SendCastResult(_player, spellInfo, castCount, SPELL_FAILED_BAD_TARGETS);
- }
- return;
- }
-
// Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state.
if (!sScriptMgr->OnItemUse(pUser, pItem, targets))
{
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 90fb8ffb9f0..c6a93ff4272 100755
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -316,7 +316,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->getSource())
if (WorldSession* session = player->GetSession())
- session->SendNotification(buff);
+ session->SendNotification("%s", buff);
}
}
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 564d0cce8b7..64e9b9a27e4 100755
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -1364,7 +1364,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i)
{
- if (i->itemid == cond->SourceEntry)
+ if (i->itemid == uint32(cond->SourceEntry))
{
i->conditions.push_back(cond);
return true;
@@ -1380,7 +1380,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i)
{
- if ((*i).itemid == cond->SourceEntry)
+ if ((*i).itemid == uint32(cond->SourceEntry))
{
(*i).conditions.push_back(cond);
return true;
@@ -1392,7 +1392,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i)
{
- if ((*i).itemid == cond->SourceEntry)
+ if ((*i).itemid == uint32(cond->SourceEntry))
{
(*i).conditions.push_back(cond);
return true;
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 3562835d957..f6189fa556c 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -666,10 +666,11 @@ void Map::RemovePlayerFromMap(Player* player, bool remove)
ASSERT(remove); //maybe deleted in logoutplayer when player is not in a map
if (remove)
+ {
DeleteFromWorld(player);
- if (remove)
sScriptMgr->OnPlayerLeaveMap(this, player);
+ }
}
template<class T>
@@ -2374,7 +2375,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin())))
- if (dungeon->map == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM)
+ if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM)
player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true);
}
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index 83ff81ab30b..9910f8ad40a 100755
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -91,7 +91,7 @@ class MotionMaster //: private std::stack<MovementGenerator *>
void InitTop();
public:
- explicit MotionMaster(Unit* unit) : _top(-1), _owner(unit), _expList(NULL), _cleanFlag(MMCF_NONE)
+ explicit MotionMaster(Unit* unit) : _expList(NULL), _top(-1), _owner(unit), _cleanFlag(MMCF_NONE)
{
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
{
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
index dc47898352e..5725aec54f6 100755
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -57,7 +57,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
}
-bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
+bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 /*time_diff*/)
{
arrived = owner.movespline->Finalized();
return !arrived;
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
index 02f9ebce847..c565e150740 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
@@ -41,7 +41,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
}
template<class T>
-bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
+bool PointMovementGenerator<T>::Update(T &unit, const uint32 & /*diff*/)
{
if (!&unit)
return false;
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 054f87d9fff..b65fa210723 100755
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -35,9 +35,8 @@
template<>
void RandomMovementGenerator<Creature>::_setRandomLocation(Creature& creature)
{
- float respX, respY, respZ, respO, currZ, destX, destY, destZ, travelDistZ;
+ float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ;
creature.GetHomePosition(respX, respY, respZ, respO);
- currZ = creature.GetPositionZ();
Map const* map = creature.GetBaseMap();
// For 2D/3D system selection
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
index bf2eecc89f6..b851dbc0e05 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
@@ -39,8 +39,9 @@ class TargetedMovementGeneratorMedium
{
protected:
TargetedMovementGeneratorMedium(Unit &target, float offset, float angle) :
- TargetedMovementGeneratorBase(target), i_offset(offset), i_angle(angle),
- i_recalculateTravel(false), i_targetReached(false), i_recheckDistance(0)
+ TargetedMovementGeneratorBase(target), i_recheckDistance(0),
+ i_offset(offset), i_angle(angle),
+ i_recalculateTravel(false), i_targetReached(false)
{
}
~TargetedMovementGeneratorMedium() {}
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index 55cf3c28d46..1871454d614 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -78,7 +78,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
{
- sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for %u.", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
+ sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for "UI64FMTD".", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL/*, false*/);
}
@@ -201,20 +201,17 @@ void FlightPathMovementGenerator::Initialize(Player &player)
InitEndGridInfo();
}
-void FlightPathMovementGenerator::Finalize(Player & player)
+void FlightPathMovementGenerator::Finalize(Player& player)
{
// remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
player.ClearUnitState(UNIT_STATE_IN_FLIGHT);
player.Dismount();
- player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+ player.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
- if(player.m_taxi.empty())
+ if (player.m_taxi.empty())
{
player.getHostileRefManager().setOnlineOfflineState(true);
- if(player.pvpInfo.inHostileArea)
- player.CastSpell(&player, 2479, true);
-
// update z position to ground and orientation for landing point
// this prevent cheating with landing point at lags
// when client side flight end early in comparison server side
@@ -243,7 +240,7 @@ void FlightPathMovementGenerator::Reset(Player & player)
init.Launch();
}
-bool FlightPathMovementGenerator::Update(Player &player, const uint32 diff)
+bool FlightPathMovementGenerator::Update(Player &player, const uint32 /*diff*/)
{
uint32 pointId = (uint32)player.movespline->currentPathIdx();
if (pointId > i_currentNode)
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
index aa6d327db3b..9c2475267f6 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
@@ -42,7 +42,7 @@ template<class T, class P>
class PathMovementBase
{
public:
- PathMovementBase() : i_currentNode(0), i_path(NULL) {}
+ PathMovementBase() : i_path(NULL), i_currentNode(0) {}
virtual ~PathMovementBase() {};
// template pattern, not defined .. override required
@@ -63,7 +63,8 @@ class WaypointMovementGenerator<Creature>
public PathMovementBase<Creature, WaypointPath const*>
{
public:
- WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : i_nextMoveTime(0), path_id(_path_id), m_isArrivalDone(false), repeating(_repeating) {}
+ WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true)
+ : i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating) {}
~WaypointMovementGenerator() { i_path = NULL; }
void Initialize(Creature &);
void Finalize(Creature &);
diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp
index 4eaa6b57b36..5d0344f9769 100644
--- a/src/server/game/Movement/Spline/MoveSpline.cpp
+++ b/src/server/game/Movement/Spline/MoveSpline.cpp
@@ -187,7 +187,7 @@ void MoveSpline::Initialize(const MoveSplineInitArgs& args)
}
MoveSpline::MoveSpline() : m_Id(0), time_passed(0),
- vertical_acceleration(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), initialOrientation(0.f)
+ vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0)
{
splineflags.done = true;
}
diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h
index 4b8dbcc8ee3..d4b19b21634 100644
--- a/src/server/game/Movement/Spline/MoveSpline.h
+++ b/src/server/game/Movement/Spline/MoveSpline.h
@@ -47,7 +47,6 @@ namespace Movement
Result_NextCycle = 0x04,
Result_NextSegment = 0x08,
};
- #pragma region fields
friend class PacketBuilder;
protected:
MySpline spline;
@@ -88,7 +87,6 @@ namespace Movement
void _Finalize();
void _Interrupt() { splineflags.done = true;}
- #pragma endregion
public:
void Initialize(const MoveSplineInitArgs&);
diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h
index de91f63c30a..33973064e09 100644
--- a/src/server/game/Movement/Spline/MoveSplineFlag.h
+++ b/src/server/game/Movement/Spline/MoveSplineFlag.h
@@ -98,14 +98,14 @@ namespace Movement
void operator &= (uint32 f) { raw() &= f;}
void operator |= (uint32 f) { raw() |= f;}
- void EnableAnimation(uint8 anim) { raw() = raw() & ~(Mask_Animations|Falling|Parabolic) | Animation|anim;}
- void EnableParabolic() { raw() = raw() & ~(Mask_Animations|Falling|Animation) | Parabolic;}
- void EnableFalling() { raw() = raw() & ~(Mask_Animations|Parabolic|Animation) | Falling;}
- void EnableFlying() { raw() = raw() & ~Catmullrom | Flying; }
- void EnableCatmullRom() { raw() = raw() & ~Flying | Catmullrom; }
- void EnableFacingPoint() { raw() = raw() & ~Mask_Final_Facing | Final_Point;}
- void EnableFacingAngle() { raw() = raw() & ~Mask_Final_Facing | Final_Angle;}
- void EnableFacingTarget() { raw() = raw() & ~Mask_Final_Facing | Final_Target;}
+ void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations|Falling|Parabolic)) | Animation|anim;}
+ void EnableParabolic() { raw() = (raw() & ~(Mask_Animations|Falling|Animation)) | Parabolic;}
+ void EnableFalling() { raw() = (raw() & ~(Mask_Animations|Parabolic|Animation)) | Falling;}
+ void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; }
+ void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; }
+ void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;}
+ void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;}
+ void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;}
uint8 animId : 8;
bool done : 1;
diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp
index 14c1bd0c117..6970acf5415 100644
--- a/src/server/game/Movement/Spline/Spline.cpp
+++ b/src/server/game/Movement/Spline/Spline.cpp
@@ -56,7 +56,6 @@ SplineBase::InitMethtod SplineBase::initializers[SplineBase::ModesEnd] =
};
///////////
-#pragma region evaluation methtods
using G3D::Matrix4;
static const Matrix4 s_catmullRomCoeffs(
@@ -199,7 +198,6 @@ float SplineBase::SegLengthBezier3(index_type index) const
}
return length;
}
-#pragma endregion
void SplineBase::init_spline(const Vector3 * controls, index_type count, EvaluationMode m)
{
diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h
index 28876b220d4..627cdcf3e3b 100644
--- a/src/server/game/Movement/Spline/Spline.h
+++ b/src/server/game/Movement/Spline/Spline.h
@@ -39,7 +39,6 @@ public:
ModesEnd
};
- #pragma region fields
protected:
ControlArray points;
@@ -84,10 +83,9 @@ protected:
void UninitializedSpline() const { ASSERT(false);}
- #pragma endregion
public:
- explicit SplineBase() : m_mode(UninitializedMode), index_lo(0), index_hi(0), cyclic(false) {}
+ explicit SplineBase() : index_lo(0), index_hi(0), m_mode(UninitializedMode), cyclic(false) {}
/** Caclulates the position for given segment Idx, and percent of segment length t
@param t - percent of segment length, assumes that t in range [0, 1]
@@ -138,13 +136,11 @@ class Spline : public SplineBase
public:
typedef length_type LengthType;
typedef std::vector<length_type> LengthArray;
- #pragma region fields
protected:
LengthArray lengths;
index_type computeIndexInBounds(length_type length) const;
- #pragma endregion
public:
explicit Spline(){}
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index eaaaeaac9ca..21b98ad2cea 100755
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -360,7 +360,7 @@ class Quest
struct QuestStatusData
{
- QuestStatusData(): Status(QUEST_STATUS_NONE), Explored(false), Timer(0), PlayerCount(0)
+ QuestStatusData(): Status(QUEST_STATUS_NONE), Timer(0), PlayerCount(0), Explored(false)
{
memset(ItemCount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint16));
memset(CreatureOrGOCount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint16));
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 1972b625a9f..99497870a15 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -373,10 +373,10 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
};
AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster):
-m_base(base), m_spellInfo(base->GetSpellInfo()), m_effIndex(effIndex),
-m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[m_effIndex].BasePoints),
-m_canBeRecalculated(true), m_spellmod(NULL), m_isPeriodic(false),
-m_periodicTimer(0), m_tickNumber(0)
+m_base(base), m_spellInfo(base->GetSpellInfo()),
+m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[effIndex].BasePoints),
+m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
+m_canBeRecalculated(true), m_isPeriodic(false)
{
CalculatePeriodic(caster, true, false);
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 4bc193b49d2..1260425ef55 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -37,8 +37,8 @@
#include "Vehicle.h"
AuraApplication::AuraApplication(Unit* target, Unit* caster, Aura* aura, uint8 effMask):
-_target(target), _base(aura), _slot(MAX_AURAS), _flags(AFLAG_NONE),
-_effectsToApply(effMask), _removeMode(AURA_REMOVE_NONE), _needClientUpdate(false)
+_target(target), _base(aura), _removeMode(AURA_REMOVE_NONE), _slot(MAX_AURAS),
+_flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false)
{
ASSERT(GetTarget() && GetBase());
@@ -1840,6 +1840,10 @@ bool Aura::CanStackWith(Aura const* existingAura) const
if (!sameCaster)
{
+ // Channeled auras can stack if not forbidden by db or aura type
+ if (existingAura->GetSpellInfo()->IsChanneled())
+ return true;
+
if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_STACK_FOR_DIFF_CASTERS)
return true;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 6cacf5e7e5a..cbfa739fb69 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2814,12 +2814,12 @@ uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur)
unitList.remove(m_targets.GetUnitTarget());
Trinity::RandomResizeList(unitList, maxTargets);
}
- }
- CallScriptAfterUnitTargetSelectHandlers(unitList, SpellEffIndex(i));
+ CallScriptAfterUnitTargetSelectHandlers(unitList, SpellEffIndex(i));
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
- AddUnitTarget(*itr, effectMask, false);
+ for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
+ AddUnitTarget(*itr, effectMask, false);
+ }
if (!gobjectList.empty())
{
@@ -4651,7 +4651,7 @@ SpellCastResult Spell::CheckCast(bool strict)
Unit::AuraEffectList const& blockSpells = m_caster->GetAuraEffectsByType(SPELL_AURA_BLOCK_SPELL_FAMILY);
for (Unit::AuraEffectList::const_iterator blockItr = blockSpells.begin(); blockItr != blockSpells.end(); ++blockItr)
- if ((*blockItr)->GetMiscValue() == m_spellInfo->SpellFamilyName)
+ if (uint32((*blockItr)->GetMiscValue()) == m_spellInfo->SpellFamilyName)
return SPELL_FAILED_SPELL_UNAVAILABLE;
bool reqCombat = true;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index a8f6ece7102..407ddbf6b21 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -751,600 +751,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
// selection by spell family
switch (m_spellInfo->SpellFamilyName)
{
- case SPELLFAMILY_GENERIC:
- {
- switch (m_spellInfo->Id)
- {
- case 31225: // Shimmering Vessel (restore creature to life)
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
- return;
- unitTarget->ToCreature()->setDeathState(JUST_ALIVED);
- return;
- }
- case 12162: // Deep wounds
- case 12850: // (now good common check for this spells)
- case 12868:
- {
- if (!unitTarget)
- return;
-
- // apply percent damage mods
- damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, damage, SPELL_DIRECT_DAMAGE);
-
- switch (m_spellInfo->Id)
- {
- case 12162: ApplyPctN(damage, 16); break; // Rank 1
- case 12850: ApplyPctN(damage, 32); break; // Rank 2
- case 12868: ApplyPctN(damage, 48); break; // Rank 3
- default:
- sLog->outError("Spell::EffectDummy: Spell %u not handled in DW", m_spellInfo->Id);
- return;
- }
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(12721);
- uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
-
- // Add remaining ticks to damage done
- if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(12721, EFFECT_0, m_caster->GetGUID()))
- damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
-
- damage = damage / ticks;
- m_caster->CastCustomSpell(unitTarget, 12721, &damage, NULL, NULL, true);
- return;
- }
- case 13567: // Dummy Trigger
- {
- // can be used for different aura triggering, so select by aura
- if (!m_triggeredByAuraSpell || !unitTarget)
- return;
-
- switch (m_triggeredByAuraSpell->Id)
- {
- case 26467: // Persistent Shield
- m_caster->CastCustomSpell(unitTarget, 26470, &damage, NULL, NULL, true);
- break;
- default:
- sLog->outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u", m_triggeredByAuraSpell->Id);
- break;
- }
- return;
- }
- case 17251: // Spirit Healer Res
- {
- if (!unitTarget || !m_originalCaster)
- return;
-
- if (m_originalCaster->GetTypeId() == TYPEID_PLAYER)
- {
- WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
- data << uint64(unitTarget->GetGUID());
- m_originalCaster->ToPlayer()->GetSession()->SendPacket(&data);
- }
- return;
- }
- case 23019: // Crystal Prison Dummy DND
- {
- if (!unitTarget || !unitTarget->isAlive() || unitTarget->GetTypeId() != TYPEID_UNIT || unitTarget->ToCreature()->isPet())
- return;
-
- Creature* creatureTarget = unitTarget->ToCreature();
-
- m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, uint32(creatureTarget->GetRespawnTime()-time(NULL)));
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019");
-
- creatureTarget->DespawnOrUnsummon();
-
- return;
- }
- case 23448: // Transporter Arrival - Ultrasafe Transporter: Gadgetzan - backfires
- {
- int32 r = irand(0, 119);
- if (r < 20) // Transporter Malfunction - 1/6 polymorph
- m_caster->CastSpell(m_caster, 23444, true);
- else if (r < 100) // Evil Twin - 4/6 evil twin
- m_caster->CastSpell(m_caster, 23445, true);
- else // Transporter Malfunction - 1/6 miss the target
- m_caster->CastSpell(m_caster, 36902, true);
- return;
- }
- case 23453: // Gnomish Transporter - Ultrasafe Transporter: Gadgetzan
- if (roll_chance_i(50)) // Gadgetzan Transporter - success
- m_caster->CastSpell(m_caster, 23441, true);
- else // Gadgetzan Transporter Failure - failure
- m_caster->CastSpell(m_caster, 23446, true);
- return;
- case 25860: // Reindeer Transformation
- {
- if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED))
- return;
-
- float flyspeed = m_caster->GetSpeedRate(MOVE_FLIGHT);
- float speed = m_caster->GetSpeedRate(MOVE_RUN);
-
- m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- //5 different spells used depending on mounted speed and if mount can fly or not
- if (flyspeed >= 4.1f)
- // Flying Reindeer
- m_caster->CastSpell(m_caster, 44827, true); //310% flying Reindeer
- else if (flyspeed >= 3.8f)
- // Flying Reindeer
- m_caster->CastSpell(m_caster, 44825, true); //280% flying Reindeer
- else if (flyspeed >= 1.6f)
- // Flying Reindeer
- m_caster->CastSpell(m_caster, 44824, true); //60% flying Reindeer
- else if (speed >= 2.0f)
- // Reindeer
- m_caster->CastSpell(m_caster, 25859, true); //100% ground Reindeer
- else
- // Reindeer
- m_caster->CastSpell(m_caster, 25858, true); //60% ground Reindeer
-
- return;
- }
- case 26074: // Holiday Cheer
- // implemented at client side
- return;
- // Polarity Shift
- case 28089:
- if (unitTarget)
- unitTarget->CastSpell(unitTarget, roll_chance_i(50) ? 28059 : 28084, true, NULL, NULL, m_caster->GetGUID());
- break;
- // Polarity Shift
- case 39096:
- if (unitTarget)
- unitTarget->CastSpell(unitTarget, roll_chance_i(50) ? 39088 : 39091, true, NULL, NULL, m_caster->GetGUID());
- break;
- case 29200: // Purify Helboar Meat
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- spell_id = roll_chance_i(50)
- ? 29277 // Summon Purified Helboar Meat
- : 29278; // Summon Toxic Helboar Meat
-
- m_caster->CastSpell(m_caster, spell_id, true, NULL);
- return;
- }
- case 29858: // Soulshatter
- if (unitTarget && unitTarget->CanHaveThreatList()
- && unitTarget->getThreatManager().getThreat(m_caster) > 0.0f)
- m_caster->CastSpell(unitTarget, 32835, true);
- return;
- case 30458: // Nigh Invulnerability
- if (!m_CastItem) return;
- if (roll_chance_i(86)) // Nigh-Invulnerability - success
- m_caster->CastSpell(m_caster, 30456, true, m_CastItem);
- else // Complete Vulnerability - backfire in 14% casts
- m_caster->CastSpell(m_caster, 30457, true, m_CastItem);
- return;
- case 30507: // Poultryizer
- if (!m_CastItem) return;
- if (roll_chance_i(80)) // Poultryized! - success
- m_caster->CastSpell(unitTarget, 30501, true, m_CastItem);
- else // Poultryized! - backfire 20%
- m_caster->CastSpell(unitTarget, 30504, true, m_CastItem);
- return;
- case 35745: // Socrethar's Stone
- {
- switch (m_caster->GetAreaId())
- {
- case 3900:
- spell_id = 35743;
- break; // Socrethar Portal
- case 3742:
- spell_id = 35744;
- break; // Socrethar Portal
- default:
- return;
- }
-
- m_caster->CastSpell(m_caster, spell_id, true);
- return;
- }
- case 37674: // Chaos Blast
- {
- if (!unitTarget)
- return;
-
- int32 basepoints0 = 100;
- m_caster->CastCustomSpell(unitTarget, 37675, &basepoints0, NULL, NULL, true);
- return;
- }
- // Wrath of the Astromancer
- case 42784:
- {
- uint32 count = 0;
- for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
- if (ihit->effectMask & (1<<effIndex))
- ++count;
-
- damage = 12000; // maybe wrong value
- damage /= count;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(42784);
-
- // now deal the damage
- for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
- if (ihit->effectMask & (1<<effIndex))
- {
- if (Unit* casttarget = Unit::GetUnit((*unitTarget), ihit->targetGUID))
- m_caster->DealDamage(casttarget, damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, spellInfo, false);
- }
-
- return;
- }
- // Demon Broiled Surprise
- case 43723:
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- Player* player = (Player*)m_caster;
-
- if (player && player->GetQuestStatus(11379) == QUEST_STATUS_INCOMPLETE)
- {
- Creature* creature = player->FindNearestCreature(19973, 10, false);
- if (!creature)
- {
- SendCastResult(SPELL_FAILED_NOT_HERE);
- return;
- }
-
- player->CastSpell(player, 43753, false);
- }
- return;
- }
- case 44875: // Complete Raptor Capture
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
- return;
-
- unitTarget->ToCreature()->DespawnOrUnsummon();
-
- //cast spell Raptor Capture Credit
- m_caster->CastSpell(m_caster, 42337, true, NULL);
- return;
- }
- case 47170: // Impale Leviroth
- {
- if (!unitTarget || (unitTarget->GetEntry() != 26452 && unitTarget->HealthAbovePct(95)))
- return;
-
- m_caster->DealDamage(unitTarget, unitTarget->CountPctFromMaxHealth(93));
- return;
- }
- case 49357: // Brewfest Mount Transformation
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
- if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED))
- return;
- m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
- // Ram for Alliance, Kodo for Horde
- if (m_caster->ToPlayer()->GetTeam() == ALLIANCE)
- {
- if (m_caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
- // 100% Ram
- m_caster->CastSpell(m_caster, 43900, true);
- else
- // 60% Ram
- m_caster->CastSpell(m_caster, 43899, true);
- }
- else
- {
- if (m_caster->ToPlayer()->GetSpeedRate(MOVE_RUN) >= 2.0f)
- // 100% Kodo
- m_caster->CastSpell(m_caster, 49379, true);
- else
- // 60% Kodo
- m_caster->CastSpell(m_caster, 49378, true);
- }
- return;
- case 52845: // Brewfest Mount Transformation (Faction Swap)
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
- if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED))
- return;
- m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
- // Ram for Horde, Kodo for Alliance
- if (m_caster->ToPlayer()->GetTeam() == HORDE)
- {
- if (m_caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
- // 100% Ram
- m_caster->CastSpell(m_caster, 43900, true);
- else
- // 60% Ram
- m_caster->CastSpell(m_caster, 43899, true);
- }
- else
- {
- if (m_caster->ToPlayer()->GetSpeedRate(MOVE_RUN) >= 2.0f)
- // 100% Kodo
- m_caster->CastSpell(m_caster, 49379, true);
- else
- // 60% Kodo
- m_caster->CastSpell(m_caster, 49378, true);
- }
- return;
- case 55004: // Nitro Boosts
- if (!m_CastItem)
- return;
- if (roll_chance_i(95)) // Nitro Boosts - success
- m_caster->CastSpell(m_caster, 54861, true, m_CastItem);
- else // Knocked Up - backfire 5%
- m_caster->CastSpell(m_caster, 46014, true, m_CastItem);
- return;
- case 50243: // Teach Language
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // spell has a 1/3 chance to trigger one of the below
- if (roll_chance_i(66))
- return;
- if (m_caster->ToPlayer()->GetTeam() == ALLIANCE)
- {
- // 1000001 - gnomish binary
- m_caster->CastSpell(m_caster, 50242, true);
- }
- else
- {
- // 01001000 - goblin binary
- m_caster->CastSpell(m_caster, 50246, true);
- }
-
- return;
- }
- case 51582: //Rocket Boots Engaged (Rocket Boots Xtreme and Rocket Boots Xtreme Lite)
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- if (Battleground* bg = m_caster->ToPlayer()->GetBattleground())
- bg->EventPlayerDroppedFlag(m_caster->ToPlayer());
-
- m_caster->CastSpell(m_caster, 30452, true, NULL);
- return;
- }
- case 52759: // Ancestral Awakening
- if (!unitTarget)
- return;
- m_caster->CastCustomSpell(unitTarget, 52752, &damage, NULL, NULL, true);
- return;
- case 54171: // Divine Storm
- {
- if (m_UniqueTargetInfo.size())
- {
- int32 heal = damage / m_UniqueTargetInfo.size();
- m_caster->CastCustomSpell(unitTarget, 54172, &heal, NULL, NULL, true);
- }
- return;
- }
- case 58418: // Portal to Orgrimmar
- case 58420: // Portal to Stormwind
- return; // implemented in EffectScript[0]
- case 62324: // Throw Passenger
- {
- if (m_targets.HasTraj())
- {
- if (Vehicle* vehicle = m_caster->GetVehicleKit())
- if (Unit* passenger = vehicle->GetPassenger(damage - 1))
- {
- std::list<Unit*> unitList;
- // use 99 because it is 3d search
- SearchAreaTarget(unitList, 99, PUSH_DST_CENTER, SPELL_TARGETS_ENTRY, 33114);
- float minDist = 99 * 99;
- Unit* target = NULL;
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
- {
- if (Vehicle* seat = (*itr)->GetVehicleKit())
- if (!seat->GetPassenger(0))
- if (Unit* device = seat->GetPassenger(2))
- if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
- {
- float dist = (*itr)->GetExactDistSq(m_targets.GetDst());
- if (dist < minDist)
- {
- minDist = dist;
- target = (*itr);
- }
- }
- }
- if (target && target->IsWithinDist2d(m_targets.GetDst(), m_spellInfo->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
- passenger->EnterVehicle(target, 0);
- else
- {
- passenger->ExitVehicle();
- float x, y, z;
- m_targets.GetDst()->GetPosition(x, y, z);
- passenger->GetMotionMaster()->MoveJump(x, y, z, m_targets.GetSpeedXY(), m_targets.GetSpeedZ());
- }
- }
- }
- return;
- }
- case 64385: // Unusual Compass
- {
- m_caster->SetOrientation(float(urand(0, 62832)) / 10000.0f);
- WorldPacket data;
- m_caster->BuildHeartBeatMsg(&data);
- m_caster->SendMessageToSet(&data, true);
- return;
- }
- case 53808: // Pygmy Oil
- {
- Aura* pAura = m_caster->GetAura(53806);
- if (pAura)
- pAura->RefreshDuration();
- else
- {
- pAura = m_caster->GetAura(53805);
- if (!pAura || pAura->GetStackAmount() < 5 || !roll_chance_i(50))
- m_caster->CastSpell(m_caster, 53805, true);
- else
- {
- pAura->Remove();
- m_caster->CastSpell(m_caster, 53806, true);
- }
- }
- return;
- }
- case 54577: // U.D.E.D.
- {
- if (unitTarget->GetEntry() != 29402)
- return;
-
- m_caster->SummonGameObject(192693, unitTarget->GetPositionX(), unitTarget->GetPositionY(),
- unitTarget->GetPositionZ(), unitTarget->GetOrientation(), 0, 0, 0, 0, 100);
-
- for (uint8 i = 0; i < 4; ++i)
- m_caster->SummonGameObject(191567, float(unitTarget->GetPositionX() + irand(-7, 7)),
- float(unitTarget->GetPositionY() + irand(-7, 7)), unitTarget->GetPositionZ(), unitTarget->GetOrientation(),
- 0, 0, 0, 0, 100);
-
- unitTarget->Kill(unitTarget);
- return;
- }
- case 51961: // Captured Chicken Cover - Quest 12702 & 12532
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER
- || !unitTarget->HasAura(51959)
- || !(m_caster->ToPlayer()->GetQuestStatus(12702) == QUEST_STATUS_INCOMPLETE || m_caster->ToPlayer()->GetQuestStatus(12532) == QUEST_STATUS_INCOMPLETE))
- return;
-
- m_caster->CastSpell(m_caster, 51037, true);
- unitTarget->Kill(unitTarget);
- return;
- }
- }
-
- break;
- }
- case SPELLFAMILY_WARRIOR:
- // Charge
- if (m_spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_WARRIOR_CHARGE && m_spellInfo->SpellVisual[0] == 867)
- {
- int32 chargeBasePoints0 = damage;
- m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true);
-
- //Juggernaut crit bonus
- if (m_caster->HasAura(64976))
- m_caster->CastSpell(m_caster, 65156, true);
- return;
- }
- // Slam
- if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_WARRIOR_SLAM && m_spellInfo->SpellIconID == 559)
- {
- int32 bp0 = damage;
- m_caster->CastCustomSpell(unitTarget, 50783, &bp0, NULL, NULL, true, 0);
- return;
- }
- // Execute
- if (m_spellInfo->SpellFamilyFlags[EFFECT_0] & SPELLFAMILYFLAG_WARRIOR_EXECUTE)
- {
- if (!unitTarget)
- return;
-
- spell_id = 20647;
-
- int32 rageUsed = std::min<int32>(300 - m_powerCost, m_caster->GetPower(POWER_RAGE));
- int32 newRage = std::max<int32>(0, m_caster->GetPower(POWER_RAGE) - rageUsed);
-
- // Sudden Death rage save
- if (AuraEffect* aurEff = m_caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, 1989, EFFECT_0))
- {
- int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10;
- newRage = std::max(newRage, ragesave);
- }
-
- m_caster->SetPower(POWER_RAGE, uint32(newRage));
-
- // Glyph of Execution bonus
- if (AuraEffect* aurEff = m_caster->GetAuraEffect(58367, EFFECT_0))
- rageUsed += aurEff->GetAmount() * 10;
-
- bp = damage + int32(rageUsed * m_spellInfo->Effects[effIndex].DamageMultiplier + m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f);
- break;
- }
- // Concussion Blow
- if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_WARRIOR_CONCUSSION_BLOW)
- {
- m_damage += CalculatePctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
- return;
- }
- switch (m_spellInfo->Id)
- {
- // Bloodthirst
- case 23881:
- {
- m_caster->CastCustomSpell(unitTarget, 23885, &damage, NULL, NULL, true, NULL);
- return;
- }
- }
- break;
- case SPELLFAMILY_WARLOCK:
- // Life Tap
- if ((m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_WARLOCK_LIFETAP) && m_caster->ToPlayer())
- {
- float spFactor = 0.0f;
- switch (m_spellInfo->Id)
- {
- case 11689: spFactor = 0.2f; break;
- case 27222:
- case 57946: spFactor = 0.5f; break;
- }
- int32 damage = int32(m_spellInfo->Effects[EFFECT_0].CalcValue() + (6.3875 * m_spellInfo->BaseLevel));
- int32 mana = int32(damage + (m_caster->ToPlayer()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * spFactor));
-
- if (unitTarget && (int32(unitTarget->GetHealth()) > damage))
- {
- // Shouldn't Appear in Combat Log
- unitTarget->ModifyHealth(-damage);
-
- // Improved Life Tap mod
- if (AuraEffect const* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 208, 0))
- AddPctN(mana, aurEff->GetAmount());
-
- m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, false);
-
- // Mana Feed
- int32 manaFeedVal = 0;
- if (AuraEffect const* aurEff = m_caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 1982, 0))
- manaFeedVal = aurEff->GetAmount();
-
- if (manaFeedVal > 0)
- {
- ApplyPctN(manaFeedVal, mana);
- m_caster->CastCustomSpell(m_caster, 32553, &manaFeedVal, NULL, NULL, true, NULL);
- }
- }
- else
- SendCastResult(SPELL_FAILED_FIZZLE);
- return;
- }
- break;
- case SPELLFAMILY_DRUID:
- // Starfall
- if (m_spellInfo->SpellFamilyFlags[2] & SPELLFAMILYFLAG2_DRUID_STARFALL)
- {
- //Shapeshifting into an animal form or mounting cancels the effect.
- if (m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted())
- {
- if (m_triggeredByAuraSpell)
- m_caster->RemoveAurasDueToSpell(m_triggeredByAuraSpell->Id);
- return;
- }
-
- //Any effect which causes you to lose control of your character will supress the starfall effect.
- if (m_caster->HasUnitState(UNIT_STATE_CONTROLLED))
- return;
-
- m_caster->CastSpell(unitTarget, damage, true);
- return;
- }
- break;
case SPELLFAMILY_PALADIN:
switch (m_spellInfo->Id)
{
@@ -1378,128 +784,40 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
}
}
break;
- case SPELLFAMILY_SHAMAN:
- // Cleansing Totem Pulse
- if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS && m_spellInfo->SpellIconID == 1673)
- {
- int32 bp1 = 1;
- // Cleansing Totem Effect
- if (unitTarget)
- m_caster->CastCustomSpell(unitTarget, 52025, NULL, &bp1, NULL, true, NULL, NULL, m_originalCasterGUID);
- return;
- }
- // Healing Stream Totem
- if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_HEALING_STREAM)
- {
- if (!unitTarget)
- return;
- if (Unit* owner = m_caster->GetOwner())
- {
- if (m_triggeredByAuraSpell)
- damage = int32(owner->SpellHealingBonus(unitTarget, m_triggeredByAuraSpell, damage, HEAL));
-
- // Restorative Totems
- if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 338, 1))
- AddPctN(damage, dummy->GetAmount());
-
- // Glyph of Healing Stream Totem
- if (AuraEffect const* aurEff = owner->GetAuraEffect(55456, EFFECT_0))
- AddPctN(damage, aurEff->GetAmount());
- }
- m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
- return;
- }
- // Mana Spring Totem
- if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_MANA_SPRING)
- {
- if (!unitTarget || unitTarget->getPowerType() != POWER_MANA)
- return;
- m_caster->CastCustomSpell(unitTarget, 52032, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
- return;
- }
- // Lava Lash
- if (m_spellInfo->SpellFamilyFlags[2] & SPELLFAMILYFLAG2_SHAMAN_LAVA_LASH)
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- if (m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
- {
- // Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
- if (m_caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
- AddPctN(m_damage, damage);
- }
- return;
- }
- break;
case SPELLFAMILY_DEATHKNIGHT:
- // Death strike
- if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_DK_DEATH_STRIKE)
- {
- uint32 count = unitTarget->GetDiseasesByCaster(m_caster->GetGUID());
- bp = int32(count * m_caster->CountPctFromMaxHealth(int32(m_spellInfo->Effects[EFFECT_0].DamageMultiplier)));
- // Improved Death Strike
- if (AuraEffect const* aurEff = m_caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, 2751, 0))
- AddPctN(bp, m_caster->CalculateSpellDamage(m_caster, aurEff->GetSpellInfo(), 2));
- m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, false);
- return;
- }
- // Death Coil
- if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_DK_DEATH_COIL)
- {
- if (m_caster->IsFriendlyTo(unitTarget))
- {
- bp = int32(damage * 1.5f);
- m_caster->CastCustomSpell(unitTarget, 47633, &bp, NULL, NULL, true);
- }
- else
- {
- bp = damage;
- m_caster->CastCustomSpell(unitTarget, 47632, &bp, NULL, NULL, true);
- }
- return;
- }
switch (m_spellInfo->Id)
{
- case 49560: // Death Grip
- Position pos;
- GetSummonPosition(effIndex, pos);
- if (Unit* unit = unitTarget->GetVehicleBase()) // what is this for?
- unit->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true);
- else if (!unitTarget->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence
- unitTarget->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true);
- return;
- case 46584: // Raise Dead
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
+ case 46584: // Raise Dead
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
- // Do we have talent Master of Ghouls?
- if (m_caster->HasAura(52143))
- // summon as pet
- bp = 52150;
- else
- // or guardian
- bp = 46585;
+ // Do we have talent Master of Ghouls?
+ if (m_caster->HasAura(52143))
+ // summon as pet
+ bp = 52150;
+ else
+ // or guardian
+ bp = 46585;
- if (m_targets.HasDst())
- targets.SetDst(*m_targets.GetDst());
- else
- {
- targets.SetDst(*m_caster);
- // Corpse not found - take reagents (only not triggered cast can take them)
- triggered = false;
- }
- // Remove cooldown - summon spellls have category
- m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
- spell_id = 48289;
- break;
- // Raise dead - take reagents and trigger summon spells
- case 48289:
- if (m_targets.HasDst())
- targets.SetDst(*m_targets.GetDst());
+ if (m_targets.HasDst())
+ targets.SetDst(*m_targets.GetDst());
+ else
+ {
+ targets.SetDst(*m_caster);
+ // Corpse not found - take reagents (only not triggered cast can take them)
+ triggered = false;
+ }
+ // Remove cooldown - summon spellls have category
+ m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
+ spell_id = 48289;
+ break;
+ // Raise dead - take reagents and trigger summon spells
+ case 48289:
+ if (m_targets.HasDst())
+ targets.SetDst(*m_targets.GetDst());
- spell_id = CalculateDamage(0, NULL);
- break;
+ spell_id = CalculateDamage(0, NULL);
+ break;
}
break;
}
@@ -3064,6 +2382,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
case 629:
case 181:
case 715:
+ case 1562:
+ case 833:
+ case 1161:
numSummons = (damage > 0) ? damage : 1;
break;
default:
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 8a58ce3c52a..14dd32a71b6 100755
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -468,6 +468,16 @@ void SpellScript::PreventHitAura()
m_spell->m_spellAura->Remove();
}
+void SpellScript::GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0)
+{
+ m_spell->GetSummonPosition(i, pos, radius, count);
+}
+
+void SpellScript::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNotifyPushType type, SpellTargets TargetType, uint32 entry)
+{
+ m_spell->SearchAreaTarget(TagUnitMap, radius, type, TargetType, entry);
+}
+
void SpellScript::PreventHitEffect(SpellEffIndex effIndex)
{
if (!IsInHitPhase() && !IsInEffectHook())
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index 945a62674d9..09b9eaebd62 100755
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -21,6 +21,7 @@
#include "Util.h"
#include "SharedDefines.h"
#include "SpellAuraDefines.h"
+#include "Spell.h"
#include <stack>
class Unit;
@@ -333,7 +334,9 @@ class SpellScript : public _SpellScript
int32 GetHitHeal();
void SetHitHeal(int32 heal);
void PreventHitHeal() { SetHitHeal(0); }
-
+ Spell* GetSpell() { return m_spell; }
+ void GetSummonPosition(uint32 i, Position &pos, float radius, uint32 count);
+ void SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNotifyPushType type, SpellTargets TargetType, uint32 entry);
// returns current spell hit target aura
Aura* GetHitAura();
// prevents applying aura on current spell hit target
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 73e6b0ac8a5..3de1181f764 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1042,7 +1042,7 @@ public:
return true;
}
- static bool HandleDebugLoSCommand(ChatHandler* handler, char const* args)
+ static bool HandleDebugLoSCommand(ChatHandler* handler, char const* /*args*/)
{
if (Unit* unit = handler->getSelectedUnit())
handler->PSendSysMessage("Unit %s (GuidLow: %u) is %sin LoS", unit->GetName(), unit->GetGUIDLow(), handler->GetSession()->GetPlayer()->IsWithinLOSInMap(unit) ? "" : "not ");
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
index 7bcd2598271..1c6cad7278a 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -143,125 +143,10 @@ class AreaTrigger_at_map_chamber : public AreaTriggerScript
}
};
-/*######
-## npc_lore_keeper_of_norgannon
-######*/
-
-#define GOSSIP_HELLO_KEEPER "Who are the Earthen?"
-#define GOSSIP_SELECT_KEEPER1 "What is a \"subterranean being matrix\"?"
-#define GOSSIP_SELECT_KEEPER2 "What are the anomalies you speak of?"
-#define GOSSIP_SELECT_KEEPER3 "What is a resilient foundation of construction?"
-#define GOSSIP_SELECT_KEEPER4 "So... the Earthen were made out of stone?"
-#define GOSSIP_SELECT_KEEPER5 "Anything else I should know about the Earthen?"
-#define GOSSIP_SELECT_KEEPER6 "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?"
-#define GOSSIP_SELECT_KEEPER7 "What high-stress environments would cause the Earthen to destabilize?"
-#define GOSSIP_SELECT_KEEPER8 "What happens when the Earthen destabilize?"
-#define GOSSIP_SELECT_KEEPER9 "Troggs?! Are the troggs you mention the same as the ones in the world today?"
-#define GOSSIP_SELECT_KEEPER10 "You mentioned two results when the Earthen destabilize. What is the second?"
-#define GOSSIP_SELECT_KEEPER11 "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!"
-#define GOSSIP_SELECT_KEEPER12 "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?"
-#define GOSSIP_SELECT_KEEPER13 "Who are the Creators?"
-#define GOSSIP_SELECT_KEEPER14 "This is a lot to think about."
-#define GOSSIP_SELECT_KEEPER15 "I will access the discs now."
-
-class npc_lore_keeper_of_norgannon : public CreatureScript
-{
- public:
-
- npc_lore_keeper_of_norgannon()
- : CreatureScript("npc_lore_keeper_of_norgannon")
- {
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_KEEPER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(1079, creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(1080, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(1081, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(1082, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(1083, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(1084, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(1085, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
- player->SEND_GOSSIP_MENU(1086, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
- player->SEND_GOSSIP_MENU(1087, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
- player->SEND_GOSSIP_MENU(1088, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);
- player->SEND_GOSSIP_MENU(1089, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12);
- player->SEND_GOSSIP_MENU(1090, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+12:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13);
- player->SEND_GOSSIP_MENU(1091, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+13:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14);
- player->SEND_GOSSIP_MENU(1092, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+14:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15);
- player->SEND_GOSSIP_MENU(1093, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+15:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16);
- player->SEND_GOSSIP_MENU(1094, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+16:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2278);
- break;
- }
- return true;
- }
-};
-
void AddSC_uldaman()
{
new mob_jadespine_basilisk();
new go_keystone_chamber();
new AreaTrigger_at_map_chamber();
- new npc_lore_keeper_of_norgannon();
}
diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp
index e6322591bf3..fac56021c3a 100644
--- a/src/server/scripts/Kalimdor/silithus.cpp
+++ b/src/server/scripts/Kalimdor/silithus.cpp
@@ -1425,7 +1425,7 @@ class go_wind_stone : public GameObjectScript
break;
}
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(gossipId), go->GetGUID());
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(gossipId, go), go->GetGUID());
return true;
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
index fc01ad2efea..6cd049967c1 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
@@ -68,7 +68,6 @@ enum BossSpells
{
SPELL_LEGION_FLAME = 66197, // player should run away from raid because he triggers Legion Flame
SPELL_LEGION_FLAME_EFFECT = 66201, // used by trigger npc
- SPELL_TOUCH_OF_JARAXXUS = 66209, // used only in 25H
SPELL_NETHER_POWER = 66228, // +20% of spell damage per stack, stackable up to 5/10 times, must be dispelled/stealed
SPELL_FEL_LIGHTING = 66528, // jumps to nearby targets
SPELL_FEL_FIREBALL = 66532, // does heavy damage to the tank, interruptable
@@ -120,7 +119,6 @@ public:
uint32 m_uiIncinerateFleshTimer;
uint32 m_uiNetherPowerTimer;
uint32 m_uiLegionFlameTimer;
- uint32 m_uiTouchOfJaraxxusTimer;
uint32 m_uiSummonNetherPortalTimer;
uint32 m_uiSummonInfernalEruptionTimer;
@@ -134,7 +132,6 @@ public:
m_uiIncinerateFleshTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS);
m_uiNetherPowerTimer = 40*IN_MILLISECONDS;
m_uiLegionFlameTimer = 30*IN_MILLISECONDS;
- m_uiTouchOfJaraxxusTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS);
m_uiSummonNetherPortalTimer = 1*MINUTE*IN_MILLISECONDS;
m_uiSummonInfernalEruptionTimer = 2*MINUTE*IN_MILLISECONDS;
Summons.DespawnAll();
@@ -240,13 +237,6 @@ public:
m_uiLegionFlameTimer = 30*IN_MILLISECONDS;
} else m_uiLegionFlameTimer -= uiDiff;
- if (GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC && m_uiTouchOfJaraxxusTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_TOUCH_OF_JARAXXUS);
- m_uiTouchOfJaraxxusTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS);
- } else m_uiTouchOfJaraxxusTimer -= uiDiff;
-
DoMeleeAttackIfReady();
}
};
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
index c1009963df0..242b2f2f0ea 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -308,7 +308,7 @@ struct boss_twin_baseAI : public ScriptedAI
void EnableDualWield(bool mode = true)
{
- SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : EQUIP_UNEQUIP, EQUIP_UNEQUIP);
+ SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : int32(EQUIP_UNEQUIP), EQUIP_UNEQUIP);
me->SetCanDualWield(mode);
me->UpdateDamagePhysical(mode ? OFF_ATTACK : BASE_ATTACK);
}
@@ -562,11 +562,13 @@ struct mob_unleashed_ballAI : public ScriptedAI
{
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
float y = y0;
- float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
+ float x = frand(x0 - r, x0 + r);
+ float sq = pow(r, 2) - pow(x - x0, 2);
+ float rt = sqrtf(fabs(sq));
if (urand(0, 1))
- y = y0 + sqrt(pow(r, 2) - pow((x-x0), 2));
+ y = y0 + rt;
else
- y = y0 - sqrt(pow(r, 2) - pow((x-x0), 2));
+ y = y0 - rt;
me->GetMotionMaster()->MovePoint(0, x, y, me->GetPositionZ());
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
index 25cd292d390..a91951ca25e 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
@@ -289,7 +289,7 @@ class spell_trash_mob_glacial_strike : public SpellScriptLoader
{
if (GetTarget()->IsFullHealth())
{
- GetTarget()->RemoveAura(GetId(), AURA_REMOVE_BY_ENEMY_SPELL);
+ GetTarget()->RemoveAura(GetId(), 0, 0, AURA_REMOVE_BY_ENEMY_SPELL);
PreventDefaultAction();
}
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index b2ee0572247..fbed870eb19 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -501,13 +501,6 @@ class boss_the_lich_king : public CreatureScript
DoCastAOE(SPELL_PLAY_MOVIE, false);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03);
- float x, y, z;
- me->GetPosition(x, y, z);
- // use larger distance for vmap height search than in most other cases
- float ground_Z = me->GetMap()->GetHeight(me->GetPhaseMask(), x, y, z, true, MAX_FALL_DISTANCE);
- if (fabs(ground_Z - z) < 0.1f)
- return;
-
me->GetMotionMaster()->MoveFall();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index 7977fa4df8a..e308cc59708 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
#include "naxxramas.h"
//Stalagg
@@ -87,7 +86,9 @@ enum ThaddiusSpells
SPELL_POSITIVE_CHARGE = 28062,
SPELL_POSITIVE_CHARGE_STACK = 29659,
SPELL_NEGATIVE_CHARGE = 28085,
- SPELL_NEGATIVE_CHARGE_STACK = 29660
+ SPELL_NEGATIVE_CHARGE_STACK = 29660,
+ SPELL_POSITIVE_POLARITY = 28059,
+ SPELL_NEGATIVE_POLARITY = 28084,
};
enum Events
@@ -503,6 +504,41 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader
}
};
+class spell_thaddius_polarity_shift : public SpellScriptLoader
+{
+ public:
+ spell_thaddius_polarity_shift() : SpellScriptLoader("spell_thaddius_polarity_shift") { }
+
+ class spell_thaddius_polarity_shift_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_thaddius_polarity_shift_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_POLARITY) || !sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_POLARITY))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, NULL, NULL, caster->GetGUID());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_thaddius_polarity_shift_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_thaddius_polarity_shift_SpellScript();
+ }
+};
+
class achievement_polarity_switch : public AchievementCriteriaScript
{
public:
@@ -520,5 +556,6 @@ void AddSC_boss_thaddius()
new mob_stalagg();
new mob_feugen();
new spell_thaddius_pos_neg_charge();
+ new spell_thaddius_polarity_shift();
new achievement_polarity_switch();
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
index 2bc2284a246..8c637bc4e90 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -34,6 +34,7 @@
#include "Vehicle.h"
#include "VehicleDefines.h"
#include "ulduar.h"
+#include "Spell.h"
enum Spells
{
@@ -1718,6 +1719,67 @@ class spell_pursue : public SpellScriptLoader
}
};
+class spell_vehicle_throw_passenger : public SpellScriptLoader
+{
+ public:
+ spell_vehicle_throw_passenger() : SpellScriptLoader("spell_vehicle_throw_passenger") {}
+
+ class spell_vehicle_throw_passenger_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_vehicle_throw_passenger_SpellScript);
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ Spell* baseSpell = GetSpell();
+ SpellCastTargets targets = baseSpell->m_targets;
+ int32 damage = GetEffectValue();
+ if (targets.HasTraj())
+ if (Vehicle* vehicle = GetCaster()->GetVehicleKit())
+ if (Unit* passenger = vehicle->GetPassenger(damage - 1))
+ {
+ std::list<Unit*> unitList;
+ // use 99 because it is 3d search
+ SearchAreaTarget(unitList, 99, PUSH_DST_CENTER, SPELL_TARGETS_ENTRY, NPC_SEAT);
+ float minDist = 99 * 99;
+ Unit* target = NULL;
+ for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
+ {
+ if (Vehicle* seat = (*itr)->GetVehicleKit())
+ if (!seat->GetPassenger(0))
+ if (Unit* device = seat->GetPassenger(2))
+ if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
+ {
+ float dist = (*itr)->GetExactDistSq(targets.GetDst());
+ if (dist < minDist)
+ {
+ minDist = dist;
+ target = (*itr);
+ }
+ }
+ }
+ if (target && target->IsWithinDist2d(targets.GetDst(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
+ passenger->EnterVehicle(target, 0);
+ else
+ {
+ passenger->ExitVehicle();
+ float x, y, z;
+ targets.GetDst()->GetPosition(x, y, z);
+ passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ());
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_vehicle_throw_passenger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_vehicle_throw_passenger_SpellScript();
+ }
+};
+
void AddSC_boss_flame_leviathan()
{
new boss_flame_leviathan();
@@ -1752,4 +1814,5 @@ void AddSC_boss_flame_leviathan()
new spell_auto_repair();
new spell_systems_shutdown();
new spell_pursue();
+ new spell_vehicle_throw_passenger();
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index 218c5a122f1..4917fb25153 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -23,7 +23,6 @@ SDComment:
SDCategory: Tempest Keep, The Eye
EndScriptData */
-#include "ScriptPCH.h"
#include "the_eye.h"
enum eEnums
@@ -40,6 +39,7 @@ enum eEnums
SPELL_ARCANE_MISSILES = 33031,
SPELL_WRATH_OF_THE_ASTROMANCER = 42783,
+ SPELL_WRATH_OF_THE_ASTROMANCER_DOT = 42784,
SPELL_BLINDING_LIGHT = 33009,
SPELL_FEAR = 34322,
SPELL_VOID_BOLT = 39329,
@@ -491,9 +491,74 @@ class mob_solarium_priest : public CreatureScript
return new mob_solarium_priestAI (Creature);
}
};
+
+class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
+{
+ public:
+ spell_astromancer_wrath_of_the_astromancer() : SpellScriptLoader("spell_astromancer_wrath_of_the_astromancer") { }
+
+ class spell_astromancer_wrath_of_the_astromancer_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_astromancer_wrath_of_the_astromancer_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_WRATH_OF_THE_ASTROMANCER_DOT))
+ return false;
+ return true;
+ }
+
+ bool Load()
+ {
+ _targetCount = 0;
+ return true;
+ }
+
+ void CountTargets(std::list<Unit*>& targetList)
+ {
+ _targetCount = targetList.size();
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (Unit* caster = GetOriginalCaster())
+ if (Unit* target = GetHitUnit())
+ {
+ if (!target->isAlive() || !_targetCount)
+ return;
+
+ int32 damage = 10000 / _targetCount;
+
+ SpellNonMeleeDamage damageInfo(caster, target, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
+ damageInfo.damage = damage;
+
+ caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &damageInfo.absorb, &damageInfo.resist, GetSpellInfo());
+ caster->DealDamageMods(target, damageInfo.damage, &damageInfo.absorb);
+ caster->SendSpellNonMeleeDamageLog(&damageInfo);
+ caster->DealSpellDamage(&damageInfo, false);
+ }
+ }
+
+ private:
+ int32 _targetCount;
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_astromancer_wrath_of_the_astromancer_SpellScript();
+ }
+};
+
void AddSC_boss_high_astromancer_solarian()
{
new boss_high_astromancer_solarian();
new mob_solarium_priest();
+ new spell_astromancer_wrath_of_the_astromancer();
}
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
index ed818fb13be..3579a7d697b 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
@@ -22,20 +22,22 @@
enum Spells
{
- SPELL_POSITIVE_CHARGE = 39090,
+ SPELL_POSITIVE_POLARITY = 39088,
SPELL_POSITIVE_CHARGE_STACK = 39089,
+ SPELL_POSITIVE_CHARGE = 39090,
+ SPELL_NEGATIVE_POLARITY = 39091,
+ SPELL_NEGATIVE_CHARGE_STACK = 39092,
SPELL_NEGATIVE_CHARGE = 39093,
- SPELL_NEGATIVE_CHARGE_STACK = 39092
};
-class spell_capacitus_polarity_shift : public SpellScriptLoader
+class spell_capacitus_polarity_charge : public SpellScriptLoader
{
public:
- spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
+ spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { }
- class spell_capacitus_polarity_shift_SpellScript : public SpellScript
+ class spell_capacitus_polarity_charge_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
+ PrepareSpellScript(spell_capacitus_polarity_charge_SpellScript);
bool Validate(SpellInfo const* /*spell*/)
{
@@ -85,8 +87,44 @@ class spell_capacitus_polarity_shift : public SpellScriptLoader
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_shift_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_capacitus_polarity_charge_SpellScript();
+ }
+};
+
+class spell_capacitus_polarity_shift : public SpellScriptLoader
+{
+ public:
+ spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
+
+ class spell_capacitus_polarity_shift_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_POLARITY) || !sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_POLARITY))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* target = GetHitUnit();
+ Unit* caster = GetCaster();
+
+ target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, NULL, NULL, caster->GetGUID());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -98,5 +136,6 @@ class spell_capacitus_polarity_shift : public SpellScriptLoader
void AddSC_boss_mechano_lord_capacitus()
{
+ new spell_capacitus_polarity_charge();
new spell_capacitus_polarity_shift();
}
diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp
index 97ce9f45430..c9fdd0f65ff 100644
--- a/src/server/scripts/Outland/blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/blades_edge_mountains.cpp
@@ -739,7 +739,7 @@ class npc_simon_bunny : public CreatureScript
if (!listening)
return;
- uint8 pressedColor;
+ uint8 pressedColor = SIMON_MAX_COLORS;
if (type == clusterIds[SIMON_RED])
pressedColor = SIMON_RED;
@@ -974,7 +974,7 @@ class npc_simon_bunny : public CreatureScript
// Handles the spell rewards. The spells also have the QuestCompleteEffect, so quests credits are working.
void GiveRewardForLevel(uint8 level)
{
- uint32 rewSpell;
+ uint32 rewSpell = 0;
switch (level)
{
case 6:
@@ -989,8 +989,6 @@ class npc_simon_bunny : public CreatureScript
case 10:
rewSpell = SPELL_REWARD_BUFF_3;
break;
- default:
- rewSpell = 0;
}
if (rewSpell)
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 5c0f6bcce59..2d90b5346a4 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_dk_".
*/
-#include "ScriptPCH.h"
#include "Spell.h"
enum DeathKnightSpells
@@ -103,7 +102,9 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- return sSpellMgr->GetSpellInfo(DK_SPELL_RUNIC_POWER_ENERGIZE);
+ if (!sSpellMgr->GetSpellInfo(DK_SPELL_RUNIC_POWER_ENERGIZE))
+ return false;
+ return true;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
@@ -160,17 +161,16 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- return sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
+ if (!sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT))
+ return false;
+ return true;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
{
SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster());
- Unit* caster = GetCaster();
- if (!caster)
- return;
- if (Player* player = caster->ToPlayer())
+ if (Player* player = GetCaster()->ToPlayer())
amount += int32(2 * player->GetTotalAttackPowerValue(BASE_ATTACK));
}
@@ -204,9 +204,7 @@ class spell_dk_corpse_explosion : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED))
- return false;
- if (!sSpellMgr->GetSpellInfo(DK_SPELL_GHOUL_EXPLODE))
+ if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED) || !sSpellMgr->GetSpellInfo(DK_SPELL_GHOUL_EXPLODE))
return false;
if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_VISUAL))
return false;
@@ -257,6 +255,13 @@ class spell_dk_ghoul_explode : public SpellScriptLoader
{
PrepareSpellScript(spell_dk_ghoul_explode_SpellScript);
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED))
+ return false;
+ return true;
+ }
+
void Suicide(SpellEffIndex /*effIndex*/)
{
if (Unit* unitTarget = GetHitUnit())
@@ -301,9 +306,8 @@ class spell_dk_death_gate : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- if (!GetHitUnit())
- return;
- GetHitUnit()->CastSpell(GetHitUnit(), GetEffectValue(), false);
+ if (Unit* target = GetHitUnit())
+ target->CastSpell(target, GetEffectValue(), false);
}
void Register()
@@ -567,12 +571,11 @@ public:
class spell_dk_improved_blood_presence_AuraScript : public AuraScript
{
- PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript)
+ PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript);
+
bool Validate(SpellInfo const* /*entry*/)
{
- if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_PRESENCE))
- return false;
- if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED))
+ if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_PRESENCE) || !sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED))
return false;
return true;
}
@@ -615,12 +618,11 @@ public:
class spell_dk_improved_unholy_presence_AuraScript : public AuraScript
{
- PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript)
+ PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript);
+
bool Validate(SpellInfo const* /*entry*/)
{
- if (!sSpellMgr->GetSpellInfo(DK_SPELL_UNHOLY_PRESENCE))
- return false;
- if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
+ if (!sSpellMgr->GetSpellInfo(DK_SPELL_UNHOLY_PRESENCE) || !sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
return false;
return true;
}
@@ -656,6 +658,141 @@ public:
}
};
+enum DeathStrike
+{
+ ICON_ID_IMPROVED_DEATH_STRIKE = 2751,
+ SPELL_DEATH_STRIKE_HEAL = 45470,
+};
+
+class spell_dk_death_strike : public SpellScriptLoader
+{
+ public:
+ spell_dk_death_strike() : SpellScriptLoader("spell_dk_death_strike") { }
+
+ class spell_dk_death_strike_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dk_death_strike_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_STRIKE_HEAL))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ {
+ uint32 count = target->GetDiseasesByCaster(caster->GetGUID());
+ int32 bp = int32(count * caster->CountPctFromMaxHealth(int32(GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier)));
+ // Improved Death Strike
+ if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, ICON_ID_IMPROVED_DEATH_STRIKE, 0))
+ AddPctN(bp, caster->CalculateSpellDamage(caster, aurEff->GetSpellInfo(), 2));
+ caster->CastCustomSpell(caster, SPELL_DEATH_STRIKE_HEAL, &bp, NULL, NULL, false);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_dk_death_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
+ }
+
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dk_death_strike_SpellScript();
+ }
+};
+
+enum DeathCoil
+{
+ SPELL_DEATH_COIL_DAMAGE = 47632,
+ SPELL_DEATH_COIL_HEAL = 47633,
+};
+
+class spell_dk_death_coil : public SpellScriptLoader
+{
+ public:
+ spell_dk_death_coil() : SpellScriptLoader("spell_dk_death_coil") { }
+
+ class spell_dk_death_coil_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dk_death_coil_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_HEAL))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 damage = GetEffectValue();
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ if (caster->IsFriendlyTo(target))
+ {
+ int32 bp = int32(damage * 1.5f);
+ caster->CastCustomSpell(target, SPELL_DEATH_COIL_HEAL, &bp, NULL, NULL, true);
+ }
+ else
+ caster->CastCustomSpell(target, SPELL_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dk_death_coil_SpellScript();
+ }
+};
+
+class spell_dk_death_grip : public SpellScriptLoader
+{
+ public:
+ spell_dk_death_grip() : SpellScriptLoader("spell_dk_death_grip") { }
+
+ class spell_dk_death_grip_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dk_death_grip_SpellScript);
+
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ int32 damage = GetEffectValue();
+ Spell* baseSpell = GetSpell();
+ Position pos;
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ {
+ GetSummonPosition(effIndex, pos, 0.0f, 0);
+
+ if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence
+ target->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_dk_death_grip_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dk_death_grip_SpellScript();
+ }
+};
+
void AddSC_deathknight_spell_scripts()
{
new spell_dk_anti_magic_shell_raid();
@@ -671,4 +808,7 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_will_of_the_necropolis();
new spell_dk_improved_blood_presence();
new spell_dk_improved_unholy_presence();
+ new spell_dk_death_strike();
+ new spell_dk_death_coil();
+ new spell_dk_death_grip();
}
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 130f61565f7..58e63a7eb66 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_dru_".
*/
-#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
enum DruidSpells
@@ -42,9 +41,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION))
- return false;
- if (!sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR))
+ if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR))
return false;
return true;
}
@@ -305,14 +302,16 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
{
PrepareAuraScript(spell_dru_swift_flight_passive_AuraScript);
- void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ bool Load()
{
- Unit* caster = GetCaster();
- if (!caster || !caster->ToPlayer())
- return;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
- if (caster->ToPlayer()->Has310Flyer(false))
- amount = 310;
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ if (Player* caster = GetCaster()->ToPlayer())
+ if (caster->Has310Flyer(false))
+ amount = 310;
}
void Register()
@@ -327,6 +326,47 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
+class spell_dru_starfall_dummy : public SpellScriptLoader
+{
+ public:
+ spell_dru_starfall_dummy() : SpellScriptLoader("spell_dru_starfall_dummy") { }
+
+ class spell_dru_starfall_dummy_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_starfall_dummy_SpellScript);
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (GetTriggeringSpell())
+ sLog->outString("triggering spell = %u",GetTriggeringSpell()->Id);
+
+ Unit* caster = GetCaster();
+ if (caster->IsInDisallowedMountForm() || caster->IsMounted())
+ {
+ if (SpellInfo const* spellInfo = GetTriggeringSpell())
+ caster->RemoveAurasDueToSpell(spellInfo->Id);
+ return;
+ }
+
+ //Any effect which causes you to lose control of your character will supress the starfall effect.
+ if (caster->HasUnitState(UNIT_STATE_CONTROLLED))
+ return;
+
+ caster->CastSpell(GetHitUnit(), GetEffectValue(), true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_starfall_dummy_SpellScript();
+ }
+};
+
void AddSC_druid_spell_scripts()
{
new spell_dru_glyph_of_starfire();
@@ -336,4 +376,5 @@ void AddSC_druid_spell_scripts()
new spell_dru_t10_restoration_4p_bonus();
new spell_dru_starfall_aoe();
new spell_dru_swift_flight_passive();
+ new spell_dru_starfall_dummy();
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 9899e50cd28..a34b16a9c22 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -22,7 +22,6 @@
* Scriptnames of files in this file should be prefixed with "spell_gen_"
*/
-#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
#include "SkillDiscovery.h"
#include "GridNotifiers.h"
@@ -236,9 +235,7 @@ class spell_gen_parachute : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
+ if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
return false;
return true;
}
@@ -246,13 +243,11 @@ class spell_gen_parachute : public SpellScriptLoader
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (Player* target = GetTarget()->ToPlayer())
- {
if (target->IsFalling())
{
target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
}
- }
}
void Register()
@@ -283,13 +278,14 @@ class spell_gen_pet_summoned : public SpellScriptLoader
{
PrepareSpellScript(spell_gen_pet_summoned_SpellScript);
- void HandleScript(SpellEffIndex /*effIndex*/)
+ bool Load()
{
- Unit* caster = GetCaster();
- if (caster->GetTypeId() != TYPEID_PLAYER)
- return;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
- Player* player = caster->ToPlayer();
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* player = GetCaster()->ToPlayer();
if (player->GetLastPetNumber())
{
PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
@@ -340,10 +336,14 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader
class spell_gen_remove_flight_auras_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript);
+
void HandleScript(SpellEffIndex /*effIndex*/)
{
- GetHitUnit()->RemoveAurasByType(SPELL_AURA_FLY);
- GetHitUnit()->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
+ if (Unit* target = GetHitUnit())
+ {
+ target->RemoveAurasByType(SPELL_AURA_FLY);
+ target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
+ }
}
void Register()
@@ -376,22 +376,21 @@ class spell_gen_leeching_swarm : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL))
+ if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG) || !sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL))
return false;
return true;
}
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
- if (Unit* caster = GetCaster())
+ Unit* caster = GetCaster();
+ if (Unit* target = GetTarget())
{
- int32 lifeLeeched = GetTarget()->CountPctFromCurHealth(aurEff->GetAmount());
+ int32 lifeLeeched = target->CountPctFromCurHealth(aurEff->GetAmount());
if (lifeLeeched < 250)
lifeLeeched = 250;
// Damage
- caster->CastCustomSpell(GetTarget(), SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false);
+ caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false);
// Heal
caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false);
}
@@ -500,31 +499,16 @@ class spell_gen_trick : public SpellScriptLoader
PrepareSpellScript(spell_gen_trick_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF))
+ if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE)
+ || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE)
+ || !sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF))
return false;
return true;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
+ Unit* caster = GetCaster();
if (Player* target = GetHitPlayer())
{
uint8 gender = target->getGender();
@@ -550,7 +534,7 @@ class spell_gen_trick : public SpellScriptLoader
break;
}
- GetCaster()->CastSpell(target, spellId, true, NULL);
+ caster->CastSpell(target, spellId, true, NULL);
}
}
@@ -585,21 +569,18 @@ class spell_gen_trick_or_treat : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_TRICK))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_TREAT))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED))
+ if (!sSpellMgr->GetSpellInfo(SPELL_TRICK) || !sSpellMgr->GetSpellInfo(SPELL_TREAT) || !sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED))
return false;
return true;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
+ Unit* caster = GetCaster();
if (Player* target = GetHitPlayer())
{
- GetCaster()->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL);
- GetCaster()->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL);
+ caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL);
+ caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL);
}
}
@@ -661,11 +642,14 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
{
PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript);
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF))
+ if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF))
return false;
return true;
}
@@ -673,10 +657,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
- if (!caster)
- return;
SpellInfo const* spellInfo = GetSpellInfo();
-
caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)->GetRecoveryTime() / IN_MILLISECONDS);
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4);
data << uint64(caster->GetGUID());
@@ -729,8 +710,9 @@ class spell_gen_animal_blood : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- if (GetUnitOwner()->IsInWater())
- GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPAWN_BLOOD_POOL, true);
+ if (Unit* owner = GetUnitOwner())
+ if (owner->IsInWater())
+ owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
}
void Register()
@@ -761,6 +743,11 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader
{
PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript);
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM))
@@ -770,9 +757,9 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
- if (Player* caster = GetCaster()->ToPlayer())
- if (caster->HasSpellCooldown(SPELL_DIVINE_STORM))
- caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true);
+ Player* caster = GetCaster()->ToPlayer();
+ if (caster->HasSpellCooldown(SPELL_DIVINE_STORM))
+ caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true);
}
void Register()
@@ -796,13 +783,15 @@ class spell_gen_gunship_portal : public SpellScriptLoader
{
PrepareSpellScript(spell_gen_gunship_portal_SpellScript);
- void HandleScript(SpellEffIndex /*effIndex*/)
+ bool Load()
{
- Unit* caster = GetCaster();
- if (caster->GetTypeId() != TYPEID_PLAYER)
- return;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
- if (Battleground* bg = caster->ToPlayer()->GetBattleground())
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (Battleground* bg = caster->GetBattleground())
if (bg->GetTypeID(true) == BATTLEGROUND_IC)
bg->DoAction(1, caster->GetGUID());
}
@@ -821,7 +810,7 @@ class spell_gen_gunship_portal : public SpellScriptLoader
enum parachuteIC
{
- SPELL_PARACHUTE_IC = 66657
+ SPELL_PARACHUTE_IC = 66657,
};
class spell_gen_parachute_ic : public SpellScriptLoader
@@ -835,13 +824,9 @@ class spell_gen_parachute_ic : public SpellScriptLoader
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
{
- Unit* target = GetTarget();
-
- if (!target->ToPlayer())
- return;
-
- if (target->ToPlayer()->m_movementInfo.fallTime > 2000)
- target->CastSpell(target, SPELL_PARACHUTE_IC, true);
+ if (Player* target = GetTarget()->ToPlayer())
+ if (target->m_movementInfo.fallTime > 2000)
+ target->CastSpell(target, SPELL_PARACHUTE_IC, true);
}
void Register()
@@ -868,7 +853,7 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
bool Load()
{
_handled = false;
- return true;
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void CreditEncounter()
@@ -878,9 +863,9 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
return;
_handled = true;
- if (GetCaster()->GetTypeId() == TYPEID_UNIT)
- if (InstanceScript* instance = GetCaster()->GetInstanceScript())
- instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, GetCaster());
+ Unit* caster = GetCaster();
+ if (InstanceScript* instance = caster->GetInstanceScript())
+ instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, caster);
}
void Register()
@@ -906,9 +891,14 @@ class spell_gen_profession_research : public SpellScriptLoader
{
PrepareSpellScript(spell_gen_profession_research_SpellScript);
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
SpellCastResult CheckRequirement()
{
- if (GetCaster()->GetTypeId() == TYPEID_PLAYER && HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer()))
+ if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer()))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER);
return SPELL_FAILED_CUSTOM_ERROR;
@@ -978,19 +968,11 @@ class spell_generic_clone_weapon : public SpellScriptLoader
class spell_generic_clone_weapon_SpellScript : public SpellScript
{
PrepareSpellScript(spell_generic_clone_weapon_SpellScript);
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED))
+ if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND)
+ || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED))
return false;
return true;
}
@@ -999,57 +981,56 @@ class spell_generic_clone_weapon : public SpellScriptLoader
{
PreventHitDefaultEffect(effIndex);
Unit* caster = GetCaster();
- Unit* target = GetHitUnit();
-
- if (!target)
- return;
+ if (Unit* target = GetHitUnit())
+ {
- uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue());
- target->CastSpell(caster, spellId, true);
+ uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue());
+ target->CastSpell(caster, spellId, true);
- if (target->GetTypeId() == TYPEID_PLAYER)
- return;
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ return;
- switch (GetSpellInfo()->Id)
- {
- case SPELL_COPY_WEAPON:
- case SPELL_COPY_WEAPON_2:
- case SPELL_COPY_WEAPON_3:
+ switch (GetSpellInfo()->Id)
{
- if (Player* player = caster->ToPlayer())
+ case SPELL_COPY_WEAPON:
+ case SPELL_COPY_WEAPON_2:
+ case SPELL_COPY_WEAPON_3:
{
- if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
+ if (Player* player = caster->ToPlayer())
+ {
+ if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
+ }
+ else
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
+ break;
}
- else
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
- break;
- }
- case SPELL_COPY_OFFHAND:
- case SPELL_COPY_OFFHAND_2:
- {
- if (Player* player = caster->ToPlayer())
+ case SPELL_COPY_OFFHAND:
+ case SPELL_COPY_OFFHAND_2:
{
- if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
+ if (Player* player = caster->ToPlayer())
+ {
+ if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
+ }
+ else
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
+ break;
}
- else
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
- break;
- }
- case SPELL_COPY_RANGED:
- {
- if (Player* player = caster->ToPlayer())
+ case SPELL_COPY_RANGED:
{
- if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
+ if (Player* player = caster->ToPlayer())
+ {
+ if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
+ }
+ else
+ target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
+ break;
}
- else
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
- break;
+ default:
+ break;
}
- default:
- break;
}
}
@@ -1095,10 +1076,10 @@ class spell_gen_seaforium_blast : public SpellScriptLoader
void AchievementCredit(SpellEffIndex /*effIndex*/)
{
// but in effect handling OriginalCaster can become NULL
- if (!GetOriginalCaster() || !GetHitGObj() || GetHitGObj()->GetGOInfo()->type != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
- return;
-
- GetOriginalCaster()->CastSpell(GetOriginalCaster(), SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
+ if (Unit* originalCaster = GetOriginalCaster())
+ if (GameObject* go = GetHitGObj())
+ if (GetHitGObj()->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
+ originalCaster->CastSpell(originalCaster, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
}
void Register()
@@ -1131,10 +1112,11 @@ class spell_gen_turkey_marker : public SpellScriptLoader
{
// store stack apply times, so we can pop them while they expire
_applyTimes.push_back(getMSTime());
+ Unit* target = GetTarget();
// on stack 15 cast the achievement crediting spell
if (GetStackAmount() >= 15)
- GetTarget()->CastSpell(GetTarget(), SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID());
+ target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID());
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
@@ -1208,29 +1190,28 @@ class spell_gen_magic_rooster : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- Player* target = GetHitPlayer();
- if (!target)
- return;
+ if (Player* target = GetHitPlayer())
+ {
+ // prevent client crashes from stacking mounts
+ target->RemoveAurasByType(SPELL_AURA_MOUNTED);
- // prevent client crashes from stacking mounts
- target->RemoveAurasByType(SPELL_AURA_MOUNTED);
+ uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL;
+ switch (target->getRace())
+ {
+ case RACE_DRAENEI:
+ if (target->getGender() == GENDER_MALE)
+ spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE;
+ break;
+ case RACE_TAUREN:
+ if (target->getGender() == GENDER_MALE)
+ spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE;
+ break;
+ default:
+ break;
+ }
- uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL;
- switch (target->getRace())
- {
- case RACE_DRAENEI:
- if (target->getGender() == GENDER_MALE)
- spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE;
- break;
- case RACE_TAUREN:
- if (target->getGender() == GENDER_MALE)
- spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE;
- break;
- default:
- break;
+ target->CastSpell(target, spellId, true);
}
-
- target->CastSpell(target, spellId, true);
}
void Register()
@@ -1258,7 +1239,6 @@ public:
{
if (!GetCastItem())
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
-
return SPELL_CAST_OK;
}
@@ -1335,12 +1315,14 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_vehicle_scaling_AuraScript);
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
Unit* caster = GetCaster();
- if (!caster || !caster->ToPlayer())
- return;
-
float factor;
uint16 baseItemLevel;
@@ -1379,21 +1361,23 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader
};
-class spell_gen_oracle_wolvar_reputation: public SpellScriptLoader
+class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader
{
-public:
- spell_gen_oracle_wolvar_reputation() : SpellScriptLoader("spell_gen_oracle_wolvar_reputation") { }
-
- class spell_gen_oracle_wolvar_reputation_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_gen_oracle_wolvar_reputation_SpellScript)
+ public:
+ spell_gen_oracle_wolvar_reputation() : SpellScriptLoader("spell_gen_oracle_wolvar_reputation") { }
- void HandleDummy(SpellEffIndex effIndex)
+ class spell_gen_oracle_wolvar_reputation_SpellScript : public SpellScript
{
+ PrepareSpellScript(spell_gen_oracle_wolvar_reputation_SpellScript);
- if (Player* player = GetCaster()->ToPlayer())
+ bool Load()
{
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ Player* player = GetCaster()->ToPlayer();
uint32 factionId = GetSpellInfo()->Effects[effIndex].CalcValue();
int32 repChange = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
@@ -1410,18 +1394,16 @@ public:
// EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation
}
- }
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_gen_oracle_wolvar_reputation_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_gen_oracle_wolvar_reputation_SpellScript();
- }
};
enum DamageReductionAura
@@ -1435,53 +1417,48 @@ enum DamageReductionAura
class spell_gen_damage_reduction_aura : public SpellScriptLoader
{
-public:
- spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { }
-
- class spell_gen_damage_reduction_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_gen_damage_reduction_AuraScript);
+ public:
+ spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { }
- bool Validate(SpellInfo const* /*SpellEntry*/)
+ class spell_gen_damage_reduction_AuraScript : public AuraScript
{
- if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA))
- return false;
- return true;
- }
+ PrepareAuraScript(spell_gen_damage_reduction_AuraScript);
- void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- Unit* target = GetTarget();
- target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true);
- }
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA))
+ return false;
+ return true;
+ }
- void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- Unit* target = GetTarget();
- if (!target->HasAura(SPELL_DAMAGE_REDUCTION_AURA))
- return;
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true);
+ }
- if (target->HasAura(SPELL_BLESSING_OF_SANCTUARY) ||
- target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) ||
- target->HasAura(SPELL_RENEWED_HOPE) ||
- target->HasAura(SPELL_VIGILANCE))
- return;
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) ||
+ target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) ||
+ target->HasAura(SPELL_RENEWED_HOPE) ||
+ target->HasAura(SPELL_VIGILANCE)))
+ target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA);
+ }
- target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA);
- }
+ void Register()
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
- void Register()
+ };
+
+ AuraScript* GetAuraScript() const
{
- OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ return new spell_gen_damage_reduction_AuraScript();
}
-
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_gen_damage_reduction_AuraScript();
- }
};
class spell_gen_luck_of_the_draw : public SpellScriptLoader
@@ -1493,6 +1470,11 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_luck_of_the_draw_AuraScript);
+ bool Load()
+ {
+ return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
+ }
+
// cheap hax to make it have update calls
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
{
@@ -1502,30 +1484,30 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
void Update(AuraEffect* /*effect*/)
{
- if (GetUnitOwner()->GetTypeId() != TYPEID_PLAYER)
- return;
-
- const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID());
- LfgDungeonSet::const_iterator itr = dungeons.begin();
-
- if (itr == dungeons.end())
+ if (Player* owner = GetUnitOwner()->ToPlayer())
{
- Remove(AURA_REMOVE_BY_DEFAULT);
- return;
- }
+ const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(owner->GetGUID());
+ LfgDungeonSet::const_iterator itr = dungeons.begin();
+
+ if (itr == dungeons.end())
+ {
+ Remove(AURA_REMOVE_BY_DEFAULT);
+ return;
+ }
- LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr);
- Group* group = GetUnitOwner()->ToPlayer()->GetGroup();
- Map const* map = GetUnitOwner()->GetMap();
- if (group && group->isLFGGroup())
- if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
- if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
- if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty())
- if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM)
- return; // in correct dungeon
+ LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr);
+ if (Group* group = owner->GetGroup())
+ if (Map const* map = owner->GetMap())
+ if (group->isLFGGroup())
+ if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
+ if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
+ if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty())
+ if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM)
+ return; // in correct dungeon
- Remove(AURA_REMOVE_BY_DEFAULT);
+ Remove(AURA_REMOVE_BY_DEFAULT);
+ }
}
void Register()
@@ -1541,6 +1523,178 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
}
};
+enum DummyTrigger
+{
+ SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470,
+ SPELL_PERSISTANT_SHIELD = 26467,
+};
+
+class spell_gen_dummy_trigger : public SpellScriptLoader
+{
+ public:
+ spell_gen_dummy_trigger() : SpellScriptLoader("spell_gen_dummy_trigger") { }
+
+ class spell_gen_dummy_trigger_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_dummy_trigger_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 damage = GetEffectValue();
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ if (SpellInfo const* triggeredByAuraSpell = GetTriggeringSpell())
+ if (triggeredByAuraSpell->Id == SPELL_PERSISTANT_SHIELD_TRIGGERED)
+ caster->CastCustomSpell(target, SPELL_PERSISTANT_SHIELD_TRIGGERED, &damage, NULL, NULL, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_dummy_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_dummy_trigger_SpellScript();
+ }
+
+};
+
+class spell_gen_spirit_healer_res : public SpellScriptLoader
+{
+ public:
+ spell_gen_spirit_healer_res(): SpellScriptLoader("spell_gen_spirit_healer_res") { }
+
+ class spell_gen_spirit_healer_res_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_spirit_healer_res_SpellScript);
+
+ bool Load()
+ {
+ return GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (Player* originalCaster = GetOriginalCaster()->ToPlayer())
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
+ data << uint64(target->GetGUID());
+ originalCaster->GetSession()->SendPacket(&data);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_spirit_healer_res_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_spirit_healer_res_SpellScript();
+ }
+};
+
+enum TransporterBackfires
+{
+ SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH = 23444,
+ SPELL_TRANSPORTER_EVIL_TWIN = 23445,
+ SPELL_TRANSPORTER_MALFUNCTION_MISS = 36902,
+};
+
+class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader
+{
+ public:
+ spell_gen_gadgetzan_transporter_backfire() : SpellScriptLoader("spell_gen_gadgetzan_transporter_backfire") { }
+
+ class spell_gen_gadgetzan_transporter_backfire_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_gadgetzan_transporter_backfire_SpellScript)
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_EVIL_TWIN)
+ || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_MISS))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ int32 r = irand(0, 119);
+ if (r < 20) // Transporter Malfunction - 1/6 polymorph
+ caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH, true);
+ else if (r < 100) // Evil Twin - 4/6 evil twin
+ caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true);
+ else // Transporter Malfunction - 1/6 miss the target
+ caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_gadgetzan_transporter_backfire_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_gadgetzan_transporter_backfire_SpellScript();
+ }
+};
+
+enum GnomishTransporter
+{
+ SPELL_TRANSPORTER_SUCCESS = 23441,
+ SPELL_TRANSPORTER_FAILURE = 23446,
+};
+
+class spell_gen_gnomish_transporter : public SpellScriptLoader
+{
+ public:
+ spell_gen_gnomish_transporter() : SpellScriptLoader("spell_gen_gnomish_transporter") { }
+
+ class spell_gen_gnomish_transporter_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_gnomish_transporter_SpellScript)
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_FAILURE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE , true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_gnomish_transporter_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_gnomish_transporter_SpellScript();
+ }
+};
+
enum DalaranDisguiseSpells
{
SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672,
@@ -1565,15 +1719,11 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader
switch (spellEntry->Id)
{
case SPELL_SUNREAVER_DISGUISE_TRIGGER:
- if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE))
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE))
return false;
break;
case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
- if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE))
+ if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE))
return false;
break;
}
@@ -1599,7 +1749,6 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader
default:
break;
}
-
GetCaster()->CastSpell(player, spellId, true);
}
}
@@ -1706,6 +1855,8 @@ class spell_gen_break_shield: public SpellScriptLoader
}
break;
}
+ default:
+ break;
}
}
@@ -1794,6 +1945,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader
{
case SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION:
spellId = SPELL_CHARGE_CHARGING_EFFECT_20K_1;
+ break;
case SPELL_CHARGE_TRIGGER_FACTION_MOUNTS:
spellId = SPELL_CHARGE_CHARGING_EFFECT_8K5;
break;
@@ -1834,7 +1986,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader
}
}
- void HandleChargeEffect(SpellEffIndex effIndex)
+ void HandleChargeEffect(SpellEffIndex /*effIndex*/)
{
uint32 spellId;
@@ -1908,7 +2060,7 @@ class spell_gen_defend : public SpellScriptLoader
void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
- if (Unit* caster = GetCaster())
+ if (GetCaster())
{
Unit* target = GetTarget();
@@ -1989,7 +2141,7 @@ class spell_gen_tournament_duel : public SpellScriptLoader
return true;
}
- void HandleScriptEffect(SpellEffIndex effIndex)
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
if (Unit* rider = GetCaster()->GetCharmer())
{
@@ -2351,6 +2503,47 @@ class spell_gen_tournament_pennant : public SpellScriptLoader
}
};
+enum ChaosBlast
+{
+ SPELL_CHAOS_BLAST = 37675,
+};
+
+class spell_gen_chaos_blast : public SpellScriptLoader
+{
+ public:
+ spell_gen_chaos_blast() : SpellScriptLoader("spell_gen_chaos_blast") { }
+
+ class spell_gen_chaos_blast_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_chaos_blast_SpellScript)
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_CHAOS_BLAST))
+ return false;
+ return true;
+ }
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 basepoints0 = 100;
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, NULL, NULL, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_chaos_blast_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_chaos_blast_SpellScript();
+ }
+
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -2384,6 +2577,10 @@ void AddSC_generic_spell_scripts()
new spell_gen_oracle_wolvar_reputation();
new spell_gen_damage_reduction_aura();
new spell_gen_luck_of_the_draw();
+ new spell_gen_dummy_trigger();
+ new spell_gen_spirit_healer_res();
+ new spell_gen_gadgetzan_transporter_backfire();
+ new spell_gen_gnomish_transporter();
new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise");
new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise");
new spell_gen_elune_candle();
@@ -2395,4 +2592,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_summon_tournament_mount();
new spell_gen_on_tournament_mount();
new spell_gen_tournament_pennant();
+ new spell_gen_chaos_blast();
}
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 8a3424ab1e7..13ad05b1930 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_hun_".
*/
-#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
#include "GridNotifiers.h"
@@ -45,219 +44,215 @@ enum HunterSpells
// 13161 Aspect of the Beast
class spell_hun_aspect_of_the_beast : public SpellScriptLoader
{
-public:
- spell_hun_aspect_of_the_beast() : SpellScriptLoader("spell_hun_aspect_of_the_beast") { }
-
- class spell_hun_aspect_of_the_beast_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_hun_aspect_of_the_beast_AuraScript)
- bool Validate(SpellInfo const* /*entry*/)
- {
- if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET))
- return false;
- return true;
- }
+ public:
+ spell_hun_aspect_of_the_beast() : SpellScriptLoader("spell_hun_aspect_of_the_beast") { }
- void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ class spell_hun_aspect_of_the_beast_AuraScript : public AuraScript
{
- if (!GetCaster())
- return;
+ PrepareAuraScript(spell_hun_aspect_of_the_beast_AuraScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*entry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET))
+ return false;
+ return true;
+ }
- Unit* caster = GetCaster();
- if (caster->ToPlayer())
- if (Pet* pet = caster->ToPlayer()->GetPet())
- pet->RemoveAurasDueToSpell(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET);
- }
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Player* caster = GetCaster()->ToPlayer())
+ if (Pet* pet = caster->GetPet())
+ pet->RemoveAurasDueToSpell(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET);
+ }
- void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (!GetCaster())
- return;
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Player* caster = GetCaster()->ToPlayer())
+ if (caster->GetPet())
+ caster->CastSpell(caster, HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET, true);
+ }
- Unit* caster = GetCaster();
- if (caster->ToPlayer())
- if (caster->ToPlayer()->GetPet())
- caster->CastSpell(caster, HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET, true);
- }
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_hun_aspect_of_the_beast_AuraScript::OnApply, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_hun_aspect_of_the_beast_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
- void Register()
+ AuraScript* GetAuraScript() const
{
- AfterEffectApply += AuraEffectApplyFn(spell_hun_aspect_of_the_beast_AuraScript::OnApply, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL);
- AfterEffectRemove += AuraEffectRemoveFn(spell_hun_aspect_of_the_beast_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL);
+ return new spell_hun_aspect_of_the_beast_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_hun_aspect_of_the_beast_AuraScript();
- }
};
// 53209 Chimera Shot
class spell_hun_chimera_shot : public SpellScriptLoader
{
-public:
- spell_hun_chimera_shot() : SpellScriptLoader("spell_hun_chimera_shot") { }
+ public:
+ spell_hun_chimera_shot() : SpellScriptLoader("spell_hun_chimera_shot") { }
- class spell_hun_chimera_shot_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_hun_chimera_shot_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_hun_chimera_shot_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SERPENT))
- return false;
- if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_VIPER))
- return false;
- if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SCORPID))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_hun_chimera_shot_SpellScript);
- void HandleScriptEffect(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- Unit* unitTarget = GetHitUnit();
- if (!unitTarget)
- return;
-
- uint32 spellId = 0;
- int32 basePoint = 0;
- Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras();
- for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
- {
- Aura* aura = i->second->GetBase();
- if (aura->GetCasterGUID() != caster->GetGUID())
- continue;
-
- // Search only Serpent Sting, Viper Sting, Scorpid Sting auras
- flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags;
- if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000))
- continue;
- if (AuraEffect const* aurEff = aura->GetEffect(0))
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SERPENT) || !sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_VIPER) || !sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SCORPID))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* unitTarget = GetHitUnit())
{
- // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
- if (familyFlag[0] & 0x4000)
- {
- int32 TickCount = aurEff->GetTotalTicks();
- spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT;
- basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount());
- ApplyPctN(basePoint, TickCount * 40);
- }
- // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
- else if (familyFlag[1] & 0x00000080)
+ uint32 spellId = 0;
+ int32 basePoint = 0;
+ Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras();
+ for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
{
- int32 TickCount = aura->GetEffect(0)->GetTotalTicks();
- spellId = HUNTER_SPELL_CHIMERA_SHOT_VIPER;
-
- // Amount of one aura tick
- basePoint = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
- int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; // TODO: WTF? caster uses unitTarget?
- if (basePoint > casterBasePoint)
- basePoint = casterBasePoint;
- ApplyPctN(basePoint, TickCount * 60);
+ Aura* aura = i->second->GetBase();
+ if (aura->GetCasterGUID() != caster->GetGUID())
+ continue;
+
+ // Search only Serpent Sting, Viper Sting, Scorpid Sting auras
+ flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags;
+ if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000))
+ continue;
+ if (AuraEffect const* aurEff = aura->GetEffect(0))
+ {
+ // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
+ if (familyFlag[0] & 0x4000)
+ {
+ int32 TickCount = aurEff->GetTotalTicks();
+ spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT;
+ basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount());
+ ApplyPctN(basePoint, TickCount * 40);
+ }
+ // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
+ else if (familyFlag[1] & 0x00000080)
+ {
+ int32 TickCount = aura->GetEffect(0)->GetTotalTicks();
+ spellId = HUNTER_SPELL_CHIMERA_SHOT_VIPER;
+
+ // Amount of one aura tick
+ basePoint = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
+ int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; // TODO: WTF? caster uses unitTarget?
+ if (basePoint > casterBasePoint)
+ basePoint = casterBasePoint;
+ ApplyPctN(basePoint, TickCount * 60);
+ }
+ // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
+ else if (familyFlag[0] & 0x00008000)
+ spellId = HUNTER_SPELL_CHIMERA_SHOT_SCORPID;
+ // ?? nothing say in spell desc (possibly need addition check)
+ //if (familyFlag & 0x0000010000000000LL || // dot
+ // familyFlag & 0x0000100000000000LL) // stun
+ //{
+ // spellId = 53366; // 53366 Chimera Shot - Wyvern
+ //}
+
+ // Refresh aura duration
+ aura->RefreshDuration();
+ }
+ break;
}
- // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
- else if (familyFlag[0] & 0x00008000)
- spellId = HUNTER_SPELL_CHIMERA_SHOT_SCORPID;
- // ?? nothing say in spell desc (possibly need addition check)
- //if (familyFlag & 0x0000010000000000LL || // dot
- // familyFlag & 0x0000100000000000LL) // stun
- //{
- // spellId = 53366; // 53366 Chimera Shot - Wyvern
- //}
-
- // Refresh aura duration
- aura->RefreshDuration();
+ if (spellId)
+ caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true);
+ if (spellId == HUNTER_SPELL_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown
+ caster->ToPlayer()->AddSpellCooldown(spellId, 0, uint32(time(NULL) + 60));
}
- break;
}
- if (spellId)
- caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true);
- if (spellId == HUNTER_SPELL_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown
- caster->ToPlayer()->AddSpellCooldown(spellId, 0, uint32(time(NULL) + 60));
- }
- void Register()
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_hun_chimera_shot_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_hun_chimera_shot_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ return new spell_hun_chimera_shot_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_hun_chimera_shot_SpellScript();
- }
};
// 53412 Invigoration
class spell_hun_invigoration : public SpellScriptLoader
{
-public:
- spell_hun_invigoration() : SpellScriptLoader("spell_hun_invigoration") { }
+ public:
+ spell_hun_invigoration() : SpellScriptLoader("spell_hun_invigoration") { }
- class spell_hun_invigoration_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_hun_invigoration_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_hun_invigoration_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_INVIGORATION_TRIGGERED))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_hun_invigoration_SpellScript);
- void HandleScriptEffect(SpellEffIndex /*effIndex*/)
- {
- if (Unit* unitTarget = GetHitUnit())
- if (AuraEffect* aurEff = unitTarget->GetDummyAuraEffect(SPELLFAMILY_HUNTER, 3487, 0))
- if (roll_chance_i(aurEff->GetAmount()))
- unitTarget->CastSpell(unitTarget, HUNTER_SPELL_INVIGORATION_TRIGGERED, true);
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_INVIGORATION_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* unitTarget = GetHitUnit())
+ if (AuraEffect* aurEff = unitTarget->GetDummyAuraEffect(SPELLFAMILY_HUNTER, 3487, 0))
+ if (roll_chance_i(aurEff->GetAmount()))
+ unitTarget->CastSpell(unitTarget, HUNTER_SPELL_INVIGORATION_TRIGGERED, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_hun_invigoration_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_hun_invigoration_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ return new spell_hun_invigoration_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_hun_invigoration_SpellScript();
- }
};
class spell_hun_last_stand_pet : public SpellScriptLoader
{
-public:
- spell_hun_last_stand_pet() : SpellScriptLoader("spell_hun_last_stand_pet") { }
+ public:
+ spell_hun_last_stand_pet() : SpellScriptLoader("spell_hun_last_stand_pet") { }
- class spell_hun_last_stand_pet_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_hun_last_stand_pet_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_hun_last_stand_pet_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_LAST_STAND_TRIGGERED))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_hun_last_stand_pet_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30));
- caster->CastCustomSpell(caster, HUNTER_PET_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_LAST_STAND_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30));
+ caster->CastCustomSpell(caster, HUNTER_PET_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
+ }
+
+ void Register()
+ {
+ // add dummy effect spell handler to pet's Last Stand
+ OnEffectHitTarget += SpellEffectFn(spell_hun_last_stand_pet_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- // add dummy effect spell handler to pet's Last Stand
- OnEffectHitTarget += SpellEffectFn(spell_hun_last_stand_pet_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_hun_last_stand_pet_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_hun_last_stand_pet_SpellScript();
- }
};
class spell_hun_masters_call : public SpellScriptLoader
@@ -267,14 +262,11 @@ class spell_hun_masters_call : public SpellScriptLoader
class spell_hun_masters_call_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_hun_masters_call_SpellScript)
+ PrepareSpellScript(spell_hun_masters_call_SpellScript);
+
bool Validate(SpellInfo const* spellEntry)
{
- if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED))
- return false;
- if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue()))
- return false;
- if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue()))
+ if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED) || !sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue()) || !sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue()))
return false;
return true;
}
@@ -312,80 +304,86 @@ class spell_hun_masters_call : public SpellScriptLoader
class spell_hun_readiness : public SpellScriptLoader
{
-public:
- spell_hun_readiness() : SpellScriptLoader("spell_hun_readiness") { }
+ public:
+ spell_hun_readiness() : SpellScriptLoader("spell_hun_readiness") { }
- class spell_hun_readiness_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_hun_readiness_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_hun_readiness_SpellScript : public SpellScript
{
- Unit* caster = GetCaster();
- if (caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
- const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
- for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
- {
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
-
- ///! If spellId in cooldown map isn't valid, the above will return a null pointer.
- if (spellInfo &&
- spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
- spellInfo->Id != HUNTER_SPELL_READINESS &&
- spellInfo->Id != HUNTER_SPELL_BESTIAL_WRATH &&
- spellInfo->GetRecoveryTime() > 0)
- caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
- else
- ++itr;
+ PrepareSpellScript(spell_hun_readiness_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- }
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ // immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
+ const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
+ for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
+
+ ///! If spellId in cooldown map isn't valid, the above will return a null pointer.
+ if (spellInfo &&
+ spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
+ spellInfo->Id != HUNTER_SPELL_READINESS &&
+ spellInfo->Id != HUNTER_SPELL_BESTIAL_WRATH &&
+ spellInfo->GetRecoveryTime() > 0)
+ caster->RemoveSpellCooldown((itr++)->first, true);
+ else
+ ++itr;
+ }
+ }
+
+ void Register()
+ {
+ // add dummy effect spell handler to Readiness
+ OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- // add dummy effect spell handler to Readiness
- OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_hun_readiness_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_hun_readiness_SpellScript();
- }
};
// 37506 Scatter Shot
class spell_hun_scatter_shot : public SpellScriptLoader
{
-public:
- spell_hun_scatter_shot() : SpellScriptLoader("spell_hun_scatter_shot") { }
+ public:
+ spell_hun_scatter_shot() : SpellScriptLoader("spell_hun_scatter_shot") { }
- class spell_hun_scatter_shot_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_hun_scatter_shot_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_hun_scatter_shot_SpellScript : public SpellScript
{
- Unit* caster = GetCaster();
- if (caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // break Auto Shot and autohit
- caster->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
- caster->AttackStop();
- caster->ToPlayer()->SendAttackSwingCancelAttack();
- }
+ PrepareSpellScript(spell_hun_scatter_shot_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ // break Auto Shot and autohit
+ caster->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
+ caster->AttackStop();
+ caster->SendAttackSwingCancelAttack();
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_hun_scatter_shot_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_hun_scatter_shot_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_hun_scatter_shot_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_hun_scatter_shot_SpellScript();
- }
};
// 53302, 53303, 53304 Sniper Training
@@ -397,169 +395,164 @@ enum eSniperTrainingSpells
class spell_hun_sniper_training : public SpellScriptLoader
{
-public:
- spell_hun_sniper_training() : SpellScriptLoader("spell_hun_sniper_training") { }
-
- class spell_hun_sniper_training_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_hun_sniper_training_AuraScript)
- bool Validate(SpellInfo const* /*entry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_R1))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_BUFF_R1))
- return false;
- return true;
- }
+ public:
+ spell_hun_sniper_training() : SpellScriptLoader("spell_hun_sniper_training") { }
- void HandlePeriodic(AuraEffect const* aurEff)
+ class spell_hun_sniper_training_AuraScript : public AuraScript
{
- PreventDefaultAction();
- if (aurEff->GetAmount() > 0)
- return;
+ PrepareAuraScript(spell_hun_sniper_training_AuraScript);
- Unit* caster = GetCaster();
+ bool Validate(SpellInfo const* /*entry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_R1) || !sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_BUFF_R1))
+ return false;
+ return true;
+ }
- if (!caster)
- return;
+ void HandlePeriodic(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+ if (aurEff->GetAmount() <= 0)
+ {
+ Unit* caster = GetCaster();
+ uint32 spellId = SPELL_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_SNIPER_TRAINING_R1;
+ if (Unit* target = GetTarget())
+ if (!target->HasAura(spellId))
+ {
+ SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId);
+ Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target;
+ triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff);
+ }
+ }
+ }
- uint32 spellId = SPELL_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_SNIPER_TRAINING_R1;
- Unit* target = GetTarget();
- if (!target->HasAura(spellId))
+ void HandleUpdatePeriodic(AuraEffect* aurEff)
{
- SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId);
- Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target;
- triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff);
+ if (Player* playerTarget = GetUnitOwner()->ToPlayer())
+ {
+ int32 baseAmount = aurEff->GetBaseAmount();
+ int32 amount = playerTarget->isMoving() ?
+ playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) :
+ aurEff->GetAmount() - 1;
+ aurEff->SetAmount(amount);
+ }
}
- }
- void HandleUpdatePeriodic(AuraEffect* aurEff)
- {
- Unit* target = GetUnitOwner();
- if (Player* playerTarget = target->ToPlayer())
+ void Register()
{
- int32 baseAmount = aurEff->GetBaseAmount();
- int32 amount = playerTarget->isMoving() ?
- target->CalculateSpellDamage(target, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) :
- aurEff->GetAmount() - 1;
- aurEff->SetAmount(amount);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_sniper_training_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_hun_sniper_training_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
- }
+ };
- void Register()
+ AuraScript* GetAuraScript() const
{
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_sniper_training_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
- OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_hun_sniper_training_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ return new spell_hun_sniper_training_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_hun_sniper_training_AuraScript();
- }
};
class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
{
-public:
- spell_hun_pet_heart_of_the_phoenix() : SpellScriptLoader("spell_hun_pet_heart_of_the_phoenix") { }
+ public:
+ spell_hun_pet_heart_of_the_phoenix() : SpellScriptLoader("spell_hun_pet_heart_of_the_phoenix") { }
- class spell_hun_pet_heart_of_the_phoenix_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_hun_pet_heart_of_the_phoenix_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_hun_pet_heart_of_the_phoenix_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED))
- return false;
- if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_hun_pet_heart_of_the_phoenix_SpellScript);
- void HandleScript(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- Unit* owner = caster->GetOwner();
- if (!owner || caster->HasAura(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
- return;
- owner->CastCustomSpell(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true);
- caster->CastSpell(caster, HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true);
- }
+ bool Load()
+ {
+ if (!GetCaster()->isPet())
+ return false;
+ return true;
+ }
- void Register()
- {
- // add dummy effect spell handler to pet's Last Stand
- OnEffectHitTarget += SpellEffectFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED) || !sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* owner = caster->GetOwner())
+ if (!caster->HasAura(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
+ {
+ owner->CastCustomSpell(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true);
+ caster->CastSpell(caster, HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true);
+ }
+ }
- bool Load()
+ void Register()
+ {
+ // add dummy effect spell handler to pet's Last Stand
+ OnEffectHitTarget += SpellEffectFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- if (!GetCaster()->isPet())
- return false;
- return true;
+ return new spell_hun_pet_heart_of_the_phoenix_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_hun_pet_heart_of_the_phoenix_SpellScript();
- }
};
class spell_hun_pet_carrion_feeder : public SpellScriptLoader
{
-public:
- spell_hun_pet_carrion_feeder() : SpellScriptLoader("spell_hun_pet_carrion_feeder") { }
+ public:
+ spell_hun_pet_carrion_feeder() : SpellScriptLoader("spell_hun_pet_carrion_feeder") { }
- class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_hun_pet_carrion_feeder_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_hun_pet_carrion_feeder_SpellScript);
+
+ bool Load()
+ {
+ if (!GetCaster()->isPet())
+ return false;
+ return true;
+ }
- SpellCastResult CheckIfCorpseNear()
- {
- Unit* caster = GetCaster();
- float max_range = GetSpellInfo()->GetMaxRange(false);
- WorldObject* result = NULL;
- // search for nearby enemy corpse in range
- Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_SELECT_CHECK_ENEMY);
- Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
- caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher);
- if (!result)
- return SPELL_FAILED_NO_EDIBLE_CORPSES;
- return SPELL_CAST_OK;
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED))
+ return false;
+ return true;
+ }
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- caster->CastSpell(caster, HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED, false);
- }
+ SpellCastResult CheckIfCorpseNear()
+ {
+ Unit* caster = GetCaster();
+ float max_range = GetSpellInfo()->GetMaxRange(false);
+ WorldObject* result = NULL;
+ // search for nearby enemy corpse in range
+ Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_SELECT_CHECK_ENEMY);
+ Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
+ caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher);
+ if (!result)
+ return SPELL_FAILED_NO_EDIBLE_CORPSES;
+ return SPELL_CAST_OK;
+ }
- void Register()
- {
- // add dummy effect spell handler to pet's Last Stand
- OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear);
- }
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED, false);
+ }
- bool Load()
+ void Register()
+ {
+ // add dummy effect spell handler to pet's Last Stand
+ OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- if (!GetCaster()->isPet())
- return false;
- return true;
+ return new spell_hun_pet_carrion_feeder_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_hun_pet_carrion_feeder_SpellScript();
- }
};
void AddSC_hunter_spell_scripts()
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index b40879d500e..844162a88ec 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -21,55 +21,55 @@
* Scriptnames of files in this file should be prefixed with "spell_item_".
*/
-#include "ScriptPCH.h"
#include "SkillDiscovery.h"
// Generic script for handling item dummy effects which trigger another spell.
class spell_item_trigger_spell : public SpellScriptLoader
{
-private:
- uint32 _triggeredSpellId;
-
-public:
- spell_item_trigger_spell(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
-
- class spell_item_trigger_spell_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_item_trigger_spell_SpellScript)
private:
uint32 _triggeredSpellId;
public:
- spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
+ spell_item_trigger_spell(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_item_trigger_spell_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_item_trigger_spell_SpellScript);
+ private:
+ uint32 _triggeredSpellId;
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Item* pItem = GetCastItem())
- GetCaster()->CastSpell(GetCaster(), _triggeredSpellId, true, pItem);
- }
+ public:
+ spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
- void Register()
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Item* pItem = GetCastItem())
+ caster->CastSpell(caster, _triggeredSpellId, true, pItem);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_trigger_spell_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_trigger_spell_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_trigger_spell_SpellScript(_triggeredSpellId);
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_trigger_spell_SpellScript(_triggeredSpellId);
- }
};
// http://www.wowhead.com/item=6522 Deviate Fish
// 8063 Deviate Fish
-enum eDeviateFishSpells
+enum DeviateFishSpells
{
SPELL_SLEEPY = 8064,
SPELL_INVIGORATE = 8065,
@@ -80,46 +80,48 @@ enum eDeviateFishSpells
class spell_item_deviate_fish : public SpellScriptLoader
{
-public:
- spell_item_deviate_fish() : SpellScriptLoader("spell_item_deviate_fish") { }
-
- class spell_item_deviate_fish_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_item_deviate_fish_SpellScript)
public:
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- for (uint32 spellId = SPELL_SLEEPY; spellId <= SPELL_HEALTHY_SPIRIT; ++spellId)
- if (!sSpellMgr->GetSpellInfo(spellId))
- return false;
- return true;
- }
+ spell_item_deviate_fish() : SpellScriptLoader("spell_item_deviate_fish") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_deviate_fish_SpellScript : public SpellScript
{
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return;
+ PrepareSpellScript(spell_item_deviate_fish_SpellScript);
- uint32 spellId = urand(SPELL_SLEEPY, SPELL_HEALTHY_SPIRIT);
- pCaster->CastSpell(pCaster, spellId, true, NULL);
- }
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
- void Register()
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ for (uint32 spellId = SPELL_SLEEPY; spellId <= SPELL_HEALTHY_SPIRIT; ++spellId)
+ if (!sSpellMgr->GetSpellInfo(spellId))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ uint32 spellId = urand(SPELL_SLEEPY, SPELL_HEALTHY_SPIRIT);
+ caster->CastSpell(caster, spellId, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_deviate_fish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_deviate_fish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_deviate_fish_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_deviate_fish_SpellScript();
- }
};
// http://www.wowhead.com/item=47499 Flask of the North
// 67019 Flask of the North
-enum eFlaskOfTheNorthSpells
+enum FlaskOfTheNorthSpells
{
SPELL_FLASK_OF_THE_NORTH_SP = 67016,
SPELL_FLASK_OF_THE_NORTH_AP = 67017,
@@ -128,75 +130,68 @@ enum eFlaskOfTheNorthSpells
class spell_item_flask_of_the_north : public SpellScriptLoader
{
-public:
- spell_item_flask_of_the_north() : SpellScriptLoader("spell_item_flask_of_the_north") { }
-
- class spell_item_flask_of_the_north_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_flask_of_the_north_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_SP))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_AP))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_STR))
- return false;
- return true;
- }
+ spell_item_flask_of_the_north() : SpellScriptLoader("spell_item_flask_of_the_north") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_flask_of_the_north_SpellScript : public SpellScript
{
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return;
+ PrepareSpellScript(spell_item_flask_of_the_north_SpellScript);
- std::vector<uint32> possibleSpells;
- switch (pCaster->getClass())
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- case CLASS_WARLOCK:
- case CLASS_MAGE:
- case CLASS_PRIEST:
- possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
- break;
- case CLASS_DEATH_KNIGHT:
- case CLASS_WARRIOR:
- possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR);
- break;
- case CLASS_ROGUE:
- case CLASS_HUNTER:
- possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP);
- break;
- case CLASS_DRUID:
- case CLASS_PALADIN:
- possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
- possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR);
- break;
- case CLASS_SHAMAN:
- possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
- possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP);
- break;
+ if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_SP) || !sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_AP) || !sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_STR))
+ return false;
+ return true;
}
- pCaster->CastSpell(pCaster, possibleSpells[irand(0, (possibleSpells.size() - 1))], true, NULL);
- }
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ std::vector<uint32> possibleSpells;
+ switch (caster->getClass())
+ {
+ case CLASS_WARLOCK:
+ case CLASS_MAGE:
+ case CLASS_PRIEST:
+ possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
+ break;
+ case CLASS_DEATH_KNIGHT:
+ case CLASS_WARRIOR:
+ possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR);
+ break;
+ case CLASS_ROGUE:
+ case CLASS_HUNTER:
+ possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP);
+ break;
+ case CLASS_DRUID:
+ case CLASS_PALADIN:
+ possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
+ possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR);
+ break;
+ case CLASS_SHAMAN:
+ possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
+ possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP);
+ break;
+ }
- void Register()
+ caster->CastSpell(caster, possibleSpells[irand(0, (possibleSpells.size() - 1))], true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_flask_of_the_north_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_flask_of_the_north_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_flask_of_the_north_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_flask_of_the_north_SpellScript();
- }
};
// http://www.wowhead.com/item=10645 Gnomish Death Ray
// 13280 Gnomish Death Ray
-enum eGnomishDeathRay
+enum GnomishDeathRay
{
SPELL_GNOMISH_DEATH_RAY_SELF = 13493,
SPELL_GNOMISH_DEATH_RAY_TARGET = 13279,
@@ -204,49 +199,45 @@ enum eGnomishDeathRay
class spell_item_gnomish_death_ray : public SpellScriptLoader
{
-public:
- spell_item_gnomish_death_ray() : SpellScriptLoader("spell_item_gnomish_death_ray") { }
-
- class spell_item_gnomish_death_ray_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_gnomish_death_ray_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_SELF))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_TARGET))
- return false;
- return true;
- }
+ spell_item_gnomish_death_ray() : SpellScriptLoader("spell_item_gnomish_death_ray") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_gnomish_death_ray_SpellScript : public SpellScript
{
- if (Unit* target = GetHitUnit())
+ PrepareSpellScript(spell_item_gnomish_death_ray_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- Unit* pCaster = GetCaster();
- if (urand(0, 99) < 15)
- pCaster->CastSpell(pCaster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure
- else
- pCaster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL);
+ if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_SELF) || !sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_TARGET))
+ return false;
+ return true;
}
- }
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ if (urand(0, 99) < 15)
+ caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure
+ else
+ caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_gnomish_death_ray_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_item_gnomish_death_ray_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_gnomish_death_ray_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_gnomish_death_ray_SpellScript();
- }
};
// http://www.wowhead.com/item=27388 Mr. Pinchy
// 33060 Make a Wish
-enum eMakeAWish
+enum MakeAWish
{
SPELL_MR_PINCHYS_BLESSING = 33053,
SPELL_SUMMON_MIGHTY_MR_PINCHY = 33057,
@@ -257,115 +248,110 @@ enum eMakeAWish
class spell_item_make_a_wish : public SpellScriptLoader
{
-public:
- spell_item_make_a_wish() : SpellScriptLoader("spell_item_make_a_wish") { }
-
- class spell_item_make_a_wish_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_make_a_wish_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_BLESSING))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_MIGHTY_MR_PINCHY))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FURIOUS_MR_PINCHY))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_TINY_MAGICAL_CRAWDAD))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_GIFT))
- return false;
- return true;
- }
+ spell_item_make_a_wish() : SpellScriptLoader("spell_item_make_a_wish") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_make_a_wish_SpellScript : public SpellScript
{
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return;
+ PrepareSpellScript(spell_item_make_a_wish_SpellScript);
- uint32 spellId = SPELL_MR_PINCHYS_GIFT;
- switch (urand(1, 5))
+ bool Load()
{
- case 1: spellId = SPELL_MR_PINCHYS_BLESSING; break;
- case 2: spellId = SPELL_SUMMON_MIGHTY_MR_PINCHY; break;
- case 3: spellId = SPELL_SUMMON_FURIOUS_MR_PINCHY; break;
- case 4: spellId = SPELL_TINY_MAGICAL_CRAWDAD; break;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- pCaster->CastSpell(pCaster, spellId, true, NULL);
- }
- void Register()
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_BLESSING) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_MIGHTY_MR_PINCHY) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_FURIOUS_MR_PINCHY) || !sSpellMgr->GetSpellInfo(SPELL_TINY_MAGICAL_CRAWDAD) || !sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_GIFT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ uint32 spellId = SPELL_MR_PINCHYS_GIFT;
+ switch (urand(1, 5))
+ {
+ case 1: spellId = SPELL_MR_PINCHYS_BLESSING; break;
+ case 2: spellId = SPELL_SUMMON_MIGHTY_MR_PINCHY; break;
+ case 3: spellId = SPELL_SUMMON_FURIOUS_MR_PINCHY; break;
+ case 4: spellId = SPELL_TINY_MAGICAL_CRAWDAD; break;
+ }
+ caster->CastSpell(caster, spellId, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_make_a_wish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_make_a_wish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_make_a_wish_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_make_a_wish_SpellScript();
- }
};
// http://www.wowhead.com/item=32686 Mingo's Fortune Giblets
// 40802 Mingo's Fortune Generator
class spell_item_mingos_fortune_generator : public SpellScriptLoader
{
-public:
- spell_item_mingos_fortune_generator() : SpellScriptLoader("spell_item_mingos_fortune_generator") { }
+ public:
+ spell_item_mingos_fortune_generator() : SpellScriptLoader("spell_item_mingos_fortune_generator") { }
- class spell_item_mingos_fortune_generator_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_item_mingos_fortune_generator_SpellScript)
- void HandleDummy(SpellEffIndex effIndex)
- {
- // Selecting one from Bloodstained Fortune item
- uint32 newitemid;
- switch (urand(1, 20))
- {
- case 1: newitemid = 32688; break;
- case 2: newitemid = 32689; break;
- case 3: newitemid = 32690; break;
- case 4: newitemid = 32691; break;
- case 5: newitemid = 32692; break;
- case 6: newitemid = 32693; break;
- case 7: newitemid = 32700; break;
- case 8: newitemid = 32701; break;
- case 9: newitemid = 32702; break;
- case 10: newitemid = 32703; break;
- case 11: newitemid = 32704; break;
- case 12: newitemid = 32705; break;
- case 13: newitemid = 32706; break;
- case 14: newitemid = 32707; break;
- case 15: newitemid = 32708; break;
- case 16: newitemid = 32709; break;
- case 17: newitemid = 32710; break;
- case 18: newitemid = 32711; break;
- case 19: newitemid = 32712; break;
- case 20: newitemid = 32713; break;
- default:
- return;
+ class spell_item_mingos_fortune_generator_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_mingos_fortune_generator_SpellScript);
+
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ // Selecting one from Bloodstained Fortune item
+ uint32 newitemid;
+ switch (urand(1, 20))
+ {
+ case 1: newitemid = 32688; break;
+ case 2: newitemid = 32689; break;
+ case 3: newitemid = 32690; break;
+ case 4: newitemid = 32691; break;
+ case 5: newitemid = 32692; break;
+ case 6: newitemid = 32693; break;
+ case 7: newitemid = 32700; break;
+ case 8: newitemid = 32701; break;
+ case 9: newitemid = 32702; break;
+ case 10: newitemid = 32703; break;
+ case 11: newitemid = 32704; break;
+ case 12: newitemid = 32705; break;
+ case 13: newitemid = 32706; break;
+ case 14: newitemid = 32707; break;
+ case 15: newitemid = 32708; break;
+ case 16: newitemid = 32709; break;
+ case 17: newitemid = 32710; break;
+ case 18: newitemid = 32711; break;
+ case 19: newitemid = 32712; break;
+ case 20: newitemid = 32713; break;
+ default:
+ return;
+ }
+
+ CreateItem(effIndex, newitemid);
}
- CreateItem(effIndex, newitemid);
- }
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_mingos_fortune_generator_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_mingos_fortune_generator_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_mingos_fortune_generator_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_mingos_fortune_generator_SpellScript();
- }
};
// http://www.wowhead.com/item=10720 Gnomish Net-o-Matic Projector
// 13120 Net-o-Matic
-enum eNetOMaticSpells
+enum NetOMaticSpells
{
SPELL_NET_O_MATIC_TRIGGERED1 = 16566,
SPELL_NET_O_MATIC_TRIGGERED2 = 13119,
@@ -374,54 +360,50 @@ enum eNetOMaticSpells
class spell_item_net_o_matic : public SpellScriptLoader
{
-public:
- spell_item_net_o_matic() : SpellScriptLoader("spell_item_net_o_matic") { }
-
- class spell_item_net_o_matic_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_net_o_matic_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED1))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED2))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED3))
- return false;
- return true;
- }
+ spell_item_net_o_matic() : SpellScriptLoader("spell_item_net_o_matic") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_net_o_matic_SpellScript : public SpellScript
{
- if (Unit* target = GetHitUnit())
+ PrepareSpellScript(spell_item_net_o_matic_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- uint32 spellId = SPELL_NET_O_MATIC_TRIGGERED3;
- uint32 roll = urand(0, 99);
- if (roll < 2) // 2% for 30 sec self root (off-like chance unknown)
- spellId = SPELL_NET_O_MATIC_TRIGGERED1;
- else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
- spellId = SPELL_NET_O_MATIC_TRIGGERED2;
+ if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED3))
+ return false;
+ return true;
+ }
- GetCaster()->CastSpell(target, spellId, true, NULL);
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ uint32 spellId = SPELL_NET_O_MATIC_TRIGGERED3;
+ uint32 roll = urand(0, 99);
+ if (roll < 2) // 2% for 30 sec self root (off-like chance unknown)
+ spellId = SPELL_NET_O_MATIC_TRIGGERED1;
+ else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
+ spellId = SPELL_NET_O_MATIC_TRIGGERED2;
+
+ GetCaster()->CastSpell(target, spellId, true, NULL);
+ }
}
- }
- void Register()
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_net_o_matic_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_item_net_o_matic_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_net_o_matic_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_net_o_matic_SpellScript();
- }
};
// http://www.wowhead.com/item=8529 Noggenfogger Elixir
// 16589 Noggenfogger Elixir
-enum eNoggenfoggerElixirSpells
+enum NoggenfoggerElixirSpells
{
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1 = 16595,
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2 = 16593,
@@ -430,55 +412,53 @@ enum eNoggenfoggerElixirSpells
class spell_item_noggenfogger_elixir : public SpellScriptLoader
{
-public:
- spell_item_noggenfogger_elixir() : SpellScriptLoader("spell_item_noggenfogger_elixir") { }
-
- class spell_item_noggenfogger_elixir_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_noggenfogger_elixir_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3))
- return false;
- return true;
- }
+ spell_item_noggenfogger_elixir() : SpellScriptLoader("spell_item_noggenfogger_elixir") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_noggenfogger_elixir_SpellScript : public SpellScript
{
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return;
+ PrepareSpellScript(spell_item_noggenfogger_elixir_SpellScript);
- uint32 spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3;
- switch (urand(1, 3))
+ bool Load()
{
- case 1: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1; break;
- case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- pCaster->CastSpell(pCaster, spellId, true, NULL);
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3))
+ return false;
+ return true;
+ }
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ uint32 spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3;
+ switch (urand(1, 3))
+ {
+ case 1: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1; break;
+ case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break;
+ }
+
+ caster->CastSpell(caster, spellId, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_noggenfogger_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_noggenfogger_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_noggenfogger_elixir_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_noggenfogger_elixir_SpellScript();
- }
};
// http://www.wowhead.com/item=6657 Savory Deviate Delight
// 8213 Savory Deviate Delight
-enum eSavoryDeviateDelight
+enum SavoryDeviateDelight
{
SPELL_FLIP_OUT_MALE = 8219,
SPELL_FLIP_OUT_FEMALE = 8220,
@@ -488,53 +468,55 @@ enum eSavoryDeviateDelight
class spell_item_savory_deviate_delight : public SpellScriptLoader
{
-public:
- spell_item_savory_deviate_delight() : SpellScriptLoader("spell_item_savory_deviate_delight") { }
-
- class spell_item_savory_deviate_delight_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_savory_deviate_delight_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- for (uint32 spellId = SPELL_FLIP_OUT_MALE; spellId <= SPELL_YAAARRRR_FEMALE; ++spellId)
- if (!sSpellMgr->GetSpellInfo(spellId))
- return false;
- return true;
- }
+ spell_item_savory_deviate_delight() : SpellScriptLoader("spell_item_savory_deviate_delight") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_savory_deviate_delight_SpellScript : public SpellScript
{
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return;
+ PrepareSpellScript(spell_item_savory_deviate_delight_SpellScript);
- uint32 spellId = 0;
- switch (urand(1, 2))
+ bool Load()
{
- // Flip Out - ninja
- case 1: spellId = (pCaster->getGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
- // Yaaarrrr - pirate
- case 2: spellId = (pCaster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- pCaster->CastSpell(pCaster, spellId, true, NULL);
- }
- void Register()
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ for (uint32 spellId = SPELL_FLIP_OUT_MALE; spellId <= SPELL_YAAARRRR_FEMALE; ++spellId)
+ if (!sSpellMgr->GetSpellInfo(spellId))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ uint32 spellId = 0;
+ switch (urand(1, 2))
+ {
+ // Flip Out - ninja
+ case 1: spellId = (caster->getGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
+ // Yaaarrrr - pirate
+ case 2: spellId = (caster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
+ }
+ caster->CastSpell(caster, spellId, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_savory_deviate_delight_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_savory_deviate_delight_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_savory_deviate_delight_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_savory_deviate_delight_SpellScript();
- }
};
// http://www.wowhead.com/item=7734 Six Demon Bag
// 14537 Six Demon Bag
-enum eSixDemonBagSpells
+enum SixDemonBagSpells
{
SPELL_FROSTBOLT = 11538,
SPELL_POLYMORPH = 14621,
@@ -546,77 +528,66 @@ enum eSixDemonBagSpells
class spell_item_six_demon_bag : public SpellScriptLoader
{
-public:
- spell_item_six_demon_bag() : SpellScriptLoader("spell_item_six_demon_bag") { }
-
- class spell_item_six_demon_bag_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_six_demon_bag_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_FROSTBOLT))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_POLYMORPH))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FELHOUND_MINION))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_FIREBALL))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_CHAIN_LIGHTNING))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_ENVELOPING_WINDS))
- return false;
- return true;
- }
+ spell_item_six_demon_bag() : SpellScriptLoader("spell_item_six_demon_bag") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_six_demon_bag_SpellScript : public SpellScript
{
- if (Unit* target = GetHitUnit())
+ PrepareSpellScript(spell_item_six_demon_bag_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- Unit* pCaster = GetCaster();
+ if (!sSpellMgr->GetSpellInfo(SPELL_FROSTBOLT) || !sSpellMgr->GetSpellInfo(SPELL_POLYMORPH) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_FELHOUND_MINION) || !sSpellMgr->GetSpellInfo(SPELL_FIREBALL) || !sSpellMgr->GetSpellInfo(SPELL_CHAIN_LIGHTNING) || !sSpellMgr->GetSpellInfo(SPELL_ENVELOPING_WINDS))
+ return false;
+ return true;
+ }
- uint32 spellId = 0;
- uint32 rand = urand(0, 99);
- if (rand < 25) // Fireball (25% chance)
- spellId = SPELL_FIREBALL;
- else if (rand < 50) // Frostball (25% chance)
- spellId = SPELL_FROSTBOLT;
- else if (rand < 70) // Chain Lighting (20% chance)
- spellId = SPELL_CHAIN_LIGHTNING;
- else if (rand < 80) // Polymorph (10% chance)
- {
- spellId = SPELL_POLYMORPH;
- if (urand(0, 100) <= 30) // 30% chance to self-cast
- target = pCaster;
- }
- else if (rand < 95) // Enveloping Winds (15% chance)
- spellId = SPELL_ENVELOPING_WINDS;
- else // Summon Felhund minion (5% chance)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
{
- spellId = SPELL_SUMMON_FELHOUND_MINION;
- target = pCaster;
+ uint32 spellId = 0;
+ uint32 rand = urand(0, 99);
+ if (rand < 25) // Fireball (25% chance)
+ spellId = SPELL_FIREBALL;
+ else if (rand < 50) // Frostball (25% chance)
+ spellId = SPELL_FROSTBOLT;
+ else if (rand < 70) // Chain Lighting (20% chance)
+ spellId = SPELL_CHAIN_LIGHTNING;
+ else if (rand < 80) // Polymorph (10% chance)
+ {
+ spellId = SPELL_POLYMORPH;
+ if (urand(0, 100) <= 30) // 30% chance to self-cast
+ target = caster;
+ }
+ else if (rand < 95) // Enveloping Winds (15% chance)
+ spellId = SPELL_ENVELOPING_WINDS;
+ else // Summon Felhund minion (5% chance)
+ {
+ spellId = SPELL_SUMMON_FELHOUND_MINION;
+ target = caster;
+ }
+
+ caster->CastSpell(target, spellId, true, GetCastItem());
}
+ }
- pCaster->CastSpell(target, spellId, true, GetCastItem());
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_six_demon_bag_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_item_six_demon_bag_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_six_demon_bag_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_six_demon_bag_SpellScript();
- }
};
// http://www.wowhead.com/item=44012 Underbelly Elixir
// 59640 Underbelly Elixir
-enum eUnderbellyElixirSpells
+enum UnderbellyElixirSpells
{
SPELL_UNDERBELLY_ELIXIR_TRIGGERED1 = 59645,
SPELL_UNDERBELLY_ELIXIR_TRIGGERED2 = 59831,
@@ -625,49 +596,46 @@ enum eUnderbellyElixirSpells
class spell_item_underbelly_elixir : public SpellScriptLoader
{
-public:
- spell_item_underbelly_elixir() : SpellScriptLoader("spell_item_underbelly_elixir") { }
-
- class spell_item_underbelly_elixir_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_item_underbelly_elixir_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3))
- return false;
- return true;
- }
+ spell_item_underbelly_elixir() : SpellScriptLoader("spell_item_underbelly_elixir") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_item_underbelly_elixir_SpellScript : public SpellScript
{
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return;
+ PrepareSpellScript(spell_item_underbelly_elixir_SpellScript);
- uint32 spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED3;
- switch (urand(1, 3))
+ bool Load()
{
- case 1: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED1; break;
- case 2: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED2; break;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3))
+ return false;
+ return true;
}
- pCaster->CastSpell(pCaster, spellId, true, NULL);
- }
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ uint32 spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED3;
+ switch (urand(1, 3))
+ {
+ case 1: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED1; break;
+ case 2: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED2; break;
+ }
+ caster->CastSpell(caster, spellId, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_item_underbelly_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_item_underbelly_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_item_underbelly_elixir_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_item_underbelly_elixir_SpellScript();
- }
};
enum eShadowmourneVisuals
@@ -684,17 +652,11 @@ public:
class spell_item_shadowmourne_AuraScript : public AuraScript
{
- public:
- PrepareAuraScript(spell_item_shadowmourne_AuraScript)
- spell_item_shadowmourne_AuraScript() : AuraScript() { }
+ PrepareAuraScript(spell_item_shadowmourne_AuraScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF))
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF))
return false;
return true;
}
@@ -702,7 +664,6 @@ public:
void OnStackChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
-
switch (GetStackAmount())
{
case 1:
@@ -716,6 +677,8 @@ public:
target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH);
target->CastSpell(target, SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF, true);
break;
+ default:
+ break;
}
}
@@ -757,11 +720,7 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_HOLD_VISUAL))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT_SELF))
+ if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_HOLD_VISUAL) || !sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT) || !sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT_SELF))
return false;
return true;
}
@@ -769,17 +728,18 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- if (!GetHitUnit())
- return;
-
- GetCaster()->CastSpell(GetCaster(), SPELL_AIR_RIFLE_HOLD_VISUAL, true);
- // needed because this spell shares GCD with its triggered spells (which must not be cast with triggered flag)
- if (Player* player = GetCaster()->ToPlayer())
- player->GetGlobalCooldownMgr().CancelGlobalCooldown(GetSpellInfo());
- if (urand(0, 4))
- GetCaster()->CastSpell(GetHitUnit(), SPELL_AIR_RIFLE_SHOOT, false);
- else
- GetCaster()->CastSpell(GetCaster(), SPELL_AIR_RIFLE_SHOOT_SELF, false);
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ {
+ caster->CastSpell(caster, SPELL_AIR_RIFLE_HOLD_VISUAL, true);
+ // needed because this spell shares GCD with its triggered spells (which must not be cast with triggered flag)
+ if (Player* player = caster->ToPlayer())
+ player->GetGlobalCooldownMgr().CancelGlobalCooldown(GetSpellInfo());
+ if (urand(0, 4))
+ caster->CastSpell(target, SPELL_AIR_RIFLE_SHOOT, false);
+ else
+ caster->CastSpell(caster, SPELL_AIR_RIFLE_SHOOT_SELF, false);
+ }
}
void Register()
@@ -794,7 +754,7 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader
}
};
-enum eGenericData
+enum GenericData
{
SPELL_ARCANITE_DRAGONLING = 19804,
SPELL_BATTLE_CHICKEN = 13166,
@@ -826,14 +786,11 @@ class spell_item_create_heart_candy : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- if (!GetHitUnit() || !GetHitUnit()->ToPlayer())
- return;
-
- Player* target = GetHitUnit()->ToPlayer();
-
- static const uint32 items[] = {ITEM_HEART_CANDY_1, ITEM_HEART_CANDY_2, ITEM_HEART_CANDY_3, ITEM_HEART_CANDY_4, ITEM_HEART_CANDY_5, ITEM_HEART_CANDY_6, ITEM_HEART_CANDY_7, ITEM_HEART_CANDY_8};
-
- target->AddItem(items[urand(0, 7)], 1);
+ if (Player* target = GetHitPlayer())
+ {
+ static const uint32 items[] = {ITEM_HEART_CANDY_1, ITEM_HEART_CANDY_2, ITEM_HEART_CANDY_3, ITEM_HEART_CANDY_4, ITEM_HEART_CANDY_5, ITEM_HEART_CANDY_6, ITEM_HEART_CANDY_7, ITEM_HEART_CANDY_8};
+ target->AddItem(items[urand(0, 7)], 1);
+ }
}
void Register()
@@ -856,10 +813,15 @@ class spell_item_book_of_glyph_mastery : public SpellScriptLoader
class spell_item_book_of_glyph_mastery_SpellScript : public SpellScript
{
PrepareSpellScript(spell_item_book_of_glyph_mastery_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
SpellCastResult CheckRequirement()
{
- if (GetCaster()->GetTypeId() == TYPEID_PLAYER && HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer()))
+ if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer()))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_LEARNED_EVERYTHING);
return SPELL_FAILED_CUSTOM_ERROR;
@@ -939,7 +901,7 @@ class spell_item_map_of_the_geyser_fields : public SpellScriptLoader
SpellCastResult CheckSinkholes()
{
Unit* caster = GetCaster();
- if (caster->FindNearestCreature(NPC_SOUTH_SINKHOLE, 30.0f, true) ||
+ if (caster->FindNearestCreature(NPC_SOUTH_SINKHOLE, 30.0f, true) ||
caster->FindNearestCreature(NPC_NORTHEAST_SINKHOLE, 30.0f, true) ||
caster->FindNearestCreature(NPC_NORTHWEST_SINKHOLE, 30.0f, true))
return SPELL_CAST_OK;
@@ -978,11 +940,7 @@ class spell_item_vanquished_clutches : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_CRUSHER))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_CONSTRICTOR))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_CORRUPTOR))
+ if (!sSpellMgr->GetSpellInfo(SPELL_CRUSHER) || !sSpellMgr->GetSpellInfo(SPELL_CONSTRICTOR) || !sSpellMgr->GetSpellInfo(SPELL_CORRUPTOR))
return false;
return true;
}
@@ -990,7 +948,8 @@ class spell_item_vanquished_clutches : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
uint32 spellId = RAND(SPELL_CRUSHER, SPELL_CONSTRICTOR, SPELL_CORRUPTOR);
- GetCaster()->CastSpell(GetCaster(), spellId, true);
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, spellId, true);
}
void Register()
@@ -1019,9 +978,6 @@ enum AshbringerSounds
SOUND_ASHBRINGER_10 = 8926, // "Scarlet Crusade is pure no longer"
SOUND_ASHBRINGER_11 = 8927, // "Balnazzar's crusade corrupted my son"
SOUND_ASHBRINGER_12 = 8928, // "Kill them all!"
-
- SPELL_ASHBRINGER = 28282, // Ashbringer - Inflicts the will of the Ashbringer upon the wielder
- SPELL_ASHBRINGER_TR = 28441 // AB Effect 000
};
class spell_item_ashbringer : public SpellScriptLoader
@@ -1031,28 +987,24 @@ class spell_item_ashbringer : public SpellScriptLoader
class spell_item_ashbringer_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_item_ashbringer_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ PrepareSpellScript(spell_item_ashbringer_SpellScript);
+
+ bool Load()
{
- if (!sSpellMgr->GetSpellInfo(SPELL_ASHBRINGER))
- return false;
- return true;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void OnDummyEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- Unit* caster = GetCaster();
- if (Player* player = caster->ToPlayer())
- {
- uint32 sound_id = RAND( SOUND_ASHBRINGER_1, SOUND_ASHBRINGER_2, SOUND_ASHBRINGER_3, SOUND_ASHBRINGER_4, SOUND_ASHBRINGER_5, SOUND_ASHBRINGER_6,
- SOUND_ASHBRINGER_7, SOUND_ASHBRINGER_8, SOUND_ASHBRINGER_9, SOUND_ASHBRINGER_10, SOUND_ASHBRINGER_11, SOUND_ASHBRINGER_12 );
+ Player* player = GetCaster()->ToPlayer();
+ uint32 sound_id = RAND( SOUND_ASHBRINGER_1, SOUND_ASHBRINGER_2, SOUND_ASHBRINGER_3, SOUND_ASHBRINGER_4, SOUND_ASHBRINGER_5, SOUND_ASHBRINGER_6,
+ SOUND_ASHBRINGER_7, SOUND_ASHBRINGER_8, SOUND_ASHBRINGER_9, SOUND_ASHBRINGER_10, SOUND_ASHBRINGER_11, SOUND_ASHBRINGER_12 );
- // Ashbringers effect (spellID 28441) retriggers every 5 seconds, with a chance of making it say one of the above 12 sounds
- if (urand(0, 60) < 1)
- player->PlayDirectSound(sound_id, player);
- }
+ // Ashbringers effect (spellID 28441) retriggers every 5 seconds, with a chance of making it say one of the above 12 sounds
+ if (urand(0, 60) < 1)
+ player->PlayDirectSound(sound_id, player);
}
void Register()
@@ -1080,9 +1032,7 @@ enum MagicEater
class spell_magic_eater_food : public SpellScriptLoader
{
public:
- spell_magic_eater_food() : SpellScriptLoader("spell_magic_eater_food")
- {
- }
+ spell_magic_eater_food() : SpellScriptLoader("spell_magic_eater_food") {}
class spell_magic_eater_food_AuraScript : public AuraScript
{
@@ -1092,7 +1042,6 @@ class spell_magic_eater_food : public SpellScriptLoader
{
PreventDefaultAction();
Unit* target = GetTarget();
-
switch (urand(0, 5))
{
case 0:
@@ -1113,7 +1062,7 @@ class spell_magic_eater_food : public SpellScriptLoader
case 5:
target->CastSpell(target, SPELL_WELL_FED_5, true);
break;
- }
+ }
}
void Register()
@@ -1128,6 +1077,873 @@ class spell_magic_eater_food : public SpellScriptLoader
}
};
+class spell_item_shimmering_vessel : public SpellScriptLoader
+{
+ public:
+ spell_item_shimmering_vessel() : SpellScriptLoader("spell_item_shimmering_vessel") { }
+
+ class spell_item_shimmering_vessel_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_shimmering_vessel_SpellScript);
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (Creature* target = GetHitCreature())
+ target->setDeathState(JUST_ALIVED);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_shimmering_vessel_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_shimmering_vessel_SpellScript();
+ }
+};
+
+enum PurifyHelboarMeat
+{
+ SPELL_SUMMON_PURIFIED_HELBOAR_MEAT = 29277,
+ SPELL_SUMMON_TOXIC_HELBOAR_MEAT = 29278,
+};
+
+class spell_item_purify_helboar_meat : public SpellScriptLoader
+{
+ public:
+ spell_item_purify_helboar_meat() : SpellScriptLoader("spell_item_purify_helboar_meat") { }
+
+ class spell_item_purify_helboar_meat_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_purify_helboar_meat_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_PURIFIED_HELBOAR_MEAT) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_TOXIC_HELBOAR_MEAT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, roll_chance_i(50) ? SPELL_SUMMON_PURIFIED_HELBOAR_MEAT : SPELL_SUMMON_TOXIC_HELBOAR_MEAT, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_purify_helboar_meat_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_purify_helboar_meat_SpellScript();
+ }
+};
+
+enum CrystalPrison
+{
+ OBJECT_IMPRISONED_DOOMGUARD = 179644,
+};
+
+class spell_item_crystal_prison_dummy_dnd : public SpellScriptLoader
+{
+ public:
+ spell_item_crystal_prison_dummy_dnd() : SpellScriptLoader("spell_item_crystal_prison_dummy_dnd") { }
+
+ class spell_item_crystal_prison_dummy_dnd_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_crystal_prison_dummy_dnd_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sObjectMgr->GetGameObjectTemplate(OBJECT_IMPRISONED_DOOMGUARD))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (Creature* target = GetHitCreature())
+ if (target->isDead() && !target->isPet())
+ {
+ GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime()-time(NULL)));
+ target->DespawnOrUnsummon();
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_crystal_prison_dummy_dnd_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_crystal_prison_dummy_dnd_SpellScript();
+ }
+};
+
+enum ReindeerTransformation
+{
+ SPELL_FLYING_REINDEER_310 = 44827,
+ SPELL_FLYING_REINDEER_280 = 44825,
+ SPELL_FLYING_REINDEER_60 = 44824,
+ SPELL_REINDEER_100 = 25859,
+ SPELL_REINDEER_60 = 25858,
+};
+
+class spell_item_reindeer_transformation : public SpellScriptLoader
+{
+ public:
+ spell_item_reindeer_transformation() : SpellScriptLoader("spell_item_reindeer_transformation") { }
+
+ class spell_item_reindeer_transformation_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_reindeer_transformation_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_310) || !sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_280)
+ || !sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_60) || !sSpellMgr->GetSpellInfo(SPELL_REINDEER_100)
+ || !sSpellMgr->GetSpellInfo(SPELL_REINDEER_60))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ if (caster->HasAuraType(SPELL_AURA_MOUNTED))
+ {
+ float flyspeed = caster->GetSpeedRate(MOVE_FLIGHT);
+ float speed = caster->GetSpeedRate(MOVE_RUN);
+
+ caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
+ //5 different spells used depending on mounted speed and if mount can fly or not
+
+ if (flyspeed >= 4.1f)
+ // Flying Reindeer
+ caster->CastSpell(caster, SPELL_FLYING_REINDEER_310, true); //310% flying Reindeer
+ else if (flyspeed >= 3.8f)
+ // Flying Reindeer
+ caster->CastSpell(caster, SPELL_FLYING_REINDEER_280, true); //280% flying Reindeer
+ else if (flyspeed >= 1.6f)
+ // Flying Reindeer
+ caster->CastSpell(caster, SPELL_FLYING_REINDEER_60, true); //60% flying Reindeer
+ else if (speed >= 2.0f)
+ // Reindeer
+ caster->CastSpell(caster, SPELL_REINDEER_100, true); //100% ground Reindeer
+ else
+ // Reindeer
+ caster->CastSpell(caster, SPELL_REINDEER_60, true); //60% ground Reindeer
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_reindeer_transformation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_reindeer_transformation_SpellScript();
+ }
+};
+
+enum NighInvulnerability
+{
+ SPELL_NIGH_INVULNERABILITY = 30456,
+ SPELL_COMPLETE_VULNERABILITY = 30457,
+};
+
+class spell_item_nigh_invulnerability : public SpellScriptLoader
+{
+ public:
+ spell_item_nigh_invulnerability() : SpellScriptLoader("spell_item_nigh_invulnerability") { }
+
+ class spell_item_nigh_invulnerability_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_nigh_invulnerability_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_NIGH_INVULNERABILITY) || !sSpellMgr->GetSpellInfo(SPELL_COMPLETE_VULNERABILITY))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ if (Item* castItem = GetCastItem())
+ if (roll_chance_i(86)) // Nigh-Invulnerability - success
+ caster->CastSpell(caster, SPELL_NIGH_INVULNERABILITY, true, castItem);
+ else // Complete Vulnerability - backfire in 14% casts
+ caster->CastSpell(caster, SPELL_COMPLETE_VULNERABILITY, true, castItem);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_nigh_invulnerability_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_nigh_invulnerability_SpellScript();
+ }
+};
+
+enum Poultryzer
+{
+ SPELL_POULTRYIZER_SUCCESS = 30501,
+ SPELL_POULTRYIZER_BACKFIRE = 30504,
+};
+
+class spell_item_poultryizer : public SpellScriptLoader
+{
+ public:
+ spell_item_poultryizer() : SpellScriptLoader("spell_item_poultryizer") { }
+
+ class spell_item_poultryizer_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_poultryizer_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_POULTRYIZER_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_POULTRYIZER_BACKFIRE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (GetCastItem() && GetHitUnit())
+ GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE , true, GetCastItem());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_poultryizer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_poultryizer_SpellScript();
+ }
+};
+
+enum SocretharsStone
+{
+ SPELL_SOCRETHAR_TO_SEAT = 35743,
+ SPELL_SOCRETHAR_FROM_SEAT = 35744,
+};
+
+class spell_item_socrethars_stone : public SpellScriptLoader
+{
+ public:
+ spell_item_socrethars_stone() : SpellScriptLoader("spell_item_socrethars_stone") { }
+
+ class spell_item_socrethars_stone_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_socrethars_stone_SpellScript);
+
+ bool Load()
+ {
+ return (GetCaster()->GetAreaId() == 3900 || GetCaster()->GetAreaId() == 3742);
+ }
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SOCRETHAR_TO_SEAT) || !sSpellMgr->GetSpellInfo(SPELL_SOCRETHAR_FROM_SEAT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ switch (caster->GetAreaId())
+ {
+ case 3900:
+ caster->CastSpell(caster, SPELL_SOCRETHAR_TO_SEAT, true);
+ break;
+ case 3742:
+ caster->CastSpell(caster, SPELL_SOCRETHAR_FROM_SEAT, true);
+ break;
+ default:
+ return;
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_socrethars_stone_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_socrethars_stone_SpellScript();
+ }
+};
+
+enum DemonBroiledSurprise
+{
+ QUEST_SUPER_HOT_STEW = 11379,
+ SPELL_CREATE_DEMON_BROILED_SURPRISE = 43753,
+ NPC_ABYSSAL_FLAMEBRINGER = 19973,
+};
+
+class spell_item_demon_broiled_surprise : public SpellScriptLoader
+{
+ public:
+ spell_item_demon_broiled_surprise() : SpellScriptLoader("spell_item_demon_broiled_surprise") { }
+
+ class spell_item_demon_broiled_surprise_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_demon_broiled_surprise_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_DEMON_BROILED_SURPRISE) || !sObjectMgr->GetCreatureTemplate(NPC_ABYSSAL_FLAMEBRINGER) || !sObjectMgr->GetQuestTemplate(QUEST_SUPER_HOT_STEW))
+ return false;
+ return true;
+ }
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* player = GetCaster();
+ player->CastSpell(player, SPELL_CREATE_DEMON_BROILED_SURPRISE, false);
+ }
+
+ SpellCastResult CheckRequirement()
+ {
+ Player* player = GetCaster()->ToPlayer();
+ if (player->GetQuestStatus(QUEST_SUPER_HOT_STEW) != QUEST_STATUS_INCOMPLETE)
+ return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
+
+ if (Creature* creature = player->FindNearestCreature(NPC_ABYSSAL_FLAMEBRINGER, 10, false))
+ if (creature->isDead())
+ return SPELL_CAST_OK;
+ return SPELL_FAILED_NOT_HERE;
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_demon_broiled_surprise_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
+ OnCheckCast += SpellCheckCastFn(spell_item_demon_broiled_surprise_SpellScript::CheckRequirement);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_demon_broiled_surprise_SpellScript();
+ }
+};
+
+enum CompleteRaptorCapture
+{
+ SPELL_RAPTOR_CAPTURE_CREDIT = 42337,
+};
+
+class spell_item_complete_raptor_capture : public SpellScriptLoader
+{
+ public:
+ spell_item_complete_raptor_capture() : SpellScriptLoader("spell_item_complete_raptor_capture") { }
+
+ class spell_item_complete_raptor_capture_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_complete_raptor_capture_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_RAPTOR_CAPTURE_CREDIT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ if (GetHitCreature())
+ {
+ GetHitCreature()->DespawnOrUnsummon();
+
+ //cast spell Raptor Capture Credit
+ caster->CastSpell(caster, SPELL_RAPTOR_CAPTURE_CREDIT, true, NULL);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_complete_raptor_capture_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_complete_raptor_capture_SpellScript();
+ }
+};
+
+enum ImpaleLeviroth
+{
+ NPC_LEVIROTH = 26452,
+};
+
+class spell_item_impale_leviroth : public SpellScriptLoader
+{
+ public:
+ spell_item_impale_leviroth() : SpellScriptLoader("spell_item_impale_leviroth") { }
+
+ class spell_item_impale_leviroth_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_impale_leviroth_SpellScript);
+
+ bool Load()
+ {
+ return GetHitCreature()->GetEntry() == NPC_LEVIROTH;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sObjectMgr->GetCreatureTemplate(NPC_LEVIROTH))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitCreature())
+ if (target->HealthBelowPct(95))
+ caster->DealDamage(target, target->CountPctFromMaxHealth(93));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_impale_leviroth_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_impale_leviroth_SpellScript();
+ }
+};
+
+enum BrewfestMountTransformation
+{
+ SPELL_MOUNT_RAM_100 = 43900,
+ SPELL_MOUNT_RAM_60 = 43899,
+ SPELL_MOUNT_KODO_100 = 49379,
+ SPELL_MOUNT_KODO_60 = 49378,
+ SPELL_BREWFEST_MOUNT_TRANSFORM = 49357,
+ SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE = 52845,
+};
+
+class spell_item_brewfest_mount_transformation : public SpellScriptLoader
+{
+ public:
+ spell_item_brewfest_mount_transformation() : SpellScriptLoader("spell_item_brewfest_mount_transformation") { }
+
+ class spell_item_brewfest_mount_transformation_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_brewfest_mount_transformation_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MOUNT_RAM_100) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_RAM_60) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_KODO_100) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_KODO_60))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (caster->HasAuraType(SPELL_AURA_MOUNTED))
+ {
+ caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
+ uint32 spell_id;
+
+ switch (GetSpellInfo()->Id)
+ {
+ case SPELL_BREWFEST_MOUNT_TRANSFORM:
+ if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
+ spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ;
+ else
+ spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ;
+ break;
+ case SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE:
+ if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
+ spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ;
+ else
+ spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ;
+ break;
+ default:
+ return;
+ }
+ caster->CastSpell(caster, spell_id, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_brewfest_mount_transformation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_brewfest_mount_transformation_SpellScript();
+ }
+};
+
+enum NitroBoots
+{
+ SPELL_NITRO_BOOTS_SUCCESS = 54861,
+ SPELL_NITRO_BOOTS_BACKFIRE = 46014,
+};
+
+class spell_item_nitro_boots : public SpellScriptLoader
+{
+ public:
+ spell_item_nitro_boots() : SpellScriptLoader("spell_item_nitro_boots") { }
+
+ class spell_item_nitro_boots_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_nitro_boots_SpellScript);
+
+ bool Load()
+ {
+ if (!GetCastItem())
+ return false;
+ return true;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_NITRO_BOOTS_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_NITRO_BOOTS_BACKFIRE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, roll_chance_i(95) ? SPELL_NITRO_BOOTS_SUCCESS : SPELL_NITRO_BOOTS_BACKFIRE, true, GetCastItem());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_nitro_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_nitro_boots_SpellScript();
+ }
+};
+
+enum TeachLanguage
+{
+ SPELL_LEARN_GNOMISH_BINARY = 50242,
+ SPELL_LEARN_GOBLIN_BINARY = 50246,
+};
+
+class spell_item_teach_language : public SpellScriptLoader
+{
+ public:
+ spell_item_teach_language() : SpellScriptLoader("spell_item_teach_language") { }
+
+ class spell_item_teach_language_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_teach_language_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_LEARN_GNOMISH_BINARY) || !sSpellMgr->GetSpellInfo(SPELL_LEARN_GOBLIN_BINARY))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+
+ if (roll_chance_i(34))
+ caster->CastSpell(caster,caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_teach_language_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_teach_language_SpellScript();
+ }
+};
+
+enum RocketBoots
+{
+ SPELL_ROCKET_BOOTS_PROC = 30452,
+};
+
+class spell_item_rocket_boots : public SpellScriptLoader
+{
+ public:
+ spell_item_rocket_boots() : SpellScriptLoader("spell_item_rocket_boots") { }
+
+ class spell_item_rocket_boots_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_rocket_boots_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ROCKET_BOOTS_PROC))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (Battleground* bg = caster->GetBattleground())
+ bg->EventPlayerDroppedFlag(caster);
+
+ caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_rocket_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_rocket_boots_SpellScript();
+ }
+};
+
+enum PygmyOil
+{
+ SPELL_PYGMY_OIL_PYGMY_AURA = 53806,
+ SPELL_PYGMY_OIL_SMALLER_AURA = 53805,
+};
+
+class spell_item_pygmy_oil : public SpellScriptLoader
+{
+ public:
+ spell_item_pygmy_oil() : SpellScriptLoader("spell_item_pygmy_oil") { }
+
+ class spell_item_pygmy_oil_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_pygmy_oil_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PYGMY_OIL_PYGMY_AURA) || !sSpellMgr->GetSpellInfo(SPELL_PYGMY_OIL_SMALLER_AURA))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ if (Aura* aura = caster->GetAura(SPELL_PYGMY_OIL_PYGMY_AURA))
+ aura->RefreshDuration();
+ else
+ {
+ aura = caster->GetAura(SPELL_PYGMY_OIL_SMALLER_AURA);
+ if (!aura || aura->GetStackAmount() < 5 || !roll_chance_i(50))
+ caster->CastSpell(caster, SPELL_PYGMY_OIL_SMALLER_AURA, true);
+ else
+ {
+ aura->Remove();
+ caster->CastSpell(caster, SPELL_PYGMY_OIL_PYGMY_AURA, true);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_pygmy_oil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_pygmy_oil_SpellScript();
+ }
+};
+
+class spell_item_unusual_compass : public SpellScriptLoader
+{
+ public:
+ spell_item_unusual_compass() : SpellScriptLoader("spell_item_unusual_compass") { }
+
+ class spell_item_unusual_compass_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_unusual_compass_SpellScript);
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ caster->SetOrientation(frand(0.0f, 62832.0f) / 10000.0f);
+ caster->SendMovementFlagUpdate();
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_unusual_compass_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_unusual_compass_SpellScript();
+ }
+};
+
+enum UDED
+{
+ NPC_IRONWOOL_MAMMOTH = 53806,
+ SPELL_MAMMOTH_CARCASS = 57444,
+ SPELL_MAMMOTH_MEAT = 54625,
+};
+
+class spell_item_uded : public SpellScriptLoader
+{
+ public:
+ spell_item_uded() : SpellScriptLoader("spell_item_uded") { }
+
+ class spell_item_uded_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_uded_SpellScript);
+
+ bool Load()
+ {
+ if (GetHitCreature() && GetHitCreature()->GetEntry() == NPC_IRONWOOL_MAMMOTH)
+ return true;
+ return false;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_CARCASS) || !sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_MEAT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Unit* caster = GetCaster();
+ Creature* creature = GetHitCreature();
+ caster->CastSpell(caster,SPELL_MAMMOTH_CARCASS,true);
+
+ for (uint8 i = 0; i < 4; ++i)
+ caster->CastSpell(caster,SPELL_MAMMOTH_MEAT,true);
+
+ creature->Kill(creature);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_uded_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_uded_SpellScript();
+ }
+};
+
+enum ChickenCover
+{
+ SPELL_CHICKEN_NET = 51959,
+ SPELL_CAPTURE_CHICKEN_ESCAPE = 51037,
+ QUEST_CHICKEN_PARTY = 12702,
+ QUEST_FLOWN_THE_COOP = 12532,
+};
+
+class spell_item_chicken_cover : public SpellScriptLoader
+{
+ public:
+ spell_item_chicken_cover() : SpellScriptLoader("spell_item_chicken_cover") { }
+
+ class spell_item_chicken_cover_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_chicken_cover_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_CHICKEN_NET) || !sSpellMgr->GetSpellInfo(SPELL_CAPTURE_CHICKEN_ESCAPE) || !sObjectMgr->GetQuestTemplate(QUEST_CHICKEN_PARTY) || !sObjectMgr->GetQuestTemplate(QUEST_FLOWN_THE_COOP))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (Unit* target = GetHitUnit())
+ {
+ if (!target->HasAura(SPELL_CHICKEN_NET) && (caster->GetQuestStatus(QUEST_CHICKEN_PARTY) == QUEST_STATUS_INCOMPLETE || caster->GetQuestStatus(QUEST_FLOWN_THE_COOP) == QUEST_STATUS_INCOMPLETE))
+ {
+ caster->CastSpell(caster, SPELL_CAPTURE_CHICKEN_ESCAPE, true);
+ target->Kill(target);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_chicken_cover_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_chicken_cover_SpellScript();
+ }
+};
+
enum Refocus
{
SPELL_AIMED_SHOT = 19434,
@@ -1206,4 +2022,22 @@ void AddSC_item_spell_scripts()
new spell_item_ashbringer();
new spell_magic_eater_food();
new spell_item_refocus();
+ new spell_item_shimmering_vessel();
+ new spell_item_purify_helboar_meat();
+ new spell_item_crystal_prison_dummy_dnd();
+ new spell_item_reindeer_transformation();
+ new spell_item_nigh_invulnerability();
+ new spell_item_poultryizer();
+ new spell_item_socrethars_stone();
+ new spell_item_demon_broiled_surprise();
+ new spell_item_complete_raptor_capture();
+ new spell_item_impale_leviroth();
+ new spell_item_brewfest_mount_transformation();
+ new spell_item_nitro_boots();
+ new spell_item_teach_language();
+ new spell_item_rocket_boots();
+ new spell_item_pygmy_oil();
+ new spell_item_unusual_compass();
+ new spell_item_uded();
+ new spell_item_chicken_cover();
}
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index b0b619c8b08..181b89ed5f8 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_mage_".
*/
-#include "ScriptPCH.h"
enum MageSpells
{
@@ -45,7 +44,8 @@ class spell_mage_blast_wave : public SpellScriptLoader
class spell_mage_blast_wave_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_mage_blast_wave_SpellScript)
+ PrepareSpellScript(spell_mage_blast_wave_SpellScript);
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_BLAST_WAVE))
@@ -78,16 +78,19 @@ class spell_mage_cold_snap : public SpellScriptLoader
class spell_mage_cold_snap_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_mage_cold_snap_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
+ PrepareSpellScript(spell_mage_cold_snap_SpellScript);
- if (caster->GetTypeId() != TYPEID_PLAYER)
- return;
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+
+ Player* caster = GetCaster()->ToPlayer();
// immediately finishes the cooldown on Frost spells
- const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
+ const SpellCooldowns& cm = caster->GetSpellCooldownMap();
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
@@ -96,7 +99,7 @@ class spell_mage_cold_snap : public SpellScriptLoader
(spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) &&
spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0)
{
- caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
+ caster->RemoveSpellCooldown((itr++)->first, true);
}
else
++itr;
@@ -123,7 +126,8 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript)
+ PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
+
static const uint32 spell_list[6];
bool Validate(SpellInfo const* /*spellEntry*/)
@@ -172,14 +176,11 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript)
+ PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript);
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT))
+ if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT))
return false;
return true;
}
@@ -210,78 +211,79 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader
// Frost Warding
class spell_mage_frost_warding_trigger : public SpellScriptLoader
{
-public:
- spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { }
-
- class spell_mage_frost_warding_trigger_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript);
+ public:
+ spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { }
- enum Spells
+ class spell_mage_frost_warding_trigger_AuraScript : public AuraScript
{
- SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776,
- SPELL_MAGE_FROST_WARDING_R1 = 28332,
- };
+ PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript);
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- return sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED)
- && sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1);
- }
+ enum Spells
+ {
+ SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776,
+ SPELL_MAGE_FROST_WARDING_R1 = 28332,
+ };
- void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- Unit* target = GetTarget();
- if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0))
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
+ if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1))
+ return false;
+ return true;
+ }
- if (roll_chance_i(chance))
+ void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ Unit* target = GetTarget();
+ if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0))
{
- absorbAmount = dmgInfo.GetDamage();
- int32 bp = absorbAmount;
- target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
+ int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
+
+ if (roll_chance_i(chance))
+ {
+ absorbAmount = dmgInfo.GetDamage();
+ int32 bp = absorbAmount;
+ target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
+ }
}
}
- }
- void Register()
+ void Register()
+ {
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
{
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0);
+ return new spell_mage_frost_warding_trigger_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_mage_frost_warding_trigger_AuraScript();
- }
};
class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript
{
-public:
- enum Spells
- {
- SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413,
- SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394,
- };
-
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED)
- && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1);
- }
+ public:
+ enum Spells
+ {
+ SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413,
+ SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394,
+ };
- void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
- {
- Unit* target = GetTarget();
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED)
+ && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1);
+ }
- if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0))
+ void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
{
- int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
- target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
+ Unit* target = GetTarget();
+
+ if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0))
+ {
+ int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
+ target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
+ }
}
- }
};
// Incanter's Absorption
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 39360e04aa1..0ef158fe4bf 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -21,8 +21,9 @@
* Scriptnames of files in this file should be prefixed with "spell_pal_".
*/
-#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
+#include "Unit.h"
+
enum PaladinSpells
{
@@ -46,323 +47,369 @@ enum PaladinSpells
// 31850 - Ardent Defender
class spell_pal_ardent_defender : public SpellScriptLoader
{
-public:
- spell_pal_ardent_defender() : SpellScriptLoader("spell_pal_ardent_defender") { }
+ public:
+ spell_pal_ardent_defender() : SpellScriptLoader("spell_pal_ardent_defender") { }
- class spell_pal_ardent_defender_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_pal_ardent_defender_AuraScript);
+ class spell_pal_ardent_defender_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_ardent_defender_AuraScript);
- uint32 absorbPct, healPct;
+ uint32 absorbPct, healPct;
- enum Spell
- {
- PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235,
- };
+ enum Spell
+ {
+ PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235,
+ };
- bool Load()
- {
- healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
- absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
- return GetUnitOwner()->ToPlayer();
- }
+ bool Load()
+ {
+ healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
+ absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
+ return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
+ }
- void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // Set absorbtion amount to unlimited
+ amount = -1;
+ }
- void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- Unit* victim = GetTarget();
- int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
- uint32 allowedHealth = victim->CountPctFromMaxHealth(35);
- // If damage kills us
- if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL))
+ void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
- // Cast healing spell, completely avoid damage
- absorbAmount = dmgInfo.GetDamage();
-
- uint32 defenseSkillValue = victim->GetDefenseSkillValue();
- // Max heal when defense skill denies critical hits from raid bosses
- // Formula: max defense at level + 140 (raiting from gear)
- uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140;
- float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal)
- ? 1.0f
- : float(defenseSkillValue) / float(reqDefForMaxHeal);
-
- int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
- victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff);
- victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120);
+ Unit* victim = GetTarget();
+ int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
+ uint32 allowedHealth = victim->CountPctFromMaxHealth(35);
+ // If damage kills us
+ if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL))
+ {
+ // Cast healing spell, completely avoid damage
+ absorbAmount = dmgInfo.GetDamage();
+
+ uint32 defenseSkillValue = victim->GetDefenseSkillValue();
+ // Max heal when defense skill denies critical hits from raid bosses
+ // Formula: max defense at level + 140 (raiting from gear)
+ uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140;
+ float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal)
+ ? 1.0f
+ : float(defenseSkillValue) / float(reqDefForMaxHeal);
+
+ int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
+ victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff);
+ victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120);
+ }
+ else if (remainingHealth < int32(allowedHealth))
+ {
+ // Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x%
+ uint32 damageToReduce = (victim->GetHealth() < allowedHealth)
+ ? dmgInfo.GetDamage()
+ : allowedHealth - remainingHealth;
+ absorbAmount = CalculatePctN(damageToReduce, absorbPct);
+ }
}
- else if (remainingHealth < int32(allowedHealth))
+
+ void Register()
{
- // Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x%
- uint32 damageToReduce = (victim->GetHealth() < allowedHealth)
- ? dmgInfo.GetDamage()
- : allowedHealth - remainingHealth;
- absorbAmount = CalculatePctN(damageToReduce, absorbPct);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_ardent_defender_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_pal_ardent_defender_AuraScript::Absorb, EFFECT_0);
}
- }
+ };
- void Register()
+ AuraScript* GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_ardent_defender_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_pal_ardent_defender_AuraScript::Absorb, EFFECT_0);
+ return new spell_pal_ardent_defender_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_pal_ardent_defender_AuraScript();
- }
};
class spell_pal_blessing_of_faith : public SpellScriptLoader
{
-public:
- spell_pal_blessing_of_faith() : SpellScriptLoader("spell_pal_blessing_of_faith") { }
+ public:
+ spell_pal_blessing_of_faith() : SpellScriptLoader("spell_pal_blessing_of_faith") { }
- class spell_pal_blessing_of_faith_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_pal_blessing_of_faith_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Unit* unitTarget = GetHitUnit())
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- uint32 spell_id = 0;
- switch (unitTarget->getClass())
+ if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* unitTarget = GetHitUnit())
{
- case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break;
- case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break;
- case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break;
- case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break;
- default: return; // ignore for non-healing classes
+ uint32 spell_id = 0;
+ switch (unitTarget->getClass())
+ {
+ case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break;
+ case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break;
+ case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break;
+ case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break;
+ default: return; // ignore for non-healing classes
+ }
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, spell_id, true);
}
+ }
- GetCaster()->CastSpell(GetCaster(), spell_id, true);
+ void Register()
+ {
+ // add dummy effect spell handler to Blessing of Faith
+ OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- // add dummy effect spell handler to Blessing of Faith
- OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_pal_blessing_of_faith_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_pal_blessing_of_faith_SpellScript();
- }
};
// 20911 Blessing of Sanctuary
// 25899 Greater Blessing of Sanctuary
class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
{
-public:
- spell_pal_blessing_of_sanctuary() : SpellScriptLoader("spell_pal_blessing_of_sanctuary") { }
+ public:
+ spell_pal_blessing_of_sanctuary() : SpellScriptLoader("spell_pal_blessing_of_sanctuary") { }
- class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript)
- bool Validate(SpellInfo const* /*entry*/)
+ class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript
{
- if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF))
- return false;
- return true;
- }
+ PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript);
- void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- Unit* target = GetTarget();
- if (Unit* pCaster = GetCaster())
- pCaster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true);
- }
+ bool Validate(SpellInfo const* /*entry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF))
+ return false;
+ return true;
+ }
- void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- Unit* target = GetTarget();
- target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID());
- }
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true);
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID());
+ }
- void Register()
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
{
- AfterEffectApply += AuraEffectApplyFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- AfterEffectRemove += AuraEffectRemoveFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ return new spell_pal_blessing_of_sanctuary_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_pal_blessing_of_sanctuary_AuraScript();
- }
};
// 63521 Guarded by The Light
class spell_pal_guarded_by_the_light : public SpellScriptLoader
{
-public:
- spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { }
+ public:
+ spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { }
- class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript);
- void HandleScriptEffect(SpellEffIndex /*effIndex*/)
- {
- // Divine Plea
- if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA))
- aura->RefreshDuration();
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ // Divine Plea
+ if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA))
+ aura->RefreshDuration();
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ return new spell_pal_guarded_by_the_light_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_pal_guarded_by_the_light_SpellScript();
- }
};
class spell_pal_holy_shock : public SpellScriptLoader
{
-public:
- spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { }
+ public:
+ spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { }
- class spell_pal_holy_shock_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_pal_holy_shock_SpellScript)
- bool Validate(SpellInfo const* spellEntry)
+ class spell_pal_holy_shock_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1))
- return false;
+ PrepareSpellScript(spell_pal_holy_shock_SpellScript)
+ bool Validate(SpellInfo const* spellEntry)
+ {
+ if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1))
+ return false;
- // can't use other spell than holy shock due to spell_ranks dependency
- if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
- return false;
+ // can't use other spell than holy shock due to spell_ranks dependency
+ if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
+ return false;
- uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
- if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true))
- return false;
- if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
- return false;
+ uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
+ if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
+ return false;
- return true;
- }
+ return true;
+ }
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Unit* unitTarget = GetHitUnit())
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
+ if (Unit* unitTarget = GetHitUnit())
+ {
+ uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ if (caster->IsFriendlyTo(unitTarget))
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0);
+ else
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
+ }
+ }
- uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
-
- if (caster->IsFriendlyTo(unitTarget))
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0);
- else
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
+ void Register()
+ {
+ // add dummy effect spell handler to Holy Shock
+ OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- // add dummy effect spell handler to Holy Shock
- OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_pal_holy_shock_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_pal_holy_shock_SpellScript();
- }
};
class spell_pal_judgement_of_command : public SpellScriptLoader
{
-public:
- spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
+ public:
+ spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
- class spell_pal_judgement_of_command_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_pal_judgement_of_command_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_pal_judgement_of_command_SpellScript : public SpellScript
{
- if (Unit* unitTarget = GetHitUnit())
- if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
- GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
- }
+ PrepareSpellScript(spell_pal_judgement_of_command_SpellScript)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* unitTarget = GetHitUnit())
+ if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
+ GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
+ }
+
+ void Register()
+ {
+ // add dummy effect spell handler to Judgement of Command
+ OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- // add dummy effect spell handler to Judgement of Command
- OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_pal_judgement_of_command_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_pal_judgement_of_command_SpellScript();
- }
};
class spell_pal_divine_storm : public SpellScriptLoader
{
-public:
- spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { }
+ public:
+ spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { }
+
+ class spell_pal_divine_storm_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_divine_storm_SpellScript);
+
+ uint32 healPct;
+
+ bool Validate(SpellInfo const* /* spell */)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_DUMMY))
+ return false;
+ return true;
+ }
- class spell_pal_divine_storm_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_pal_divine_storm_SpellScript);
+ bool Load()
+ {
+ healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
+ return true;
+ }
- uint32 healPct;
+ void TriggerHeal()
+ {
+ Unit* caster = GetCaster();
+ caster->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true);
+ }
- bool Load()
+ void Register()
+ {
+ AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
- return true;
+ return new spell_pal_divine_storm_SpellScript();
}
+};
- void TriggerHeal()
+class spell_pal_divine_storm_dummy : public SpellScriptLoader
+{
+ public:
+ spell_pal_divine_storm_dummy() : SpellScriptLoader("spell_pal_divine_storm_dummy") { }
+
+ class spell_pal_divine_storm_dummy_SpellScript : public SpellScript
{
- GetCaster()->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, GetCaster(), true);
- }
+ PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript);
- void Register()
+ bool Validate(SpellInfo const* /* spell */)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_HEAL))
+ return false;
+ return true;
+ }
+
+ void CountTargets(std::list<Unit*>& targetList)
+ {
+ _targetCount = targetList.size();
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (!_targetCount || ! GetHitUnit())
+ return;
+
+ int32 heal = GetEffectValue() / _targetCount;
+ GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_DIVINE_STORM_HEAL, &heal, NULL, NULL, true);
+ }
+ private:
+ uint32 _targetCount;
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal);
+ return new spell_pal_divine_storm_dummy_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_pal_divine_storm_SpellScript();
- }
};
void AddSC_paladin_spell_scripts()
@@ -374,4 +421,5 @@ void AddSC_paladin_spell_scripts()
new spell_pal_holy_shock();
new spell_pal_judgement_of_command();
new spell_pal_divine_storm();
+ new spell_pal_divine_storm_dummy();
}
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index ee5f6a6d772..b7793c919b6 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_pri_".
*/
-#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
#include "GridNotifiers.h"
@@ -49,7 +48,9 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- return sSpellMgr->GetSpellInfo(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL) != NULL;
+ if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL))
+ return false;
+ return true;
}
bool Load()
@@ -101,11 +102,8 @@ class spell_pri_mana_burn : public SpellScriptLoader
void HandleAfterHit()
{
- Unit* unitTarget = GetHitUnit();
- if (!unitTarget)
- return;
-
- unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH));
+ if (Unit* unitTarget = GetHitUnit())
+ unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH));
}
void Register()
@@ -204,18 +202,19 @@ class spell_pri_penance : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- Unit* unitTarget = GetHitUnit();
- if (!unitTarget || !unitTarget->isAlive())
- return;
-
Unit* caster = GetCaster();
+ if (Unit* unitTarget = GetHitUnit())
+ {
+ if(!unitTarget->isAlive())
+ return;
- uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
- if (caster->IsFriendlyTo(unitTarget))
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank), false, 0);
- else
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank), false, 0);
+ if (caster->IsFriendlyTo(unitTarget))
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank), false, 0);
+ else
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank), false, 0);
+ }
}
void Register()
@@ -243,7 +242,9 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- return sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) && sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_R1);
+ if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_R1))
+ return false;
+ return true;
}
void Trigger(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
@@ -251,14 +252,13 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader
Unit* target = GetTarget();
if (dmgInfo.GetAttacker() == target)
return;
- Unit* caster = GetCaster();
- if (!caster)
- return;
- if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(PRIEST_SPELL_REFLECTIVE_SHIELD_R1, EFFECT_0))
- {
- int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
- target->CastCustomSpell(dmgInfo.GetAttacker(), PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
- }
+
+ if (Unit* caster = GetCaster())
+ if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(PRIEST_SPELL_REFLECTIVE_SHIELD_R1, EFFECT_0))
+ {
+ int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
+ target->CastCustomSpell(dmgInfo.GetAttacker(), PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
+ }
}
void Register()
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 940e494f18f..9b5e2b2ea09 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -21,48 +21,47 @@
* Scriptnames of files in this file should be prefixed with "spell_q#questID_".
*/
-#include "ScriptPCH.h"
#include "Vehicle.h"
class spell_generic_quest_update_entry_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_generic_quest_update_entry_SpellScript)
-private:
- uint16 _spellEffect;
- uint8 _effIndex;
- uint32 _originalEntry;
- uint32 _newEntry;
- bool _shouldAttack;
- uint32 _despawnTime;
-
-public:
- spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) :
- SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry),
- _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { }
-
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Creature* creatureTarget = GetHitCreature())
- if (!creatureTarget->isPet() && creatureTarget->GetEntry() == _originalEntry)
- {
- creatureTarget->UpdateEntry(_newEntry);
- if (_shouldAttack && creatureTarget->IsAIEnabled)
- creatureTarget->AI()->AttackStart(GetCaster());
+ PrepareSpellScript(spell_generic_quest_update_entry_SpellScript);
+ private:
+ uint16 _spellEffect;
+ uint8 _effIndex;
+ uint32 _originalEntry;
+ uint32 _newEntry;
+ bool _shouldAttack;
+ uint32 _despawnTime;
- if (_despawnTime)
- creatureTarget->DespawnOrUnsummon(_despawnTime);
- }
- }
+ public:
+ spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) :
+ SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry),
+ _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Creature* creatureTarget = GetHitCreature())
+ if (!creatureTarget->isPet() && creatureTarget->GetEntry() == _originalEntry)
+ {
+ creatureTarget->UpdateEntry(_newEntry);
+ if (_shouldAttack && creatureTarget->IsAIEnabled)
+ creatureTarget->AI()->AttackStart(GetCaster());
+
+ if (_despawnTime)
+ creatureTarget->DespawnOrUnsummon(_despawnTime);
+ }
+ }
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_generic_quest_update_entry_SpellScript::HandleDummy, _effIndex, _spellEffect);
- }
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_generic_quest_update_entry_SpellScript::HandleDummy, _effIndex, _spellEffect);
+ }
};
// http://www.wowhead.com/quest=55 Morbent Fel
// 8913 Sacred Cleansing
-enum eQuest55Data
+enum Quest55Data
{
NPC_MORBENT = 1200,
NPC_WEAKENED_MORBENT = 24782,
@@ -70,18 +69,18 @@ enum eQuest55Data
class spell_q55_sacred_cleansing : public SpellScriptLoader
{
-public:
- spell_q55_sacred_cleansing() : SpellScriptLoader("spell_q55_sacred_cleansing") { }
+ public:
+ spell_q55_sacred_cleansing() : SpellScriptLoader("spell_q55_sacred_cleansing") { }
- SpellScript* GetSpellScript() const
- {
- return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_1, NPC_MORBENT, NPC_WEAKENED_MORBENT, true);
- }
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_1, NPC_MORBENT, NPC_WEAKENED_MORBENT, true);
+ }
};
// http://www.wowhead.com/quest=5206 Marauders of Darrowshire
// 17271 Test Fetid Skull
-enum eQuest5206Data
+enum Quest5206Data
{
SPELL_CREATE_RESONATING_SKULL = 17269,
SPELL_CREATE_BONE_DUST = 17270
@@ -89,47 +88,48 @@ enum eQuest5206Data
class spell_q5206_test_fetid_skull : public SpellScriptLoader
{
-public:
- spell_q5206_test_fetid_skull() : SpellScriptLoader("spell_q5206_test_fetid_skull") { }
+ public:
+ spell_q5206_test_fetid_skull() : SpellScriptLoader("spell_q5206_test_fetid_skull") { }
- class spell_q5206_test_fetid_skull_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q5206_test_fetid_skull_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_q5206_test_fetid_skull_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_RESONATING_SKULL))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_BONE_DUST))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_q5206_test_fetid_skull_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() == TYPEID_PLAYER)
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_RESONATING_SKULL) || !sSpellMgr->GetSpellInfo(SPELL_CREATE_BONE_DUST))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
+ Unit* caster = GetCaster();
uint32 spellId = roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST;
- pCaster->CastSpell(pCaster, spellId, true, NULL);
+ caster->CastSpell(caster, spellId, true, NULL);
}
- }
- void Register()
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_q5206_test_fetid_skull_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_q5206_test_fetid_skull_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q5206_test_fetid_skull_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q5206_test_fetid_skull_SpellScript();
- }
};
// http://www.wowhead.com/quest=6124 Curing the Sick (A)
// http://www.wowhead.com/quest=6129 Curing the Sick (H)
// 19512 Apply Salve
-enum eQuests6124_6129Data
+enum Quests6124_6129Data
{
NPC_SICKLY_GAZELLE = 12296,
NPC_CURED_GAZELLE = 12297,
@@ -140,20 +140,26 @@ enum eQuests6124_6129Data
class spell_q6124_6129_apply_salve : public SpellScriptLoader
{
-public:
- spell_q6124_6129_apply_salve() : SpellScriptLoader("spell_q6124_6129_apply_salve") { }
+ public:
+ spell_q6124_6129_apply_salve() : SpellScriptLoader("spell_q6124_6129_apply_salve") { }
- class spell_q6124_6129_apply_salve_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q6124_6129_apply_salve_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_q6124_6129_apply_salve_SpellScript : public SpellScript
{
- if (GetCastItem())
- if (Player* pCaster = GetCaster()->ToPlayer())
+ PrepareSpellScript(spell_q6124_6129_apply_salve_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (GetCastItem())
if (Creature* creatureTarget = GetHitCreature())
{
uint32 uiNewEntry = 0;
- switch (pCaster->GetTeam())
+ switch (caster->GetTeam())
{
case HORDE:
if (creatureTarget->GetEntry() == NPC_SICKLY_GAZELLE)
@@ -170,23 +176,23 @@ public:
creatureTarget->DespawnOrUnsummon(DESPAWN_TIME);
}
}
- }
+ }
- void Register()
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q6124_6129_apply_salve_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_q6124_6129_apply_salve_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q6124_6129_apply_salve_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q6124_6129_apply_salve_SpellScript();
- }
};
// http://www.wowhead.com/quest=10255 Testing the Antidote
// 34665 Administer Antidote
-enum eQuest10255Data
+enum Quest10255Data
{
NPC_HELBOAR = 16880,
NPC_DREADTUSK = 16992,
@@ -194,18 +200,18 @@ enum eQuest10255Data
class spell_q10255_administer_antidote : public SpellScriptLoader
{
-public:
- spell_q10255_administer_antidote() : SpellScriptLoader("spell_q10255_administer_antidote") { }
+ public:
+ spell_q10255_administer_antidote() : SpellScriptLoader("spell_q10255_administer_antidote") { }
- SpellScript* GetSpellScript() const
- {
- return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_HELBOAR, NPC_DREADTUSK, true);
- }
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_HELBOAR, NPC_DREADTUSK, true);
+ }
};
// http://www.wowhead.com/quest=11396 Bring Down Those Shields (A)
// http://www.wowhead.com/quest=11399 Bring Down Those Shields (H)
-enum eQuest11396_11399Data
+enum Quest11396_11399Data
{
SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3 = 43874,
SPELL_SCOURGING_CRYSTAL_CONTROLLER = 43878
@@ -214,115 +220,116 @@ enum eQuest11396_11399Data
// 43874 Scourge Mur'gul Camp: Force Shield Arcane Purple x3
class spell_q11396_11399_force_shield_arcane_purple_x3 : public SpellScriptLoader
{
-public:
- spell_q11396_11399_force_shield_arcane_purple_x3() : SpellScriptLoader("spell_q11396_11399_force_shield_arcane_purple_x3") { }
+ public:
+ spell_q11396_11399_force_shield_arcane_purple_x3() : SpellScriptLoader("spell_q11396_11399_force_shield_arcane_purple_x3") { }
- class spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript)
- void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ class spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript : public AuraScript
{
- Unit* target = GetTarget();
+ PrepareAuraScript(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript);
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
target->AddUnitState(UNIT_STATE_ROOT);
- }
+ }
- void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- }
+ }
- void Register()
- {
- OnEffectApply += AuraEffectApplyFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- OnEffectRemove += AuraEffectRemoveFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- }
+ void Register()
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ OnEffectRemove += AuraEffectRemoveFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
- };
+ };
- AuraScript* GetAuraScript() const
- {
- return new spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript();
- }
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript();
+ }
};
// 50133 Scourging Crystal Controller
class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader
{
-public:
- spell_q11396_11399_scourging_crystal_controller() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller") { }
+ public:
+ spell_q11396_11399_scourging_crystal_controller() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller") { }
- class spell_q11396_11399_scourging_crystal_controller_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_SpellScript);
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_q11396_11399_scourging_crystal_controller_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Unit* target = GetTargetUnit())
- if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
- // Make sure nobody else is channeling the same target
- if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
- GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem());
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3) || !sSpellMgr->GetSpellInfo(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
+ return false;
+ return true;
+ }
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetTargetUnit())
+ if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
+ // Make sure nobody else is channeling the same target
+ if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
+ GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- SpellScript* GetSpellScript() const
- {
- return new spell_q11396_11399_scourging_crystal_controller_SpellScript();
- };
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q11396_11399_scourging_crystal_controller_SpellScript();
+ };
};
// 43882 Scourging Crystal Controller Dummy
class spell_q11396_11399_scourging_crystal_controller_dummy : public SpellScriptLoader
{
-public:
- spell_q11396_11399_scourging_crystal_controller_dummy() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller_dummy") { }
+ public:
+ spell_q11396_11399_scourging_crystal_controller_dummy() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller_dummy") { }
- class spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript);
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Unit* target = GetTargetUnit())
- if (target->GetTypeId() == TYPEID_UNIT)
- target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3);
- }
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
+ return false;
+ return true;
+ }
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ if (target->GetTypeId() == TYPEID_UNIT)
+ target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- SpellScript* GetSpellScript() const
- {
- return new spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript();
- };
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript();
+ };
};
// http://www.wowhead.com/quest=11515 Blood for Blood
// 44936 Quest - Fel Siphon Dummy
-enum eQuest11515Data
+enum Quest11515Data
{
NPC_FELBLOOD_INITIATE = 24918,
NPC_EMACIATED_FELBLOOD = 24955
@@ -330,18 +337,18 @@ enum eQuest11515Data
class spell_q11515_fel_siphon_dummy : public SpellScriptLoader
{
-public:
- spell_q11515_fel_siphon_dummy() : SpellScriptLoader("spell_q11515_fel_siphon_dummy") { }
+ public:
+ spell_q11515_fel_siphon_dummy() : SpellScriptLoader("spell_q11515_fel_siphon_dummy") { }
- SpellScript* GetSpellScript() const
- {
- return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_FELBLOOD_INITIATE, NPC_EMACIATED_FELBLOOD, true);
- }
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_FELBLOOD_INITIATE, NPC_EMACIATED_FELBLOOD, true);
+ }
};
// http://www.wowhead.com/quest=11587 Prison Break
// 45449 Arcane Prisoner Rescue
-enum eQuest11587Data
+enum Quest11587Data
{
SPELL_SUMMON_ARCANE_PRISONER_MALE = 45446, // Summon Arcane Prisoner - Male
SPELL_SUMMON_ARCANE_PRISONER_FEMALE = 45448, // Summon Arcane Prisoner - Female
@@ -350,51 +357,48 @@ enum eQuest11587Data
class spell_q11587_arcane_prisoner_rescue : public SpellScriptLoader
{
-public:
- spell_q11587_arcane_prisoner_rescue() : SpellScriptLoader("spell_q11587_arcane_prisoner_rescue") { }
+ public:
+ spell_q11587_arcane_prisoner_rescue() : SpellScriptLoader("spell_q11587_arcane_prisoner_rescue") { }
- class spell_q11587_arcane_prisoner_rescue_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q11587_arcane_prisoner_rescue_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_q11587_arcane_prisoner_rescue_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_MALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_FEMALE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_ARCANE_PRISONER_KILL_CREDIT))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_q11587_arcane_prisoner_rescue_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- if (Unit* unitTarget = GetHitUnit())
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- uint32 spellId = SPELL_SUMMON_ARCANE_PRISONER_MALE;
- if (rand() % 2)
- spellId = SPELL_SUMMON_ARCANE_PRISONER_FEMALE;
- caster->CastSpell(caster, spellId, true);
- unitTarget->CastSpell(caster, SPELL_ARCANE_PRISONER_KILL_CREDIT, true);
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_MALE) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_ARCANE_PRISONER_KILL_CREDIT))
+ return false;
+ return true;
}
- }
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* unitTarget = GetHitUnit())
+ {
+ uint32 spellId = SPELL_SUMMON_ARCANE_PRISONER_MALE;
+ if (rand() % 2)
+ spellId = SPELL_SUMMON_ARCANE_PRISONER_FEMALE;
+ caster->CastSpell(caster, spellId, true);
+ unitTarget->CastSpell(caster, SPELL_ARCANE_PRISONER_KILL_CREDIT, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q11587_arcane_prisoner_rescue_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_q11587_arcane_prisoner_rescue_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q11587_arcane_prisoner_rescue_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q11587_arcane_prisoner_rescue_SpellScript();
- }
};
// http://www.wowhead.com/quest=11730 Master and Servant
// 46023 The Ultrasonic Screwdriver
-enum eQuest11730Data
+enum Quest11730Data
{
SPELL_SUMMON_SCAVENGEBOT_004A8 = 46063,
SPELL_SUMMON_SENTRYBOT_57K = 46068,
@@ -411,74 +415,63 @@ enum eQuest11730Data
class spell_q11730_ultrasonic_screwdriver : public SpellScriptLoader
{
-public:
- spell_q11730_ultrasonic_screwdriver() : SpellScriptLoader("spell_q11730_ultrasonic_screwdriver") { }
+ public:
+ spell_q11730_ultrasonic_screwdriver() : SpellScriptLoader("spell_q11730_ultrasonic_screwdriver") { }
- class spell_q11730_ultrasonic_screwdriver_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q11730_ultrasonic_screwdriver_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
+ class spell_q11730_ultrasonic_screwdriver_SpellScript : public SpellScript
{
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_004A8))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SENTRYBOT_57K))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_DEFENDOTANK_66D))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_005B6))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_55D_COLLECTATRON))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_ROBOT_KILL_CREDIT))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_q11730_ultrasonic_screwdriver_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Item* castItem = GetCastItem();
- if (!castItem)
- return;
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem();
+ }
- Unit* pCaster = GetCaster();
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return;
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_004A8) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_SENTRYBOT_57K) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_DEFENDOTANK_66D) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_005B6) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_55D_COLLECTATRON) || !sSpellMgr->GetSpellInfo(SPELL_ROBOT_KILL_CREDIT))
+ return false;
+ return true;
+ }
- Creature* target = GetHitCreature();
- if (!target)
- return;
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Item* castItem = GetCastItem();
+ Unit* caster = GetCaster();
+ if (Creature* target = GetHitCreature())
+ {
+ uint32 spellId = 0;
+ switch (target->GetEntry())
+ {
+ case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break;
+ case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break;
+ case NPC_DEFENDOTANK_66D: spellId = SPELL_SUMMON_DEFENDOTANK_66D; break;
+ case NPC_SCAVENGEBOT_005B6: spellId = SPELL_SUMMON_SCAVENGEBOT_005B6; break;
+ case NPC_55D_COLLECTATRON: spellId = SPELL_SUMMON_55D_COLLECTATRON; break;
+ default:
+ return;
+ }
+ caster->CastSpell(caster, spellId, true, castItem);
+ caster->CastSpell(caster, SPELL_ROBOT_KILL_CREDIT, true);
+ target->DespawnOrUnsummon();
+ }
+ }
- uint32 spellId = 0;
- switch (target->GetEntry())
+ void Register()
{
- case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break;
- case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break;
- case NPC_DEFENDOTANK_66D: spellId = SPELL_SUMMON_DEFENDOTANK_66D; break;
- case NPC_SCAVENGEBOT_005B6: spellId = SPELL_SUMMON_SCAVENGEBOT_005B6; break;
- case NPC_55D_COLLECTATRON: spellId = SPELL_SUMMON_55D_COLLECTATRON; break;
- default:
- return;
+ OnEffectHitTarget += SpellEffectFn(spell_q11730_ultrasonic_screwdriver_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- pCaster->CastSpell(pCaster, spellId, true, castItem);
- pCaster->CastSpell(pCaster, SPELL_ROBOT_KILL_CREDIT, true);
- target->DespawnOrUnsummon();
- }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_q11730_ultrasonic_screwdriver_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q11730_ultrasonic_screwdriver_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q11730_ultrasonic_screwdriver_SpellScript();
- }
};
// http://www.wowhead.com/quest=12459 That Which Creates Can Also Destroy
// 49587 Seeds of Nature's Wrath
-enum eQuest12459Data
+enum Quest12459Data
{
NPC_REANIMATED_FROSTWYRM = 26841,
NPC_WEAK_REANIMATED_FROSTWYRM = 27821,
@@ -492,44 +485,44 @@ enum eQuest12459Data
class spell_q12459_seeds_of_natures_wrath : public SpellScriptLoader
{
-public:
- spell_q12459_seeds_of_natures_wrath() : SpellScriptLoader("spell_q12459_seeds_of_natures_wrath") { }
-
- class spell_q12459_seeds_of_natures_wrath_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_q12459_seeds_of_natures_wrath_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ spell_q12459_seeds_of_natures_wrath() : SpellScriptLoader("spell_q12459_seeds_of_natures_wrath") { }
+
+ class spell_q12459_seeds_of_natures_wrath_SpellScript : public SpellScript
{
- if (Creature* creatureTarget = GetHitCreature())
+ PrepareSpellScript(spell_q12459_seeds_of_natures_wrath_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
- uint32 uiNewEntry = 0;
- switch (creatureTarget->GetEntry())
+ if (Creature* creatureTarget = GetHitCreature())
{
- case NPC_REANIMATED_FROSTWYRM: uiNewEntry = NPC_WEAK_REANIMATED_FROSTWYRM; break;
- case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break;
- case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break;
+ uint32 uiNewEntry = 0;
+ switch (creatureTarget->GetEntry())
+ {
+ case NPC_REANIMATED_FROSTWYRM: uiNewEntry = NPC_WEAK_REANIMATED_FROSTWYRM; break;
+ case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break;
+ case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break;
+ }
+ if (uiNewEntry)
+ creatureTarget->UpdateEntry(uiNewEntry);
}
- if (uiNewEntry)
- creatureTarget->UpdateEntry(uiNewEntry);
}
- }
- void Register()
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12459_seeds_of_natures_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_q12459_seeds_of_natures_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q12459_seeds_of_natures_wrath_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q12459_seeds_of_natures_wrath_SpellScript();
- }
};
// http://www.wowhead.com/quest=12634 Some Make Lemonade, Some Make Liquor
// 51840 Despawn Fruit Tosser
-enum eQuest12634Data
+enum Quest12634Data
{
SPELL_BANANAS_FALL_TO_GROUND = 51836,
SPELL_ORANGE_FALLS_TO_GROUND = 51837,
@@ -539,90 +532,84 @@ enum eQuest12634Data
class spell_q12634_despawn_fruit_tosser : public SpellScriptLoader
{
-public:
- spell_q12634_despawn_fruit_tosser() : SpellScriptLoader("spell_q12634_despawn_fruit_tosser") { }
-
- class spell_q12634_despawn_fruit_tosser_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_q12634_despawn_fruit_tosser_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_BANANAS_FALL_TO_GROUND))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_ORANGE_FALLS_TO_GROUND))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_PAPAYA_FALLS_TO_GROUND))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ADVENTUROUS_DWARF))
- return false;
- return true;
- }
+ spell_q12634_despawn_fruit_tosser() : SpellScriptLoader("spell_q12634_despawn_fruit_tosser") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_q12634_despawn_fruit_tosser_SpellScript : public SpellScript
{
- uint32 spellId = SPELL_BANANAS_FALL_TO_GROUND;
- switch (urand(0, 3))
+ PrepareSpellScript(spell_q12634_despawn_fruit_tosser_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
{
- case 1: spellId = SPELL_ORANGE_FALLS_TO_GROUND; break;
- case 2: spellId = SPELL_PAPAYA_FALLS_TO_GROUND; break;
+ if (!sSpellMgr->GetSpellInfo(SPELL_BANANAS_FALL_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_ORANGE_FALLS_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_PAPAYA_FALLS_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_ADVENTUROUS_DWARF))
+ return false;
+ return true;
}
- // sometimes, if you're lucky, you get a dwarf
- if (roll_chance_i(5))
- spellId = SPELL_SUMMON_ADVENTUROUS_DWARF;
- GetCaster()->CastSpell(GetCaster(), spellId, true, NULL);
- }
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ uint32 spellId = SPELL_BANANAS_FALL_TO_GROUND;
+ switch (urand(0, 3))
+ {
+ case 1: spellId = SPELL_ORANGE_FALLS_TO_GROUND; break;
+ case 2: spellId = SPELL_PAPAYA_FALLS_TO_GROUND; break;
+ }
+ // sometimes, if you're lucky, you get a dwarf
+ if (roll_chance_i(5))
+ spellId = SPELL_SUMMON_ADVENTUROUS_DWARF;
+ GetCaster()->CastSpell(GetCaster(), spellId, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_q12634_despawn_fruit_tosser_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_q12634_despawn_fruit_tosser_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q12634_despawn_fruit_tosser_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q12634_despawn_fruit_tosser_SpellScript();
- }
};
// http://www.wowhead.com/quest=12683 Burning to Help
// 52308 Take Sputum Sample
class spell_q12683_take_sputum_sample : public SpellScriptLoader
{
-public:
- spell_q12683_take_sputum_sample() : SpellScriptLoader("spell_q12683_take_sputum_sample") { }
-
- class spell_q12683_take_sputum_sample_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_q12683_take_sputum_sample_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ spell_q12683_take_sputum_sample() : SpellScriptLoader("spell_q12683_take_sputum_sample") { }
+
+ class spell_q12683_take_sputum_sample_SpellScript : public SpellScript
{
- uint32 reqAuraId = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
+ PrepareSpellScript(spell_q12683_take_sputum_sample_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ uint32 reqAuraId = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
+
+ Unit* caster = GetCaster();
+ if (caster->HasAuraEffect(reqAuraId, 0))
+ {
+ uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
+ caster->CastSpell(caster, spellId, true, NULL);
+ }
+ }
- Unit* pCaster = GetCaster();
- if (pCaster->HasAuraEffect(reqAuraId, 0))
+ void Register()
{
- uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
- pCaster->CastSpell(pCaster, spellId, true, NULL);
+ OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q12683_take_sputum_sample_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q12683_take_sputum_sample_SpellScript();
- }
};
// http://www.wowhead.com/quest=12851 Going Bearback
// 54798 FLAMING Arrow Triggered Effect
-enum eQuest12851Data
+enum Quest12851Data
{
NPC_FROSTGIANT = 29351,
NPC_FROSTWORG = 29358,
@@ -634,53 +621,53 @@ enum eQuest12851Data
class spell_q12851_going_bearback : public SpellScriptLoader
{
-public:
- spell_q12851_going_bearback() : SpellScriptLoader("spell_q12851_going_bearback") { }
-
- class spell_q12851_going_bearback_AuraScript : public AuraScript
- {
public:
- PrepareAuraScript(spell_q12851_going_bearback_AuraScript)
- void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ spell_q12851_going_bearback() : SpellScriptLoader("spell_q12851_going_bearback") { }
+
+ class spell_q12851_going_bearback_AuraScript : public AuraScript
{
- if (Unit* caster = GetCaster())
+ PrepareAuraScript(spell_q12851_going_bearback_AuraScript);
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- Unit* target = GetTarget();
- if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
+ if (Unit* caster = GetCaster())
{
- switch (target->GetEntry())
+ Unit* target = GetTarget();
+ if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
{
- case NPC_FROSTWORG:
- target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true);
- target->CastSpell(target, SPELL_IMMOLATION, true);
- target->CastSpell(target, SPELL_ABLAZE, true);
- break;
- case NPC_FROSTGIANT:
- target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true);
- target->CastSpell(target, SPELL_IMMOLATION, true);
- target->CastSpell(target, SPELL_ABLAZE, true);
- break;
+ switch (target->GetEntry())
+ {
+ case NPC_FROSTWORG:
+ target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true);
+ target->CastSpell(target, SPELL_IMMOLATION, true);
+ target->CastSpell(target, SPELL_ABLAZE, true);
+ break;
+ case NPC_FROSTGIANT:
+ target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true);
+ target->CastSpell(target, SPELL_IMMOLATION, true);
+ target->CastSpell(target, SPELL_ABLAZE, true);
+ break;
+ }
}
}
}
- }
- void Register()
- {
- AfterEffectApply += AuraEffectApplyFn(spell_q12851_going_bearback_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- }
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_q12851_going_bearback_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
- };
+ };
- AuraScript* GetAuraScript() const
- {
- return new spell_q12851_going_bearback_AuraScript();
- }
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_q12851_going_bearback_AuraScript();
+ }
};
// http://www.wowhead.com/quest=12937 Relief for the Fallen
// 55804 Healing Finished
-enum eQuest12937Data
+enum Quest12937Data
{
SPELL_TRIGGER_AID_OF_THE_EARTHEN = 55809,
NPC_FALLEN_EARTHEN_DEFENDER = 30035,
@@ -688,50 +675,50 @@ enum eQuest12937Data
class spell_q12937_relief_for_the_fallen : public SpellScriptLoader
{
-public:
- spell_q12937_relief_for_the_fallen() : SpellScriptLoader("spell_q12937_relief_for_the_fallen") { }
-
- class spell_q12937_relief_for_the_fallen_SpellScript : public SpellScript
- {
public:
- PrepareSpellScript(spell_q12937_relief_for_the_fallen_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGER_AID_OF_THE_EARTHEN))
- return false;
- return true;
- }
+ spell_q12937_relief_for_the_fallen() : SpellScriptLoader("spell_q12937_relief_for_the_fallen") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_q12937_relief_for_the_fallen_SpellScript : public SpellScript
{
- Unit* pCaster = GetCaster();
- if (Player* player = pCaster->ToPlayer())
+ PrepareSpellScript(spell_q12937_relief_for_the_fallen_SpellScript);
+
+ bool Load()
{
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGER_AID_OF_THE_EARTHEN))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
if (Creature* target = GetHitCreature())
{
- player->CastSpell(player, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL);
- player->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, 0);
+ caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL);
+ caster->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, 0);
target->DespawnOrUnsummon();
}
}
- }
- void Register()
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12937_relief_for_the_fallen_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_q12937_relief_for_the_fallen_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q12937_relief_for_the_fallen_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q12937_relief_for_the_fallen_SpellScript();
- }
};
-enum eWhoarethey
+enum Whoarethey
{
- SPELL_QUESTGIVER = 48917,
-
SPELL_MALE_DISGUISE = 38080,
SPELL_FEMALE_DISGUISE = 38081,
SPELL_GENERIC_DISGUISE = 32756
@@ -748,7 +735,7 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_QUESTGIVER))
+ if (!sSpellMgr->GetSpellInfo(SPELL_MALE_DISGUISE) || !sSpellMgr->GetSpellInfo(SPELL_FEMALE_DISGUISE) || !sSpellMgr->GetSpellInfo(SPELL_GENERIC_DISGUISE))
return false;
return true;
}
@@ -756,11 +743,11 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- if (!GetHitUnit() || !GetHitUnit()->ToPlayer())
- return;
-
- GetHitUnit()->CastSpell(GetHitUnit(), GetHitUnit()->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true);
- GetHitUnit()->CastSpell(GetHitUnit(), SPELL_GENERIC_DISGUISE, true);
+ if (Player* target = GetHitPlayer())
+ {
+ target->CastSpell(target, target->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true);
+ target->CastSpell(target, SPELL_GENERIC_DISGUISE, true);
+ }
}
void Register()
@@ -783,79 +770,81 @@ enum symboloflife
// 8593 Symbol of life dummy
class spell_symbol_of_life_dummy : public SpellScriptLoader
{
-public:
- spell_symbol_of_life_dummy() : SpellScriptLoader("spell_symbol_of_life_dummy") { }
-
- class spell_symbol_of_life_dummy_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_symbol_of_life_dummy_SpellScript);
+ public:
+ spell_symbol_of_life_dummy() : SpellScriptLoader("spell_symbol_of_life_dummy") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_symbol_of_life_dummy_SpellScript : public SpellScript
{
- if (Creature* target = GetHitCreature())
+ PrepareSpellScript(spell_symbol_of_life_dummy_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
- if (target->HasAura(SPELL_PERMANENT_FEIGN_DEATH))
+ if (Creature* target = GetHitCreature())
{
- target->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
- target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
- target->SetUInt32Value(UNIT_FIELD_FLAGS_2, 0);
- target->SetHealth(target->GetMaxHealth() / 2);
- target->SetPower(POWER_MANA, uint32(target->GetMaxPower(POWER_MANA) * 0.75f));
+ if (target->HasAura(SPELL_PERMANENT_FEIGN_DEATH))
+ {
+ target->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
+ target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
+ target->SetUInt32Value(UNIT_FIELD_FLAGS_2, 0);
+ target->SetHealth(target->GetMaxHealth() / 2);
+ target->SetPower(POWER_MANA, uint32(target->GetMaxPower(POWER_MANA) * 0.75f));
+ }
}
}
- }
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_symbol_of_life_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_symbol_of_life_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- SpellScript* GetSpellScript() const
- {
- return new spell_symbol_of_life_dummy_SpellScript();
- };
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_symbol_of_life_dummy_SpellScript();
+ };
};
// http://www.wowhead.com/quest=12659 Scalps!
// 52090 Ahunae's Knife
-enum eQuest12659Data
+enum Quest12659Data
{
NPC_SCALPS_KC_BUNNY = 28622,
};
class spell_q12659_ahunaes_knife : public SpellScriptLoader
{
-public:
- spell_q12659_ahunaes_knife() : SpellScriptLoader("spell_q12659_ahunaes_knife") { }
-
- class spell_q12659_ahunaes_knife_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q12659_ahunaes_knife_SpellScript);
+ public:
+ spell_q12659_ahunaes_knife() : SpellScriptLoader("spell_q12659_ahunaes_knife") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_q12659_ahunaes_knife_SpellScript : public SpellScript
{
- Player* caster = GetCaster()->ToPlayer();
- if (!caster)
- return;
+ PrepareSpellScript(spell_q12659_ahunaes_knife_SpellScript);
- if (Creature* target = GetTargetUnit()->ToCreature())
+ bool Load()
{
- target->ForcedDespawn();
- caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY, 0);
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- }
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_q12659_ahunaes_knife_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (Creature* target = GetHitCreature())
+ {
+ target->ForcedDespawn();
+ caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY, 0);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12659_ahunaes_knife_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
- SpellScript* GetSpellScript() const
- {
- return new spell_q12659_ahunaes_knife_SpellScript();
- };
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q12659_ahunaes_knife_SpellScript();
+ };
};
enum StoppingTheSpread
@@ -875,16 +864,21 @@ class spell_q9874_liquid_fire : public SpellScriptLoader
{
PrepareSpellScript(spell_q9874_liquid_fire_SpellScript);
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
- Creature* target = GetHitUnit()->ToCreature();
- if (!caster || !target || (target && target->HasAura(SPELL_FLAMES)))
- return;
-
- caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT, 0);
- target->CastSpell(target, SPELL_FLAMES, true);
- target->DespawnOrUnsummon(60000);
+ if (Creature* target = GetHitCreature())
+ if (target && target->HasAura(SPELL_FLAMES))
+ {
+ caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT, 0);
+ target->CastSpell(target, SPELL_FLAMES, true);
+ target->DespawnOrUnsummon(60000);
+ }
}
void Register()
@@ -915,16 +909,20 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader
{
PrepareSpellScript(spell_q12805_lifeblood_dummy_SpellScript);
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
void HandleScript(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
- Creature* target = GetHitUnit()->ToCreature();
- if (!caster || !target)
- return;
-
- caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT, 0);
- target->CastSpell(target, uint32(GetEffectValue()), true);
- target->DespawnOrUnsummon(2000);
+ if (Creature* target = GetHitCreature())
+ {
+ caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT, 0);
+ target->CastSpell(target, uint32(GetEffectValue()), true);
+ target->DespawnOrUnsummon(2000);
+ }
}
void Register()
@@ -945,37 +943,38 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader
59643 Plant Horde Battle Standard
4338 Plant Alliance Battle Standard
*/
-enum eBattleStandard
+enum BattleStandard
{
NPC_KING_OF_THE_MOUNTAINT_KC = 31766,
};
class spell_q13280_13283_plant_battle_standard: public SpellScriptLoader
{
-public:
- spell_q13280_13283_plant_battle_standard() : SpellScriptLoader("spell_q13280_13283_plant_battle_standard") { }
+ public:
+ spell_q13280_13283_plant_battle_standard() : SpellScriptLoader("spell_q13280_13283_plant_battle_standard") { }
- class spell_q13280_13283_plant_battle_standard_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q13280_13283_plant_battle_standard_SpellScript)
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_q13280_13283_plant_battle_standard_SpellScript : public SpellScript
{
- Unit* caster = GetCaster();
- if (caster->IsVehicle())
- if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
- player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC, 0);
- }
+ PrepareSpellScript(spell_q13280_13283_plant_battle_standard_SpellScript);
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (caster->IsVehicle())
+ if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
+ player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC, 0);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_q13280_13283_plant_battle_standard_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHit += SpellEffectFn(spell_q13280_13283_plant_battle_standard_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_q13280_13283_plant_battle_standard_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q13280_13283_plant_battle_standard_SpellScript();
- }
};
enum ChumTheWaterSummons
@@ -988,42 +987,36 @@ enum ChumTheWaterSummons
class spell_q14112_14145_chum_the_water: public SpellScriptLoader
{
-public:
- spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { }
-
- class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q14112_14145_chum_the_water_SpellScript);
-
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR))
- return false;
- if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO))
- return false;
- if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER))
- return false;
- if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK))
- return false;
- return true;
- }
+ public:
+ spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { }
- void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript
{
- Unit* caster = GetCaster();
- caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK));
- }
+ PrepareSpellScript(spell_q14112_14145_chum_the_water_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK))
+ return false;
+ return true;
+ }
- void Register()
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ return new spell_q14112_14145_chum_the_water_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_q14112_14145_chum_the_water_SpellScript();
- }
};
// http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty!
@@ -1041,15 +1034,16 @@ class spell_q9452_cast_net: public SpellScriptLoader
class spell_q9452_cast_net_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_q9452_cast_net_SpellScript)
+ PrepareSpellScript(spell_q9452_cast_net_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
-
- if (!caster)
- return;
-
switch (urand(0, 2))
{
case 0: case 1:
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index c88d7b891d6..0be2bf6b40c 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_rog_".
*/
-#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
enum RogueSpells
@@ -29,120 +28,114 @@ enum RogueSpells
ROGUE_SPELL_SHIV_TRIGGERED = 5940,
ROGUE_SPELL_GLYPH_OF_PREPARATION = 56819,
ROGUE_SPELL_PREY_ON_THE_WEAK = 58670,
+ ROGUE_SPELL_CHEAT_DEATH_COOLDOWN = 31231,
};
// Cheat Death
class spell_rog_cheat_death : public SpellScriptLoader
{
-public:
- spell_rog_cheat_death() : SpellScriptLoader("spell_rog_cheat_death") { }
+ public:
+ spell_rog_cheat_death() : SpellScriptLoader("spell_rog_cheat_death") { }
- class spell_rog_cheat_death_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_rog_cheat_death_AuraScript);
+ class spell_rog_cheat_death_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_rog_cheat_death_AuraScript);
- uint32 absorbChance;
+ uint32 absorbChance;
- enum Spell
- {
- ROG_SPELL_CHEAT_DEATH_COOLDOWN = 31231,
- };
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN))
+ return false;
+ return true;
+ }
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- return sSpellMgr->GetSpellInfo(ROG_SPELL_CHEAT_DEATH_COOLDOWN);
- }
+ bool Load()
+ {
+ absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
+ return GetUnitOwner()->ToPlayer();
+ }
- bool Load()
- {
- absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
- return GetUnitOwner()->ToPlayer();
- }
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // Set absorbtion amount to unlimited
+ amount = -1;
+ }
- void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
+ void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ Player* target = GetTarget()->ToPlayer();
+ if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance))
+ return;
- void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- Unit* target = GetTarget();
- if (dmgInfo.GetDamage() < target->GetHealth())
- return;
- if (target->ToPlayer()->HasSpellCooldown(ROG_SPELL_CHEAT_DEATH_COOLDOWN))
- return;
- if (!roll_chance_i(absorbChance))
- return;
-
- target->CastSpell(target, ROG_SPELL_CHEAT_DEATH_COOLDOWN, true);
- target->ToPlayer()->AddSpellCooldown(ROG_SPELL_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60);
-
- uint32 health10 = target->CountPctFromMaxHealth(10);
-
- // hp > 10% - absorb hp till 10%
- if (target->GetHealth() > health10)
- absorbAmount = dmgInfo.GetDamage() - target->GetHealth() + health10;
- // hp lower than 10% - absorb everything
- else
- absorbAmount = dmgInfo.GetDamage();
- }
+ target->CastSpell(target, ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, true);
+ target->AddSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60);
- void Register()
+ uint32 health10 = target->CountPctFromMaxHealth(10);
+
+ // hp > 10% - absorb hp till 10%
+ if (target->GetHealth() > health10)
+ absorbAmount = dmgInfo.GetDamage() - target->GetHealth() + health10;
+ // hp lower than 10% - absorb everything
+ else
+ absorbAmount = dmgInfo.GetDamage();
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_cheat_death_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_cheat_death_AuraScript::Absorb, EFFECT_0);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_cheat_death_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_cheat_death_AuraScript::Absorb, EFFECT_0);
+ return new spell_rog_cheat_death_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_rog_cheat_death_AuraScript();
- }
};
// 31130 - Nerves of Steel
class spell_rog_nerves_of_steel : public SpellScriptLoader
{
-public:
- spell_rog_nerves_of_steel() : SpellScriptLoader("spell_rog_nerves_of_steel") { }
+ public:
+ spell_rog_nerves_of_steel() : SpellScriptLoader("spell_rog_nerves_of_steel") { }
- class spell_rog_nerves_of_steel_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript);
+ class spell_rog_nerves_of_steel_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript);
- uint32 absorbPct;
+ uint32 absorbPct;
- bool Load()
- {
- absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
- return true;
- }
+ bool Load()
+ {
+ absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
+ return true;
+ }
- void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // Set absorbtion amount to unlimited
+ amount = -1;
+ }
- void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- // reduces all damage taken while stun or fear
- if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
- absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
- }
+ void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ // reduces all damage taken while stun or fear
+ if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
+ absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
+ }
- void Register()
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_nerves_of_steel_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_nerves_of_steel_AuraScript::Absorb, EFFECT_0);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_nerves_of_steel_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_nerves_of_steel_AuraScript::Absorb, EFFECT_0);
+ return new spell_rog_nerves_of_steel_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_rog_nerves_of_steel_AuraScript();
- }
};
class spell_rog_preparation : public SpellScriptLoader
@@ -152,7 +145,13 @@ class spell_rog_preparation : public SpellScriptLoader
class spell_rog_preparation_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_rog_preparation_SpellScript)
+ PrepareSpellScript(spell_rog_preparation_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_GLYPH_OF_PREPARATION))
@@ -162,12 +161,10 @@ class spell_rog_preparation : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- Unit* caster = GetCaster();
- if (caster->GetTypeId() != TYPEID_PLAYER)
- return;
+ Player* caster = GetCaster()->ToPlayer();
//immediately finishes the cooldown on certain Rogue abilities
- const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
+ const SpellCooldowns& cm = caster->GetSpellCooldownMap();
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
@@ -176,14 +173,14 @@ class spell_rog_preparation : public SpellScriptLoader
{
if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) // Vanish, Evasion, Sprint
- caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
+ caster->RemoveSpellCooldown((itr++)->first, true);
else if (caster->HasAura(ROGUE_SPELL_GLYPH_OF_PREPARATION))
{
if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick
(spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry
spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY))
- caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
+ caster->RemoveSpellCooldown((itr++)->first, true);
else
++itr;
}
@@ -216,7 +213,8 @@ public:
class spell_rog_prey_on_the_weak_AuraScript : public AuraScript
{
- PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript)
+ PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript);
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_PREY_ON_THE_WEAK))
@@ -259,7 +257,13 @@ class spell_rog_shiv : public SpellScriptLoader
class spell_rog_shiv_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_rog_shiv_SpellScript)
+ PrepareSpellScript(spell_rog_shiv_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_SHIV_TRIGGERED))
@@ -270,9 +274,6 @@ class spell_rog_shiv : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
- if (caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
if (Unit* unitTarget = GetHitUnit())
caster->CastSpell(unitTarget, ROGUE_SPELL_SHIV_TRIGGERED, true);
}
@@ -297,8 +298,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
class spell_rog_deadly_poison_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_rog_deadly_poison_SpellScript)
-
+ PrepareSpellScript(spell_rog_deadly_poison_SpellScript);
bool Load()
{
@@ -309,13 +309,10 @@ class spell_rog_deadly_poison : public SpellScriptLoader
void HandleBeforeHit()
{
- Unit* target = GetHitUnit();
- if (!target)
- return;
-
- // Deadly Poison
- if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID()))
- _stackAmount = aurEff->GetBase()->GetStackAmount();
+ if (Unit* target = GetHitUnit())
+ // Deadly Poison
+ if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID()))
+ _stackAmount = aurEff->GetBase()->GetStackAmount();
}
void HandleAfterHit()
@@ -324,49 +321,50 @@ class spell_rog_deadly_poison : public SpellScriptLoader
return;
Player* player = GetCaster()->ToPlayer();
- Unit* target = GetHitUnit();
- if (!target)
- return;
-
- Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
+
+ if (Unit* target = GetHitUnit())
+ {
- if (item == GetCastItem())
- item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+ Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
- if (!item)
- return;
+ if (item == GetCastItem())
+ item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
- // item combat enchantments
- for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot)
- {
- SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot)));
- if (!enchant)
- continue;
+ if (!item)
+ return;
- for (uint8 s = 0; s < 3; ++s)
+ // item combat enchantments
+ for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot)
{
- if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot)));
+ if (!enchant)
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]);
- if (!spellInfo)
+ for (uint8 s = 0; s < 3; ++s)
{
- sLog->outError("Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName(), player->GetGUIDLow(), enchant->spellid[s]);
- continue;
+ if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ continue;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]);
+ if (!spellInfo)
+ {
+ sLog->outError("Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName(), player->GetGUIDLow(), enchant->spellid[s]);
+ continue;
+ }
+
+ // Proc only rogue poisons
+ if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON)
+ continue;
+
+ // Do not reproc deadly
+ if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0))
+ continue;
+
+ if (spellInfo->IsPositive())
+ player->CastSpell(player, enchant->spellid[s], true, item);
+ else
+ player->CastSpell(target, enchant->spellid[s], true, item);
}
-
- // Proc only rogue poisons
- if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON)
- continue;
-
- // Do not reproc deadly
- if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0))
- continue;
-
- if (spellInfo->IsPositive())
- player->CastSpell(player, enchant->spellid[s], true, item);
- else
- player->CastSpell(target, enchant->spellid[s], true, item);
}
}
}
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index b0116d6d33d..be5d04c1597 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_sha_".
*/
-#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
enum ShamanSpells
@@ -94,9 +93,7 @@ class spell_sha_fire_nova : public SpellScriptLoader
bool Validate(SpellInfo const* spellEntry)
{
- if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1))
- return false;
- if (sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
return false;
uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
@@ -119,13 +116,15 @@ class spell_sha_fire_nova : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- Unit* caster = GetCaster();
- uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
- if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank))
+ if (Unit* caster = GetCaster())
{
- Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
- if (totem && totem->isTotem())
- caster->CastSpell(totem, spellId, true);
+ uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank))
+ {
+ Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
+ if (totem && totem->isTotem())
+ caster->CastSpell(totem, spellId, true);
+ }
}
}
@@ -154,30 +153,28 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE))
- return false;
- if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM))
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE) || !sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- Unit* caster = GetCaster();
- if (Unit* unitTarget = GetHitUnit())
- {
- if (unitTarget->getPowerType() == POWER_MANA)
+ if (Unit* caster = GetCaster())
+ if (Unit* unitTarget = GetHitUnit())
{
- int32 effValue = GetEffectValue();
- // Glyph of Mana Tide
- if (Unit* owner = caster->GetOwner())
- if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0))
- effValue += dummy->GetAmount();
- // Regenerate 6% of Total Mana Every 3 secs
- int32 effBasePoints0 = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), effValue));
- caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
+ if (unitTarget->getPowerType() == POWER_MANA)
+ {
+ int32 effValue = GetEffectValue();
+ // Glyph of Mana Tide
+ if (Unit* owner = caster->GetOwner())
+ if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0))
+ effValue += dummy->GetAmount();
+ // Regenerate 6% of Total Mana Every 3 secs
+ int32 effBasePoints0 = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), effValue));
+ caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
+ }
}
- }
}
void Register()
@@ -204,22 +201,20 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM))
- return false;
- if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER))
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER))
return false;
return true;
}
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
- Unit* target = GetTarget();
- if (Unit* caster = aurEff->GetBase()->GetCaster())
- if (TempSummon* summon = caster->ToTempSummon())
- if (Unit* owner = summon->GetOwner())
- if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
- if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE))
- caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
+ if (Unit* target = GetTarget())
+ if (Unit* caster = aurEff->GetBase()->GetCaster())
+ if (TempSummon* summon = caster->ToTempSummon())
+ if (Unit* owner = summon->GetOwner())
+ if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
+ if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE))
+ caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
}
void Register()
@@ -257,7 +252,8 @@ class spell_sha_bloodlust : public SpellScriptLoader
void ApplyDebuff()
{
- GetHitUnit()->CastSpell(GetHitUnit(), SHAMAN_SPELL_SATED, true);
+ if (Unit* target = GetHitUnit())
+ target->CastSpell(target, SHAMAN_SPELL_SATED, true);
}
void Register()
@@ -298,7 +294,8 @@ class spell_sha_heroism : public SpellScriptLoader
void ApplyDebuff()
{
- GetHitUnit()->CastSpell(GetHitUnit(), SHAMAN_SPELL_EXHAUSTION, true);
+ if (Unit* target = GetHitUnit())
+ target->CastSpell(target, SHAMAN_SPELL_EXHAUSTION, true);
}
void Register()
@@ -316,6 +313,232 @@ class spell_sha_heroism : public SpellScriptLoader
}
};
+enum AncestralAwakeningProc
+{
+ SPELL_ANCESTRAL_AWAKENING_PROC = 52752,
+};
+
+class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
+{
+ public:
+ spell_sha_ancestral_awakening_proc() : SpellScriptLoader("spell_sha_ancestral_awakening_proc") { }
+
+ class spell_sha_ancestral_awakening_proc_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sha_ancestral_awakening_proc_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ANCESTRAL_AWAKENING_PROC))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 damage = GetEffectValue();
+ if (GetCaster() && GetHitUnit())
+ GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_sha_ancestral_awakening_proc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_sha_ancestral_awakening_proc_SpellScript();
+ }
+};
+
+enum CleansingTotemPulse
+{
+ SPELL_CLEANSING_TOTEM_EFFECT = 52025,
+};
+
+class spell_sha_cleansing_totem_pulse : public SpellScriptLoader
+{
+ public:
+ spell_sha_cleansing_totem_pulse() : SpellScriptLoader("spell_sha_cleansing_totem_pulse") { }
+
+ class spell_sha_cleansing_totem_pulse_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sha_cleansing_totem_pulse_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_CLEANSING_TOTEM_EFFECT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 bp = 1;
+ if (GetCaster() && GetHitUnit() && GetOriginalCaster())
+ GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_CLEANSING_TOTEM_EFFECT, NULL, &bp, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_sha_cleansing_totem_pulse_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_sha_cleansing_totem_pulse_SpellScript();
+ }
+};
+
+enum HealingStreamTotem
+{
+ SPELL_GLYPH_OF_HEALING_STREAM_TOTEM = 55456,
+ ICON_ID_RESTORATIVE_TOTEMS = 338,
+ SPELL_HEALING_STREAM_TOTEM_HEAL = 52042,
+};
+
+class spell_sha_healing_stream_totem : public SpellScriptLoader
+{
+ public:
+ spell_sha_healing_stream_totem() : SpellScriptLoader("spell_sha_healing_stream_totem") { }
+
+ class spell_sha_healing_stream_totem_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sha_healing_stream_totem_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 damage = GetEffectValue();
+ SpellInfo const* triggeringSpell = GetTriggeringSpell();
+ if (Unit* target = GetHitUnit())
+ if (Unit* caster = GetCaster())
+ {
+ if (Unit* owner = caster->GetOwner())
+ {
+ if (triggeringSpell)
+ damage = int32(owner->SpellHealingBonus(target, triggeringSpell, damage, HEAL));
+
+ // Restorative Totems
+ if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1))
+ AddPctN(damage, dummy->GetAmount());
+
+ // Glyph of Healing Stream Totem
+ if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
+ AddPctN(damage, aurEff->GetAmount());
+ }
+ caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_sha_healing_stream_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_sha_healing_stream_totem_SpellScript();
+ }
+};
+
+enum ManaSpringTotem
+{
+ SPELL_MANA_SPRING_TOTEM_ENERGIZE = 52032,
+};
+
+class spell_sha_mana_spring_totem : public SpellScriptLoader
+{
+ public:
+ spell_sha_mana_spring_totem() : SpellScriptLoader("spell_sha_mana_spring_totem") { }
+
+ class spell_sha_mana_spring_totem_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sha_mana_spring_totem_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MANA_SPRING_TOTEM_ENERGIZE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 damage = GetEffectValue();
+ if (Unit* target = GetHitUnit())
+ if (Unit* caster = GetCaster())
+ if (target->getPowerType() == POWER_MANA)
+ caster->CastCustomSpell(target, SPELL_MANA_SPRING_TOTEM_ENERGIZE, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_sha_mana_spring_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_sha_mana_spring_totem_SpellScript();
+ }
+};
+
+class spell_sha_lava_lash : public SpellScriptLoader
+{
+ public:
+ spell_sha_lava_lash() : SpellScriptLoader("spell_sha_lava_lash") { }
+
+ class spell_sha_lava_lash_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sha_lava_lash_SpellScript)
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ if (Player* caster = GetCaster()->ToPlayer())
+ {
+ int32 damage = GetEffectValue();
+ int32 hitDamage = GetHitDamage();
+ if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ {
+ // Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
+ if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
+ AddPctN(hitDamage, damage);
+ SetHitDamage(hitDamage);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
+ }
+
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_sha_lava_lash_SpellScript();
+ }
+};
+
+
void AddSC_shaman_spell_scripts()
{
new spell_sha_astral_shift();
@@ -324,4 +547,9 @@ void AddSC_shaman_spell_scripts()
new spell_sha_earthbind_totem();
new spell_sha_bloodlust();
new spell_sha_heroism();
+ new spell_sha_ancestral_awakening_proc();
+ new spell_sha_cleansing_totem_pulse();
+ new spell_sha_healing_stream_totem();
+ new spell_sha_mana_spring_totem();
+ new spell_sha_lava_lash();
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 51b2de5d0f3..bf1c205f1af 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_warl_".
*/
-#include "ScriptPCH.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
@@ -99,15 +98,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS))
- return false;
- if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER))
- return false;
- if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD))
- return false;
- if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER))
- return false;
- if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP))
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP))
return false;
return true;
}
@@ -172,9 +163,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1))
- return false;
- if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2))
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2))
return false;
return true;
}
@@ -267,7 +256,8 @@ public:
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- GetCaster()->CastSpell(GetCaster(), GetEffectValue(), true);
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, GetEffectValue(), true);
}
void Register()
@@ -293,7 +283,8 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader
void FilterTargets(std::list<Unit*>& unitList)
{
- unitList.remove(GetTargetUnit());
+ if (GetTargetUnit())
+ unitList.remove(GetTargetUnit());
}
void Register()
@@ -308,6 +299,147 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader
}
};
+enum Soulshatter
+{
+ SPELL_SOULSHATTER = 32835,
+};
+
+class spell_warl_soulshatter : public SpellScriptLoader
+{
+ public:
+ spell_warl_soulshatter() : SpellScriptLoader("spell_warl_soulshatter") { }
+
+ class spell_warl_soulshatter_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warl_soulshatter_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SOULSHATTER))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f)
+ {
+ sLog->outString("THREATREDUCTION");
+ caster->CastSpell(target, SPELL_SOULSHATTER, true);
+ } else
+ sLog->outString("can have threat? %b . threat number? %f ",target->CanHaveThreatList(),target->getThreatManager().getThreat(caster));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warl_soulshatter_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warl_soulshatter_SpellScript();
+ }
+};
+
+enum LifeTap
+{
+ SPELL_LIFE_TAP_RANK_6 = 11689,
+ SPELL_LIFE_TAP_RANK_7 = 27222,
+ SPELL_LIFE_TAP_RANK_8 = 57946,
+ SPELL_LIFE_TAP_ENERGIZE = 31818,
+ SPELL_LIFE_TAP_ENERGIZE_2 = 32553,
+ ICON_ID_IMPROVED_LIFE_TAP = 208,
+ ICON_ID_MANA_FEED = 1982,
+};
+
+class spell_warl_life_tap : public SpellScriptLoader
+{
+ public:
+ spell_warl_life_tap() : SpellScriptLoader("spell_warl_life_tap") { }
+
+ class spell_warl_life_tap_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warl_life_tap_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_6) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_7)
+ || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_8) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE)
+ || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (Unit* target = GetHitUnit())
+ {
+ SpellInfo const* spellInfo = GetSpellInfo();
+ float spFactor = 0.0f;
+ int32 damage = int32(GetEffectValue() + (6.3875 * spellInfo->BaseLevel));
+ switch (spellInfo->Id)
+ {
+ case SPELL_LIFE_TAP_RANK_6: spFactor = 0.2f; break;
+ case SPELL_LIFE_TAP_RANK_7:
+ case SPELL_LIFE_TAP_RANK_8: spFactor = 0.5f; break;
+ default: break;
+ }
+
+ int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * spFactor));
+
+ // Shouldn't Appear in Combat Log
+ target->ModifyHealth(-damage);
+
+ // Improved Life Tap mod
+ if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, ICON_ID_IMPROVED_LIFE_TAP, 0))
+ AddPctN(mana, aurEff->GetAmount());
+
+ caster->CastCustomSpell(target, SPELL_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
+
+ // Mana Feed
+ int32 manaFeedVal = 0;
+ if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, ICON_ID_MANA_FEED, 0))
+ manaFeedVal = aurEff->GetAmount();
+
+ if (manaFeedVal > 0)
+ {
+ ApplyPctN(manaFeedVal, mana);
+ caster->CastCustomSpell(caster, SPELL_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
+ }
+ }
+ }
+
+ SpellCastResult CheckCast()
+ {
+ if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel))))
+ {
+ return SPELL_CAST_OK;
+ }
+ return SPELL_FAILED_FIZZLE;
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warl_life_tap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnCheckCast += SpellCheckCastFn(spell_warl_life_tap_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warl_life_tap_SpellScript();
+ }
+};
+
void AddSC_warlock_spell_scripts()
{
new spell_warl_banish();
@@ -316,4 +448,6 @@ void AddSC_warlock_spell_scripts()
new spell_warl_everlasting_affliction();
new spell_warl_ritual_of_doom_effect();
new spell_warl_seed_of_corruption();
+ new spell_warl_soulshatter();
+ new spell_warl_life_tap();
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index f39ad3d1426..cf4c7bfdec8 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -21,7 +21,6 @@
* Scriptnames of files in this file should be prefixed with "spell_warr_".
*/
-#include "ScriptPCH.h"
enum WarriorSpells
{
@@ -46,8 +45,11 @@ class spell_warr_last_stand : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- int32 healthModSpellBasePoints0 = int32(GetCaster()->CountPctFromMaxHealth(30));
- GetCaster()->CastCustomSpell(GetCaster(), WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
+ if (Unit* caster = GetCaster())
+ {
+ int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30));
+ caster->CastCustomSpell(caster, WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
+ }
}
void Register()
@@ -74,7 +76,8 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader
void FilterTargets(std::list<Unit*>& unitList)
{
- unitList.remove(GetCaster());
+ if (GetCaster())
+ unitList.remove(GetCaster());
}
void Register()
@@ -115,23 +118,19 @@ public:
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- Unit* target = GetTarget();
- target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true);
+ if (Unit* target = GetTarget())
+ target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- Unit* target = GetTarget();
-
- if (!target->HasAura(SPELL_DAMAGE_REDUCTION_AURA))
- return;
-
- if (target->HasAura(SPELL_BLESSING_OF_SANCTUARY) ||
- target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) ||
- target->HasAura(SPELL_RENEWED_HOPE))
- return;
-
- target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA);
+ if (Unit* target = GetTarget())
+ {
+ if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) ||
+ target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) ||
+ target->HasAura(SPELL_RENEWED_HOPE)))
+ target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA);
+ }
}
void Register()
@@ -148,9 +147,278 @@ public:
}
};
+enum DeepWounds
+{
+ SPELL_DEEP_WOUNDS_RANK_1 = 12162,
+ SPELL_DEEP_WOUNDS_RANK_2 = 12850,
+ SPELL_DEEP_WOUNDS_RANK_3 = 12868,
+ SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721,
+};
+
+class spell_warr_deep_wounds : public SpellScriptLoader
+{
+ public:
+ spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { }
+
+ class spell_warr_deep_wounds_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_deep_wounds_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_3))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 damage = GetEffectValue();
+ if (Unit* target = GetHitUnit())
+ if (Unit* caster = GetCaster())
+ {
+ // apply percent damage mods
+ damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
+
+ ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
+ uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
+
+ // Add remaining ticks to damage done
+ if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
+ damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
+
+ damage = damage / ticks;
+ caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_deep_wounds_SpellScript();
+ }
+};
+
+enum Charge
+{
+ SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
+ SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
+ SPELL_CHARGE = 34846,
+};
+
+class spell_warr_charge : public SpellScriptLoader
+{
+ public:
+ spell_warr_charge() : SpellScriptLoader("spell_warr_charge") { }
+
+ class spell_warr_charge_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_charge_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_CHARGE))
+ return false;
+ return true;
+ }
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 chargeBasePoints0 = GetEffectValue();
+ Unit* caster = GetCaster();
+ caster->CastCustomSpell(caster, SPELL_CHARGE, &chargeBasePoints0, NULL, NULL, true);
+
+ //Juggernaut crit bonus
+ if (caster->HasAura(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT))
+ caster->CastSpell(caster, SPELL_JUGGERNAUT_CRIT_BONUS_BUFF, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_charge_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_charge_SpellScript();
+ }
+};
+
+enum Slam
+{
+ SPELL_SLAM = 50783,
+};
+
+class spell_warr_slam : public SpellScriptLoader
+{
+ public:
+ spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { }
+
+ class spell_warr_slam_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_slam_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SLAM))
+ return false;
+ return true;
+ }
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 bp0 = GetEffectValue();
+ if (GetHitUnit())
+ GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_slam_SpellScript();
+ }
+};
+
+enum Execute
+{
+ SPELL_EXECUTE = 20647,
+ SPELL_GLYPH_OF_EXECUTION = 58367,
+ ICON_ID_SUDDEN_DEATH = 1989,
+};
+
+class spell_warr_execute : public SpellScriptLoader
+{
+ public:
+ spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { }
+
+ class spell_warr_execute_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_execute_SpellScript);
+
+ bool Validate(SpellInfo const* /*SpellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_EXECUTION))
+ return false;
+ return true;
+ }
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
+ {
+ SpellInfo const* spellInfo = GetSpellInfo();
+ int32 rageUsed = std::min<int32>(300 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
+ int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);
+
+ // Sudden Death rage save
+ if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0))
+ {
+ int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10;
+ newRage = std::max(newRage, ragesave);
+ }
+
+ caster->SetPower(POWER_RAGE, uint32(newRage));
+ // Glyph of Execution bonus
+ if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_GLYPH_OF_EXECUTION, EFFECT_0))
+ rageUsed += aurEff->GetAmount() * 10;
+
+
+ int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f);
+ caster->CastCustomSpell(target,SPELL_EXECUTE,&bp,0,0,true,0,0,GetOriginalCaster()->GetGUID());
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_execute_SpellScript();
+ }
+};
+
+class spell_warr_concussion_blow : public SpellScriptLoader
+{
+ public:
+ spell_warr_concussion_blow() : SpellScriptLoader("spell_warr_concussion_blow") { }
+
+ class spell_warr_concussion_blow_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_concussion_blow_SpellScript);
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ SetHitDamage(GetHitDamage() + CalculatePctF(GetHitDamage(),GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_concussion_blow_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_concussion_blow_SpellScript();
+ }
+};
+
+enum Bloodthirst
+{
+ SPELL_BLOODTHIRST = 23885,
+};
+
+class spell_warr_bloodthirst : public SpellScriptLoader
+{
+ public:
+ spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { }
+
+ class spell_warr_bloodthirst_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
+
+ void HandleDummy(SpellEffIndex /* effIndex */)
+ {
+ int32 damage = GetEffectValue();
+ if (GetHitUnit())
+ GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_bloodthirst_SpellScript();
+ }
+};
+
void AddSC_warrior_spell_scripts()
{
new spell_warr_last_stand();
new spell_warr_improved_spell_reflection();
new spell_warr_vigilance();
+ new spell_warr_deep_wounds();
+ new spell_warr_charge();
+ new spell_warr_slam();
+ new spell_warr_execute();
+ new spell_warr_concussion_blow();
+ new spell_warr_bloodthirst();
}
diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h
index 46e14d81a5e..c05c4e62c96 100755
--- a/src/server/shared/Database/MySQLConnection.h
+++ b/src/server/shared/Database/MySQLConnection.h
@@ -62,13 +62,6 @@ struct MySQLConnectionInfo
std::string port_or_socket;
};
-struct PreparedStatementTable
-{
- uint32 index;
- const char* query;
- ConnectionFlags type;
-};
-
typedef std::map<uint32 /*index*/, std::pair<const char* /*query*/, ConnectionFlags /*sync/async*/> > PreparedStatementMap;
#define PREPARE_STATEMENT(a, b, c) m_queries[a] = std::make_pair(strdup(b), c);
diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp
index 8b7d8c19071..26b28b25fbb 100755
--- a/src/server/worldserver/TCSoap/TCSoap.cpp
+++ b/src/server/worldserver/TCSoap/TCSoap.cpp
@@ -30,7 +30,7 @@ void TCSoapRunnable::run()
soap.accept_timeout = 3;
soap.recv_timeout = 5;
soap.send_timeout = 5;
- if (soap_bind(&soap, m_host.c_str(), m_port, 100) < 0)
+ if (!soap_valid_socket(soap_bind(&soap, m_host.c_str(), m_port, 100)))
{
sLog->outError("TCSoap: couldn't bind to %s:%d", m_host.c_str(), m_port);
exit(-1);