--HG--
branch : trunk
This commit is contained in:
Machiavelli
2009-06-10 08:45:45 +02:00
77 changed files with 1565 additions and 687 deletions
+63
View File
@@ -1707,3 +1707,66 @@ INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content
--
-- Below just for beautiful view in table, run at own desire
--
DELETE FROM `creature_ai_scripts` WHERE `creature_id` in (26796, 26798, 26929, 26928, 26930);
INSERT INTO `creature_ai_scripts` VALUES
-- Commander Stoutbeard
( 2679600, 26796, 4, 0, 100, 4, 0, 0, 0, 0, 28, 0, 47543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - crystal prison remove'),
( 2679601, 26796, 4, 0, 100, 4, 0, 0, 0, 0, 11, 31403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast battle shout'),
( 2679602, 26796, 0, 0, 100, 5, 3000, 3000, 11000, 15000, 11, 60067, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast charge'),
( 2679603, 26796, 0, 0, 100, 5, 6000, 8000, 19500, 25000, 11, 38618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast whirlwind'),
( 2679604, 26796, 0, 0, 100, 5, 13000, 13000, 45000, 55000, 11, 19134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast Frightening Shout'),
-- Commander Kolurg
( 2679800, 26798, 4, 0, 100, 4, 0, 0, 0, 0, 28, 0, 47543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - crystal prison remove'),
( 2679801, 26798, 4, 0, 100, 4, 0, 0, 0, 0, 11, 31403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast battle shout'),
( 2679802, 26798, 0, 0, 100, 5, 3000, 3000, 11000, 15000, 11, 60067, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast charge'),
( 2679803, 26798, 0, 0, 100, 5, 6000, 8000, 19500, 25000, 11, 38618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast whirlwind'),
( 2679804, 26798, 0, 0, 100, 5, 13000, 13000, 45000, 55000, 11, 19134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast Frightening Shout'),
-- Grand Magus Telestra Clone (Arcane)
( 2692901, 26929, 0, 0, 100, 7, 6000, 8000, 10000, 12000, 11, 47731, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra arcane - cast pollymorph critter'),
( 2692902, 26929, 0, 0, 100, 7, 15000, 16000, 15000, 16000, 11, 47736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra arcane - cast time stop'),
-- Grand Magus Telestra Clone (Fire)
( 2692801, 26928, 0, 0, 100, 3, 3000, 3000, 8000, 9000, 11, 47721, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast fire blast N'),
( 2692802, 26928, 0, 0, 100, 5, 3000, 3000, 8000, 9000, 11, 56939, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast fire blast H'),
( 2692803, 26928, 0, 0, 100, 3, 9000, 9000, 9500, 11500, 11, 47723, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast scorge N'),
( 2692804, 26928, 0, 0, 100, 5, 9000, 9000, 9500, 11500, 11, 56938, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast scorge H'),
-- Grand Magus Telestra Clone (Frost)
( 2693001, 26930, 0, 0, 100, 3, 3000, 3000, 8000, 9000, 11, 47729, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast ice bard N'),
( 2693002, 26930, 0, 0, 100, 5, 3000, 3000, 8000, 9000, 11, 56937, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast ice bard H'),
( 2693003, 26930, 0, 0, 100, 3, 9000, 9000, 15000, 16000, 11, 47727, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast blizzard N'),
( 2693004, 26930, 0, 0, 100, 5, 9000, 9000, 15000, 16000, 11, 56936, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast blizzard H');
-- Grand Magus Telestra
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576000,'You know what they say about curiosity.',13319,1,0,0,'grand magus telestra SAY_AGGRO'),
(-1576001,'Death becomes you!',13324,1,0,0,'grand magus telestra SAY_KILL'),
(-1576002,'Damn the... luck.',13320,1,0,0,'grand magus telestra SAY_DEATH'),
(-1576003,'Now to finish the job!',13323,1,0,0,'grand magus telestra SAY_MERGE'),
(-1576004,'There\'s plenty of me to go around.',13321,1,0,0,'grand magus telestra SAY_SPLIT_1'),
(-1576005,'I\'ll give you more than you can handle.',13322,1,0,0,'grand magus telestra SAY_SPLIT_2');
-- Anomalus
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576010,'Chaos beckons.',13186,1,0,0,'anomalus SAY_AGGRO'),
(-1576011,'Of course.',13187,1,0,0,'anomalus SAY_DEATH'),
(-1576012,'Reality... unwoven.',13188,1,0,0,'anomalus SAY_RIFT'),
(-1576013,'Indestructible.',13189,1,0,0,'anomalus SAY_SHIELD');
-- Ormorok the Tree-Shaper
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576020,'Noo!',13328,1,0,0,'ormorok SAY_AGGRO'),
(-1576021,'Aaggh!',13330,1,0,0,'ormorok SAY_DEATH'),
(-1576022,'Back!',13331,1,0,0,'ormorok SAY_REFLECT'),
(-1576023,'Bleed!',13332,1,0,0,'ormorok SAY_CRYSTAL_SPIKES'),
(-1576024,'Aaggh! Kill!',13329,1,0,0,'ormorok SAY_KILL');
-- Keristrasza
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576040,'Preserve? Why? There\'s no truth in it. No no no... only in the taking! I see that now!',13450,1,0,0,'keristrasza SAY_AGGRO'),
(-1576041,'Now we\'ve come to the truth!',13453,1,0,0,'keristrasza SAY_SLAY'),
(-1576042,'Finish it! FINISH IT! Kill me, or I swear by the Dragonqueen you\'ll never see daylight again!',13452,1,0,0,'keristrasza SAY_ENRAGE'),
(-1576043,'Dragonqueen... Life-Binder... preserve... me.',13454,1,0,0,'keristrasza SAY_DEATH'),
(-1576044,'Stay. Enjoy your final moments.',13451,1,0,0,'keristrasza SAY_CRYSTAL_NOVA');
+80
View File
@@ -0,0 +1,80 @@
-- Grand Magus Telestra
update `creature_template` set `ScriptName`='boss_magus_telestra' where `entry`=26731;
-- Anomalus
update `creature_template` set `ScriptName`='boss_anomalus' where `entry`=26763;
update `creature_template` set `ScriptName`='mob_chaotic_rift' where `entry`=26918;
-- Ormorok the Tree-Shaper
update `creature_template` set `ScriptName`='boss_ormorok' where `entry`=26794;
update `creature_template` set `ScriptName`='mob_crystal_spike' where `entry`=27099;
update `creature_template` set `ScriptName`='mob_crystalline_tangler' where `entry`=32665;
-- Keristrasza
update `creature_template` set `ScriptName`='boss_keristrasza' where `entry`=26723;
-- Instance script
update `instance_template` set `script`='instance_nexus' where `map`=576;
UPDATE creature_template set AIName = 'EventAI' where entry in (26796, 26798, 26929, 26928, 26930);
DELETE FROM `creature_ai_scripts` WHERE `creature_id` in (26796, 26798, 26929, 26928, 26930);
INSERT INTO `creature_ai_scripts` VALUES
-- Commander Stoutbeard
( 2679600, 26796, 4, 0, 100, 4, 0, 0, 0, 0, 28, 0, 47543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - crystal prison remove'),
( 2679601, 26796, 4, 0, 100, 4, 0, 0, 0, 0, 11, 31403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast battle shout'),
( 2679602, 26796, 0, 0, 100, 5, 3000, 3000, 11000, 15000, 11, 60067, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast charge'),
( 2679603, 26796, 0, 0, 100, 5, 6000, 8000, 19500, 25000, 11, 38618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast whirlwind'),
( 2679604, 26796, 0, 0, 100, 5, 13000, 13000, 45000, 55000, 11, 19134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast Frightening Shout'),
-- Commander Kolurg
( 2679800, 26798, 4, 0, 100, 4, 0, 0, 0, 0, 28, 0, 47543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - crystal prison remove'),
( 2679801, 26798, 4, 0, 100, 4, 0, 0, 0, 0, 11, 31403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast battle shout'),
( 2679802, 26798, 0, 0, 100, 5, 3000, 3000, 11000, 15000, 11, 60067, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast charge'),
( 2679803, 26798, 0, 0, 100, 5, 6000, 8000, 19500, 25000, 11, 38618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast whirlwind'),
( 2679804, 26798, 0, 0, 100, 5, 13000, 13000, 45000, 55000, 11, 19134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast Frightening Shout'),
-- Grand Magus Telestra Clone (Arcane)
( 2692901, 26929, 0, 0, 100, 7, 6000, 8000, 10000, 12000, 11, 47731, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra arcane - cast pollymorph critter'),
( 2692902, 26929, 0, 0, 100, 7, 15000, 16000, 15000, 16000, 11, 47736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra arcane - cast time stop'),
-- Grand Magus Telestra Clone (Fire)
( 2692801, 26928, 0, 0, 100, 3, 3000, 3000, 8000, 9000, 11, 47721, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast fire blast N'),
( 2692802, 26928, 0, 0, 100, 5, 3000, 3000, 8000, 9000, 11, 56939, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast fire blast H'),
( 2692803, 26928, 0, 0, 100, 3, 9000, 9000, 9500, 11500, 11, 47723, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast scorge N'),
( 2692804, 26928, 0, 0, 100, 5, 9000, 9000, 9500, 11500, 11, 56938, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast scorge H'),
-- Grand Magus Telestra Clone (Frost)
( 2693001, 26930, 0, 0, 100, 3, 3000, 3000, 8000, 9000, 11, 47729, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast ice bard N'),
( 2693002, 26930, 0, 0, 100, 5, 3000, 3000, 8000, 9000, 11, 56937, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast ice bard H'),
( 2693003, 26930, 0, 0, 100, 3, 9000, 9000, 15000, 16000, 11, 47727, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast blizzard N'),
( 2693004, 26930, 0, 0, 100, 5, 9000, 9000, 15000, 16000, 11, 56936, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast blizzard H');
-- Grand Magus Telestra
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576000,'You know what they say about curiosity.',13319,1,0,0,'grand magus telestra SAY_AGGRO'),
(-1576001,'Death becomes you!',13324,1,0,0,'grand magus telestra SAY_KILL'),
(-1576002,'Damn the... luck.',13320,1,0,0,'grand magus telestra SAY_DEATH'),
(-1576003,'Now to finish the job!',13323,1,0,0,'grand magus telestra SAY_MERGE'),
(-1576004,'There\'s plenty of me to go around.',13321,1,0,0,'grand magus telestra SAY_SPLIT_1'),
(-1576005,'I\'ll give you more than you can handle.',13322,1,0,0,'grand magus telestra SAY_SPLIT_2');
-- Anomalus
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576010,'Chaos beckons.',13186,1,0,0,'anomalus SAY_AGGRO'),
(-1576011,'Of course.',13187,1,0,0,'anomalus SAY_DEATH'),
(-1576012,'Reality... unwoven.',13188,1,0,0,'anomalus SAY_RIFT'),
(-1576013,'Indestructible.',13189,1,0,0,'anomalus SAY_SHIELD');
-- Ormorok the Tree-Shaper
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576020,'Noo!',13328,1,0,0,'ormorok SAY_AGGRO'),
(-1576021,'Aaggh!',13330,1,0,0,'ormorok SAY_DEATH'),
(-1576022,'Back!',13331,1,0,0,'ormorok SAY_REFLECT'),
(-1576023,'Bleed!',13332,1,0,0,'ormorok SAY_CRYSTAL_SPIKES'),
(-1576024,'Aaggh! Kill!',13329,1,0,0,'ormorok SAY_KILL');
-- Keristrasza
REPLACE INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(-1576040,'Preserve? Why? There\'s no truth in it. No no no... only in the taking! I see that now!',13450,1,0,0,'keristrasza SAY_AGGRO'),
(-1576041,'Now we\'ve come to the truth!',13453,1,0,0,'keristrasza SAY_SLAY'),
(-1576042,'Finish it! FINISH IT! Kill me, or I swear by the Dragonqueen you\'ll never see daylight again!',13452,1,0,0,'keristrasza SAY_ENRAGE'),
(-1576043,'Dragonqueen... Life-Binder... preserve... me.',13454,1,0,0,'keristrasza SAY_DEATH'),
(-1576044,'Stay. Enjoy your final moments.',13451,1,0,0,'keristrasza SAY_CRYSTAL_NOVA');
+55
View File
@@ -1072,4 +1072,59 @@ UPDATE `creature_template` SET `ScriptName`='mob_batrider' WHERE `entry`=14965;
UPDATE `creature_template` SET `ScriptName`='mob_shade_of_jindo' WHERE `entry`=14986;
UPDATE `creature_template` SET `ScriptName`='mob_ohgan' WHERE `entry`=14988;
-- Grand Magus Telestra
update `creature_template` set `ScriptName`='boss_magus_telestra' where `entry`=26731;
-- Anomalus
update `creature_template` set `ScriptName`='boss_anomalus' where `entry`=26763;
update `creature_template` set `ScriptName`='mob_chaotic_rift' where `entry`=26918;
-- Ormorok the Tree-Shaper
update `creature_template` set `ScriptName`='boss_ormorok' where `entry`=26794;
update `creature_template` set `ScriptName`='mob_crystal_spike' where `entry`=27099;
update `creature_template` set `ScriptName`='mob_crystalline_tangler' where `entry`=32665;
-- Keristrasza
update `creature_template` set `ScriptName`='boss_keristrasza' where `entry`=26723;
-- Instance script
update `instance_template` set `script`='instance_nexus' where `map`=576;
-- --------
-- EVENT AI
-- --------
UPDATE creature_template set AIName = 'EventAI' where entry in (26796, 26798, 26929, 26928, 26930);
DELETE FROM `creature_ai_scripts` WHERE `creature_id` in (26796, 26798, 26929, 26928, 26930);
INSERT INTO `creature_ai_scripts` VALUES
-- Commander Stoutbeard
( 2679600, 26796, 4, 0, 100, 4, 0, 0, 0, 0, 28, 0, 47543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - crystal prison remove'),
( 2679601, 26796, 4, 0, 100, 4, 0, 0, 0, 0, 11, 31403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast battle shout'),
( 2679602, 26796, 0, 0, 100, 5, 3000, 3000, 11000, 15000, 11, 60067, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast charge'),
( 2679603, 26796, 0, 0, 100, 5, 6000, 8000, 19500, 25000, 11, 38618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast whirlwind'),
( 2679604, 26796, 0, 0, 100, 5, 13000, 13000, 45000, 55000, 11, 19134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Stoutbeard - cast Frightening Shout'),
-- Commander Kolurg
( 2679800, 26798, 4, 0, 100, 4, 0, 0, 0, 0, 28, 0, 47543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - crystal prison remove'),
( 2679801, 26798, 4, 0, 100, 4, 0, 0, 0, 0, 11, 31403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast battle shout'),
( 2679802, 26798, 0, 0, 100, 5, 3000, 3000, 11000, 15000, 11, 60067, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast charge'),
( 2679803, 26798, 0, 0, 100, 5, 6000, 8000, 19500, 25000, 11, 38618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast whirlwind'),
( 2679804, 26798, 0, 0, 100, 5, 13000, 13000, 45000, 55000, 11, 19134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Commander Kolurg - cast Frightening Shout'),
-- Grand Magus Telestra Clone (Arcane)
( 2692901, 26929, 0, 0, 100, 7, 6000, 8000, 10000, 12000, 11, 47731, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra arcane - cast pollymorph critter'),
( 2692902, 26929, 0, 0, 100, 7, 15000, 16000, 15000, 16000, 11, 47736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra arcane - cast time stop'),
-- Grand Magus Telestra Clone (Fire)
( 2692801, 26928, 0, 0, 100, 3, 3000, 3000, 8000, 9000, 11, 47721, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast fire blast N'),
( 2692802, 26928, 0, 0, 100, 5, 3000, 3000, 8000, 9000, 11, 56939, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast fire blast H'),
( 2692803, 26928, 0, 0, 100, 3, 9000, 9000, 9500, 11500, 11, 47723, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast scorge N'),
( 2692804, 26928, 0, 0, 100, 5, 9000, 9000, 9500, 11500, 11, 56938, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand magus Telestra fire - cast scorge H'),
-- Grand Magus Telestra Clone (Frost)
( 2693001, 26930, 0, 0, 100, 3, 3000, 3000, 8000, 9000, 11, 47729, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast ice bard N'),
( 2693002, 26930, 0, 0, 100, 5, 3000, 3000, 8000, 9000, 11, 56937, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast ice bard H'),
( 2693003, 26930, 0, 0, 100, 3, 9000, 9000, 15000, 16000, 11, 47727, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast blizzard N'),
( 2693004, 26930, 0, 0, 100, 5, 9000, 9000, 15000, 16000, 11, 56936, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Grand Magus Telestra frost - cast blizzard H');
/* EOF */
+6
View File
@@ -270,6 +270,12 @@ scripts/zone/naxxramas/boss_sapphiron.cpp \
scripts/zone/naxxramas/boss_thaddius.cpp \
scripts/zone/naxxramas/instance_naxxramas.cpp \
scripts/zone/netherstorm/netherstorm.cpp \
scripts/zone/nexus/nexus/boss_magus_telestra.cpp \
scripts/zone/nexus/nexus/boss_anomalus.cpp \
scripts/zone/nexus/nexus/boss_ormorok.cpp \
scripts/zone/nexus/nexus/boss_keristrasza.cpp \
scripts/zone/nexus/nexus/def_nexus.h \
scripts/zone/nexus/nexus/instance_nexus.cpp \
scripts/zone/onyxias_lair/boss_onyxia.cpp \
scripts/zone/orgrimmar/orgrimmar.cpp \
scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp \
+14
View File
@@ -401,6 +401,13 @@ extern void AddSC_instance_naxxramas();
//Netherstorm
extern void AddSC_netherstorm();
//The Nexus
extern void AddSC_boss_magus_telestra();
extern void AddSC_boss_anomalus();
extern void AddSC_boss_ormorok();
extern void AddSC_boss_keristrasza();
extern void AddSC_instance_nexus();
//Onyxia's Lair
extern void AddSC_boss_onyxia();
@@ -1286,6 +1293,13 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
//Netherstorm
AddSC_netherstorm();
//The Nexus
AddSC_boss_magus_telestra();
AddSC_boss_anomalus();
AddSC_boss_ormorok();
AddSC_boss_keristrasza();
AddSC_instance_nexus();
//Onyxia's Lair
AddSC_boss_onyxia();
+24 -20
View File
@@ -2514,22 +2514,30 @@
<Filter
Name="Nexus"
>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp"
>
@@ -2538,10 +2546,6 @@
RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
>
+24 -24
View File
@@ -2513,22 +2513,30 @@
<Filter
Name="Nexus"
>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp"
>
@@ -2537,14 +2545,6 @@
RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
>
</File>
<File
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
>
</File>
</Filter>
<Filter
Name="Oculus"
@@ -37,7 +37,7 @@ struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
IkissDoor = NULL;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -240,9 +240,9 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if(who && !m_creature->getVictim() && m_creature->canStartAttack(who))
AttackStart(who);
if (!Intro && who && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who))
ScriptedAI::MoveInLineOfSight(who);
if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who))
{
DoScriptText(SAY_INTRO, m_creature);
Intro = true;
@@ -69,7 +69,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -69,9 +69,9 @@ struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case 29309: Elder_Nadox = creature->GetGUID(); break;
case 29308: Prince_Taldaram = creature->GetGUID(); break;
@@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -64,9 +64,9 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case 28684: Krikthir = creature->GetGUID(); break;
case 28921: Hadronox = creature->GetGUID(); break;
@@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -148,7 +148,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -305,7 +305,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -267,7 +267,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -149,7 +149,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
player->SendUpdateWorldState(WORLD_STATE_BM,0);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
if (creature->GetEntry() == C_MEDIVH)
MedivhGUID = creature->GetGUID();
@@ -434,14 +434,10 @@ void hyjalAI::EnterCombat(Unit *who)
void hyjalAI::MoveInLineOfSight(Unit *who)
{
if(IsDummy)return;
if (IsBeingEscorted && !GetAttack())
if(IsDummy)
return;
if(m_creature->getVictim() || !m_creature->canStartAttack(who))
return;
AttackStart(who);
npc_escortAI::MoveInLineOfSight(who);
}
void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
@@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -120,7 +120,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
HandleGameObject(DoorGUID, open, NULL);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -96,7 +96,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
debug_log("TSCR: Instance Old Hillsbrad: UpdateOHWorldState, but PlayerList is empty!");
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -141,7 +141,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
DoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -629,7 +629,7 @@ CreatureAI* GetAI_npc_dkc1_gothik(Creature *_Creature)
return new npc_dkc1_gothikAI(_Creature);
}
// npc 28912 quest 17217 boss 29001 go 191092
// npc 28912 quest 17217 boss 29001 mob 29007 go 191092
void AddSC_the_scarlet_enclave()
{
@@ -649,22 +649,16 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
WaveTimer = 0;
}
void EnterCombat(Unit* who){}
void MoveInLineOfSight(Unit* who)
{
if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) && !Progress)
if(!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
{
if( CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE )
{
float Radius = 10.0;
if( m_creature->IsWithinDistInMap(who, Radius) )
{
PlayerGUID = who->GetGUID();
WaveTimer = 1000;
EndTimer = 60000;
Progress = true;
}
PlayerGUID = who->GetGUID();
WaveTimer = 1000;
EndTimer = 60000;
Progress = true;
}
}
}
@@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
Sewer2GUID = 0;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -42,12 +42,12 @@ struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance
}
void OnObjectCreate(GameObject* pGo)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(pGo->GetEntry())
switch(go->GetEntry())
{
case 185168: m_uiChestNGUID = pGo->GetGUID(); break;
case 185169: m_uiChestHGUID = pGo->GetGUID(); break;
case 185168: m_uiChestNGUID = go->GetGUID(); break;
case 185169: m_uiChestHGUID = go->GetGUID(); break;
}
}
@@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -84,7 +84,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance
Encounter[i] = NOT_STARTED;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch( go->GetEntry() )
{
@@ -53,9 +53,9 @@ struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch( creature_entry )
switch(creature->GetEntry())
{
case 16807: nethekurseGUID = creature->GetGUID(); break;
}
@@ -170,10 +170,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if(!Intro && !Flying)
{
if(!m_creature->getVictim() && m_creature->canStartAttack(who))
ScriptedAI::AttackStart(who);
}
ScriptedAI::MoveInLineOfSight(who);
}
void MovementInform(uint32 type, uint32 id)
@@ -126,7 +126,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
return 0;
}
void OnCreatureCreate(Creature *creature, uint32 entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature->GetEntry())
{
@@ -210,7 +210,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -249,7 +249,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -113,7 +113,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance
};
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -124,9 +124,9 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry)
switch (creature->GetEntry())
{
case ID_LUCIFRON:
Lucifron = creature->GetGUID();
@@ -1,121 +1,256 @@
/* Script Data Start
SDName: Boss anomalus
SDAuthor: LordVanMartin
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Anomalus
SD%Complete:
SDComment:
SDCategory:
Script Data End */
SDCategory: The Nexus, The Nexus
EndScriptData */
/*** SQL START ***
update creature_template set scriptname = '' where entry = '';
*** SQL END ***/
#include "precompiled.h"
#include "def_nexus.h"
//Spells
#define SPELL_SPARK_1 47751
#define SPELL_SPARK_2 57062
#define SPELL_SPARK_N 47751
#define SPELL_SPARK_H 57062
#define SPELL_RIFT_SHIELD 47748
#define SPELL_CHARGE_RIFT 47747
#define SPELL_ARCANE_ATTRACTION 57063
#define SPELL_CREATE_RIFT 47743 //Dummy ---> summons (npc 26918) "Chaotic Rift", which spawns "Crazed Mana Wraith"s (npc 26746)
#define SPELL_CHARGE_RIFT 47747 //Works wrong (affect players, not rifts)
#define SPELL_CREATE_RIFT 47743 //Don't work, using WA
#define SPELL_ARCANE_ATTRACTION 57063 //No idea, when it's used
#define MOB_CRAZED_MANA_WRAITH 26746
#define NPC_CHAOTIC_RIFT 26918
#define MOB_CRAZED_MANA_WRAITH 26746
#define MOB_CHAOTIC_RIFT 26918
#define SPELL_CHAOTIC_ENERGY_BURST 47688
#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737
#define SPELL_ARCANEFORM 48019 //Chaotic Rift visual
//Yell
#define SAY_AGGRO -1576000
#define SAY_KILL -1576001
#define SAY_DEATH -1576002
#define SAY_RIFT -1576003
#define SAY_SHIELD -1576004
#define SAY_AGGRO -1576010
#define SAY_DEATH -1576011
#define SAY_RIFT -1576012
#define SAY_SHIELD -1576013
float RiftLocation[6][3]=
{
{652.64, -273.70, -8.75},
{634.45, -265.94, -8.44},
{620.73, -281.17, -9.02},
{626.10, -304.67, -9.44},
{639.87, -314.11, -9.49},
{651.72, -297.44, -9.37}
};
struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI
{
boss_anomalusAI(Creature *c) : ScriptedAI(c) {}
boss_anomalusAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
Reset();
HeroicMode = c->GetMap()->IsHeroic();
}
void Reset() {}
void EnterCombat(Unit* who)
ScriptedInstance* pInstance;
bool HeroicMode;
uint8 Phase;
uint32 SPELL_SPARK_Timer;
uint32 SPELL_CREATE_RIFT_Timer;
uint64 ChaoticRiftGUID;
void Reset()
{
Phase = 0;
SPELL_SPARK_Timer = 5000;
SPELL_CREATE_RIFT_Timer = 25000;
ChaoticRiftGUID = 0;
if(pInstance)
pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
}
void Aggro(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if(!UpdateVictim())
return;
//Source DBM
if((((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 80) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 77))
|| (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 52))
|| (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 27)))
if (!UpdateVictim())
{
//Summon rift at a random location
return;
}
if (m_creature->HasAura(SPELL_RIFT_SHIELD))
{
Unit* Rift;
if (ChaoticRiftGUID)
Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID);
if (Rift && Rift->isDead())
{
m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
ChaoticRiftGUID = 0;
}
return;
} else
ChaoticRiftGUID = 0;
if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75))
{
Phase = 1;
DoScriptText(SAY_SHIELD, m_creature);
DoCast(m_creature, SPELL_RIFT_SHIELD);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
{
//DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(target);
ChaoticRiftGUID = Rift->GetGUID();
DoScriptText(SAY_RIFT , m_creature);
}
}
if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50))
{
Phase = 2;
DoScriptText(SAY_SHIELD , m_creature);
DoCast(m_creature,SPELL_RIFT_SHIELD);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
{
//DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(target);
ChaoticRiftGUID = Rift->GetGUID();
DoScriptText(SAY_RIFT , m_creature);
}
}
if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
{
Phase = 3;
DoScriptText(SAY_SHIELD , m_creature);
DoCast(m_creature,SPELL_RIFT_SHIELD);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
{
//DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(target);
ChaoticRiftGUID = Rift->GetGUID();
DoScriptText(SAY_RIFT , m_creature);
}
}
if (SPELL_SPARK_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target, HeroicMode ? SPELL_SPARK_H : SPELL_SPARK_N);
SPELL_SPARK_Timer = 5000;
}else SPELL_SPARK_Timer -=diff;
if (SPELL_CREATE_RIFT_Timer < diff)
{
DoScriptText(SAY_RIFT , m_creature);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(target);
SPELL_CREATE_RIFT_Timer = 25000;
}else SPELL_CREATE_RIFT_Timer -=diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
}
void KilledUnit(Unit *victim)
{
if(victim == m_creature)
return;
DoScriptText(SAY_KILL, m_creature);
if (pInstance)
pInstance->SetData(DATA_ANOMALUS_EVENT, DONE);
}
};
/*######
## Crazed Mana Wraiths
######*/
#define SPELL_ARCANE_MISSILES 33833
struct TRINITY_DLL_DECL mob_crazed_mana_wraithAI : public ScriptedAI
struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI
{
mob_crazed_mana_wraithAI(Creature *c) : ScriptedAI(c) {}
mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c)
{
pInstance = c->GetInstanceData();
Reset();
}
ScriptedInstance* pInstance;
uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer;
uint32 SUMMON_CRAZED_MANA_WRAITH_Timer;
void Reset()
{
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000;
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000;
m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different.
//Model for ally (1126) does not show auras. Horde model works perfect.
//Set model to horde number
DoCast(m_creature, SPELL_ARCANEFORM, false);
}
void Reset() {}
void EnterCombat(Unit* who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if(!UpdateVictim())
if (!UpdateVictim())
{
return;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer) {}
if (SPELL_CHAOTIC_ENERGY_BURST_Timer < diff)
{
Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS));
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
else
DoCast(target, SPELL_CHAOTIC_ENERGY_BURST);
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000;
}else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff;
if (SUMMON_CRAZED_MANA_WRAITH_Timer < diff)
{
Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Wraith)
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
Wraith->AI()->AttackStart(target);
Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS));
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000;
else
SUMMON_CRAZED_MANA_WRAITH_Timer = 10000;
}else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff;
}
};
/*######
## Chaotic Rift
######*/
#define SPELL_CHAOTIC_ENERGY_BURST 47688
#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737
struct TRINITY_DLL_DECL npc_chaotic_riftAI : public ScriptedAI
CreatureAI* GetAI_mob_chaotic_rift(Creature *_Creature)
{
npc_chaotic_riftAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void EnterCombat(Unit* who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if(!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer) {}
};
CreatureAI* GetAI_npc_chaotic_rift(Creature *_Creature)
{
return new npc_chaotic_riftAI (_Creature);
return new mob_chaotic_riftAI (_Creature);
}
CreatureAI* GetAI_boss_anomalus(Creature *_Creature)
@@ -123,11 +258,6 @@ CreatureAI* GetAI_boss_anomalus(Creature *_Creature)
return new boss_anomalusAI (_Creature);
}
CreatureAI* GetAI_mob_crazed_mana_wraith(Creature *_Creature)
{
return new boss_anomalusAI (_Creature);
}
void AddSC_boss_anomalus()
{
Script *newscript;
@@ -138,12 +268,7 @@ void AddSC_boss_anomalus()
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="mob_crazed_mana_wraith";
newscript->GetAI = &GetAI_mob_crazed_mana_wraith;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_chaotic_rift";
newscript->GetAI = &GetAI_npc_chaotic_rift;
newscript->Name="mob_chaotic_rift";
newscript->GetAI = &GetAI_mob_chaotic_rift;
newscript->RegisterSelf();
}
@@ -1,74 +1,152 @@
/* Script Data Start
SDName: Boss keristrasza
SDAuthor: LordVanMartin
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Keristrasza
SD%Complete:
SDComment:
SDCategory:
Script Data End */
SDCategory: The Nexus, The Nexus
EndScriptData */
/*** SQL START ***
update creature_template set scriptname = 'boss_maiden_of_grief' where entry = '';
*** SQL END ***/
#include "precompiled.h"
#include "def_nexus.h"
//Spells
#define SPELL_FROZEN_PRISON 47854
#define SPELL_TAIL_SWEEP 50155
#define SPELL_CRYSTAL_CHAINS 50997
#define SPELL_ENRAGE 8599
#define SPELL_CRYSTALFIRE_BREATH_1 48096
#define SPELL_CRYSTALFIRE_BREATH_2 57091
#define SPELL_CRYSTALFIRE_BREATH_N 48096
#define SPELL_CRYSTALFIRE_BREATH_H 57091
#define SPELL_CRYSTALIZE 48179
#define SPELL_INTENSE_COLD 48095 //stackable debuff
#define SPELL_INTENSE_COLD 48094
//Yell
#define SAY_AGGRO -1576005
#define SAY_SLAY -1576006
#define SAY_ENRAGE -1576007
#define SAY_DEATH -1576008
#define SAY_CRYSTAL_NOVA -1576009
#define SAY_AGGRO -1576040
#define SAY_SLAY -1576041
#define SAY_ENRAGE -1576042
#define SAY_DEATH -1576043
#define SAY_CRYSTAL_NOVA -1576044
struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI
{
boss_keristraszaAI(Creature *c) : ScriptedAI(c) {}
boss_keristraszaAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
bool enraged;
ScriptedInstance* pInstance;
bool HeroicMode;
uint32 CRYSTALFIRE_BREATH_Timer;
uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer;
uint32 TAIL_SWEEP_Timer;
bool Enrage;
void Reset()
{
enraged = false;
CRYSTALFIRE_BREATH_Timer = 14000;
CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000;
TAIL_SWEEP_Timer = 5000;
Enrage = false;
m_creature->RemoveAurasDueToSpell(SPELL_INTENSE_COLD);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
if (pInstance && pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}else{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, false);
}
}
void EnterCombat(Unit* who)
void MoveInLineOfSight(Unit *who)
{
if (pInstance && pInstance->GetData(DATA_KERISTRASZA_FREED) != DONE && pInstance->GetData(DATA_MAGUS_TELESTRA_EVENT) == DONE &&
pInstance->GetData(DATA_ANOMALUS_EVENT) == DONE && pInstance->GetData(DATA_ORMOROK_EVENT) == DONE &&
m_creature->IsHostileTo(who) && m_creature->IsWithinDist(who, 15.0f, false))
{
pInstance->SetData(DATA_KERISTRASZA_FREED, DONE);
}
if (pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE)
{
m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
ScriptedAI::MoveInLineOfSight(who);
}
}
void Aggro(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoCast(m_creature, SPELL_INTENSE_COLD);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if(!UpdateVictim())
return;
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 10)
if (!UpdateVictim())
{
if(!enraged)
{
DoScriptText(SAY_ENRAGE, m_creature);
DoCast(m_creature, SPELL_ENRAGE);
enraged = true;
}
return;
}
if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
{
DoScriptText(SAY_ENRAGE , m_creature);
DoCast(m_creature, SPELL_ENRAGE);
Enrage = true;
}
if (CRYSTALFIRE_BREATH_Timer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? SPELL_CRYSTALFIRE_BREATH_H : SPELL_CRYSTALFIRE_BREATH_N);
CRYSTALFIRE_BREATH_Timer = 14000;
}else CRYSTALFIRE_BREATH_Timer -=diff;
if (TAIL_SWEEP_Timer < diff)
{
DoCast(m_creature, SPELL_TAIL_SWEEP);
TAIL_SWEEP_Timer = 5000;
}else TAIL_SWEEP_Timer -=diff;
if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff)
{
DoScriptText(SAY_CRYSTAL_NOVA , m_creature);
if (HeroicMode)
DoCast(m_creature, SPELL_CRYSTALIZE);
else
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_CRYSTAL_CHAINS);
CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000;
}else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
}
void KilledUnit(Unit *victim)
{
if(victim == m_creature)
return;
DoScriptText(SAY_SLAY, m_creature);
}
};
@@ -1,103 +1,278 @@
/* Script Data Start
SDName: Boss magus_telestra
SDAuthor: LordVanMartin
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Magus_Telestra
SD%Complete:
SDComment:
SDCategory:
Script Data End */
SDCategory: The Nexus, The Nexus
EndScriptData */
/*** SQL START ***
update creature_template set scriptname = '' where entry = '';
*** SQL END ***/
#include "precompiled.h"
#include "def_nexus.h"
//Spells
//phase 1
#define SPELL_ICE_NOVA 47772
#define SPELL_ICE_NOVA 56935
#define SPELL_FIREBOMB 47773
#define SPELL_FIREBOMB 56934
#define SPELL_GAVITY_WELL 47756
#define SPELL_ICE_NOVA_N 47772
#define SPELL_ICE_NOVA_H 56935
#define SPELL_FIREBOMB_N 47773
#define SPELL_FIREBOMB_H 56934
#define SPELL_GRAVITY_WELL 47756
#define SPELL_TELESTRA_BACK 47714
//Phase 2 -->50% HP (3 clones, Frost, Fire, Arcane)
//Frost Magus (npc 26930)
#define FROST_MAGUS_VISUAL 47706 //Dummy
#define SPELL_BLIZZARD_N 47727
#define SPELL_ICE_BARB_N 47729
//heroic
#define SPELL_BLIZZARD_H 56936
#define SPELL_ICE_BARB_H 56937
float CenterOfRoom[1][4] =
{
{504.80, 89.07, -16.12, 6.27}
};
//Fire Magus (npc 26928)
#define FIRE_MAGUS_VISUAL 47705 //Dummy
#define SPELL_FIRE_BLAST 47721
#define SPELL_SCORCH 47723
//heroic
#define SPELL_FIRE_BLAST_H 56939
#define SPELL_SCORCH_H 56938
//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic)
#define MOB_FIRE_MAGUS 26928
#define MOB_FROST_MAGUS 26930
#define MOB_ARCANE_MAGUS 26929
//Arcane Magus (npc 26929)
#define ARCANE_MAGUS_VISUAL 47704 //Dummy
#define SPELL_CRITTER 47731
#define SPELL_TIME_STOP 47736
#define SPELL_FIRE_MAGUS_VISUAL 47705
#define SPELL_FROST_MAGUS_VISUAL 47706
#define SPELL_ARCANE_MAGUS_VISUAL 47704
//Yell
#define SAY_AGGRO -1576010
#define SAY_KILL -1576011
#define SAY_DEATH -1576012
#define SAY_MERGE -1576013
#define SAY_SPLIT_1 -1576014
#define SAY_SPLIT_2 -1576015
#define SAY_AGGRO -1576000
#define SAY_KILL -1576001
#define SAY_DEATH -1576002
#define SAY_MERGE -1576003
#define SAY_SPLIT_1 -1576004
#define SAY_SPLIT_2 -1576005
struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI
{
boss_magus_telestraAI(Creature *c) : ScriptedAI(c) {}
boss_magus_telestraAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
Reset();
HeroicMode = c->GetMap()->IsHeroic();
}
bool splited;
uint64 Magus_frost,
Magus_fire,
Magus_arcane;
ScriptedInstance* pInstance;
bool HeroicMode;
uint64 FireMagusGUID;
uint64 FrostMagusGUID;
uint64 ArcaneMagusGUID;
bool FireMagusDead;
bool FrostMagusDead;
bool ArcaneMagusDead;
uint32 AppearDelay_Timer;
bool AppearDelay;
uint8 Phase;
uint32 SPELL_ICE_NOVA_Timer;
uint32 SPELL_FIREBOMB_Timer;
uint32 SPELL_GRAVITY_WELL_Timer;
void Reset()
{
splited = false;
Phase = 0;
//These times are probably wrong
SPELL_ICE_NOVA_Timer = 7000;
SPELL_FIREBOMB_Timer = 0;
SPELL_GRAVITY_WELL_Timer = 15000;
FireMagusGUID = 0;
FrostMagusGUID = 0;
ArcaneMagusGUID = 0;
AppearDelay = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetVisibility(VISIBILITY_ON);
if(pInstance)
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
void Aggro(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
uint64 SplitPersonality(uint32 entry)
{
Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Summoned)
{
switch (entry)
{
case MOB_FIRE_MAGUS:
{
Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false);
break;
}
case MOB_FROST_MAGUS:
{
Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false);
break;
}
case MOB_ARCANE_MAGUS:
{
Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false);
break;
}
}
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
Summoned->AI()->AttackStart(target);
return Summoned->GetGUID();
}
return 0;
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if(!UpdateVictim())
return;
if(!splited)
if (!UpdateVictim())
{
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50)
{
DoScriptText(SAY_SPLIT_1, m_creature);
//HandleSplit
splited = true;
}
return;
}
if (AppearDelay)
{
m_creature->StopMoving();
m_creature->AttackStop();
if (AppearDelay_Timer < diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
AppearDelay = false;
}else AppearDelay_Timer -= diff;
return;
}
if ((Phase == 1)||(Phase == 3))
{
Unit* FireMagus;
Unit* FrostMagus;
Unit* ArcaneMagus;
if (FireMagusGUID)
FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID);
if (FrostMagusGUID)
FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID);
if (ArcaneMagusGUID)
ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID);
if (FireMagus && FireMagus->isDead())
FireMagusDead = true;
if (FrostMagus && FrostMagus->isDead())
FrostMagusDead = true;
if (ArcaneMagus && ArcaneMagus->isDead())
ArcaneMagusDead = true;
if (FireMagusDead && FrostMagusDead && ArcaneMagusDead)
{
m_creature->GetMotionMaster()->Clear();
m_creature->Relocate(CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]);
DoCast(m_creature, SPELL_TELESTRA_BACK);
m_creature->SetVisibility(VISIBILITY_ON);
if (Phase == 1)
Phase = 2;
if (Phase == 3)
Phase = 4;
FireMagusGUID = 0;
FrostMagusGUID = 0;
ArcaneMagusGUID = 0;
AppearDelay = true;
AppearDelay_Timer = 4000;
DoScriptText(SAY_MERGE, m_creature);
}else
return;
}
if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5)))
{
Phase = 1;
m_creature->CastStop();
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
FireMagusDead = false;
FrostMagusDead = false;
ArcaneMagusDead = false;
switch(rand()%2)
{
case 0: DoScriptText(SAY_SPLIT_1, m_creature); break;
case 1: DoScriptText(SAY_SPLIT_2, m_creature); break;
}
return;
}
if (HeroicMode && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1)))
{
Phase = 3;
m_creature->CastStop();
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
FireMagusDead = false;
FrostMagusDead = false;
ArcaneMagusDead = false;
switch(rand()%2)
{
case 0: DoScriptText(SAY_SPLIT_1, m_creature); break;
case 1: DoScriptText(SAY_SPLIT_2, m_creature); break;
}
return;
}
if (SPELL_ICE_NOVA_Timer < diff)
{
m_creature->CastStop();
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target, HeroicMode ? SPELL_ICE_NOVA_H : SPELL_ICE_NOVA_N);
SPELL_ICE_NOVA_Timer = 15000;
}else SPELL_ICE_NOVA_Timer -=diff;
if (SPELL_GRAVITY_WELL_Timer < diff)
{
m_creature->CastStop();
if (Unit* target = m_creature->getVictim())
DoCast(target, SPELL_GRAVITY_WELL);
SPELL_GRAVITY_WELL_Timer = 15000;
}else SPELL_GRAVITY_WELL_Timer -=diff;
if (SPELL_FIREBOMB_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target, HeroicMode ? SPELL_FIREBOMB_H : SPELL_FIREBOMB_N);
SPELL_FIREBOMB_Timer = 2000;
}else SPELL_FIREBOMB_Timer -=diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer)
{
{
DoScriptText(SAY_DEATH, m_creature);
}
if (pInstance)
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
if(victim == m_creature)
return;
DoScriptText(SAY_KILL, m_creature);
}
};
@@ -1,79 +1,288 @@
/* Script Data Start
SDName: Boss ormorok
SDAuthor: LordVanMartin
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Ormorok
SD%Complete:
SDComment:
SDCategory:
Script Data End */
SDCategory: The Nexus, The Nexus
EndScriptData */
/*** SQL START ***
update creature_template set scriptname = '' where entry = '';
*** SQL END ***/
#include "precompiled.h"
#include "def_nexus.h"
//Spells
#define SPELL_CRYSTAL_SPIKES_1 47958
#define SPELL_CRYSTAL_SPIKES_2 57082
#define SPELL_CRYSTAL_SPIKES_3 57083
#define SPELL_CRYSTAL_SPIKES_N 47958 //Don't work, using walkaround
#define SPELL_CRYSTAL_SPIKES_H 57082 //Don't work, using walkaround
//Walkaround for spells Crystal Spikes -----------------
#define SPELL_CRYSTALL_SPIKE_DAMAGE_N 47944
#define SPELL_CRYSTALL_SPIKE_DAMAGE_H 57067
#define SPELL_CRYSTAL_SPIKE_PREVISUAL 50442
#define MOB_CRYSTAL_SPIKE 27099
//------------------------------------------------------
#define SPELL_SPELL_REFLECTION 47981
#define SPELL_TRAMPLE_N 48016
#define SPELL_TRAMPLE_H 57066
#define SPELL_FRENZY_N 48017
#define SPELL_FRENZY_H 57086
#define SPELL_FRENZY 48017
#define SPELL_SUMMON_CRYSTALLINE_TANGLER 61564 //summons npc 32665
#define MOB_CRYSTALLINE_TANGLER 32665
#define SPELL_ROOTS 28858 //proper spell id is unknown
//Yell
#define SAY_AGGRO -1576016
#define SAY_KILL -1576017
#define SAY_DEATH -1576018
#define SAY_REFLECT -1576019
#define SAY_ICE_SPIKES -1576020
#define SAY_AGGRO -1576020
#define SAY_DEATH -1576021
#define SAY_REFLECT -1576022
#define SAY_CRYSTAL_SPIKES -1576023
#define SAY_KILL -1576024
#define SPIKE_DISTANCE 5.0f
struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI
{
boss_ormorokAI(Creature *c) : ScriptedAI(c) {}
boss_ormorokAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
Reset();
HeroicMode = c->GetMap()->IsHeroic();
}
bool frenzy;
ScriptedInstance* pInstance;
bool HeroicMode;
bool Frenzy;
bool CrystalSpikes;
uint8 CrystalSpikes_Count;
float BaseX;
float BaseY;
float BaseZ;
float BaseO;
float SpikeXY[4][2];
uint32 SPELL_CRYSTAL_SPIKES_Timer;
uint32 CRYSTAL_SPIKES_Timer;
uint32 SPELL_TRAMPLE_Timer;
uint32 SPELL_FRENZY_Timer;
uint32 SPELL_SPELL_REFLECTION_Timer;
uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer;
void Reset()
{
frenzy = false;
}
void EnterCombat(Unit* who)
{
SPELL_CRYSTAL_SPIKES_Timer = 12000;
SPELL_TRAMPLE_Timer = 10000;
SPELL_SPELL_REFLECTION_Timer = 30000;
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000;
Frenzy = false;
CrystalSpikes = false;
if(pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED);
}
void Aggro(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if(!UpdateVictim())
return;
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 25)
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
{
if(!frenzy)
{
DoCast(m_creature, SPELL_FRENZY_N);
frenzy = true;
}
return;
}
if (CrystalSpikes)
if (CRYSTAL_SPIKES_Timer < diff)
{
SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));
SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));
for (uint8 i = 0; i < 4; i++)
Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000);
if (++CrystalSpikes_Count >= 13)
CrystalSpikes = false;
CRYSTAL_SPIKES_Timer = 200;
}else CRYSTAL_SPIKES_Timer -= diff;
if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
{
DoCast(m_creature, SPELL_FRENZY);
Frenzy = true;
}
if (SPELL_TRAMPLE_Timer < diff)
{
DoCast(m_creature, HeroicMode ? SPELL_TRAMPLE_H : SPELL_TRAMPLE_N);
SPELL_TRAMPLE_Timer = 10000;
}else SPELL_TRAMPLE_Timer -= diff;
if (SPELL_SPELL_REFLECTION_Timer < diff)
{
DoScriptText(SAY_REFLECT, m_creature);
DoCast(m_creature, SPELL_SPELL_REFLECTION);
SPELL_SPELL_REFLECTION_Timer = 30000;
}else SPELL_SPELL_REFLECTION_Timer -= diff;
if (SPELL_CRYSTAL_SPIKES_Timer < diff)
{
DoScriptText(SAY_CRYSTAL_SPIKES, m_creature);
CrystalSpikes = true;
CrystalSpikes_Count = 1;
CRYSTAL_SPIKES_Timer = 0;
BaseX = m_creature->GetPositionX();
BaseY = m_creature->GetPositionY();
BaseZ = m_creature->GetPositionZ();
BaseO = m_creature->GetOrientation();
SPELL_CRYSTAL_SPIKES_Timer = 20000;
}else SPELL_CRYSTAL_SPIKES_Timer -=diff;
if (HeroicMode && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer < diff))
{
Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Crystalline_Tangler)
{
Unit* target = NULL;
uint8 Healer = 0;
for (uint8 j = 1; j<=4; j++)
{
switch (j)
{
case 1: Healer = CLASS_PRIEST; break;
case 2: Healer = CLASS_PALADIN; break;
case 3: Healer = CLASS_DRUID; break;
case 4: Healer = CLASS_SHAMAN; break;
}
std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
{
Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer)
{
target = pTemp;
break;
}
}
if (target)
break;
}
if (!target)
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (target)
{
Crystalline_Tangler->AI()->AttackStart(target);
Crystalline_Tangler->getThreatManager().addThreat(target, 1000000000.0f);
}
}
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000;
}else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer)
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, DONE);
}
void KilledUnit(Unit *victim)
void KilledUnit(Unit *victim)
{
if(victim == m_creature)
return;
DoScriptText(SAY_KILL, m_creature);
}
};
struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI
{
mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c)
{
Reset();
HeroicMode = c->GetMap()->IsHeroic();
}
bool HeroicMode;
uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer;
uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer;
void Reset()
{
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700;
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000;
m_creature->SetLevel(80); //
m_creature->setFaction(16); //Walkaround to be independent from data in DB
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //
}
void UpdateAI(const uint32 diff)
{
if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer < diff)
{
DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL);
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000;
}else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff;
if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer < diff)
{
DoCast(m_creature, HeroicMode ? SPELL_CRYSTALL_SPIKE_DAMAGE_H : SPELL_CRYSTALL_SPIKE_DAMAGE_N);
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000;
}else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff;
}
};
struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI
{
mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c)
{
Reset();
}
uint32 SPELL_ROOTS_Timer;
void Reset()
{
SPELL_ROOTS_Timer = 1000;
}
void UpdateAI(const uint32 diff)
{
if (SPELL_ROOTS_Timer < diff)
{
if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false))
{
DoCast(m_creature->getVictim(), SPELL_ROOTS);
SPELL_ROOTS_Timer = 15000;
}
}else SPELL_ROOTS_Timer -=diff;
}
};
CreatureAI* GetAI_mob_crystal_spike(Creature *_Creature)
{
return new mob_crystal_spikeAI (_Creature);
}
CreatureAI* GetAI_mob_crystalline_tangler(Creature *_Creature)
{
return new mob_crystalline_tanglerAI (_Creature);
}
CreatureAI* GetAI_boss_ormorok(Creature *_Creature)
{
return new boss_ormorokAI (_Creature);
@@ -85,6 +294,16 @@ void AddSC_boss_ormorok()
newscript = new Script;
newscript->Name="boss_ormorok";
newscript->GetAI = &GetAI_boss_ormorok;
newscript->GetAI = GetAI_boss_ormorok;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="mob_crystal_spike";
newscript->GetAI = &GetAI_mob_crystal_spike;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="mob_crystalline_tangler";
newscript->GetAI = &GetAI_mob_crystalline_tangler;
newscript->RegisterSelf();
}
@@ -1,35 +1,11 @@
#ifndef DEF_NEXUS_H
#define DEF_NEXUS_H
#define DATA_ANOMALUSDEAD 1
#define DATA_ANOMALUS_DEATH 2
#define DATA_ORMOROKDDEAD 3
#define DATA_ORMOROK_DEATH 4
#define DATA_MAGUS_TELESTRA_EVENT 1
#define DATA_ANOMALUS_EVENT 2
#define DATA_ORMOROK_EVENT 3
#define DATA_KERISTRASZA_FREED 4
#define DATA_MAGUSTELESTRADEAD 5
#define DATA_MAGUSTELESTRA_DEATH 6
#define DATA_MAGUSTELESTRA_A_DEAD 7
#define DATA_MAGUSTELESTRA_A_DEATH 8
#define DATA_MAGUSTELESTRA_F_DEAD 9
#define DATA_MAGUSTELESTRA_F_DEATH 10
#define DATA_MAGUSTELESTRA_FI_DEAD 11
#define DATA_MAGUSTELESTRA_FI_DEATH 12
#define DATA_ANOMALUS 5
#define DATA_KERISTRASZADEAD 13
#define DATA_KERISTRASZA_DEATH 14
#define DATA_COMMANDER_KOLURGDEAD 15
#define DATA_COMMANDER_KOLURG_DEATH 16
#define DATA_COMMANDER_STOUTBEARDDEAD 17
#define DATA_COMMANDER_STOUTBEARD_DEATH 18
#define DATA_ANOMALUS 19
#define DATA_ORMOROK 20
#define DATA_MAGUSTELESTRA 21
#define DATA_MAGUSTELESTRA_A 22
#define DATA_MAGUSTELESTRA_F 23
#define DATA_MAGUSTELESTRA_FI 24
#define DATA_KERISTRASZA 25
#define DATA_COMMANDER_KOLURG 26
#define DATA_COMMANDER_STOUTBEARD 27
#endif
@@ -1,145 +1,176 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Nexus
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "precompiled.h"
#include "def_nexus.h"
#define NUMBER_OF_ENCOUNTERS 4
struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
{
instance_nexus(Map *Map) : ScriptedInstance(Map) {Initialize();};
uint64 Anomalus,
Ormorok,
Magus_telestra,
Magus_frost,
Magus_fire,
Magus_arcane,
keristrasza,
Commander_kolurg,
Commander_stoutbeard;
bool IsBossDied[9];
std::string strInstData;
uint64 Anomalus;
uint32 Encounters[NUMBER_OF_ENCOUNTERS];
void Initialize()
{
Anomalus = 0;
Ormorok = 0;
Magus_telestra =0;
Magus_frost =0;
Magus_fire =0;
Magus_arcane =0;
keristrasza =0;
Commander_kolurg = 0;
Commander_stoutbeard = 0;
IsBossDied[0] = false;
IsBossDied[1] = false;
IsBossDied[2] = false;
IsBossDied[3] = false;
IsBossDied[4] = false;
IsBossDied[5] = false;
IsBossDied[6] = false;
IsBossDied[7] = false;
IsBossDied[8] = false;
Anomalus = 0;
for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++)
Encounters[i] = NOT_STARTED;
}
bool IsEncounterInProgress() const
void OnCreatureCreate(Creature* pCreature, bool add)
{
//not active
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
switch(creature->GetEntry())
{
case 26763: Anomalus = creature->GetGUID(); break;
case 26794: Ormorok = creature->GetGUID(); break;
case 26731: Magus_telestra = creature->GetGUID(); break;
case 26930: Magus_frost = creature->GetGUID(); break;
case 26928: Magus_fire = creature->GetGUID(); break;
case 26926: Magus_arcane = creature->GetGUID(); break;
case 26723: keristrasza = creature->GetGUID(); break;
case 26798: Commander_kolurg = creature->GetGUID(); break;
case 26796: Commander_stoutbeard = creature->GetGUID(); break;
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_ANOMALUSDEAD:
if(IsBossDied[0])
return 1;
break;
case DATA_ORMOROKDDEAD:
if(IsBossDied[1])
return 1;
break;
case DATA_MAGUSTELESTRADEAD:
if(IsBossDied[2])
return 1;
break;
case DATA_MAGUSTELESTRA_A_DEAD:
if(IsBossDied[3])
return 1;
break;
case DATA_MAGUSTELESTRA_F_DEAD:
if(IsBossDied[4])
return 1;
break;
case DATA_MAGUSTELESTRA_FI_DEAD:
if(IsBossDied[5])
return 1;
break;
case DATA_KERISTRASZADEAD:
if(IsBossDied[6])
return 1;
break;
case DATA_COMMANDER_KOLURGDEAD:
if(IsBossDied[7])
return 1;
break;
case DATA_COMMANDER_STOUTBEARDDEAD:
if(IsBossDied[8])
return 1;
break;
}
Map::PlayerList const& players = instance->GetPlayers();
uint32 TeamInInstance;
if (!players.isEmpty())
{
if (Player* pPlayer = players.begin()->getSource())
{
TeamInInstance = pPlayer->GetTeam();
}
}
switch(pCreature->GetEntry())
{
case 26763: Anomalus = pCreature->GetGUID(); break;
case 26800:
{
//26799
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24358);
break;
}
case 26802:
{
//26801
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24354);
break;
}
case 26805:
{
//26803
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24357);
break;
}
case 27949:
{
//27947
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24352);
break;
}
case 26796:
{
//26798
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->SetDisplayId(24352);
break;
}
}
}
uint64 GetData64(uint32 uiIdentifier)
{
switch(uiIdentifier)
{
case DATA_ANOMALUS:
return Anomalus;
}
return 0;
}
uint64 GetData64 (uint32 identifier)
uint32 GetData(uint32 identifier)
{
switch(identifier)
{
case DATA_MAGUS_TELESTRA_EVENT: return Encounters[0];
case DATA_ANOMALUS_EVENT: return Encounters[1];
case DATA_ORMOROK_EVENT: return Encounters[2];
case DATA_KERISTRASZA_FREED: return Encounters[3];
}
return 0;
}
void SetData(uint32 type, uint32 data)
void SetData(uint32 identifier, uint32 data)
{
switch(type)
switch(identifier)
{
case DATA_ANOMALUS_DEATH:
IsBossDied[0] = true;
break;
case DATA_ORMOROK_DEATH:
IsBossDied[1] = true;
break;
case DATA_MAGUSTELESTRA_DEATH:
IsBossDied[2] = true;
break;
case DATA_MAGUSTELESTRA_A_DEATH:
IsBossDied[3] = true;
break;
case DATA_MAGUSTELESTRA_F_DEATH:
IsBossDied[4] = true;
break;
case DATA_MAGUSTELESTRA_FI_DEAD:
IsBossDied[5] = true;
break;
case DATA_KERISTRASZA_DEATH:
IsBossDied[6] = true;
break;
case DATA_COMMANDER_KOLURG_DEATH:
IsBossDied[7] = true;
break;
case DATA_COMMANDER_STOUTBEARD_DEATH:
IsBossDied[8] = true;
break;
case DATA_MAGUS_TELESTRA_EVENT: Encounters[0] = data; break;
case DATA_ANOMALUS_EVENT: Encounters[1] = data; break;
case DATA_ORMOROK_EVENT: Encounters[2] = data; break;
case DATA_KERISTRASZA_FREED: Encounters[3] = data; break;
}
if (data == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
<< Encounters[3];
strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
std::string GetSaveData()
{
return strInstData;
}
void Load(const char* chrIn)
{
if (!chrIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(chrIn);
std::istringstream loadStream(chrIn);
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3];
for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i)
{
if (Encounters[i] == IN_PROGRESS)
Encounters[i] = NOT_STARTED;
}
OUT_LOAD_INST_DATA_COMPLETE;
}
};
@@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
Encounter[i] = NOT_STARTED;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -73,9 +73,9 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case ENTRY_HORSEMAN: HorsemanGUID = creature->GetGUID(); break;
case ENTRY_HEAD: HeadGUID = creature->GetGUID(); break;
@@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
Encounter[i] = NOT_STARTED;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -82,7 +82,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature* pCreature, uint32 uiCreature)
void OnCreatureCreate(Creature* pCreature, bool add)
{
switch(pCreature->GetEntry())
{
@@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -188,7 +188,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
std::string GetSaveData()
{
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -119,9 +119,9 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature* creature, uint32 entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(entry)
switch(creature->GetEntry())
{
case 24850: Kalecgos_Dragon = creature->GetGUID(); break;
case 24891: Kalecgos_Human = creature->GetGUID(); break;
@@ -139,17 +139,17 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* gobj)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(gobj->GetEntry())
switch(go->GetEntry())
{
case 188421: ForceField = gobj->GetGUID(); break;
case 188075: FireBarrier = gobj->GetGUID(); break;
case 187979: Gate[0] = gobj->GetGUID(); break;
case 187770: Gate[1] = gobj->GetGUID(); break;
case 187896: Gate[2] = gobj->GetGUID(); break;
case 187990: Gate[3] = gobj->GetGUID(); break;
case 188118: Gate[4] = gobj->GetGUID(); break;
case 188421: ForceField = go->GetGUID(); break;
case 188075: FireBarrier = go->GetGUID(); break;
case 187979: Gate[0] = go->GetGUID(); break;
case 187770: Gate[1] = go->GetGUID(); break;
case 187896: Gate[2] = go->GetGUID(); break;
case 187990: Gate[3] = go->GetGUID(); break;
case 188118: Gate[4] = go->GetGUID(); break;
}
}
@@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
return false;
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -107,7 +107,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
if (creature->GetEntry() == MELLICHAR)
MellicharGUID = creature->GetGUID();
@@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -33,10 +33,6 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
uint32 Encounters[ENCOUNTERS];
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
{
}
void Initialize()
{
for(uint8 i = 0; i < ENCOUNTERS; ++i)
@@ -59,9 +59,9 @@ struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance
CthunPhase = 0;
}
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry)
switch (creature->GetEntry())
{
case 15263: SkeramGUID = creature->GetGUID(); break;
case 15544: VemGUID = creature->GetGUID(); break;
@@ -57,7 +57,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance
std::vector<uint64> earthenGuardian;
std::vector<uint64> archaedasWallMinions; // minions lined up around the wall
void OnObjectCreate (GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch (go->GetEntry())
{
@@ -238,9 +238,9 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance
}
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry) {
switch (creature->GetEntry()) {
case 4857: // Stone Keeper
SetFrozenState (creature);
stoneKeeper.push_back(creature->GetGUID());
@@ -105,9 +105,9 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature_entry)
switch(creature->GetEntry())
{
case 23953: Keleseth = creature->GetGUID(); break;
case 24201: Dalronn = creature->GetGUID(); break;
@@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
}
}
void OnObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -242,7 +242,7 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data.c_str();
return str_data;
}
void Load(const char* in)
@@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
return false;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch(creature->GetEntry())
{
@@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
}
}
void OnObjectCreate(GameObject *go)
void OnGameObjectCreate(GameObject *go, bool add)
{
switch(go->GetEntry())
{
@@ -37,9 +37,9 @@ struct TRINITY_DLL_DECL instance_zulgurub : public ScriptedInstance
uint64 ThekalGUID;
uint64 JindoGUID;
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
void OnCreatureCreate(Creature *creature, bool add)
{
switch (creature_entry)
switch (creature->GetEntry())
{
case 11347:
LorKhanGUID = creature->GetGUID();
+12
View File
@@ -205,6 +205,14 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
return false;
}
return true;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM:
if(team.team != ALLIANCE && team.team != HORDE)
{
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) have unknown team in value1 (%u), ignore.",
criteria->ID, criteria->requiredType,dataType,gender.gender);
return false;
}
return true;
default:
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) have data for not supported data type (%u), ignore.", criteria->ID, criteria->requiredType,dataType);
return false;
@@ -265,6 +273,10 @@ bool AchievementCriteriaData::Meets(Player const* source, Unit const* target, ui
return source->GetMap()->GetSpawnMode()==difficalty.difficalty;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM:
if (!target || target->GetTypeId() != TYPEID_PLAYER)
return false;
return ((Player*)target)->GetTeam() == team.team;
}
return false;
}
+8 -2
View File
@@ -53,12 +53,13 @@ enum AchievementCriteriaDataType
ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8, // minvalue value provided with achievement update must be not less that limit
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9, // minlevel minlevel of target
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10,// gender 0=male; 1=female
ACHIEVEMENT_CRITERIA_DATA_TYPE_DISABLED = 11,// used to prevent achievement createria complete if not all requirement implemented and listed in table
ACHIEVEMENT_CRITERIA_DATA_TYPE_DISABLED = 11,// used to prevent achievement creteria complete if not all requirement implemented and listed in table
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12,// difficulty normal/heroic difficulty for current event map
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13,// count "with less than %u people in the zone"
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14,// team HORDE(67), ALLIANCE(469)
};
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 14 // maximum value in AchievementCriteriaDataType enum
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 15 // maximum value in AchievementCriteriaDataType enum
class Player;
class Unit;
@@ -128,6 +129,11 @@ struct AchievementCriteriaData
{
uint32 maxcount;
} map_players;
// ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14
struct
{
uint32 team;
} team;
// ...
struct
{
+7 -5
View File
@@ -1646,15 +1646,17 @@ bool Creature::IsWithinSightDist(Unit const* u) const
return IsWithinDistInMap(u, sWorld.getConfig(CONFIG_SIGHT_MONSTER));
}
bool Creature::canStartAttack(Unit const* who) const
bool Creature::canStartAttack(Unit const* who, bool force) const
{
if(isCivilian() || IsNeutralToAll()
if(isCivilian()
|| !who->isInAccessiblePlaceFor(this)
|| !canFly() && GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE
|| !IsWithinDistInMap(who, GetAttackDistance(who)))
|| !canFly() && GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return false;
if(!canAttack(who, false))
if(!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who))))
return false;
if(!canAttack(who, force))
return false;
return IsWithinLOSInMap(who);
+1 -1
View File
@@ -643,7 +643,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
bool IsWithinSightDist(Unit const* u) const;
bool canStartAttack(Unit const* u) const;
bool canStartAttack(Unit const* u, bool force) const;
float GetAttackDistance(Unit const* pl) const;
Unit* SelectNearestTarget(float dist = 0) const;
+2 -2
View File
@@ -100,11 +100,11 @@ void CreatureAI::MoveInLineOfSight(Unit *who)
if(me->getVictim())
return;
if(me->canStartAttack(who))
if(me->canStartAttack(who, false))
AttackStart(who);
else if(who->getVictim() && me->IsFriendlyTo(who)
&& me->IsWithinDistInMap(who, sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
&& me->canAttack(who->getVictim()))
&& me->canStartAttack(who->getVictim(), true))
AttackStart(who->getVictim());
}
+1
View File
@@ -37,6 +37,7 @@ namespace AIRegistry
void Initialize()
{
(new CreatureAIFactory<NullCreatureAI>("NullCreatureAI"))->RegisterSelf();
(new CreatureAIFactory<TriggerAI>("TriggerAI"))->RegisterSelf();
(new CreatureAIFactory<AggressorAI>("AggressorAI"))->RegisterSelf();
(new CreatureAIFactory<ReactorAI>("ReactorAI"))->RegisterSelf();
(new CreatureAIFactory<PassiveAI>("PassiveAI"))->RegisterSelf();
+8 -3
View File
@@ -60,12 +60,17 @@ namespace FactorySelector
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
else if(creature->isGuard())
ai_factory = ai_registry.GetRegistryItem("GuardAI");
else if(creature->HasSummonMask(SUMMON_MASK_GUARDIAN))
else if(creature->isGuardian())
ai_factory = ai_registry.GetRegistryItem("PetAI");
else if(creature->isTotem())
ai_factory = ai_registry.GetRegistryItem("TotemAI");
else if(creature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
else if(creature->isTrigger())
{
if(creature->m_spells[0])
ai_factory = ai_registry.GetRegistryItem("TriggerAI");
else
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
}
else if(creature->GetCreatureType() == CREATURE_TYPE_CRITTER)
ai_factory = ai_registry.GetRegistryItem("CritterAI");
}
+5 -4
View File
@@ -957,11 +957,12 @@ void CreatureEventAI::MoveInLineOfSight(Unit *who)
}
}
//if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
// return;
if(me->canStartAttack(who))
if(me->canStartAttack(who, false))
AttackStart(who);
else if(who->getVictim() && me->IsFriendlyTo(who)
&& me->IsWithinDistInMap(who, sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
&& me->canStartAttack(who->getVictim(), true))
AttackStart(who->getVictim());
}
void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell)
+4 -4
View File
@@ -45,7 +45,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
if(!_getPoint(owner, x, y, z))
return;
owner.addUnitState(UNIT_STAT_FLEEING);
owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
Traveller<T> traveller(owner);
i_destinationHolder.SetDestination(traveller, x, y, z);
}
@@ -304,7 +304,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
_Init(owner);
owner.CastStop();
owner.addUnitState(UNIT_STAT_FLEEING);
owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.SetUInt64Value(UNIT_FIELD_TARGET, 0);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -353,7 +353,7 @@ void
FleeingMovementGenerator<T>::Finalize(T &owner)
{
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.clearUnitState(UNIT_STAT_FLEEING);
owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
if(owner.GetTypeId() == TYPEID_UNIT && owner.getVictim())
owner.SetUInt64Value(UNIT_FIELD_TARGET, owner.getVictim()->GetGUID());
}
@@ -413,7 +413,7 @@ template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint3
void TimedFleeingMovementGenerator::Finalize(Unit &owner)
{
owner.clearUnitState(UNIT_STAT_FLEEING);
owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
if (Unit* victim = owner.getVictim())
{
if (owner.isAlive())
+1 -1
View File
@@ -997,7 +997,7 @@ namespace Trinity
}
else
{
if(!m_creature->canStartAttack(u))
if(!m_creature->canStartAttack(u, false))
return false;
}
-6
View File
@@ -53,12 +53,6 @@ bool InstanceData::IsEncounterInProgress() const
return false;
}
//This will be removed in the future, just compitiable with Mangos
void InstanceData::OnCreatureCreate(Creature *creature, bool add)
{
OnCreatureCreate(creature, creature->GetEntry());
}
void InstanceData::LoadMinionData(const MinionData *data)
{
while(data->entry)
-6
View File
@@ -138,12 +138,6 @@ class TRINITY_DLL_SPEC InstanceData : public ZoneScript
//Called when a player successfully enters the instance.
virtual void OnPlayerEnter(Player *) {}
//Called when a gameobject is created
void OnGameObjectCreate(GameObject *go, bool add) { OnObjectCreate(go); }
//called on creature creation
void OnCreatureCreate(Creature *, bool add);
//Handle open / close objects
//use HandleGameObject(NULL,boolen,GO); in OnObjectCreate in instance scripts
//use HandleGameObject(GUID,boolen,NULL); in any other script
+6
View File
@@ -1002,6 +1002,12 @@ bool Item::IsBindedNotWith( Player const* player ) const
bool ItemRequiredTarget::IsFitToRequirements( Unit* pUnitTarget ) const
{
if(pUnitTarget->GetTypeId() != TYPEID_UNIT)
return false;
if(pUnitTarget->GetEntry() != m_uiTargetEntry)
return false;
switch(m_uiType)
{
case ITEM_TARGET_TYPE_CREATURE:
+55 -38
View File
@@ -370,16 +370,16 @@ void Map::AddNotifier(T*)
template<>
void Map::AddNotifier(Player* obj)
{
obj->m_Notified = false;
obj->m_IsInNotifyList = false;
//obj->m_Notified = false;
//obj->m_IsInNotifyList = false;
AddUnitToNotify(obj);
}
template<>
void Map::AddNotifier(Creature* obj)
{
obj->m_Notified = false;
obj->m_IsInNotifyList = false;
//obj->m_Notified = false;
//obj->m_IsInNotifyList = false;
AddUnitToNotify(obj);
}
@@ -561,25 +561,21 @@ bool Map::loaded(const GridPair &p) const
void Map::RelocationNotify()
{
//Move backlog to notify list
for(std::vector<uint64>::iterator iter = i_unitsToNotifyBacklog.begin(); iter != i_unitsToNotifyBacklog.end(); ++iter)
{
if(Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL))
{
i_unitsToNotify.push_back(unit);
}
}
i_unitsToNotifyBacklog.clear();
i_lock = true;
//Notify
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
{
Unit *unit = *iter;
if(unit->m_Notified || !unit->IsInWorld() || unit->GetMapId() != GetId())
if(!unit)
continue;
unit->m_NotifyListPos = -1;
if(unit->m_Notified)
continue;
unit->m_Notified = true;
unit->m_IsInNotifyList = false;
float dist = abs(unit->GetPositionX() - unit->oldX) + abs(unit->GetPositionY() - unit->oldY);
if(dist > 10.0f)
@@ -592,10 +588,10 @@ void Map::RelocationNotify()
if(unit->GetTypeId() == TYPEID_PLAYER)
{
Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));
if(((Player*)unit)->m_seer != unit)
//if(((Player*)unit)->m_seer != unit)
VisitAll(((Player*)unit)->m_seer->GetPositionX(), ((Player*)unit)->m_seer->GetPositionY(), World::GetMaxVisibleDistance() + dist, notifier);
else
VisitAll(((Player*)unit)->GetPositionX(), ((Player*)unit)->GetPositionY(), World::GetMaxVisibleDistance() + dist, notifier);
//else
//VisitAll(((Player*)unit)->GetPositionX(), ((Player*)unit)->GetPositionY(), World::GetMaxVisibleDistance() + dist, notifier);
notifier.Notify();
}
else
@@ -605,31 +601,55 @@ void Map::RelocationNotify()
}
}
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
{
(*iter)->m_Notified = false;
}
if(*iter)
(*iter)->m_Notified = false;
i_unitsToNotify.clear();
i_lock = false;
if(!i_unitsToNotifyBacklog.empty())
{
i_unitsToNotify.insert(i_unitsToNotify.end(), i_unitsToNotifyBacklog.begin(), i_unitsToNotifyBacklog.end());
i_unitsToNotifyBacklog.clear();
}
}
void Map::AddUnitToNotify(Unit* u)
{
if(u->m_IsInNotifyList)
return;
if(u->m_NotifyListPos < 0)
{
u->oldX = u->GetPositionX();
u->oldY = u->GetPositionY();
u->m_IsInNotifyList = true;
u->oldX = u->GetPositionX();
u->oldY = u->GetPositionY();
if(i_lock)
{
u->m_NotifyListPos = i_unitsToNotifyBacklog.size();
i_unitsToNotifyBacklog.push_back(u);
}
else
{
u->m_NotifyListPos = i_unitsToNotify.size();
i_unitsToNotify.push_back(u);
}
}
}
void Map::RemoveUnitFromNotify(int32 slot)
{
if(i_lock)
i_unitsToNotifyBacklog.push_back(u->GetGUID());
{
assert(slot < i_unitsToNotifyBacklog.size());
i_unitsToNotifyBacklog[slot] = NULL;
}
else
i_unitsToNotify.push_back(u);
{
assert(slot < i_unitsToNotify.size());
i_unitsToNotify[slot] = NULL;
}
}
void Map::Update(const uint32 &t_diff)
{
i_lock = false;
resetMarkedCells();
Trinity::ObjectUpdater updater(t_diff);
@@ -734,10 +754,7 @@ void Map::Update(const uint32 &t_diff)
}
}
i_lock = true;
MoveAllCreaturesInMoveList();
RelocationNotify();
RemoveAllObjectsInRemoveList();
// Don't unload grids if it's battleground, since we may have manually added GOs,creatures, those doesn't load from DB at grid re-load !
@@ -2109,11 +2126,11 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y)
i_grids[x][y] = grid;
}
void Map::DoDelayedMovesAndRemoves()
{
MoveAllCreaturesInMoveList();
RemoveAllObjectsInRemoveList();
}
//void Map::DoDelayedMovesAndRemoves()
//{
//MoveAllCreaturesInMoveList();
//RemoveAllObjectsInRemoveList();
//}
void Map::AddObjectToRemoveList(WorldObject *obj)
{
+4 -3
View File
@@ -340,6 +340,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
virtual void MoveAllCreaturesInMoveList();
virtual void RemoveAllObjectsInRemoveList();
virtual void RelocationNotify();
bool CreatureRespawnRelocation(Creature *c); // used only in MoveAllCreaturesInMoveList and ObjectGridUnloader
@@ -373,7 +374,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
void AddObjectToRemoveList(WorldObject *obj);
void AddObjectToSwitchList(WorldObject *obj, bool on);
void DoDelayedMovesAndRemoves();
//void DoDelayedMovesAndRemoves();
virtual bool RemoveBones(uint64 guid, float x, float y);
@@ -388,7 +389,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
bool ActiveObjectsNearGrid(uint32 x, uint32 y) const;
void AddUnitToNotify(Unit* unit);
void RelocationNotify();
void RemoveUnitFromNotify(int32 slot);
void SendToPlayers(WorldPacket const* data) const;
@@ -496,7 +497,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
time_t i_gridExpiry;
bool i_lock;
std::vector<uint64> i_unitsToNotifyBacklog;
std::vector<Unit*> i_unitsToNotifyBacklog;
std::vector<Unit*> i_unitsToNotify;
std::set<WorldObject *> i_objectsToRemove;
std::map<WorldObject*, bool> i_objectsToSwitch;
+6
View File
@@ -77,6 +77,12 @@ void MapInstanced::RemoveAllObjectsInRemoveList()
Map::RemoveAllObjectsInRemoveList();
}
void MapInstanced::RelocationNotify()
{
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
i->second->RelocationNotify();
}
bool MapInstanced::RemoveBones(uint64 guid, float x, float y)
{
bool remove_result = false;
+1
View File
@@ -37,6 +37,7 @@ class TRINITY_DLL_DECL MapInstanced : public Map
void Update(const uint32&);
void MoveAllCreaturesInMoveList();
void RemoveAllObjectsInRemoveList();
void RelocationNotify();
bool RemoveBones(uint64 guid, float x, float y);
void UnloadAll();
bool CanEnter(Player* player);
+1 -1
View File
@@ -270,7 +270,7 @@ MapManager::Update(uint32 diff)
void MapManager::DoDelayedMovesAndRemoves()
{
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
iter->second->DoDelayedMovesAndRemoves();
iter->second->RelocationNotify();
}
bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y)
+11
View File
@@ -20,6 +20,7 @@
#include "NullCreatureAI.h"
#include "Creature.h"
#include "TemporarySummon.h"
void PassiveAI::UpdateAI(const uint32)
{
@@ -68,3 +69,13 @@ void CritterAI::EnterEvadeMode()
me->SetControlled(false, UNIT_STAT_FLEEING);
CreatureAI::EnterEvadeMode();
}
void TriggerAI::UpdateAI(const uint32 diff)
{
if(!casted)
{
casted = true;
if(me->m_spells[0] && me->isSummon())
me->CastSpell(me, me->m_spells[0], false, 0, 0, ((TempSummon*)me)->GetSummonerGUID());
}
}
+9
View File
@@ -75,5 +75,14 @@ class TRINITY_DLL_DECL CritterAI : public PassiveAI
void EnterEvadeMode();
};
class TRINITY_DLL_DECL TriggerAI : public NullCreatureAI
{
public:
explicit TriggerAI(Creature *c) : NullCreatureAI(c), casted(false) {}
void UpdateAI(const uint32);
private:
bool casted;
};
#endif
+2 -2
View File
@@ -204,12 +204,12 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
case SUMMON_PET:
petlevel=owner->getLevel();
SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x800); //class=mage
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
// this enables popup window (pet dismiss, cancel)
break;
case HUNTER_PET:
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100);
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); //class=warrior,gender=none,power=focus
SetSheath(SHEATH_STATE_MELEE);
SetByteValue(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_RENAME_NOT_ALLOWED : UNIT_RENAME_ALLOWED);
+1 -1
View File
@@ -6489,7 +6489,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply)
return;
// not apply mods for broken item
if(item->IsBroken() && apply)
if(item->IsBroken())
return;
ItemPrototype const *proto = item->GetProto();
+12 -9
View File
@@ -176,12 +176,22 @@ void TempSummon::InitStats(uint32 duration)
if(m_type == TEMPSUMMON_MANUAL_DESPAWN)
m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
Unit *owner = GetSummoner();
if(owner && isTrigger() && m_spells[0])
{
setFaction(owner->getFaction());
SetLevel(owner->getLevel());
if(owner->GetTypeId() == TYPEID_PLAYER)
m_ControlledByPlayer = true;
}
if(!m_Properties)
return;
if(uint32 slot = m_Properties->Slot)
if(owner)
{
if(Unit *owner = GetSummoner())
if(uint32 slot = m_Properties->Slot)
{
if(owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
{
@@ -204,13 +214,6 @@ void TempSummon::InitSummon()
{
if(owner->GetTypeId()==TYPEID_UNIT && ((Creature*)owner)->IsAIEnabled)
((Creature*)owner)->AI()->JustSummoned(this);
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && m_spells[0])
{
setFaction(owner->getFaction());
SetLevel(owner->getLevel());
CastSpell(this, m_spells[0], false, 0, 0, m_summonerGUID);
}
}
}
+15 -10
View File
@@ -80,7 +80,7 @@ static bool procPrepared = InitTriggerAuraData();
Unit::Unit()
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
, m_IsInNotifyList(false), m_Notified(false), IsAIEnabled(false), NeedChangeAI(false)
, m_NotifyListPos(-1), m_Notified(false), IsAIEnabled(false), NeedChangeAI(false)
, i_AI(NULL), i_disabledAI(NULL), m_removedAurasCount(0), m_Vehicle(NULL), m_transport(NULL)
, m_ControlledByPlayer(false), m_procDeep(0)
{
@@ -10450,8 +10450,7 @@ void Unit::SetVisibility(UnitVisibility x)
{
m_Visibility = x;
if(IsInWorld())
SetToNotify();
SetToNotify();
if(x == VISIBILITY_GROUP_STEALTH)
DestroyForNearbyPlayers();
@@ -11685,7 +11684,8 @@ void Unit::AddToWorld()
{
WorldObject::AddToWorld();
m_Notified = false;
m_IsInNotifyList = false;
//assert(m_NotifyListPos < 0); instance : crash
m_NotifyListPos = -1;
SetToNotify();
}
}
@@ -11704,6 +11704,12 @@ void Unit::RemoveFromWorld()
RemoveNotOwnSingleTargetAuras();
ExitVehicle();
if(m_NotifyListPos >= 0)
{
GetMap()->RemoveUnitFromNotify(m_NotifyListPos);
m_NotifyListPos = -1;
}
if(GetCharmerGUID())
{
sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry());
@@ -13229,11 +13235,9 @@ bool Unit::HandleAuraRaidProcFromCharge( AuraEffect* triggeredByAura )
void Unit::SetToNotify()
{
if(m_IsInNotifyList)
return;
if(Map *map = GetMap())
map->AddUnitToNotify(this);
// it is called somewhere when obj is not in world (crash when log in instance)
if(m_NotifyListPos < 0)
GetMap()->AddUnitToNotify(this);
}
void Unit::Kill(Unit *pVictim, bool durabilityLoss)
@@ -13668,7 +13672,7 @@ void Unit::SetCharmedBy(Unit* charmer, CharmType type)
if(cinfo && cinfo->type == CREATURE_TYPE_DEMON)
{
//to prevent client crash
//SetFlag(UNIT_FIELD_BYTES_0, 2048);
SetByteValue(UNIT_FIELD_BYTES_0, 1, (uint8)CLASS_MAGE);
//just to enable stat window
if(GetCharmInfo())
@@ -13763,6 +13767,7 @@ void Unit::RemoveCharmedBy(Unit *charmer)
CreatureInfo const *cinfo = ((Creature*)this)->GetCreatureInfo();
if(cinfo && cinfo->type == CREATURE_TYPE_DEMON)
{
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
if(GetCharmInfo())
GetCharmInfo()->SetPetNumber(0, true);
else
+2 -1
View File
@@ -1722,7 +1722,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
// relocation notification
void SetToNotify();
bool m_Notified, m_IsInNotifyList;
bool m_Notified;
int32 m_NotifyListPos;
float oldX, oldY;
void SetReducedThreatPercent(uint32 pct, uint64 guid)
+22 -28
View File
@@ -1500,7 +1500,7 @@ void World::SetInitialWorldSettings()
LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime) VALUES('%u', " UI64FMTD ", '%s', 0)",
realmID, uint64(m_startTime), isoDate);
m_timers[WUPDATE_OBJECTS].SetInterval(0);
m_timers[WUPDATE_OBJECTS].SetInterval(IN_MILISECONDS/2);
m_timers[WUPDATE_SESSIONS].SetInterval(0);
m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILISECONDS);
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILISECONDS);
@@ -1698,14 +1698,9 @@ void World::Update(uint32 diff)
auctionmgr.Update();
}
RecordTimeDiff(NULL);
/// <li> Handle session updates when the timer has passed
if (m_timers[WUPDATE_SESSIONS].Passed())
{
m_timers[WUPDATE_SESSIONS].Reset();
UpdateSessions(diff);
}
RecordTimeDiff(NULL);
UpdateSessions(diff);
RecordTimeDiff("UpdateSessions");
/// <li> Handle weather updates when the timer has passed
@@ -1754,26 +1749,29 @@ void World::Update(uint32 diff)
}
/// <li> Handle all other objects
if (m_timers[WUPDATE_OBJECTS].Passed())
///- Update objects when the timer has passed (maps, transport, creatures,...)
MapManager::Instance().Update(diff); // As interval = 0
if(m_timers[WUPDATE_OBJECTS].Passed())
{
m_timers[WUPDATE_OBJECTS].Reset();
///- Update objects when the timer has passed (maps, transport, creatures,...)
MapManager::Instance().Update(diff); // As interval = 0
RecordTimeDiff(NULL);
///- Process necessary scripts
if (!m_scriptSchedule.empty())
ScriptsProcess();
RecordTimeDiff("UpdateScriptsProcess");
sBattleGroundMgr.Update(diff);
RecordTimeDiff("UpdateBattleGroundMgr");
sOutdoorPvPMgr.Update(diff);
RecordTimeDiff("UpdateOutdoorPvPMgr");
MapManager::Instance().DoDelayedMovesAndRemoves();
}
RecordTimeDiff(NULL);
///- Process necessary scripts
if (!m_scriptSchedule.empty())
{
RecordTimeDiff(NULL);
ScriptsProcess();
RecordTimeDiff("UpdateScriptsProcess");
}
sBattleGroundMgr.Update(diff);
RecordTimeDiff("UpdateBattleGroundMgr");
sOutdoorPvPMgr.Update(diff);
RecordTimeDiff("UpdateOutdoorPvPMgr");
// execute callbacks from sql queries that were queued recently
UpdateResultQueue();
RecordTimeDiff("UpdateResultQueue");
@@ -1795,10 +1793,6 @@ void World::Update(uint32 diff)
m_timers[WUPDATE_EVENTS].Reset();
}
/// </ul>
///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove"
//MapManager::Instance().DoDelayedMovesAndRemoves();
// update the instance reset times
sInstanceSaveManager.Update();