Merge remote-tracking branch 'origin/master' into 4.3.4

This commit is contained in:
DDuarte committed 2014-09-13 13:55:17 +01:00
commit b9b2a87d42
59 files changed
+1305 -500

No files matched your search

-22
View File
@@ -626,28 +626,6 @@ CREATE TABLE `creature_text` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `db_script_string`
--
DROP TABLE IF EXISTS `db_script_string`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `db_script_string` (
`entry` int(10) unsigned NOT NULL DEFAULT '0',
`content_default` text NOT NULL,
`content_loc1` text,
`content_loc2` text,
`content_loc3` text,
`content_loc4` text,
`content_loc5` text,
`content_loc6` text,
`content_loc7` text,
`content_loc8` text,
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `disables`
--
@@ -0,0 +1,98 @@
DELETE FROM `gossip_menu_option` WHERE menu_id IN(8510,8524);
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES
(8510, 0, 0, 'Yes Scryer, You may possess me', 20008, 1, 1, 0, 0, 0, 0, NULL, 0);
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` IN (22258,22259,22273,22267,22366);
UPDATE `spell_dbc` SET `Effect1`=28,`EffectMiscValueB1`=64 WHERE `Id`IN(38674,38675,38676,38677,38678,38679,38709,38681);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (22258,22259,22273,22267,22366,2225800);
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
(22258, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, 2225800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - On Spawn - Run Script'),
(22258, 0, 1, 2 ,62,0, 100, 0, 8510,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Demoniac Scryer - On Gossip Select - Close Gossip'),
(22258, 0, 2, 0, 61,0, 100, 0,0,0,0,0,85,38708,1,0,0,0,0,7,0,0,0,0,0,0,0,'Demoniac Scryer - On Gossip Select - Cast Demoniac Visitation'),
(22258, 0, 3, 7, 11,0, 100, 0,0,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Demoniac Scryer - On Spawn - Set NPC Flags'),
(22258, 0, 4, 5, 7,0, 100, 0,0,0,0,0,11,38672,0,0,0,0,0,1,0,0,0,0,0,0,0,'Demoniac Scryer - On Evade - Cast Magic Sucker Device timer'),
(22258, 0, 5, 0, 61,0, 100, 0,0,0,0,0,11,38690,0,0,0,0,0,1,0,0,0,0,0,0,0,'Demoniac Scryer - On Evade - Cast Magic Sucker Device Bunny Appearance'),
(22258, 0, 6 ,0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 38691, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - On Death - Cast Magic Sucker Device Despawner, Mob AE'),
(22258, 0, 7 ,8, 61, 0, 100, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - On Spawn - Disable Auto Attack'),
(22258, 0, 8 ,9, 61, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - On Death - Disable Combatmovement'),
(22258, 0, 9 ,0, 61, 0, 100, 0, 0, 0, 0, 0, 18, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - On Death - Disable Combatmovement'),
(22258, 0, 10 ,0, 64, 0, 100, 0, 0, 0, 0, 0, 98, 8510, 10643, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - On Death - Disable Combatmovement'),
(22366, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Visitation - On Just Summoned - Say'),
(22259, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 38683, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hellfire Wardling - On Just Summoned - Cast Magic Sucker Device Despawner, Mob'),
(22259, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hellfire Wardling - On Just Summoned - Say'),
(22259, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 7741, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hellfire Wardling - On Just Summoned - Cast Summoned Demon'),
(22259, 0, 3, 4, 6, 0, 100, 0, 0, 0, 0, 0, 11, 38891, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hellfire Wardling - On Death - Cast Magic Sucker Device (Despawn Visual)'),
(22259, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hellfire Wardling - On Death - Despawn'),
(22259, 0, 5, 0, 8, 0, 100, 0, 38691, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hellfire Wardling - On Spellhit (Magic Sucker Device Despawner, Mob AE) - Despawn'),
(22273, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 38683, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Warden - On Just Summoned - Cast Magic Sucker Device Despawner, Mob'),
(22273, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Warden - On Just Summoned - Say'),
(22273, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 7741, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Warden - On Just Summoned - Cast Summoned Demon'),
(22273, 0, 3, 0, 8, 0, 100, 0, 38691, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Warden - On Spellhit (Magic Sucker Device Despawner, Mob AE) - Despawn'),
(22267, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 38719, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Magic Sucker Device Buttress - On Just Summoned - Cast Magic Sucker Device Buttress Appearance'),
(22267, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 22258, 0, 0, 0, 0, 0, 0, 'Magic Sucker Device Buttress - On Just Summoned - Set Orientation'),
(22267, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 11, 30259, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Magic Sucker Device Buttress - On Just Summoned - Cast Statue (dnd)'),
(22267, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 38721, 0, 0, 0, 0, 0, 19, 22258, 0, 0, 0, 0, 0, 0, 'Magic Sucker Device Buttress - On Just Summoned - Cast Magic Sucker Device Channel(dnd)'),
(22267, 0, 4, 0, 8, 0, 100, 0, 38691, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Magic Sucker Device Buttress - On Spellhit (Magic Sucker Device Despawner, Mob AE) - Despawn'),
(22267, 0, 5, 3, 1, 0, 100, 0, 0, 0, 3000, 3000, 11, 38719, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Magic Sucker Device Buttress - IC - Cast Magic Sucker Device Buttress Appearance'),
(22267, 0, 6, 3, 0, 0, 100, 0, 0, 0, 3000, 3000, 11, 38919, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Magic Sucker Device Buttress - OOC - Cast Magic Sucker Device Buttress Appearance'),
(2225800, 9, 0 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38672, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Magic Sucker Device timer'), -- 15:36:21
(2225800, 9, 1 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38690, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Magic Sucker Device Bunny Appearance'), -- 15:36:21
(2225800, 9, 2 ,0, 0, 0, 100, 0, 8000, 8000, 0, 0, 11, 38681, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Spawner, Device'), -- 15:36:29
(2225800, 9, 3 ,0, 0, 0, 100, 0, 7000, 7000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:36:36 *
(2225800, 9, 4 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:36:51 *
(2225800, 9, 5 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:37:06 *
(2225800, 9, 6 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38675, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Create Magic Sucker Device Buttress (N)'), -- 15:37:06 *
(2225800, 9, 7 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:37:21 *
(2225800, 9, 8 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:37:36 *
(2225800, 9, 9 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:37:51 *
(2225800, 9, 10 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38676, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Create Magic Sucker Device Buttress (S)'), -- 15:37:51 *
(2225800, 9, 11 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:38:06 *
(2225800, 9, 12 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:38:21 *
(2225800, 9, 13 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:38:36 *
(2225800, 9, 14 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38709, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Boss'), -- 15:38:36 *
(2225800, 9, 15 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:38:51 *
(2225800, 9, 16 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38677, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Create Magic Sucker Device Buttress (E)'), -- 15:38:51 *
(2225800, 9, 17 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:39:06 *
(2225800, 9, 18 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:39:21 *
(2225800, 9, 19 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38678, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Create Magic Sucker Device Buttress (W)'), -- 15:39:21 *
(2225800, 9, 20 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:39:36 *
(2225800, 9, 21 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38679, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Spawn Magic Sucker Device Mob'), -- 15:39:51 *
(2225800, 9, 22 ,0, 0, 0, 100, 0, 15000, 15000, 0, 0, 11, 38691, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Magic Sucker Device Despawner, Mob AE'), -- 15:40:06 *
(2225800, 9, 23 ,0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 38727, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Magic Sucker Device (Success Visual timer)'), -- 15:40:07 *
(2225800, 9, 24 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Set Unit Flags'),
(2225800, 9, 25 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 28, 38672, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Remove Aura Magic Sucker Device timer'),
(2225800, 9, 26 ,0, 0, 0, 100, 0, 3000, 3000, 0, 0, 11, 38727, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Magic Sucker Device (Success Visual timer)'), -- 15:40:07 *
(2225800, 9, 27 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 28, 38672, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Remove Aura Magic Sucker Device timer'),
(2225800, 9, 28 ,0, 0, 0, 100, 0, 3000, 3000, 0, 0, 11, 38727, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Cast Magic Sucker Device (Success Visual timer)'), -- 15:40:07 *
(2225800, 9, 29 ,0, 0, 0, 100, 0, 0, 0, 0, 0, 28, 38672, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Remove Aura Magic Sucker Device timer'),
(2225800, 9, 30 ,0, 0, 0, 100, 0, 84000, 84000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demoniac Scryer - Script - Remove Aura Magic Sucker Device timer');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=22258;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(22, 11, 22258, 0, 0, 9, 0, 10838, 0, 0, 0, 0, 0, '', 'Demoniac Scryer - Only run SAI if player has the Demoniac Scryer Taken'),
(22, 11, 22258, 0, 0, 2, 0, 31607, 1, 0, 1, 0, 0, '', 'Demoniac Scryer - Only run SAI if player does not have Demoniac Scryer Reading'),
(22, 11, 22258, 0, 0, 1, 0, 38708, 0, 0, 1, 0, 0, '', 'Demoniac Scryer - Only run SAI if player does not have Aura Demonaic Visitation'),
(22, 11, 22258, 0, 0, 1, 1, 38672, 0, 0, 1, 0, 0, '', 'Demoniac Scryer - Only run SAI if Demoniac Scryer does not have Aura Magic Sucker Device timer');
DELETE FROM `creature_text` WHERE `entry` IN (22259,22273,22366);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
(22273, 0, 0, 'Die, interloper! Your puny device cannot pierce the dark magics of Hellfire Citadel!', 12, 0, 100, 397, 0, 0, 'Fel Warden',20020),
(22259, 0, 0, 'Your end has come!', 12, 0, 100, 0, 0, 0, 'Hellfire Wardling',53515),
(22259, 0, 1, 'An intruder! Begone!', 12, 0, 100, 0, 0, 0, 'Hellfire Wardling',20027),
(22259, 0, 2, 'An intruder! Begone!', 12, 0, 100, 0, 0, 8152, 'Hellfire Wardling',20027),
(22259, 0, 3, 'You will burn!', 12, 0, 100, 0, 0, 0, 'Hellfire Wardling',53513),
(22259, 0, 4, 'Die!', 12, 0, 100, 0, 0, 0, 'Hellfire Wardling',53514),
(22259, 0, 5, 'Your end has come!', 12, 0, 100, 0, 0, 8152, 'Hellfire Wardling',53515),
(22259, 0, 6, 'Die!', 12, 0, 100, 0, 0, 8152, 'Hellfire Wardling',53514),
(22366, 0, 0, 'Thank you for allowing me to visit, $n. You have a very colorful soul, but it''s a little brighter than I prefer... or I might have stayed longer!', 15, 0, 100, 0, 0, 0, 'Demoniac Visitation',20154);
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`IN(-38708);
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(-38708, 38991, 0,'Upon Demoniac Visitation expiring cast Summon Demonaic Visitation');
@@ -0,0 +1,185 @@
DROP TABLE IF EXISTS `db_script_string`; -- RIP
UPDATE `waypoint_scripts` SET `dataint` = 5960 WHERE `dataint` = 2000005018;
UPDATE `waypoint_scripts` SET `dataint` = 22392 WHERE `dataint` = 2000005019;
UPDATE `waypoint_scripts` SET `dataint` = 22050 WHERE `dataint` = 2000005020;
UPDATE `waypoint_scripts` SET `dataint` = 22051 WHERE `dataint` = 2000005021;
UPDATE `waypoint_scripts` SET `dataint` = 22052 WHERE `dataint` = 2000005022;
UPDATE `waypoint_scripts` SET `dataint` = 10141 WHERE `dataint` = 2000005023;
UPDATE `waypoint_scripts` SET `dataint` = 10146 WHERE `dataint` = 2000005024;
UPDATE `waypoint_scripts` SET `dataint` = 10152 WHERE `dataint` = 2000005025;
UPDATE `waypoint_scripts` SET `dataint` = 10126 WHERE `dataint` = 2000005026;
UPDATE `waypoint_scripts` SET `dataint` = 7194 WHERE `dataint` = 2000005027;
UPDATE `waypoint_scripts` SET `dataint` = 7193 WHERE `dataint` = 2000005028;
UPDATE `waypoint_scripts` SET `dataint` = 7191 WHERE `dataint` = 2000005029;
UPDATE `waypoint_scripts` SET `dataint` = 10139 WHERE `dataint` = 2000005030; -- 4.x text
UPDATE `waypoint_scripts` SET `dataint` = 6406 WHERE `dataint` = 2000005031;
UPDATE `waypoint_scripts` SET `dataint` = 6405 WHERE `dataint` = 2000005032;
UPDATE `waypoint_scripts` SET `dataint` = 10158 WHERE `dataint` = 2000005033;
UPDATE `waypoint_scripts` SET `dataint` = 22544 WHERE `dataint` = 2000005034;
UPDATE `waypoint_scripts` SET `dataint` = 10146 WHERE `dataint` = 2000005035;
UPDATE `waypoint_scripts` SET `dataint` = 12835 WHERE `dataint` = 2000005036;
UPDATE `waypoint_scripts` SET `dataint` = 12832 WHERE `dataint` = 2000005037;
UPDATE `waypoint_scripts` SET `dataint` = 12833 WHERE `dataint` = 2000005038;
UPDATE `waypoint_scripts` SET `dataint` = 14565 WHERE `dataint` = 2000005039;
UPDATE `waypoint_scripts` SET `dataint` = 14567 WHERE `dataint` = 2000005040;
UPDATE `waypoint_scripts` SET `dataint` = 15144 WHERE `dataint` = 2000005041;
UPDATE `waypoint_scripts` SET `dataint` = 15373 WHERE `dataint` = 2000005042;
UPDATE `waypoint_scripts` SET `dataint` = 17569 WHERE `dataint` = 2000005043; -- doesn't exist anywhere, picked a random text from the same npc
UPDATE `waypoint_scripts` SET `dataint` = 17563 WHERE `dataint` = 2000005044; -- doesn't exist anywhere, picked a random text from the same npc
UPDATE `waypoint_scripts` SET `dataint` = 16059 WHERE `dataint` = 2000005045;
UPDATE `waypoint_scripts` SET `dataint` = 10119 WHERE `dataint` = 2000005048;
UPDATE `waypoint_scripts` SET `dataint` = 17035 WHERE `dataint` = 2000005049;
UPDATE `waypoint_scripts` SET `dataint` = 17045 WHERE `dataint` = 2000005050;
UPDATE `waypoint_scripts` SET `dataint` = 17056 WHERE `dataint` = 2000005051;
UPDATE `waypoint_scripts` SET `dataint` = 17486 WHERE `dataint` = 2000005052;
UPDATE `waypoint_scripts` SET `dataint` = 17485 WHERE `dataint` = 2000005053;
UPDATE `waypoint_scripts` SET `dataint` = 17485 WHERE `dataint` = 2000005054;
UPDATE `waypoint_scripts` SET `dataint` = 17485 WHERE `dataint` = 2000005055;
UPDATE `waypoint_scripts` SET `dataint` = 18816 WHERE `dataint` = 2000005056;
UPDATE `waypoint_scripts` SET `dataint` = 709 WHERE `dataint` = 2000005057;
UPDATE `waypoint_scripts` SET `dataint` = 710 WHERE `dataint` = 2000005058;
UPDATE `waypoint_scripts` SET `dataint` = 705 WHERE `dataint` = 2000005059;
UPDATE `waypoint_scripts` SET `dataint` = 693 WHERE `dataint` = 2000005060;
UPDATE `waypoint_scripts` SET `dataint` = 710 WHERE `dataint` = 2000005061;
UPDATE `waypoint_scripts` SET `dataint` = 706 WHERE `dataint` = 2000005062;
UPDATE `waypoint_scripts` SET `dataint` = 709 WHERE `dataint` = 2000005063;
UPDATE `waypoint_scripts` SET `dataint` = 710 WHERE `dataint` = 2000005064;
UPDATE `waypoint_scripts` SET `dataint` = 705 WHERE `dataint` = 2000005065;
UPDATE `waypoint_scripts` SET `dataint` = 693 WHERE `dataint` = 2000005066;
UPDATE `waypoint_scripts` SET `dataint` = 710 WHERE `dataint` = 2000005067;
UPDATE `waypoint_scripts` SET `dataint` = 706 WHERE `dataint` = 2000005068;
UPDATE `waypoint_scripts` SET `dataint` = 709 WHERE `dataint` = 2000005069;
UPDATE `waypoint_scripts` SET `dataint` = 710 WHERE `dataint` = 2000005070;
UPDATE `waypoint_scripts` SET `dataint` = 705 WHERE `dataint` = 2000005071;
UPDATE `waypoint_scripts` SET `dataint` = 693 WHERE `dataint` = 2000005072;
UPDATE `waypoint_scripts` SET `dataint` = 710 WHERE `dataint` = 2000005073;
UPDATE `waypoint_scripts` SET `dataint` = 706 WHERE `dataint` = 2000005074;
UPDATE `waypoint_scripts` SET `dataint` = 709 WHERE `dataint` = 2000005075;
UPDATE `waypoint_scripts` SET `dataint` = 710 WHERE `dataint` = 2000005076;
UPDATE `waypoint_scripts` SET `dataint` = 705 WHERE `dataint` = 2000005077;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005078;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005079;
UPDATE `waypoint_scripts` SET `dataint` = 696 WHERE `dataint` = 2000005080;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005081;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005082;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005083;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005084;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005085;
UPDATE `waypoint_scripts` SET `dataint` = 696 WHERE `dataint` = 2000005086;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005087;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005088;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005089;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005090;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005091;
UPDATE `waypoint_scripts` SET `dataint` = 696 WHERE `dataint` = 2000005092;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005093;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005094;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005095;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005096;
UPDATE `waypoint_scripts` SET `dataint` = 694 WHERE `dataint` = 2000005097;
UPDATE `waypoint_scripts` SET `dataint` = 696 WHERE `dataint` = 2000005098;
UPDATE `waypoint_scripts` SET `dataint` = 1101 WHERE `dataint` = 2000005099;
UPDATE `waypoint_scripts` SET `dataint` = 1103 WHERE `dataint` = 2000005100;
UPDATE `waypoint_scripts` SET `dataint` = 4013 WHERE `dataint` = 2000005101;
UPDATE `waypoint_scripts` SET `dataint` = 1104 WHERE `dataint` = 2000005102;
UPDATE `waypoint_scripts` SET `dataint` = 1110 WHERE `dataint` = 2000005103;
UPDATE `waypoint_scripts` SET `dataint` = 1105 WHERE `dataint` = 2000005104;
UPDATE `waypoint_scripts` SET `dataint` = 1108 WHERE `dataint` = 2000005105;
UPDATE `waypoint_scripts` SET `dataint` = 1106 WHERE `dataint` = 2000005106;
UPDATE `waypoint_scripts` SET `dataint` = 1107 WHERE `dataint` = 2000005107;
UPDATE `waypoint_scripts` SET `dataint` = 1112 WHERE `dataint` = 2000005108;
UPDATE `waypoint_scripts` SET `dataint` = 151 WHERE `dataint` = 2000005109;
UPDATE `waypoint_scripts` SET `dataint` = 151 WHERE `dataint` = 2000005110;
UPDATE `waypoint_scripts` SET `dataint` = 155 WHERE `dataint` = 2000005111;
UPDATE `waypoint_scripts` SET `dataint` = 154 WHERE `dataint` = 2000005112;
UPDATE `waypoint_scripts` SET `dataint` = 152 WHERE `dataint` = 2000005113;
UPDATE `waypoint_scripts` SET `dataint` = 177 WHERE `dataint` = 2000005114;
UPDATE `waypoint_scripts` SET `dataint` = 149 WHERE `dataint` = 2000005115;
UPDATE `waypoint_scripts` SET `dataint` = 173 WHERE `dataint` = 2000005116;
UPDATE `waypoint_scripts` SET `dataint` = 174 WHERE `dataint` = 2000005117;
UPDATE `waypoint_scripts` SET `dataint` = 172 WHERE `dataint` = 2000005118;
UPDATE `waypoint_scripts` SET `dataint` = 173 WHERE `dataint` = 2000005119;
UPDATE `waypoint_scripts` SET `dataint` = 172 WHERE `dataint` = 2000005120;
UPDATE `waypoint_scripts` SET `dataint` = 176 WHERE `dataint` = 2000005121;
UPDATE `waypoint_scripts` SET `dataint` = 178 WHERE `dataint` = 2000005122;
UPDATE `waypoint_scripts` SET `dataint` = 169 WHERE `dataint` = 2000005123;
UPDATE `waypoint_scripts` SET `dataint` = 147 WHERE `dataint` = 2000005124;
UPDATE `waypoint_scripts` SET `dataint` = 157 WHERE `dataint` = 2000005125;
UPDATE `waypoint_scripts` SET `dataint` = 168 WHERE `dataint` = 2000005126;
UPDATE `waypoint_scripts` SET `dataint` = 147 WHERE `dataint` = 2000005127;
UPDATE `waypoint_scripts` SET `dataint` = 157 WHERE `dataint` = 2000005128;
UPDATE `waypoint_scripts` SET `dataint` = 167 WHERE `dataint` = 2000005129;
UPDATE `waypoint_scripts` SET `dataint` = 157 WHERE `dataint` = 2000005130;
UPDATE `waypoint_scripts` SET `dataint` = 147 WHERE `dataint` = 2000005131;
UPDATE `waypoint_scripts` SET `dataint` = 2874 WHERE `dataint` = 2000005132;
UPDATE `waypoint_scripts` SET `dataint` = 10119 WHERE `dataint` = 2000005133;
UPDATE `waypoint_scripts` SET `dataint` = 1129 WHERE `dataint` = 2000005134;
UPDATE `waypoint_scripts` SET `dataint` = 1154 WHERE `dataint` = 2000005135;
UPDATE `waypoint_scripts` SET `dataint` = 1155 WHERE `dataint` = 2000005136;
UPDATE `waypoint_scripts` SET `dataint` = 1140 WHERE `dataint` = 2000005137;
UPDATE `waypoint_scripts` SET `dataint` = 1161 WHERE `dataint` = 2000005138;
UPDATE `waypoint_scripts` SET `dataint` = 1162 WHERE `dataint` = 2000005139;
UPDATE `waypoint_scripts` SET `dataint` = 1163 WHERE `dataint` = 2000005140;
UPDATE `waypoint_scripts` SET `dataint` = 1165 WHERE `dataint` = 2000005141;
UPDATE `waypoint_scripts` SET `dataint` = 1166 WHERE `dataint` = 2000005142;
UPDATE `waypoint_scripts` SET `dataint` = 13580 WHERE `dataint` = 2000005144;
UPDATE `waypoint_scripts` SET `dataint` = 13576 WHERE `dataint` = 2000005145;
UPDATE `waypoint_scripts` SET `dataint` = 15119 WHERE `dataint` = 2000005147;
UPDATE `waypoint_scripts` SET `dataint` = 209 WHERE `dataint` = 2000005148;
UPDATE `waypoint_scripts` SET `dataint` = 224 WHERE `dataint` = 2000005149;
UPDATE `waypoint_scripts` SET `dataint` = 225 WHERE `dataint` = 2000005150;
UPDATE `waypoint_scripts` SET `dataint` = 213 WHERE `dataint` = 2000005151;
UPDATE `waypoint_scripts` SET `dataint` = 225 WHERE `dataint` = 2000005152;
UPDATE `waypoint_scripts` SET `dataint` = 225 WHERE `dataint` = 2000005153;
UPDATE `waypoint_scripts` SET `dataint` = 224 WHERE `dataint` = 2000005154;
UPDATE `waypoint_scripts` SET `dataint` = 214 WHERE `dataint` = 2000005155;
UPDATE `waypoint_scripts` SET `dataint` = 217 WHERE `dataint` = 2000005156;
UPDATE `waypoint_scripts` SET `dataint` = 210 WHERE `dataint` = 2000005157;
UPDATE `waypoint_scripts` SET `dataint` = 205 WHERE `dataint` = 2000005158;
UPDATE `waypoint_scripts` SET `dataint` = 216 WHERE `dataint` = 2000005159;
UPDATE `waypoint_scripts` SET `dataint` = 212 WHERE `dataint` = 2000005160;
UPDATE `waypoint_scripts` SET `dataint` = 208 WHERE `dataint` = 2000005161;
UPDATE `waypoint_scripts` SET `dataint` = 214 WHERE `dataint` = 2000005162;
UPDATE `waypoint_scripts` SET `dataint` = 215 WHERE `dataint` = 2000005163;
UPDATE `waypoint_scripts` SET `dataint` = 206 WHERE `dataint` = 2000005164;
UPDATE `waypoint_scripts` SET `dataint` = 212 WHERE `dataint` = 2000005165;
UPDATE `waypoint_scripts` SET `dataint` = 214 WHERE `dataint` = 2000005166;
UPDATE `waypoint_scripts` SET `dataint` = 1153 WHERE `dataint` = 2000005167;
UPDATE `waypoint_scripts` SET `dataint` = 1130 WHERE `dataint` = 2000005168;
UPDATE `waypoint_scripts` SET `dataint` = 201 WHERE `dataint` = 2000005169;
UPDATE `waypoint_scripts` SET `dataint` = 218 WHERE `dataint` = 2000005170;
UPDATE `waypoint_scripts` SET `dataint` = 222 WHERE `dataint` = 2000005171;
UPDATE `waypoint_scripts` SET `dataint` = 221 WHERE `dataint` = 2000005172;
UPDATE `waypoint_scripts` SET `dataint` = 204 WHERE `dataint` = 2000005173;
UPDATE `waypoint_scripts` SET `dataint` = 222 WHERE `dataint` = 2000005174;
UPDATE `waypoint_scripts` SET `dataint` = 219 WHERE `dataint` = 2000005175;
UPDATE `waypoint_scripts` SET `dataint` = 218 WHERE `dataint` = 2000005176;
UPDATE `waypoint_scripts` SET `dataint` = 221 WHERE `dataint` = 2000005177;
UPDATE `waypoint_scripts` SET `dataint` = 219 WHERE `dataint` = 2000005178;
UPDATE `waypoint_scripts` SET `dataint` = 222 WHERE `dataint` = 2000005179;
UPDATE `waypoint_scripts` SET `dataint` = 587 WHERE `dataint` = 2000005180;
UPDATE `waypoint_scripts` SET `dataint` = 589 WHERE `dataint` = 2000005181;
UPDATE `waypoint_scripts` SET `dataint` = 590 WHERE `dataint` = 2000005182;
UPDATE `waypoint_scripts` SET `dataint` = 588 WHERE `dataint` = 2000005183;
UPDATE `waypoint_scripts` SET `dataint` = 1091 WHERE `dataint` = 2000005184;
UPDATE `waypoint_scripts` SET `dataint` = 24425 WHERE `dataint` = 2000005200;
UPDATE `waypoint_scripts` SET `dataint` = 24425 WHERE `dataint` = 2000005201;
UPDATE `waypoint_scripts` SET `dataint` = 22216 WHERE `dataint` = 2000005202;
UPDATE `waypoint_scripts` SET `dataint` = 22211 WHERE `dataint` = 2000005203;
UPDATE `waypoint_scripts` SET `dataint` = 22206 WHERE `dataint` = 2000005204;
UPDATE `waypoint_scripts` SET `dataint` = 25086 WHERE `dataint` = 2000005205;
UPDATE `waypoint_scripts` SET `dataint` = 25073 WHERE `dataint` = 2000005206;
UPDATE `waypoint_scripts` SET `dataint` = 25074 WHERE `dataint` = 2000005207;
UPDATE `waypoint_scripts` SET `dataint` = 25075 WHERE `dataint` = 2000005208;
UPDATE `waypoint_scripts` SET `dataint` = 25076 WHERE `dataint` = 2000005209;
UPDATE `waypoint_scripts` SET `dataint` = 23842 WHERE `dataint` = 2000005210;
UPDATE `waypoint_scripts` SET `dataint` = 328 WHERE `dataint` = 2000005400;
UPDATE `waypoint_scripts` SET `dataint` = 327 WHERE `dataint` = 2000005401;
UPDATE `waypoint_scripts` SET `dataint` = 5956 WHERE `dataint` = 2000005402;
UPDATE `waypoint_scripts` SET `dataint` = 5957 WHERE `dataint` = 2000005403;
UPDATE `waypoint_scripts` SET `dataint` = 5960 WHERE `dataint` = 2000005404;
UPDATE `waypoint_scripts` SET `dataint` = 5959 WHERE `dataint` = 2000005405;
UPDATE `waypoint_scripts` SET `dataint` = 24439 WHERE `dataint` = 2000005406;
UPDATE `waypoint_scripts` SET `dataint` = 24443 WHERE `dataint` = 2000005407;
UPDATE `waypoint_scripts` SET `dataint` = 36 WHERE `dataint` = 2000005408;
@@ -0,0 +1,19 @@
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`IN(31606,47190);
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(31606, 31746, 0, 'Stormcrow Amulet triggers Stormcrow Shape'),
(47190, 47189, 1, 'Toaluus Spiritual Incense triggers Spiritual Insight');
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` IN(26595,17841);
DELETE FROM `smart_scripts` WHERE `entryorguid`IN(26595,17841) 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
(26595, 0, 0, 0, 10, 0, 100, 0, 1, 30, 10, 10, 28, 47189, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Toaluu the Mystic - Out of Combat - Remove Aura Spiritual Insight'),
(17841, 0, 0, 0, 10, 0, 100, 0, 1, 30, 10, 10, 28, 31746, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ysiel Windsinger - Out of Combat - Remove Aura Stormcrow Shape');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN(26595,17841);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(22, 1, 26595, 0, 0, 28, 0, 12028, 0, 0, 0, 0, 0, '', 'Only run SAI if Player Has Spiritual Insight Complete in Log'),
(22, 1, 26595, 0, 0, 1, 0, 47189, 0, 0, 0, 0, 0, '', 'Only run SAI if Player Has Aura Spiritual Insight'),
(22, 1, 17841, 0, 0, 28, 0, 9718, 0, 0, 0, 0, 0, '', 'Only run SAI if Player Has As The Crow Flies Complete in Log'),
(22, 1, 17841, 0, 0, 1, 0, 31746, 0, 0, 0, 0, 0, '', 'Only run SAI if Player Has Aura Stormcrow Shape');
@@ -774,7 +774,7 @@ void Battleground::EndBattleground(uint32 winner)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PVPSTATS_BATTLEGROUND);
stmt->setUInt64(0, battlegroundId);
stmt->setUInt8(1, GetWinner());
stmt->setUInt8(2, m_BracketId + 1);
stmt->setUInt8(2, GetUniqueBracketId());
stmt->setUInt8(3, GetTypeID(true));
CharacterDatabase.Execute(stmt);
}
@@ -1927,3 +1927,8 @@ bool Battleground::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const*
TC_LOG_ERROR("bg.battleground", "Battleground::CheckAchievementCriteriaMeet: No implementation for criteria %u", criteriaId);
return false;
}
uint8 Battleground::GetUniqueBracketId() const
{
return GetMinLevel() / 10;
}
@@ -474,6 +474,9 @@ class Battleground
virtual uint32 GetPrematureWinner();
// because BattleGrounds with different types and same level range has different m_BracketId
uint8 GetUniqueBracketId() const;
protected:
// this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
void EndNow();
+18 -4
View File
@@ -2081,8 +2081,17 @@ namespace Trinity
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(Language(language)), i_target(target) { }
void operator()(WorldPacket& data, LocaleConstant loc_idx)
{
char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, text, 0, "", loc_idx);
if (BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(i_textId))
{
uint8 gender = GENDER_MALE;
if (Unit const* unit = i_object->ToUnit())
gender = unit->getGender();
std::string text = broadcastText->GetText(loc_idx, gender);
ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, text, 0, "", loc_idx);
}
else
TC_LOG_ERROR("entities.unit", "MonsterChatBuilder: `broadcast_text` id %i missing", i_textId);
}
private:
@@ -2207,10 +2216,15 @@ void WorldObject::MonsterWhisper(int32 textId, Player const* target, bool IsBoss
if (!target)
return;
uint8 gender = GENDER_MALE;
if (Unit const* unit = ToUnit())
gender = unit->getGender();
LocaleConstant loc_idx = target->GetSession()->GetSessionDbLocaleIndex();
char const* text = sObjectMgr->GetTrinityString(textId, loc_idx);
BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(textId);
std::string text = broadcastText->GetText(loc_idx, gender);
WorldPacket data;
ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text, 0, "", loc_idx);
ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text.c_str(), 0, "", loc_idx);
target->GetSession()->SendPacket(&data);
}
-50
View File
@@ -4662,12 +4662,6 @@ void ObjectMgr::LoadScripts(ScriptsType type)
tableName.c_str(), tmp.Talk.TextID, tmp.id);
continue;
}
if (tmp.Talk.TextID < MIN_DB_SCRIPT_STRING_ID || tmp.Talk.TextID >= MAX_DB_SCRIPT_STRING_ID)
{
TC_LOG_ERROR("sql.sql", "Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(), tmp.Talk.TextID, MIN_DB_SCRIPT_STRING_ID, MAX_DB_SCRIPT_STRING_ID, tmp.id);
continue;
}
break;
}
@@ -8745,33 +8739,6 @@ uint32 ObjectMgr::GetScriptId(const char *name)
return uint32(itr - _scriptNamesStore.begin());
}
void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids)
{
ScriptMapMap* scripts = GetScriptsMapByType(type);
if (!scripts)
return;
for (ScriptMapMap::const_iterator itrMM = scripts->begin(); itrMM != scripts->end(); ++itrMM)
{
for (ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM)
{
switch (itrM->second.command)
{
case SCRIPT_COMMAND_TALK:
{
if (!GetTrinityStringLocale (itrM->second.Talk.TextID))
TC_LOG_ERROR("sql.sql", "Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first);
if (ids.find(itrM->second.Talk.TextID) != ids.end())
ids.erase(itrM->second.Talk.TextID);
}
default:
break;
}
}
}
}
void ObjectMgr::LoadBroadcastTexts()
{
uint32 oldMSTime = getMSTime();
@@ -8907,23 +8874,6 @@ void ObjectMgr::LoadBroadcastTextLocales()
TC_LOG_INFO("server.loading", ">> Loaded %u broadcast text locales in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadDbScriptStrings()
{
LoadTrinityStrings("db_script_string", MIN_DB_SCRIPT_STRING_ID, MAX_DB_SCRIPT_STRING_ID);
std::set<int32> ids;
for (int32 i = MIN_DB_SCRIPT_STRING_ID; i < MAX_DB_SCRIPT_STRING_ID; ++i)
if (GetTrinityStringLocale(i))
ids.insert(i);
for (int type = SCRIPTS_FIRST; type < SCRIPTS_LAST; ++type)
CheckScripts(ScriptsType(type), ids);
for (std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
TC_LOG_ERROR("sql.sql", "Table `db_script_string` has unused string id %u", *itr);
}
CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass)
{
CreatureBaseStatsContainer::const_iterator it = _creatureBaseStatsStore.find(MAKE_PAIR16(level, unitClass));
-4
View File
@@ -493,8 +493,6 @@ typedef std::unordered_map<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap
// Trinity string ranges
#define MIN_TRINITY_STRING_ID 1 // 'trinity_string'
#define MAX_TRINITY_STRING_ID 2000000000
#define MIN_DB_SCRIPT_STRING_ID MAX_TRINITY_STRING_ID // 'db_script_string'
#define MAX_DB_SCRIPT_STRING_ID 2000010000
// Trinity Trainer Reference start range
#define TRINITY_TRAINER_START_REF 200000
@@ -990,7 +988,6 @@ class ObjectMgr
void LoadBroadcastTextLocales();
bool LoadTrinityStrings(char const* table, int32 min_value, int32 max_value);
bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string", MIN_TRINITY_STRING_ID, MAX_TRINITY_STRING_ID); }
void LoadDbScriptStrings();
void LoadCreatureClassLevelStats();
void LoadCreatureLocales();
void LoadGraveyardOrientations();
@@ -1439,7 +1436,6 @@ class ObjectMgr
private:
void LoadScripts(ScriptsType type);
void CheckScripts(ScriptsType type, std::set<int32>& ids);
void LoadQuestRelationsHelper(QuestRelations& map, QuestRelationsReverse* reverseMap, std::string const& table, bool starter, bool go);
void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count);
-1
View File
@@ -1204,7 +1204,6 @@ enum TrinityStrings
LANG_NPCINFO_FLAGS_EXTRA = 11009
// NOT RESERVED IDS 12000-1999999999
// `db_script_string` table index 2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
// For other tables maybe 2000010000-2147483647 (max index)
};
#endif
+2 -1
View File
@@ -383,7 +383,8 @@ void Map::ScriptsProcess()
if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script))
{
LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
std::string text(sObjectMgr->GetTrinityString(step.script->Talk.TextID, loc_idx));
BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(step.script->Talk.TextID);
std::string text = broadcastText->GetText(loc_idx, player->getGender());
switch (step.script->Talk.ChatType)
{
-3
View File
@@ -1763,9 +1763,6 @@ void World::SetInitialWorldSettings()
sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadWaypointScripts();
TC_LOG_INFO("server.loading", "Loading Scripts text locales..."); // must be after Load*Scripts calls
sObjectMgr->LoadDbScriptStrings();
TC_LOG_INFO("server.loading", "Loading spell script names...");
sObjectMgr->LoadSpellScriptNames();
+21 -2
View File
@@ -1299,14 +1299,29 @@ public:
static bool HandleNpcWhisperCommand(ChatHandler* handler, char const* args)
{
if (!*args)
{
handler->SendSysMessage(LANG_CMD_SYNTAX);
handler->SetSentErrorMessage(true);
return false;
}
char* receiver_str = strtok((char*)args, " ");
char* text = strtok(NULL, "");
Creature* creature = handler->getSelectedCreature();
if (!creature || !receiver_str || !text)
if (!receiver_str || !text)
{
handler->SendSysMessage(LANG_CMD_SYNTAX);
handler->SetSentErrorMessage(true);
return false;
}
Creature* creature = handler->getSelectedCreature();
if (!creature)
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
uint64 receiver_guid = atol(receiver_str);
@@ -1322,7 +1337,11 @@ public:
static bool HandleNpcYellCommand(ChatHandler* handler, char const* args)
{
if (!*args)
{
handler->SendSysMessage(LANG_CMD_SYNTAX);
handler->SetSentErrorMessage(true);
return false;
}
Creature* creature = handler->getSelectedCreature();
if (!creature)
-10
View File
@@ -88,7 +88,6 @@ public:
{ "creature_queststarter", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTSTARTER, true, &HandleReloadCreatureQuestStarterCommand, "", NULL },
{ "creature_summon_groups", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_SUMMON_GROUPS, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL },
{ "creature_template", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_TEMPLATE, true, &HandleReloadCreatureTemplateCommand, "", NULL },
//{ "db_script_string", rbac::RBAC_PERM_COMMAND_RELOAD_, true, &HandleReloadDbScriptStringCommand, "", NULL },
{ "disables", rbac::RBAC_PERM_COMMAND_RELOAD_DISABLES, true, &HandleReloadDisablesCommand, "", NULL },
{ "disenchant_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_DISENCHANT_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesDisenchantCommand, "", NULL },
{ "event_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_EVENT_SCRIPTS, true, &HandleReloadEventScriptsCommand, "", NULL },
@@ -264,7 +263,6 @@ public:
HandleReloadEventScriptsCommand(handler, "a");
HandleReloadSpellScriptsCommand(handler, "a");
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
HandleReloadDbScriptStringCommand(handler, "a");
HandleReloadWpScriptsCommand(handler, "a");
HandleReloadWpCommand(handler, "a");
return true;
@@ -950,14 +948,6 @@ public:
return true;
}
static bool HandleReloadDbScriptStringCommand(ChatHandler* handler, const char* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Script strings from `db_script_string`...");
sObjectMgr->LoadDbScriptStrings();
handler->SendGlobalGMSysMessage("DB table `db_script_string` reloaded.");
return true;
}
static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, const char* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Graveyard-zone links...");
@@ -66,14 +66,22 @@ public:
struct boss_maexxnaAI : public BossAI
{
boss_maexxnaAI(Creature* creature) : BossAI(creature, BOSS_MAEXXNA) { }
boss_maexxnaAI(Creature* creature) : BossAI(creature, BOSS_MAEXXNA)
{
Initialize();
}
void Initialize()
{
enraged = false;
}
bool enraged;
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
enraged = false;
Initialize();
events.ScheduleEvent(EVENT_WRAP, 20000);
events.ScheduleEvent(EVENT_SPRAY, 40000);
events.ScheduleEvent(EVENT_SHOCK, urand(5000, 10000));
@@ -72,7 +72,11 @@ public:
struct boss_nothAI : public BossAI
{
boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH) { }
boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH)
{
balconyCount = 0;
waveCount = 0;
}
void Reset() override
{
@@ -61,7 +61,10 @@ public:
struct boss_patchwerkAI : public BossAI
{
boss_patchwerkAI(Creature* creature) : BossAI(creature, BOSS_PATCHWERK) { }
boss_patchwerkAI(Creature* creature) : BossAI(creature, BOSS_PATCHWERK)
{
Enraged = false;
}
bool Enraged;
@@ -90,9 +90,19 @@ class boss_sapphiron : public CreatureScript
struct boss_sapphironAI : public BossAI
{
boss_sapphironAI(Creature* creature) :
BossAI(creature, BOSS_SAPPHIRON), _phase(PHASE_NULL),
_map(me->GetMap())
{ }
BossAI(creature, BOSS_SAPPHIRON), _map(me->GetMap())
{
Initialize();
_iceboltCount = 0;
}
void Initialize()
{
_phase = PHASE_NULL;
_canTheHundredClub = true;
_checkFrostResistTimer = 5 * IN_MILLISECONDS;
}
void InitializeAI() override
{
@@ -115,10 +125,7 @@ class boss_sapphiron : public CreatureScript
if (_phase == PHASE_FLIGHT)
ClearIceBlock();
_phase = PHASE_NULL;
_canTheHundredClub = true;
_checkFrostResistTimer = 5 * IN_MILLISECONDS;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -137,6 +137,9 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
me->SetReactState(REACT_PASSIVE);
}
polaritySwitch = false;
uiAddsTimer = 0;
}
bool checkStalaggAlive;
@@ -287,9 +290,16 @@ public:
{
npc_stalaggAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
powerSurgeTimer = urand(20000, 25000);
magneticPullTimer = 20000;
}
InstanceScript* instance;
uint32 powerSurgeTimer;
@@ -300,8 +310,7 @@ public:
if (Creature* pThaddius = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
if (pThaddius->AI())
pThaddius->AI()->DoAction(ACTION_STALAGG_RESET);
powerSurgeTimer = urand(20000, 25000);
magneticPullTimer = 20000;
Initialize();
}
void KilledUnit(Unit* /*victim*/) override
@@ -379,9 +388,15 @@ public:
{
npc_feugenAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
staticFieldTimer = 5000;
}
InstanceScript* instance;
uint32 staticFieldTimer;
@@ -391,7 +406,7 @@ public:
if (Creature* pThaddius = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
if (pThaddius->AI())
pThaddius->AI()->DoAction(ACTION_FEUGEN_RESET);
staticFieldTimer = 5000;
Initialize();
}
void KilledUnit(Unit* /*victim*/) override
@@ -126,6 +126,9 @@ class instance_naxxramas : public InstanceMapScript
SapphironGUID = 0;
KelthuzadGUID = 0;
KelthuzadTriggerGUID = 0;
minHorsemenDiedTime = 0;
maxHorsemenDiedTime = 0;
AbominationCount = 0;
playerDied = 0;
@@ -447,7 +450,6 @@ class instance_naxxramas : public InstanceMapScript
uint64 BaronGUID;
uint64 SirGUID;
uint64 HorsemenChestGUID;
uint64 HorsemenTeleporterGUID;
time_t minHorsemenDiedTime;
time_t maxHorsemenDiedTime;
@@ -342,16 +342,13 @@ public:
{
boss_malygosAI(Creature* creature) : BossAI(creature, DATA_MALYGOS_EVENT)
{
Initialize();
_despawned = false; // We determine if Malygos will be realocated to spawning position on reset triggered by boss despawn on evade
_flySpeed = me->GetSpeed(MOVE_FLIGHT); // Get initial fly speed, otherwise on each wipe fly speed would add up if we get it
}
void Reset() override
void Initialize()
{
// EnterEvadeMode and Reset() links are cut for the sake of properly functioning despawner.
if (!_despawned)
_Reset();
_summonDeaths = 0;
_preparingPulsesChecker = 0;
_arcaneOverloadGUID = 0;
@@ -366,6 +363,15 @@ public:
_firstCyclicMovementStarted = false;
_performingSurgeOfPower = false;
_performingDestroyPlatform = false;
}
void Reset() override
{
// EnterEvadeMode and Reset() links are cut for the sake of properly functioning despawner.
if (!_despawned)
_Reset();
Initialize();
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
@@ -1173,17 +1179,23 @@ public:
{
npc_melee_hover_diskAI(Creature* creature) : VehicleAI(creature)
{
Initialize();
_instance = creature->GetInstanceScript();
me->SetReactState(REACT_PASSIVE);
// TO DO: These were a bit faster than what they should be. Not sure what is the reason.
me->SetSpeed(MOVE_FLIGHT, 1.25f);
}
void Initialize()
{
_wpCount = 0;
}
void Reset() override
{
VehicleAI::Reset();
_wpCount = 0;
Initialize();
}
void PassengerBoarded(Unit* unit, int8 /*seat*/, bool apply) override
@@ -1507,10 +1519,7 @@ public:
void IsSummonedBy(Unit* summoner) override
{
if (Creature* creature = summoner->ToCreature())
{
_malygos = creature;
_malygos->AI()->SetGUID(me->GetGUID(), DATA_LAST_OVERLOAD_GUID);
}
creature->AI()->SetGUID(me->GetGUID(), DATA_LAST_OVERLOAD_GUID);
}
void UpdateAI(uint32 /*diff*/) override
@@ -1539,7 +1548,6 @@ public:
}
private:
Creature* _malygos;
InstanceScript* _instance;
};
@@ -1559,6 +1567,7 @@ public:
{
npc_wyrmrest_skytalonAI(Creature* creature) : VehicleAI(creature)
{
_summoner = NULL;
}
void IsSummonedBy(Unit* summoner) override
@@ -47,6 +47,8 @@ public:
platformGUID = 0;
exitPortalGUID = 0;
alexstraszaBunnyGUID = 0;
heartOfMagicGUID = 0;
giftBoxBunnyGUID = 0;
};
bool SetBossState(uint32 type, EncounterState state) override
@@ -77,23 +77,28 @@ class boss_anomalus : public CreatureScript
{
boss_anomalusAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = me->GetInstanceScript();
}
void Initialize()
{
Phase = 0;
uiSparkTimer = 5000;
uiChaoticRiftGUID = 0;
chaosTheory = true;
}
InstanceScript* instance;
uint8 Phase;
uint32 uiSparkTimer;
uint32 uiCreateRiftTimer;
uint64 uiChaoticRiftGUID;
bool chaosTheory;
void Reset() override
{
Phase = 0;
uiSparkTimer = 5000;
uiChaoticRiftGUID = 0;
chaosTheory = true;
Initialize();
instance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
}
@@ -197,10 +202,17 @@ class npc_chaotic_rift : public CreatureScript
{
npc_chaotic_riftAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = me->GetInstanceScript();
SetCombatMovement(false);
}
void Initialize()
{
uiChaoticEnergyBurstTimer = 1000;
uiSummonCrazedManaWraithTimer = 5000;
}
InstanceScript* instance;
uint32 uiChaoticEnergyBurstTimer;
@@ -208,8 +220,7 @@ class npc_chaotic_rift : public CreatureScript
void Reset() override
{
uiChaoticEnergyBurstTimer = 1000;
uiSummonCrazedManaWraithTimer = 5000;
Initialize();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
DoCast(me, SPELL_ARCANEFORM, false);
}
@@ -68,9 +68,20 @@ public:
{
boss_keristraszaAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiCrystalfireBreathTimer = 14 * IN_MILLISECONDS;
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30 * IN_MILLISECONDS, 11 * IN_MILLISECONDS);
uiTailSweepTimer = 5 * IN_MILLISECONDS;
bEnrage = false;
intenseCold = true;
}
InstanceScript* instance;
std::list<uint64> intenseColdList;
@@ -83,12 +94,7 @@ public:
void Reset() override
{
uiCrystalfireBreathTimer = 14*IN_MILLISECONDS;
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILLISECONDS, 11*IN_MILLISECONDS);
uiTailSweepTimer = 5*IN_MILLISECONDS;
bEnrage = false;
intenseCold = true;
Initialize();
intenseColdList.clear();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
@@ -72,7 +72,32 @@ public:
{
boss_magus_telestraAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
bFireMagusDead = false;
bFrostMagusDead = false;
bArcaneMagusDead = false;
uiIsWaitingToAppearTimer = 0;
}
void Initialize()
{
Phase = 0;
//These times are probably wrong
uiIceNovaTimer = 7 * IN_MILLISECONDS;
uiFireBombTimer = 0;
uiGravityWellTimer = 15 * IN_MILLISECONDS;
uiCooldown = 0;
uiFireMagusGUID = 0;
uiFrostMagusGUID = 0;
uiArcaneMagusGUID = 0;
for (uint8 n = 0; n < 3; ++n)
time[n] = 0;
splitPersonality = 0;
bIsWaitingToAppear = false;
}
InstanceScript* instance;
@@ -98,22 +123,7 @@ public:
void Reset() override
{
Phase = 0;
//These times are probably wrong
uiIceNovaTimer = 7*IN_MILLISECONDS;
uiFireBombTimer = 0;
uiGravityWellTimer = 15*IN_MILLISECONDS;
uiCooldown = 0;
uiFireMagusGUID = 0;
uiFrostMagusGUID = 0;
uiArcaneMagusGUID = 0;
for (uint8 n = 0; n < 3; ++n)
time[n] = 0;
splitPersonality = 0;
bIsWaitingToAppear = false;
Initialize();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisible(true);
@@ -68,12 +68,20 @@ public:
struct boss_ormorokAI : public BossAI
{
boss_ormorokAI(Creature* creature) : BossAI(creature, DATA_ORMOROK_EVENT) { }
boss_ormorokAI(Creature* creature) : BossAI(creature, DATA_ORMOROK_EVENT)
{
Initialize();
}
void Initialize()
{
frenzy = false;
}
void Reset()
{
BossAI::Reset();
frenzy = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -57,7 +57,15 @@ class boss_drakos : public CreatureScript
struct boss_drakosAI : public BossAI
{
boss_drakosAI(Creature* creature) : BossAI(creature, DATA_DRAKOS) { }
boss_drakosAI(Creature* creature) : BossAI(creature, DATA_DRAKOS)
{
Initialize();
}
void Initialize()
{
postPull = false;
}
void Reset() override
{
@@ -67,7 +75,7 @@ class boss_drakos : public CreatureScript
events.ScheduleEvent(EVENT_STOMP, 17000);
events.ScheduleEvent(EVENT_BOMB_SUMMON, 2000);
postPull = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -150,7 +158,15 @@ class npc_unstable_sphere : public CreatureScript
struct npc_unstable_sphereAI : public ScriptedAI
{
npc_unstable_sphereAI(Creature* creature) : ScriptedAI(creature) { }
npc_unstable_sphereAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
pulseTimer = 3000;
}
void Reset() override
{
@@ -160,7 +176,7 @@ class npc_unstable_sphere : public CreatureScript
me->AddAura(SPELL_UNSTABLE_SPHERE_PASSIVE, me);
me->AddAura(SPELL_UNSTABLE_SPHERE_TIMER, me);
pulseTimer = 3000;
Initialize();
me->DespawnOrUnsummon(19000);
}
@@ -85,16 +85,24 @@ class boss_eregos : public CreatureScript
struct boss_eregosAI : public BossAI
{
boss_eregosAI(Creature* creature) : BossAI(creature, DATA_EREGOS) { }
void Reset() override
boss_eregosAI(Creature* creature) : BossAI(creature, DATA_EREGOS)
{
Initialize();
}
void Initialize()
{
_Reset();
_phase = PHASE_NORMAL;
_rubyVoid = true;
_emeraldVoid = true;
_amberVoid = true;
}
void Reset() override
{
_Reset();
Initialize();
DoAction(ACTION_SET_NORMAL_EVENTS);
}
@@ -95,6 +95,7 @@ class boss_urom : public CreatureScript
{
boss_uromAI(Creature* creature) : BossAI(creature, DATA_UROM)
{
Initialize();
platform = 0;
for (uint8 i = 0; i < 3; ++i)
@@ -103,19 +104,13 @@ class boss_urom : public CreatureScript
std::random_shuffle(group, group + 3);
}
void Reset() override
void Initialize()
{
me->CastSpell(me, SPELL_EVOCATE);
_Reset();
x = 0.0f;
y = 0.0f;
canCast = false;
canGoBack = false;
me->GetMotionMaster()->MoveIdle();
teleportTimer = urand(30000, 35000);
arcaneExplosionTimer = 9000;
castArcaneExplosionTimer = 2000;
@@ -123,6 +118,15 @@ class boss_urom : public CreatureScript
timeBombTimer = urand(20000, 25000);
}
void Reset() override
{
me->CastSpell(me, SPELL_EVOCATE);
_Reset();
me->GetMotionMaster()->MoveIdle();
}
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
@@ -59,7 +59,16 @@ class boss_varos : public CreatureScript
struct boss_varosAI : public BossAI
{
boss_varosAI(Creature* creature) : BossAI(creature, DATA_VAROS) { }
boss_varosAI(Creature* creature) : BossAI(creature, DATA_VAROS)
{
Initialize();
}
void Initialize()
{
firstCoreEnergize = false;
coreEnergizeOrientation = 0.0f;
}
void InitializeAI() override
{
@@ -77,8 +86,7 @@ class boss_varos : public CreatureScript
// not sure if this is handled by a timer or hp percentage
events.ScheduleEvent(EVENT_CALL_AZURE, urand(15, 30) * IN_MILLISECONDS);
firstCoreEnergize = false;
coreEnergizeOrientation = 0.0f;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -170,12 +178,18 @@ class npc_azure_ring_captain : public CreatureScript
{
npc_azure_ring_captainAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
targetGUID = 0;
}
void Reset() override
{
targetGUID = 0;
Initialize();
me->SetWalk(true);
//! HACK: Creature's can't have MOVEMENTFLAG_FLYING
@@ -232,13 +232,19 @@ class npc_ruby_emerald_amber_drake : public CreatureScript
{
npc_ruby_emerald_amber_drakeAI(Creature* creature) : VehicleAI(creature)
{
Initialize();
_instance = creature->GetInstanceScript();
}
void Initialize()
{
_healthWarning = true;
}
void Reset() override
{
_events.Reset();
_healthWarning = true;
Initialize();
}
void IsSummonedBy(Unit* summoner) override
@@ -106,12 +106,35 @@ public:
{
boss_bjarngrimAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
m_uiStance = STANCE_DEFENSIVE;
memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID));
canBuff = true;
}
void Initialize()
{
m_bIsChangingStance = false;
m_uiChargingStatus = 0;
m_uiCharge_Timer = 1000;
m_uiChangeStance_Timer = urand(20000, 25000);
m_uiReflection_Timer = 8000;
m_uiKnockAway_Timer = 20000;
m_uiPummel_Timer = 10000;
m_uiIronform_Timer = 25000;
m_uiIntercept_Timer = 5000;
m_uiWhirlwind_Timer = 10000;
m_uiCleave_Timer = 8000;
m_uiMortalStrike_Timer = 8000;
m_uiSlam_Timer = 10000;
}
InstanceScript* instance;
bool m_bIsChangingStance;
@@ -143,24 +166,7 @@ public:
if (!me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
me->AddAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE, me);
m_bIsChangingStance = false;
m_uiChargingStatus = 0;
m_uiCharge_Timer = 1000;
m_uiChangeStance_Timer = urand(20000, 25000);
m_uiReflection_Timer = 8000;
m_uiKnockAway_Timer = 20000;
m_uiPummel_Timer = 10000;
m_uiIronform_Timer = 25000;
m_uiIntercept_Timer = 5000;
m_uiWhirlwind_Timer = 10000;
m_uiCleave_Timer = 8000;
m_uiMortalStrike_Timer = 8000;
m_uiSlam_Timer = 10000;
Initialize();
for (uint8 i = 0; i < 2; ++i)
{
@@ -393,9 +399,16 @@ public:
{
npc_stormforged_lieutenantAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
m_uiArcWeld_Timer = urand(20000, 21000);
m_uiRenewSteel_Timer = urand(10000, 11000);
}
InstanceScript* instance;
uint32 m_uiArcWeld_Timer;
@@ -403,8 +416,7 @@ public:
void Reset() override
{
m_uiArcWeld_Timer = urand(20000, 21000);
m_uiRenewSteel_Timer = urand(10000, 11000);
Initialize();
}
void EnterCombat(Unit* who) override
@@ -76,9 +76,23 @@ public:
{
boss_ionarAI(Creature* creature) : ScriptedAI(creature), lSparkList(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
bIsSplitPhase = true;
bHasDispersed = false;
uiSplitTimer = 25 * IN_MILLISECONDS;
uiStaticOverloadTimer = urand(5 * IN_MILLISECONDS, 6 * IN_MILLISECONDS);
uiBallLightningTimer = urand(10 * IN_MILLISECONDS, 11 * IN_MILLISECONDS);
uiDisperseHealth = 45 + urand(0, 10);
}
InstanceScript* instance;
SummonList lSparkList;
@@ -97,15 +111,7 @@ public:
{
lSparkList.DespawnAll();
bIsSplitPhase = true;
bHasDispersed = false;
uiSplitTimer = 25*IN_MILLISECONDS;
uiStaticOverloadTimer = urand(5*IN_MILLISECONDS, 6*IN_MILLISECONDS);
uiBallLightningTimer = urand(10*IN_MILLISECONDS, 11*IN_MILLISECONDS);
uiDisperseHealth = 45 + urand(0, 10);
Initialize();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
@@ -297,16 +303,22 @@ public:
{
npc_spark_of_ionarAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiCheckTimer = 2 * IN_MILLISECONDS;
}
InstanceScript* instance;
uint32 uiCheckTimer;
void Reset() override
{
uiCheckTimer = 2*IN_MILLISECONDS;
Initialize();
me->SetReactState(REACT_PASSIVE);
}
@@ -74,9 +74,19 @@ public:
{
boss_lokenAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
m_uiArcLightning_Timer = 15000;
m_uiLightningNova_Timer = 20000;
m_uiResumePulsingShockwave_Timer = 1000;
m_uiHealthAmountModifier = 1;
}
InstanceScript* instance;
uint32 m_uiArcLightning_Timer;
@@ -87,11 +97,7 @@ public:
void Reset() override
{
m_uiArcLightning_Timer = 15000;
m_uiLightningNova_Timer = 20000;
m_uiResumePulsingShockwave_Timer = 1000;
m_uiHealthAmountModifier = 1;
Initialize();
instance->SetBossState(DATA_LOKEN, NOT_STARTED);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
@@ -78,9 +78,26 @@ public:
{
boss_volkhanAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
m_bIsStriking = false;
m_bHasTemper = false;
m_bCanShatterGolem = false;
m_uiPause_Timer = 3500;
m_uiShatteringStomp_Timer = 0;
m_uiShatter_Timer = 5000;
m_uiDelay_Timer = 1000;
m_uiSummonPhase = 0;
GolemsShattered = 0;
m_uiHealthAmountModifier = 1;
}
InstanceScript* instance;
std::list<uint64> m_lGolemGUIDList;
@@ -100,18 +117,7 @@ public:
void Reset() override
{
m_bIsStriking = false;
m_bHasTemper = false;
m_bCanShatterGolem = false;
m_uiPause_Timer = 3500;
m_uiShatteringStomp_Timer = 0;
m_uiShatter_Timer = 5000;
m_uiDelay_Timer = 1000;
m_uiSummonPhase = 0;
GolemsShattered = 0;
m_uiHealthAmountModifier = 1;
Initialize();
DespawnGolem();
m_lGolemGUIDList.clear();
@@ -362,7 +368,19 @@ public:
struct npc_molten_golemAI : public ScriptedAI
{
npc_molten_golemAI(Creature* creature) : ScriptedAI(creature) { }
npc_molten_golemAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
m_bIsFrozen = false;
m_uiBlast_Timer = 20000;
m_uiDeathDelay_Timer = 0;
m_uiImmolation_Timer = 5000;
}
bool m_bIsFrozen;
@@ -372,11 +390,7 @@ public:
void Reset() override
{
m_bIsFrozen = false;
m_uiBlast_Timer = 20000;
m_uiDeathDelay_Timer = 0;
m_uiImmolation_Timer = 5000;
Initialize();
}
void AttackStart(Unit* who) override
@@ -76,12 +76,20 @@ class boss_sjonnir : public CreatureScript
struct boss_sjonnirAI : public BossAI
{
boss_sjonnirAI(Creature* creature) : BossAI(creature, DATA_SJONNIR) { }
boss_sjonnirAI(Creature* creature) : BossAI(creature, DATA_SJONNIR)
{
Initialize();
}
void Initialize()
{
abuseTheOoze = 0;
}
void Reset() override
{
_Reset();
abuseTheOoze = 0;
Initialize();
}
void EnterCombat(Unit* who) override
@@ -211,11 +219,19 @@ class npc_malformed_ooze : public CreatureScript
struct npc_malformed_oozeAI : public ScriptedAI
{
npc_malformed_oozeAI(Creature* creature) : ScriptedAI(creature) { }
npc_malformed_oozeAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
_mergeTimer = 10000;
}
void Reset() override
{
_mergeTimer = 10000;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -138,10 +138,22 @@ public:
{
npc_tribuna_controllerAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
SetCombatMovement(false);
}
void Initialize()
{
uiKaddrakEncounterTimer = 1500;
uiMarnakEncounterTimer = 10000;
uiAbedneumEncounterTimer = 10000;
bKaddrakActivated = false;
bMarnakActivated = false;
bAbedneumActivated = false;
}
InstanceScript* instance;
uint32 uiKaddrakEncounterTimer;
@@ -156,13 +168,7 @@ public:
void Reset() override
{
uiKaddrakEncounterTimer = 1500;
uiMarnakEncounterTimer = 10000;
uiAbedneumEncounterTimer = 10000;
bKaddrakActivated = false;
bMarnakActivated = false;
bAbedneumActivated = false;
Initialize();
instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
@@ -290,9 +296,20 @@ public:
{
npc_brann_hosAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
bIsLowHP = false;
bIsBattle = false;
uiStep = 0;
uiPhaseTimer = 0;
uiControllerGUID = 0;
brannSparklinNews = true;
}
uint32 uiStep;
uint32 uiPhaseTimer;
@@ -309,12 +326,7 @@ public:
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
{
bIsLowHP = false;
bIsBattle = false;
uiStep = 0;
uiPhaseTimer = 0;
uiControllerGUID = 0;
brannSparklinNews = true;
Initialize();
DespawnDwarf();
@@ -301,17 +301,23 @@ class boss_algalon_the_observer : public CreatureScript
{
boss_algalon_the_observerAI(Creature* creature) : BossAI(creature, BOSS_ALGALON)
{
Initialize();
_firstPull = true;
_fedOnTears = false;
}
void Initialize()
{
_phaseTwo = false;
_fightWon = false;
_hasYelled = false;
}
void Reset() override
{
_Reset();
me->SetReactState(REACT_PASSIVE);
_phaseTwo = false;
_fightWon = false;
_hasYelled = false;
Initialize();
}
void KilledUnit(Unit* victim) override
@@ -715,13 +721,19 @@ class npc_living_constellation : public CreatureScript
{
npc_living_constellationAI(Creature* creature) : CreatureAI(creature)
{
Initialize();
}
void Initialize()
{
_isActive = false;
}
void Reset() override
{
_events.Reset();
_events.ScheduleEvent(EVENT_ARCANE_BARRAGE, 2500);
_isActive = false;
Initialize();
}
uint32 GetData(uint32 /*type*/) const override
@@ -858,6 +870,7 @@ class npc_brann_bronzebeard_algalon : public CreatureScript
{
npc_brann_bronzebeard_algalonAI(Creature* creature) : CreatureAI(creature)
{
_currentPoint = 0;
}
void DoAction(int32 action) override
@@ -138,14 +138,22 @@ class boss_steelbreaker : public CreatureScript
struct boss_steelbreakerAI : public BossAI
{
boss_steelbreakerAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON) { }
boss_steelbreakerAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
{
Initialize();
}
void Initialize()
{
phase = 0;
}
uint32 phase;
void Reset() override
{
_Reset();
phase = 0;
Initialize();
me->RemoveAllAuras();
}
@@ -275,14 +283,22 @@ class boss_runemaster_molgeim : public CreatureScript
struct boss_runemaster_molgeimAI : public BossAI
{
boss_runemaster_molgeimAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON) { }
boss_runemaster_molgeimAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
{
Initialize();
}
void Initialize()
{
phase = 0;
}
uint32 phase;
void Reset() override
{
_Reset();
phase = 0;
Initialize();
me->RemoveAllAuras();
}
@@ -432,14 +448,22 @@ class boss_stormcaller_brundir : public CreatureScript
struct boss_stormcaller_brundirAI : public BossAI
{
boss_stormcaller_brundirAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON) { }
boss_stormcaller_brundirAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
{
Initialize();
}
void Initialize()
{
phase = 0;
}
uint32 phase;
void Reset() override
{
_Reset();
phase = 0;
Initialize();
me->RemoveAllAuras();
me->SetDisableGravity(false);
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); // Should be interruptable unless overridden by spell (Overload)
@@ -107,15 +107,21 @@ class boss_auriaya : public CreatureScript
{
boss_auriayaAI(Creature* creature) : BossAI(creature, BOSS_AURIAYA)
{
Initialize();
}
void Initialize()
{
DefenderGUID = 0;
defenderLives = 8;
crazyCatLady = true;
nineLives = false;
}
void Reset() override
{
_Reset();
DefenderGUID = 0;
defenderLives = 8;
crazyCatLady = true;
nineLives = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -226,14 +226,12 @@ class boss_flame_leviathan : public CreatureScript
{
boss_flame_leviathanAI(Creature* creature) : BossAI(creature, BOSS_LEVIATHAN), vehicle(creature->GetVehicleKit())
{
Initialize();
_pursueTarget = 0;
}
void InitializeAI() override
void Initialize()
{
ASSERT(vehicle);
if (!me->isDead())
Reset();
ActiveTowersCount = 4;
Shutdown = 0;
ActiveTowers = false;
@@ -243,6 +241,15 @@ class boss_flame_leviathan : public CreatureScript
towerOfFrost = false;
Shutout = true;
Unbroken = true;
}
void InitializeAI() override
{
ASSERT(vehicle);
if (!me->isDead())
Reset();
Initialize();
DoCast(SPELL_INVIS_AND_STEALTH_DETECT);
@@ -634,13 +641,19 @@ class boss_flame_leviathan_defense_cannon : public CreatureScript
{
boss_flame_leviathan_defense_cannonAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
NapalmTimer = 5 * IN_MILLISECONDS;
}
uint32 NapalmTimer;
void Reset() override
{
NapalmTimer = 5*IN_MILLISECONDS;
Initialize();
DoCast(me, AURA_STEALTH_DETECTION);
}
@@ -781,14 +794,20 @@ class npc_mechanolift : public CreatureScript
{
npc_mechanoliftAI(Creature* creature) : PassiveAI(creature)
{
Initialize();
ASSERT(me->GetVehicleKit());
}
void Initialize()
{
MoveTimer = 0;
}
uint32 MoveTimer;
void Reset() override
{
MoveTimer = 0;
Initialize();
me->GetMotionMaster()->MoveRandom(50);
}
@@ -956,11 +975,17 @@ public:
{
npc_mimirons_infernoAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->CastSpell(me, AURA_DUMMY_YELLOW, true);
me->SetReactState(REACT_PASSIVE);
}
void Initialize()
{
infernoTimer = 2000;
}
void WaypointReached(uint32 /*waypointId*/) override
{
@@ -968,7 +993,7 @@ public:
void Reset() override
{
infernoTimer = 2000;
Initialize();
}
uint32 infernoTimer;
@@ -1047,14 +1072,20 @@ class npc_freyas_ward : public CreatureScript
{
npc_freyas_wardAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
me->CastSpell(me, AURA_DUMMY_GREEN, true);
}
void Initialize()
{
summonTimer = 5000;
}
uint32 summonTimer;
void Reset() override
{
summonTimer = 5000;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -1090,14 +1121,20 @@ class npc_freya_ward_summon : public CreatureScript
{
npc_freya_ward_summonAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
creature->GetMotionMaster()->MoveRandom(100);
}
void Initialize()
{
lashTimer = 5000;
}
uint32 lashTimer;
void Reset() override
{
lashTimer = 5000;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -267,7 +267,35 @@ class boss_freya : public CreatureScript
struct boss_freyaAI : public BossAI
{
boss_freyaAI(Creature* creature) : BossAI(creature, BOSS_FREYA) { }
boss_freyaAI(Creature* creature) : BossAI(creature, BOSS_FREYA)
{
Initialize();
memset(elementalTimer, 0, sizeof(elementalTimer));
diffTimer = 0;
attunedToNature = 0;
}
void Initialize()
{
trioWaveCount = 0;
trioWaveController = 0;
waveCount = 0;
elderCount = 0;
for (uint8 i = 0; i < 3; ++i)
for (uint8 n = 0; n < 2; ++n)
ElementalGUID[i][n] = 0;
for (uint8 i = 0; i < 6; ++i)
for (uint8 n = 0; n < 2; ++n)
deforestation[i][n] = 0;
for (uint8 n = 0; n < 2; ++n)
{
checkElementalAlive[n] = true;
trioDefeated[n] = false;
}
for (uint8 n = 0; n < 3; ++n)
random[n] = false;
}
uint64 ElementalGUID[3][2];
@@ -287,24 +315,7 @@ class boss_freya : public CreatureScript
void Reset() override
{
_Reset();
trioWaveCount = 0;
trioWaveController = 0;
waveCount = 0;
elderCount = 0;
for (uint8 i = 0; i < 3; ++i)
for (uint8 n = 0; n < 2; ++n)
ElementalGUID[i][n] = 0;
for (uint8 i = 0; i < 6; ++i)
for (uint8 n = 0; n < 2; ++n)
deforestation[i][n] = 0;
for (uint8 n = 0; n < 2; ++n)
{
checkElementalAlive[n] = true;
trioDefeated[n] = false;
}
for (uint8 n = 0; n < 3; ++n)
random[n] = false;
Initialize();
}
void KilledUnit(Unit* who) override
@@ -689,8 +700,6 @@ class boss_elder_brightleaf : public CreatureScript
events.ScheduleEvent(EVENT_SOLAR_FLARE, urand(5000, 7000));
events.ScheduleEvent(EVENT_UNSTABLE_SUN_BEAM, urand(7000, 12000));
events.ScheduleEvent(EVENT_FLUX, 5000);
elderCount = 0;
lumberjack = false;
}
void KilledUnit(Unit* who) override
@@ -758,9 +767,6 @@ class boss_elder_brightleaf : public CreatureScript
}
}
if (lumberjack)
lumberjackTimer += diff;
DoMeleeAttackIfReady();
}
@@ -768,21 +774,12 @@ class boss_elder_brightleaf : public CreatureScript
{
switch (action)
{
case ACTION_ELDER_DEATH:
++elderCount;
lumberjack = true;
break;
case ACTION_ELDER_FREYA_KILLED:
me->DespawnOrUnsummon(10000);
_JustDied();
break;
}
}
private:
uint32 lumberjackTimer;
uint8 elderCount;
bool lumberjack;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -810,8 +807,6 @@ class boss_elder_stonebark : public CreatureScript
events.ScheduleEvent(EVENT_TREMOR, urand(10000, 12000));
events.ScheduleEvent(EVENT_FISTS, urand(25000, 35000));
events.ScheduleEvent(EVENT_BARK, urand(37500, 40000));
elderCount = 0;
lumberjack = false;
}
void KilledUnit(Unit* who) override
@@ -885,9 +880,6 @@ class boss_elder_stonebark : public CreatureScript
}
}
if (lumberjack)
lumberjackTimer += diff;
DoMeleeAttackIfReady();
}
@@ -895,21 +887,12 @@ class boss_elder_stonebark : public CreatureScript
{
switch (action)
{
case ACTION_ELDER_DEATH:
++elderCount;
lumberjack = true;
break;
case ACTION_ELDER_FREYA_KILLED:
me->DespawnOrUnsummon(10000);
_JustDied();
break;
}
}
private:
uint32 lumberjackTimer;
uint8 elderCount;
bool lumberjack;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -937,8 +920,6 @@ class boss_elder_ironbranch : public CreatureScript
events.ScheduleEvent(EVENT_IMPALE, urand(18000, 22000));
events.ScheduleEvent(EVENT_IRON_ROOTS, urand(12000, 17000));
events.ScheduleEvent(EVENT_THORN_SWARM, urand(7500, 12500));
elderCount = 0;
lumberjack = false;
}
void KilledUnit(Unit* who) override
@@ -999,9 +980,6 @@ class boss_elder_ironbranch : public CreatureScript
}
}
if (lumberjack)
lumberjackTimer += diff;
DoMeleeAttackIfReady();
}
@@ -1009,21 +987,12 @@ class boss_elder_ironbranch : public CreatureScript
{
switch (action)
{
case ACTION_ELDER_DEATH:
++elderCount;
lumberjack = true;
break;
case ACTION_ELDER_FREYA_KILLED:
me->DespawnOrUnsummon(10000);
_JustDied();
break;
}
}
private:
uint32 lumberjackTimer;
uint8 elderCount;
bool lumberjack;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1041,13 +1010,19 @@ class npc_detonating_lasher : public CreatureScript
{
npc_detonating_lasherAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
}
void Initialize()
{
lashTimer = 5000;
changeTargetTimer = 7500;
}
void Reset() override
{
lashTimer = 5000;
changeTargetTimer = 7500;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -1099,14 +1074,22 @@ class npc_ancient_water_spirit : public CreatureScript
{
npc_ancient_water_spiritAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = me->GetInstanceScript();
if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA)))
waveCount = ENSURE_AI(boss_freya::boss_freyaAI, Freya->AI())->trioWaveCount;
else
waveCount = 0;
}
void Initialize()
{
tidalWaveTimer = 10000;
}
void Reset() override
{
tidalWaveTimer = 10000;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -1159,15 +1142,23 @@ class npc_storm_lasher : public CreatureScript
{
npc_storm_lasherAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = me->GetInstanceScript();
if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA)))
waveCount = ENSURE_AI(boss_freya::boss_freyaAI, Freya->AI())->trioWaveCount;
else
waveCount = 0;
}
void Initialize()
{
lightningLashTimer = 10000;
stormboltTimer = 5000;
}
void Reset() override
{
lightningLashTimer = 10000;
stormboltTimer = 5000;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -1229,6 +1220,8 @@ class npc_snaplasher : public CreatureScript
instance = me->GetInstanceScript();
if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA)))
waveCount = ENSURE_AI(boss_freya::boss_freyaAI, Freya->AI())->trioWaveCount;
else
waveCount = 0;
}
void UpdateAI(uint32 /*diff*/) override
@@ -1271,12 +1264,18 @@ class npc_ancient_conservator : public CreatureScript
{
npc_ancient_conservatorAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
natureFuryTimer = 7500;
healthySporeTimer = 3500;
}
void Reset() override
{
natureFuryTimer = 7500;
healthySporeTimer = 3500;
Initialize();
SummonHealthySpores(2);
}
@@ -105,6 +105,15 @@ class boss_general_vezax : public CreatureScript
{
boss_general_vezaxAI(Creature* creature) : BossAI(creature, BOSS_VEZAX)
{
Initialize();
}
void Initialize()
{
shadowDodger = true;
smellSaronite = true;
animusDead = false;
vaporCount = 0;
}
bool shadowDodger;
@@ -116,10 +125,7 @@ class boss_general_vezax : public CreatureScript
{
_Reset();
shadowDodger = true;
smellSaronite = true;
animusDead = false;
vaporCount = 0;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -181,11 +181,18 @@ class npc_flash_freeze : public CreatureScript
{
npc_flash_freezeAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = me->GetInstanceScript();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
}
void Initialize()
{
targetGUID = 0;
checkDespawnTimer = 1000;
}
InstanceScript* instance;
uint64 targetGUID;
@@ -193,8 +200,7 @@ class npc_flash_freeze : public CreatureScript
void Reset() override
{
targetGUID = 0;
checkDespawnTimer = 1000;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -312,9 +318,19 @@ class boss_hodir : public CreatureScript
{
boss_hodirAI(Creature* creature) : BossAI(creature, BOSS_HODIR)
{
Initialize();
me->SetReactState(REACT_PASSIVE);
}
void Initialize()
{
gettingColdInHereTimer = 0;
gettingColdInHere = false;
cheeseTheFreeze = false;
iHaveTheCoolestFriends = false;
iCouldSayThatThisCacheWasRare = false;
}
uint32 gettingColdInHereTimer;
bool gettingColdInHere;
@@ -324,11 +340,7 @@ class boss_hodir : public CreatureScript
void Reset() override
{
gettingColdInHereTimer = 0;
gettingColdInHere = false;
cheeseTheFreeze = false;
iHaveTheCoolestFriends = false;
iCouldSayThatThisCacheWasRare = false;
Initialize();
_Reset();
me->SetReactState(REACT_PASSIVE);
@@ -526,16 +538,22 @@ class npc_icicle : public CreatureScript
{
npc_icicleAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
}
void Initialize()
{
icicleTimer = 2500;
}
uint32 icicleTimer;
void Reset() override
{
icicleTimer = 2500;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -574,16 +592,22 @@ class npc_snowpacked_icicle : public CreatureScript
{
npc_snowpacked_icicleAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
me->SetReactState(REACT_PASSIVE);
}
void Initialize()
{
despawnTimer = 12000;
}
uint32 despawnTimer;
void Reset() override
{
despawnTimer = 12000;
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -118,9 +118,17 @@ class boss_ignis : public CreatureScript
{
boss_ignis_AI(Creature* creature) : BossAI(creature, BOSS_IGNIS), _vehicle(me->GetVehicleKit())
{
Initialize();
ASSERT(_vehicle);
}
void Initialize()
{
_slagPotGUID = 0;
_shattered = false;
_firstConstructKill = 0;
}
void Reset() override
{
_Reset();
@@ -140,9 +148,7 @@ class boss_ignis : public CreatureScript
events.ScheduleEvent(EVENT_CONSTRUCT, 15000);
events.ScheduleEvent(EVENT_END_POT, 40000);
events.ScheduleEvent(EVENT_BERSERK, 480000);
_slagPotGUID = 0;
_shattered = false;
_firstConstructKill = 0;
Initialize();
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVEMENT_IGNIS_START_EVENT);
}
@@ -298,12 +304,18 @@ class npc_iron_construct : public CreatureScript
{
npc_iron_constructAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
{
Initialize();
creature->SetReactState(REACT_PASSIVE);
}
void Initialize()
{
_brittled = false;
}
void Reset() override
{
_brittled = false;
Initialize();
}
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
@@ -365,12 +377,19 @@ class npc_scorch_ground : public CreatureScript
{
npc_scorch_groundAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE |UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
creature->SetDisplayId(16925); //model 2 in db cannot overwrite wdb fields
}
void MoveInLineOfSight(Unit* who) override
void Initialize()
{
_heat = false;
_constructGUID = 0;
_heatTimer = 0;
}
void MoveInLineOfSight(Unit* who) override
{
if (!_heat)
{
@@ -387,10 +406,8 @@ class npc_scorch_ground : public CreatureScript
void Reset() override
{
_heat = false;
Initialize();
DoCast(me, SPELL_GROUND);
_constructGUID = 0;
_heatTimer = 0;
}
void UpdateAI(uint32 uiDiff) override
@@ -327,8 +327,19 @@ class boss_razorscale : public CreatureScript
{
boss_razorscaleAI(Creature* creature) : BossAI(creature, BOSS_RAZORSCALE)
{
Initialize();
// Do not let Razorscale be affected by Battle Shout buff
me->ApplySpellImmune(0, IMMUNITY_ID, (SPELL_BATTLE_SHOUT), true);
FlyCount = 0;
EnrageTimer = 0;
Enraged = false;
phase = PHASE_GROUND;
}
void Initialize()
{
PermaGround = false;
HarpoonCounter = 0;
}
Phases phase;
@@ -345,8 +356,7 @@ class boss_razorscale : public CreatureScript
me->SetCanFly(true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
PermaGround = false;
HarpoonCounter = 0;
Initialize();
if (Creature* commander = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_EXPEDITION_COMMANDER)))
commander->AI()->DoAction(ACTION_COMMANDER_RESET);
}
@@ -594,7 +604,16 @@ class npc_expedition_commander : public CreatureScript
{
npc_expedition_commanderAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = me->GetInstanceScript();
memset(Engineer, 0, sizeof(Engineer));
memset(Defender, 0, sizeof(Defender));
}
void Initialize()
{
AttackStartTimer = 0;
Phase = 0;
Greet = false;
}
@@ -604,14 +623,12 @@ class npc_expedition_commander : public CreatureScript
bool Greet;
uint32 AttackStartTimer;
uint8 Phase;
Creature* Engineer[4];
Creature* Defender[4];
uint64 Engineer[4];
uint64 Defender[4];
void Reset() override
{
AttackStartTimer = 0;
Phase = 0;
Greet = false;
Initialize();
summons.clear();
}
@@ -659,31 +676,40 @@ class npc_expedition_commander : public CreatureScript
case 2:
for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
{
Engineer[n] = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
Engineer[n]->SetWalk(false);
Engineer[n]->SetSpeed(MOVE_RUN, 0.5f);
Engineer[n]->SetHomePosition(PosEngRepair[n]);
Engineer[n]->GetMotionMaster()->MoveTargetedHome();
if (Creature* summonedEngineer = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000))
{
summonedEngineer->SetWalk(false);
summonedEngineer->SetSpeed(MOVE_RUN, 0.5f);
summonedEngineer->SetHomePosition(PosEngRepair[n]);
summonedEngineer->GetMotionMaster()->MoveTargetedHome();
Engineer[n] = summonedEngineer->GetGUID();
}
}
Engineer[0]->AI()->Talk(SAY_AGGRO_3);
if (Creature* firstSummon = ObjectAccessor::GetCreature(*me, Engineer[0]))
firstSummon->AI()->Talk(SAY_AGGRO_3);
Phase = 3;
AttackStartTimer = 14000;
break;
case 3:
for (uint8 n = 0; n < 4; n++)
{
Defender[n] = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
Defender[n]->SetWalk(false);
Defender[n]->SetHomePosition(PosDefCombat[n]);
Defender[n]->GetMotionMaster()->MoveTargetedHome();
if (Creature* summonedDefender = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000))
{
summonedDefender->SetWalk(false);
summonedDefender->SetHomePosition(PosDefCombat[n]);
summonedDefender->GetMotionMaster()->MoveTargetedHome();
Defender[n] = summonedDefender->GetGUID();
}
}
Phase = 4;
break;
case 4:
for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
Engineer[n]->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
if (Creature* summonedEngineer = ObjectAccessor::GetCreature(*me, Engineer[n]))
summonedEngineer->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
for (uint8 n = 0; n < 4; ++n)
Defender[n]->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
if (Creature* summonedDefender = ObjectAccessor::GetCreature(*me, Defender[n]))
summonedDefender->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
Talk(SAY_AGGRO_2);
AttackStartTimer = 16000;
Phase = 5;
@@ -694,7 +720,8 @@ class npc_expedition_commander : public CreatureScript
Razorscale->AI()->DoAction(ACTION_EVENT_START);
me->SetInCombatWith(Razorscale);
}
Engineer[0]->AI()->Talk(SAY_AGGRO_1);
if (Creature* firstEngineer = ObjectAccessor::GetCreature(*me, Engineer[0]))
firstEngineer->AI()->Talk(SAY_AGGRO_1);
Phase = 6;
break;
}
@@ -748,10 +775,20 @@ class npc_mole_machine_trigger : public CreatureScript
{
npc_mole_machine_triggerAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
SetCombatMovement(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
}
void Initialize()
{
SummonGobTimer = 2000;
SummonNpcTimer = 6000;
DissapearTimer = 10000;
GobSummoned = false;
NpcSummoned = false;
}
uint32 SummonGobTimer;
uint32 SummonNpcTimer;
uint32 DissapearTimer;
@@ -760,11 +797,7 @@ class npc_mole_machine_trigger : public CreatureScript
void Reset() override
{
SummonGobTimer = 2000;
SummonNpcTimer = 6000;
DissapearTimer = 10000;
GobSummoned = false;
NpcSummoned = false;
Initialize();
}
void UpdateAI(uint32 Diff) override
@@ -851,15 +884,23 @@ class npc_darkrune_watcher : public CreatureScript
struct npc_darkrune_watcherAI : public ScriptedAI
{
npc_darkrune_watcherAI(Creature* creature) : ScriptedAI(creature){ }
npc_darkrune_watcherAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
ChainTimer = urand(10000, 15000);
LightTimer = urand(1000, 3000);
}
uint32 ChainTimer;
uint32 LightTimer;
void Reset() override
{
ChainTimer = urand(10000, 15000);
LightTimer = urand(1000, 3000);
Initialize();
}
void UpdateAI(uint32 Diff) override
@@ -900,14 +941,22 @@ class npc_darkrune_guardian : public CreatureScript
struct npc_darkrune_guardianAI : public ScriptedAI
{
npc_darkrune_guardianAI(Creature* creature) : ScriptedAI(creature){ }
npc_darkrune_guardianAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
StormTimer = urand(3000, 6000);
killedByBreath = false;
}
uint32 StormTimer;
void Reset() override
{
StormTimer = urand(3000, 6000);
killedByBreath = false;
Initialize();
}
uint32 GetData(uint32 type) const override
@@ -955,7 +1004,17 @@ class npc_darkrune_sentinel : public CreatureScript
struct npc_darkrune_sentinelAI : public ScriptedAI
{
npc_darkrune_sentinelAI(Creature* creature) : ScriptedAI(creature){ }
npc_darkrune_sentinelAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
HeroicTimer = urand(4000, 8000);
WhirlTimer = urand(20000, 25000);
ShoutTimer = urand(15000, 30000);
}
uint32 HeroicTimer;
uint32 WhirlTimer;
@@ -963,9 +1022,7 @@ class npc_darkrune_sentinel : public CreatureScript
void Reset() override
{
HeroicTimer = urand(4000, 8000);
WhirlTimer = urand(20000, 25000);
ShoutTimer = urand(15000, 30000);
Initialize();
}
void UpdateAI(uint32 Diff) override
@@ -196,6 +196,18 @@ class boss_xt002 : public CreatureScript
{
boss_xt002_AI(Creature* creature) : BossAI(creature, BOSS_XT002)
{
Initialize();
_transferHealth = 0;
}
void Initialize()
{
_healthRecovered = false;
_gravityBombCasualty = false;
_hardMode = false;
_phase = 1;
_heartExposed = 0;
}
void Reset() override
@@ -206,12 +218,7 @@ class boss_xt002 : public CreatureScript
me->SetReactState(REACT_AGGRESSIVE);
DoCast(me, SPELL_STAND);
_healthRecovered = false;
_gravityBombCasualty = false;
_hardMode = false;
_phase = 1;
_heartExposed = 0;
Initialize();
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MUST_DECONSTRUCT_FASTER);
}
@@ -489,14 +496,20 @@ class npc_scrapbot : public CreatureScript
{
npc_scrapbotAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
_instance = me->GetInstanceScript();
}
void Initialize()
{
_rangeCheckTimer = 500;
}
void Reset() override
{
me->SetReactState(REACT_PASSIVE);
_rangeCheckTimer = 500;
Initialize();
if (Creature* pXT002 = ObjectAccessor::GetCreature(*me, _instance->GetData64(BOSS_XT002)))
me->GetMotionMaster()->MoveFollow(pXT002, 0.0f, 0.0f);
@@ -546,14 +559,20 @@ class npc_pummeller : public CreatureScript
{
npc_pummellerAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
_instance = creature->GetInstanceScript();
}
void Reset() override
void Initialize()
{
_arcingSmashTimer = TIMER_ARCING_SMASH;
_trampleTimer = TIMER_TRAMPLE;
_uppercutTimer = TIMER_UPPERCUT;
}
void Reset() override
{
Initialize();
if (Creature* xt002 = ObjectAccessor::GetCreature(*me, _instance->GetData64(BOSS_XT002)))
{
@@ -647,12 +666,18 @@ class npc_boombot : public CreatureScript
{
npc_boombotAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
_instance = creature->GetInstanceScript();
}
void Initialize()
{
_boomed = false;
}
void Reset() override
{
_boomed = false;
Initialize();
DoCast(SPELL_AURA_BOOMBOT); // For achievement
@@ -726,12 +751,18 @@ class npc_life_spark : public CreatureScript
{
npc_life_sparkAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
_shockTimer = 0; // first one is immediate.
}
void Reset() override
{
DoCast(me, SPELL_STATIC_CHARGED);
_shockTimer = 0; // first one is immediate.
Initialize();
}
void UpdateAI(uint32 diff) override
@@ -427,9 +427,17 @@ class boss_voice_of_yogg_saron : public CreatureScript
{
boss_voice_of_yogg_saronAI(Creature* creature) : BossAI(creature, BOSS_YOGG_SARON)
{
Initialize();
SetCombatMovement(false);
}
void Initialize()
{
_guardiansCount = 0;
_guardianTimer = 20000;
_illusionShattered = false;
}
void MoveInLineOfSight(Unit* who) override
{
@@ -467,9 +475,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
instance->SetData(DATA_DRIVE_ME_CRAZY, uint32(true));
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
_guardiansCount = 0;
_guardianTimer = 20000;
_illusionShattered = false;
Initialize();
bool clockwise = false;
std::list<TempSummon*> clouds;
@@ -1014,7 +1020,10 @@ class boss_brain_of_yogg_saron : public CreatureScript
struct boss_brain_of_yogg_saronAI : public PassiveAI
{
boss_brain_of_yogg_saronAI(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()), _summons(creature) { }
boss_brain_of_yogg_saronAI(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()), _summons(creature)
{
_tentaclesKilled = 0;
}
void Reset() override
{
@@ -1953,7 +1962,7 @@ class spell_yogg_saron_target_selectors : public SpellScriptLoader // 63744,
class SanityReduction : public SpellScript
{
public:
SanityReduction() : SpellScript() { }
SanityReduction() : SpellScript(), _stacks(0) { }
SanityReduction(uint8 stacks) : SpellScript(), _stacks(stacks) { }
void RemoveSanity(SpellEffIndex /*effIndex*/)
@@ -264,6 +264,9 @@ class npc_annhylde_the_caller : public CreatureScript
{
npc_annhylde_the_callerAI(Creature* creature) : ScriptedAI(creature)
{
x = 0.f;
y = 0.f;
z = 0.f;
_instance = creature->GetInstanceScript();
}
@@ -115,7 +115,15 @@ class boss_keleseth : public CreatureScript
struct boss_kelesethAI : public BossAI
{
boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCE_KELESETH) { }
boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCE_KELESETH)
{
Initialize();
}
void Initialize()
{
onTheRocks = true;
}
void Reset() override
{
@@ -124,7 +132,7 @@ class boss_keleseth : public CreatureScript
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14, 19)*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS);
onTheRocks = true;
Initialize();
}
void EnterCombat(Unit* who) override
@@ -92,20 +92,11 @@ public:
{
boss_palehoofAI(Creature* creature) : BossAI(creature, DATA_GORTOK_PALEHOOF)
{
Initialize();
}
uint32 uiArcingSmashTimer;
uint32 uiImpaleTimer;
uint32 uiWhiteringRoarTimer;
uint32 uiWaitingTimer;
Phase currentPhase;
uint8 AddCount;
Phase Sequence[4];
void Reset() override
void Initialize()
{
_Reset();
/// There is a good reason to store them like this, we are going to shuffle the order.
for (uint32 i = PHASE_FRENZIED_WORGEN; i < PHASE_GORTOK_PALEHOOF; ++i)
Sequence[i] = Phase(i);
@@ -117,11 +108,25 @@ public:
uiImpaleTimer = 12000;
uiWhiteringRoarTimer = 10000;
me->GetMotionMaster()->MoveTargetedHome();
AddCount = 0;
currentPhase = PHASE_NONE;
}
uint32 uiArcingSmashTimer;
uint32 uiImpaleTimer;
uint32 uiWhiteringRoarTimer;
Phase currentPhase;
uint8 AddCount;
Phase Sequence[4];
void Reset() override
{
_Reset();
Initialize();
me->GetMotionMaster()->MoveTargetedHome();
for (uint8 i = DATA_FRENZIED_WORGEN; i <= DATA_FEROCIOUS_RHINO; ++i)
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetData64(i)))
@@ -263,9 +268,17 @@ public:
{
npc_ravenous_furbolgAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiChainLightingTimer = 5000;
uiCrazedTimer = 10000;
uiTerrifyingRoarTimer = 15000;
}
uint32 uiChainLightingTimer;
uint32 uiCrazedTimer;
uint32 uiTerrifyingRoarTimer;
@@ -274,9 +287,7 @@ public:
void Reset() override
{
uiChainLightingTimer = 5000;
uiCrazedTimer = 10000;
uiTerrifyingRoarTimer = 15000;
Initialize();
me->GetMotionMaster()->MoveTargetedHome();
@@ -371,9 +382,17 @@ public:
{
npc_frenzied_worgenAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiMortalWoundTimer = 5000;
uiEnrage1Timer = 15000;
uiEnrage2Timer = 10000;
}
uint32 uiMortalWoundTimer;
uint32 uiEnrage1Timer;
uint32 uiEnrage2Timer;
@@ -382,9 +401,7 @@ public:
void Reset() override
{
uiMortalWoundTimer = 5000;
uiEnrage1Timer = 15000;
uiEnrage2Timer = 10000;
Initialize();
me->GetMotionMaster()->MoveTargetedHome();
@@ -481,9 +498,17 @@ public:
{
npc_ferocious_rhinoAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiStompTimer = 10000;
uiGoreTimer = 15000;
uiGrievousWoundTimer = 20000;
}
uint32 uiStompTimer;
uint32 uiGoreTimer;
uint32 uiGrievousWoundTimer;
@@ -492,9 +517,7 @@ public:
void Reset() override
{
uiStompTimer = 10000;
uiGoreTimer = 15000;
uiGrievousWoundTimer = 20000;
Initialize();
me->GetMotionMaster()->MoveTargetedHome();
@@ -596,9 +619,17 @@ public:
{
npc_massive_jormungarAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiAcidSpitTimer = 3000;
uiAcidSplatterTimer = 12000;
uiPoisonBreathTimer = 10000;
}
uint32 uiAcidSpitTimer;
uint32 uiAcidSplatterTimer;
uint32 uiPoisonBreathTimer;
@@ -607,9 +638,7 @@ public:
void Reset() override
{
uiAcidSpitTimer = 3000;
uiAcidSplatterTimer = 12000;
uiPoisonBreathTimer = 10000;
Initialize();
me->GetMotionMaster()->MoveTargetedHome();
@@ -697,17 +726,23 @@ public:
{
npc_palehoof_orbAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
currentPhase = PHASE_NONE;
SummonTimer = 5000;
}
InstanceScript* instance;
uint32 SummonTimer;
Phase currentPhase;
void Reset() override
{
currentPhase = PHASE_NONE;
SummonTimer = 5000;
Initialize();
//! HACK: Creature's can't have MOVEMENTFLAG_FLYING
me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
me->RemoveAurasDueToSpell(SPELL_ORB_VISUAL);
@@ -169,8 +169,24 @@ public:
{
boss_skadiAI(Creature* creature) : ScriptedAI(creature), Summons(me)
{
Initialize();
instance = creature->GetInstanceScript();
m_uiGraufGUID = 0;
m_uiMovementTimer = 0;
m_uiSummonTimer = 0;
}
void Initialize()
{
m_uiCrushTimer = 8000;
m_uiPoisonedSpearTimer = 10000;
m_uiWhirlwindTimer = 20000;
m_uiMountTimer = 3000;
m_uiWaypointId = 0;
m_bSaidEmote = false;
m_uiSpellHitCount = 0;
Phase = SKADI;
}
InstanceScript* instance;
@@ -194,15 +210,7 @@ public:
{
triggersGUID.clear();
m_uiCrushTimer = 8000;
m_uiPoisonedSpearTimer = 10000;
m_uiWhirlwindTimer = 20000;
m_uiMountTimer = 3000;
m_uiWaypointId = 0;
m_bSaidEmote = false;
m_uiSpellHitCount = 0;
Phase = SKADI;
Initialize();
Summons.DespawnAll();
me->SetSpeed(MOVE_FLIGHT, 3.0f);
@@ -137,13 +137,20 @@ class boss_svala : public CreatureScript
{
boss_svalaAI(Creature* creature) : BossAI(creature, DATA_SVALA_SORROWGRAVE)
{
Initialize();
_introCompleted = false;
}
void Initialize()
{
_arthasGUID = 0;
_sacrificed = false;
}
void Reset() override
{
_Reset();
_sacrificed = false;
SetCombatMovement(true);
if (_introCompleted)
@@ -153,7 +160,7 @@ class boss_svala : public CreatureScript
me->SetDisableGravity(events.IsInPhase(NORMAL));
_arthasGUID = 0;
Initialize();
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
}
@@ -398,17 +405,23 @@ class npc_ritual_channeler : public CreatureScript
{
npc_ritual_channelerAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
SetCombatMovement(false);
}
void Initialize()
{
paralyzeTimer = 1600;
}
InstanceScript* instance;
uint32 paralyzeTimer;
void Reset() override
{
paralyzeTimer = 1600;
Initialize();
if (IsHeroic())
DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
@@ -514,16 +527,24 @@ class npc_scourge_hulk : public CreatureScript
struct npc_scourge_hulkAI : public ScriptedAI
{
npc_scourge_hulkAI(Creature* creature) : ScriptedAI(creature) { }
npc_scourge_hulkAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
mightyBlow = urand(4000, 9000);
volatileInfection = urand(10000, 14000);
killedByRitualStrike = false;
}
uint32 mightyBlow;
uint32 volatileInfection;
void Reset() override
{
mightyBlow = urand(4000, 9000);
volatileInfection = urand(10000, 14000);
killedByRitualStrike = false;
Initialize();
}
uint32 GetData(uint32 type) const override
@@ -102,6 +102,7 @@ public:
{
boss_ymironAI(Creature* creature) : BossAI(creature, DATA_KING_YMIRON)
{
Initialize();
for (int i = 0; i < 4; ++i)
m_uiActiveOrder[i] = i;
for (int i = 0; i < 3; ++i)
@@ -113,6 +114,35 @@ public:
}
}
void Initialize()
{
m_bIsWalking = false;
m_bIsPause = false;
m_bIsActiveWithBJORN = false;
m_bIsActiveWithHALDOR = false;
m_bIsActiveWithRANULF = false;
m_bIsActiveWithTORGYN = false;
kingsBane = true;
m_uiFetidRot_Timer = urand(8000, 13000);
m_uiBane_Timer = urand(18000, 23000);
m_uiDarkSlash_Timer = urand(28000, 33000);
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(60000, 45000);
m_uiPause_Timer = 0;
m_uiAbility_BJORN_Timer = 0;
m_uiAbility_HALDOR_Timer = 0;
m_uiAbility_RANULF_Timer = 0;
m_uiAbility_TORGYN_Timer = 0;
m_uiActivedNumber = 0;
m_uiHealthAmountModifier = 1;
m_uiHealthAmountMultipler = DUNGEON_MODE(20, 25);
m_uiActivedCreatureGUID = 0;
m_uiOrbGUID = 0;
}
bool m_bIsWalking;
bool m_bIsPause;
bool m_bIsActiveWithBJORN;
@@ -144,31 +174,7 @@ public:
void Reset() override
{
_Reset();
m_bIsWalking = false;
m_bIsPause = false;
m_bIsActiveWithBJORN = false;
m_bIsActiveWithHALDOR = false;
m_bIsActiveWithRANULF = false;
m_bIsActiveWithTORGYN = false;
kingsBane = true;
m_uiFetidRot_Timer = urand(8000, 13000);
m_uiBane_Timer = urand(18000, 23000);
m_uiDarkSlash_Timer = urand(28000, 33000);
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(60000, 45000);
m_uiPause_Timer = 0;
m_uiAbility_BJORN_Timer = 0;
m_uiAbility_HALDOR_Timer = 0;
m_uiAbility_RANULF_Timer = 0;
m_uiAbility_TORGYN_Timer = 0;
m_uiActivedNumber = 0;
m_uiHealthAmountModifier = 1;
m_uiHealthAmountMultipler = DUNGEON_MODE(20, 25);
m_uiActivedCreatureGUID = 0;
m_uiOrbGUID = 0;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -184,13 +184,19 @@ class npc_tempest_minion : public CreatureScript
{
npc_tempest_minionAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
OverchargedTimer = 0;
}
void Reset() override
{
events.Reset();
OverchargedTimer = 0;
Initialize();
}
void JustDied(Unit* /*killer*/) override
@@ -185,12 +185,18 @@ public:
{
npc_frozen_orbAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
done = false;
killTimer = 60000; // if after this time there is no victim -> destroy!
}
void Reset() override
{
done = false;
killTimer = 60000; // if after this time there is no victim -> destroy!
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -57,9 +57,19 @@ public:
{
boss_cyanigosaAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiArcaneVacuumTimer = 10000;
uiBlizzardTimer = 15000;
uiManaDestructionTimer = 30000;
uiTailSweepTimer = 20000;
uiUncontrollableEnergyTimer = 25000;
}
uint32 uiArcaneVacuumTimer;
uint32 uiBlizzardTimer;
uint32 uiManaDestructionTimer;
@@ -70,11 +80,7 @@ public:
void Reset() override
{
uiArcaneVacuumTimer = 10000;
uiBlizzardTimer = 15000;
uiManaDestructionTimer = 30000;
uiTailSweepTimer = 20000;
uiUncontrollableEnergyTimer = 25000;
Initialize();
instance->SetData(DATA_CYANIGOSA_EVENT, NOT_STARTED);
}
@@ -56,9 +56,19 @@ public:
{
boss_erekemAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiBloodlustTimer = 15000;
uiChainHealTimer = 0;
uiEarthShockTimer = urand(2000, 8000);
uiLightningBoltTimer = urand(5000, 10000);
uiEarthShieldTimer = 20000;
}
uint32 uiBloodlustTimer;
uint32 uiChainHealTimer;
uint32 uiEarthShockTimer;
@@ -69,11 +79,7 @@ public:
void Reset() override
{
uiBloodlustTimer = 15000;
uiChainHealTimer = 0;
uiEarthShockTimer = urand(2000, 8000);
uiLightningBoltTimer = urand(5000, 10000);
uiEarthShieldTimer = 20000;
Initialize();
if (instance->GetData(DATA_WAVE_COUNT) == 6)
instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
else if (instance->GetData(DATA_WAVE_COUNT) == 12)
@@ -264,9 +270,17 @@ public:
{
npc_erekem_guardAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiStrikeTimer = urand(4000, 8000);
uiHowlingScreechTimer = urand(8000, 13000);
uiGushingWoundTimer = urand(1000, 3000);
}
uint32 uiGushingWoundTimer;
uint32 uiHowlingScreechTimer;
uint32 uiStrikeTimer;
@@ -275,9 +289,7 @@ public:
void Reset() override
{
uiStrikeTimer = urand(4000, 8000);
uiHowlingScreechTimer = urand(8000, 13000);
uiGushingWoundTimer = urand(1000, 3000);
Initialize();
}
void AttackStart(Unit* who) override
@@ -85,9 +85,19 @@ public:
{
boss_ichoronAI(Creature* creature) : ScriptedAI(creature), m_waterElements(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
bIsExploded = false;
bIsFrenzy = false;
dehydration = true;
uiBubbleCheckerTimer = 1000;
uiWaterBoltVolleyTimer = urand(10000, 15000);
}
bool bIsExploded;
bool bIsFrenzy;
bool dehydration;
@@ -101,11 +111,7 @@ public:
void Reset() override
{
bIsExploded = false;
bIsFrenzy = false;
dehydration = true;
uiBubbleCheckerTimer = 1000;
uiWaterBoltVolleyTimer = urand(10000, 15000);
Initialize();
me->SetVisible(true);
DespawnWaterElements();
@@ -340,16 +346,22 @@ public:
{
npc_ichor_globuleAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiRangeCheck_Timer = 1000;
}
InstanceScript* instance;
uint32 uiRangeCheck_Timer;
void Reset() override
{
uiRangeCheck_Timer = 1000;
Initialize();
DoCast(me, SPELL_WATER_GLOBULE);
}