diff options
7 files changed, 5105 insertions, 0 deletions
diff --git a/sql/updates/hotfixes/master/9999_99_99_98_hotfixes.sql b/sql/updates/hotfixes/master/9999_99_99_98_hotfixes.sql new file mode 100644 index 00000000000..4413614b2ac --- /dev/null +++ b/sql/updates/hotfixes/master/9999_99_99_98_hotfixes.sql @@ -0,0 +1,77 @@ +-- Hotfix_Optional_Data (Required for creature sounds and conversations) +DELETE FROM `hotfix_optional_data` WHERE (`TableHash`=35137211 AND `RecordId`=214114 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xF175DE53CF97EC92B118552F097B2ADED2B25CD6DC19D8CF) OR (`TableHash`=35137211 AND `RecordId`=214113 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x394CBA225E477EBF602BF576552D8F5DFD9FE9EFF9E8BE2A) OR (`TableHash`=35137211 AND `RecordId`=214115 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xAC624E3375D8FFCF567A5CFFE30618A4A1101A5C454F5AA5) OR (`TableHash`=35137211 AND `RecordId`=214116 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xED04B99F2795DA9EA850DF3A5EEE4D3D483B7F75BD738266) OR (`TableHash`=35137211 AND `RecordId`=214955 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xBD106F86ACE4D091FACE3E365DFC7B44D4C406BF1B1A13EF) OR (`TableHash`=35137211 AND `RecordId`=214965 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x46D3E46BC2C3568DF230BD7D1FCDF2C20D1C9A1437B39E80) OR (`TableHash`=35137211 AND `RecordId`=214964 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xAF317D83C433AC4C9FEEFEE4F54F1E283E13EDA4D1676FE5) OR (`TableHash`=35137211 AND `RecordId`=215003 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x5620095989CE5875F61B258645A6EA59BC986F18FD0692EE) OR (`TableHash`=35137211 AND `RecordId`=214996 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x4FD1551A62CE38319AE689C95F624635C69C226CDFD33D3D) OR (`TableHash`=35137211 AND `RecordId`=214994 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x769125E12A4FD5963429FAAFF2D0822B1986DC2DCCB36433) OR (`TableHash`=35137211 AND `RecordId`=215001 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x118EBC29F1F883D33728A2C1E837FC7325880B06C46F2371) OR (`TableHash`=35137211 AND `RecordId`=214992 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xB6CF6E300A915CD0A2481821BC9AC28A09A22882A43CE112) OR (`TableHash`=35137211 AND `RecordId`=214637 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xA353DF8A249CE373EC2D29A38A23CDA6B014C3C3AB274918) OR (`TableHash`=35137211 AND `RecordId`=214638 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x54CD93D17AFCD550B9F63E7B117D518896E9FF2DB88635B0) OR (`TableHash`=35137211 AND `RecordId`=214639 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xA61B85BC9951842BBBC1B4F1C5E1D6D5896D6AE31ACB09E0) OR (`TableHash`=35137211 AND `RecordId`=214966 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xBD7A37C83254EAA3878E5D5FECC069FAE2B8E21222801344) OR (`TableHash`=35137211 AND `RecordId`=214979 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x12F8B6EF4B87646A17A6CC570CF5E70A8CEB3D57B72B3193) OR (`TableHash`=35137211 AND `RecordId`=214989 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xBF44C07607F041965913268633CCF039B408580CB33F6C55) OR (`TableHash`=35137211 AND `RecordId`=214971 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xD2AD8FCFFAA9EC1363CDBC06EBA734BA50002F85CDF0F25B) OR (`TableHash`=35137211 AND `RecordId`=214970 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x0EDED15B3AA6178D0E61DD35D25F15A395D27DB84A70D16B) OR (`TableHash`=35137211 AND `RecordId`=215004 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x9725E71F28514FAB18C70DDBE44B69DD6BFC3360C1C78F8D) OR (`TableHash`=35137211 AND `RecordId`=214954 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x8D1432002A88A021AC97F275E89C8B855167E7AFB7999665) OR (`TableHash`=35137211 AND `RecordId`=214963 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x90C2F33E68C7FA865E236E334DD7C02C59BA58EA093435A3) OR (`TableHash`=35137211 AND `RecordId`=214960 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x9F48D24B9D15CB900083063E6897AC5B5477D76002CC1861) OR (`TableHash`=35137211 AND `RecordId`=214961 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x5FA4D092523DB233A15F353689C6A22C06464E93E560B035) OR (`TableHash`=35137211 AND `RecordId`=214962 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xDA556420FA3306522833B95E14F4193B79E9C38627BD10EC) OR (`TableHash`=35137211 AND `RecordId`=214636 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x43E6AAD69A0D945C2B318CEFDB91FDABE0139F52769413F5) OR (`TableHash`=35137211 AND `RecordId`=214089 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xDCA9AF1D3CE510371B5BBC28909B706E3F6296FFC8BBD320) OR (`TableHash`=35137211 AND `RecordId`=215436 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xBCC8E5376E263392EA21FC6DCF09D5E630E0D623D4E2978A) OR (`TableHash`=35137211 AND `RecordId`=214090 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x1E9945844DFA1472E54BD9E8C1793313A1E93CB002E85741) OR (`TableHash`=35137211 AND `RecordId`=214104 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x4105EDA0389A82F09DEB7E0F27C1C7C4A299122FEA883FFD) OR (`TableHash`=35137211 AND `RecordId`=214091 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xB8557F40EF89F662DA86FB037F5EF1F7D3AA010EA34B5E10) OR (`TableHash`=35137211 AND `RecordId`=214105 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0xAFE2A57DFD298E423C4032B9019C71E83CE7C9D9538E708A) OR (`TableHash`=35137211 AND `RecordId`=214069 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x2585386E20C157E96B62B03BB785DB9F38A4FF132D769F9F) OR (`TableHash`=35137211 AND `RecordId`=243553 AND `locale`='enUS' AND `Key`=3744420815 AND `Data`=0x1A6940C7706E8D0146585C9FBC350C8A0270E4E1E73A3751); +INSERT INTO `hotfix_optional_data` (`TableHash`, `RecordId`, `locale`, `Key`, `Data`, `VerifiedBuild`) VALUES +(35137211, 214114, 'enUS', 3744420815, 0xF175DE53CF97EC92B118552F097B2ADED2B25CD6DC19D8CF, 51485), +(35137211, 214113, 'enUS', 3744420815, 0x394CBA225E477EBF602BF576552D8F5DFD9FE9EFF9E8BE2A, 51485), +(35137211, 214115, 'enUS', 3744420815, 0xAC624E3375D8FFCF567A5CFFE30618A4A1101A5C454F5AA5, 51485), +(35137211, 214116, 'enUS', 3744420815, 0xED04B99F2795DA9EA850DF3A5EEE4D3D483B7F75BD738266, 51485), +(35137211, 214955, 'enUS', 3744420815, 0xBD106F86ACE4D091FACE3E365DFC7B44D4C406BF1B1A13EF, 51485), +(35137211, 214965, 'enUS', 3744420815, 0x46D3E46BC2C3568DF230BD7D1FCDF2C20D1C9A1437B39E80, 51485), +(35137211, 214964, 'enUS', 3744420815, 0xAF317D83C433AC4C9FEEFEE4F54F1E283E13EDA4D1676FE5, 51485), +(35137211, 215003, 'enUS', 3744420815, 0x5620095989CE5875F61B258645A6EA59BC986F18FD0692EE, 51485), +(35137211, 214996, 'enUS', 3744420815, 0x4FD1551A62CE38319AE689C95F624635C69C226CDFD33D3D, 51485), +(35137211, 214994, 'enUS', 3744420815, 0x769125E12A4FD5963429FAAFF2D0822B1986DC2DCCB36433, 51485), +(35137211, 215001, 'enUS', 3744420815, 0x118EBC29F1F883D33728A2C1E837FC7325880B06C46F2371, 51485), +(35137211, 214992, 'enUS', 3744420815, 0xB6CF6E300A915CD0A2481821BC9AC28A09A22882A43CE112, 51485), +(35137211, 214637, 'enUS', 3744420815, 0xA353DF8A249CE373EC2D29A38A23CDA6B014C3C3AB274918, 51485), +(35137211, 214638, 'enUS', 3744420815, 0x54CD93D17AFCD550B9F63E7B117D518896E9FF2DB88635B0, 51485), +(35137211, 214639, 'enUS', 3744420815, 0xA61B85BC9951842BBBC1B4F1C5E1D6D5896D6AE31ACB09E0, 51485), +(35137211, 214966, 'enUS', 3744420815, 0xBD7A37C83254EAA3878E5D5FECC069FAE2B8E21222801344, 51485), +(35137211, 214979, 'enUS', 3744420815, 0x12F8B6EF4B87646A17A6CC570CF5E70A8CEB3D57B72B3193, 51485), +(35137211, 214989, 'enUS', 3744420815, 0xBF44C07607F041965913268633CCF039B408580CB33F6C55, 51485), +(35137211, 214971, 'enUS', 3744420815, 0xD2AD8FCFFAA9EC1363CDBC06EBA734BA50002F85CDF0F25B, 51485), +(35137211, 214970, 'enUS', 3744420815, 0x0EDED15B3AA6178D0E61DD35D25F15A395D27DB84A70D16B, 51485), +(35137211, 215004, 'enUS', 3744420815, 0x9725E71F28514FAB18C70DDBE44B69DD6BFC3360C1C78F8D, 51485), +(35137211, 214954, 'enUS', 3744420815, 0x8D1432002A88A021AC97F275E89C8B855167E7AFB7999665, 51485), +(35137211, 214963, 'enUS', 3744420815, 0x90C2F33E68C7FA865E236E334DD7C02C59BA58EA093435A3, 51485), +(35137211, 214960, 'enUS', 3744420815, 0x9F48D24B9D15CB900083063E6897AC5B5477D76002CC1861, 51485), +(35137211, 214961, 'enUS', 3744420815, 0x5FA4D092523DB233A15F353689C6A22C06464E93E560B035, 51485), +(35137211, 214962, 'enUS', 3744420815, 0xDA556420FA3306522833B95E14F4193B79E9C38627BD10EC, 51485), +(35137211, 214636, 'enUS', 3744420815, 0x43E6AAD69A0D945C2B318CEFDB91FDABE0139F52769413F5, 51485), +(35137211, 214089, 'enUS', 3744420815, 0xDCA9AF1D3CE510371B5BBC28909B706E3F6296FFC8BBD320, 51485), +(35137211, 215436, 'enUS', 3744420815, 0xBCC8E5376E263392EA21FC6DCF09D5E630E0D623D4E2978A, 51485), +(35137211, 214090, 'enUS', 3744420815, 0x1E9945844DFA1472E54BD9E8C1793313A1E93CB002E85741, 51485), +(35137211, 214104, 'enUS', 3744420815, 0x4105EDA0389A82F09DEB7E0F27C1C7C4A299122FEA883FFD, 51485), +(35137211, 214091, 'enUS', 3744420815, 0xB8557F40EF89F662DA86FB037F5EF1F7D3AA010EA34B5E10, 51485), +(35137211, 214105, 'enUS', 3744420815, 0xAFE2A57DFD298E423C4032B9019C71E83CE7C9D9538E708A, 51485), +(35137211, 214069, 'enUS', 3744420815, 0x2585386E20C157E96B62B03BB785DB9F38A4FF132D769F9F, 51485), +(35137211, 243553, 'enUS', 3744420815, 0x1A6940C7706E8D0146585C9FBC350C8A0270E4E1E73A3751, 51485); + +-- Hotfix Optional Data German +DELETE FROM `hotfix_optional_data` WHERE (`TableHash`=35137211 AND `RecordId`=214114 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xF175DE53CF97EC92B118552F097B2ADED2B25CD6DC19D8CF) OR (`TableHash`=35137211 AND `RecordId`=214113 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x394CBA225E477EBF602BF576552D8F5DFD9FE9EFF9E8BE2A) OR (`TableHash`=35137211 AND `RecordId`=214115 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xAC624E3375D8FFCF567A5CFFE30618A4A1101A5C454F5AA5) OR (`TableHash`=35137211 AND `RecordId`=214116 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xED04B99F2795DA9EA850DF3A5EEE4D3D483B7F75BD738266) OR (`TableHash`=35137211 AND `RecordId`=214955 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xBD106F86ACE4D091FACE3E365DFC7B44D4C406BF1B1A13EF) OR (`TableHash`=35137211 AND `RecordId`=214965 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x46D3E46BC2C3568DF230BD7D1FCDF2C20D1C9A1437B39E80) OR (`TableHash`=35137211 AND `RecordId`=214964 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xAF317D83C433AC4C9FEEFEE4F54F1E283E13EDA4D1676FE5) OR (`TableHash`=35137211 AND `RecordId`=215003 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x5620095989CE5875F61B258645A6EA59BC986F18FD0692EE) OR (`TableHash`=35137211 AND `RecordId`=214996 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x4FD1551A62CE38319AE689C95F624635C69C226CDFD33D3D) OR (`TableHash`=35137211 AND `RecordId`=214994 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x769125E12A4FD5963429FAAFF2D0822B1986DC2DCCB36433) OR (`TableHash`=35137211 AND `RecordId`=215001 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x118EBC29F1F883D33728A2C1E837FC7325880B06C46F2371) OR (`TableHash`=35137211 AND `RecordId`=214992 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xB6CF6E300A915CD0A2481821BC9AC28A09A22882A43CE112) OR (`TableHash`=35137211 AND `RecordId`=214637 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xA353DF8A249CE373EC2D29A38A23CDA6B014C3C3AB274918) OR (`TableHash`=35137211 AND `RecordId`=214638 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x54CD93D17AFCD550B9F63E7B117D518896E9FF2DB88635B0) OR (`TableHash`=35137211 AND `RecordId`=214639 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xA61B85BC9951842BBBC1B4F1C5E1D6D5896D6AE31ACB09E0) OR (`TableHash`=35137211 AND `RecordId`=214966 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xBD7A37C83254EAA3878E5D5FECC069FAE2B8E21222801344) OR (`TableHash`=35137211 AND `RecordId`=214979 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x12F8B6EF4B87646A17A6CC570CF5E70A8CEB3D57B72B3193) OR (`TableHash`=35137211 AND `RecordId`=214989 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xBF44C07607F041965913268633CCF039B408580CB33F6C55) OR (`TableHash`=35137211 AND `RecordId`=214971 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xD2AD8FCFFAA9EC1363CDBC06EBA734BA50002F85CDF0F25B) OR (`TableHash`=35137211 AND `RecordId`=214970 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x0EDED15B3AA6178D0E61DD35D25F15A395D27DB84A70D16B) OR (`TableHash`=35137211 AND `RecordId`=215004 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x9725E71F28514FAB18C70DDBE44B69DD6BFC3360C1C78F8D) OR (`TableHash`=35137211 AND `RecordId`=214954 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x8D1432002A88A021AC97F275E89C8B855167E7AFB7999665) OR (`TableHash`=35137211 AND `RecordId`=214963 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x90C2F33E68C7FA865E236E334DD7C02C59BA58EA093435A3) OR (`TableHash`=35137211 AND `RecordId`=214960 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x9F48D24B9D15CB900083063E6897AC5B5477D76002CC1861) OR (`TableHash`=35137211 AND `RecordId`=214961 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x5FA4D092523DB233A15F353689C6A22C06464E93E560B035) OR (`TableHash`=35137211 AND `RecordId`=214962 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xDA556420FA3306522833B95E14F4193B79E9C38627BD10EC) OR (`TableHash`=35137211 AND `RecordId`=214636 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x43E6AAD69A0D945C2B318CEFDB91FDABE0139F52769413F5) OR (`TableHash`=35137211 AND `RecordId`=214089 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xDCA9AF1D3CE510371B5BBC28909B706E3F6296FFC8BBD320) OR (`TableHash`=35137211 AND `RecordId`=215436 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xBCC8E5376E263392EA21FC6DCF09D5E630E0D623D4E2978A) OR (`TableHash`=35137211 AND `RecordId`=214090 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x1E9945844DFA1472E54BD9E8C1793313A1E93CB002E85741) OR (`TableHash`=35137211 AND `RecordId`=214104 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x4105EDA0389A82F09DEB7E0F27C1C7C4A299122FEA883FFD) OR (`TableHash`=35137211 AND `RecordId`=214091 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xB8557F40EF89F662DA86FB037F5EF1F7D3AA010EA34B5E10) OR (`TableHash`=35137211 AND `RecordId`=214105 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0xAFE2A57DFD298E423C4032B9019C71E83CE7C9D9538E708A) OR (`TableHash`=35137211 AND `RecordId`=214069 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x2585386E20C157E96B62B03BB785DB9F38A4FF132D769F9F) OR (`TableHash`=35137211 AND `RecordId`=243553 AND `locale`='deDE' AND `Key`=3744420815 AND `Data`=0x1A6940C7706E8D0146585C9FBC350C8A0270E4E1E73A3751); +INSERT INTO `hotfix_optional_data` (`TableHash`, `RecordId`, `locale`, `Key`, `Data`, `VerifiedBuild`) VALUES +(35137211, 214114, 'deDE', 3744420815, 0xF175DE53CF97EC92B118552F097B2ADED2B25CD6DC19D8CF, 51485), +(35137211, 214113, 'deDE', 3744420815, 0x394CBA225E477EBF602BF576552D8F5DFD9FE9EFF9E8BE2A, 51485), +(35137211, 214115, 'deDE', 3744420815, 0xAC624E3375D8FFCF567A5CFFE30618A4A1101A5C454F5AA5, 51485), +(35137211, 214116, 'deDE', 3744420815, 0xED04B99F2795DA9EA850DF3A5EEE4D3D483B7F75BD738266, 51485), +(35137211, 214955, 'deDE', 3744420815, 0xBD106F86ACE4D091FACE3E365DFC7B44D4C406BF1B1A13EF, 51485), +(35137211, 214965, 'deDE', 3744420815, 0x46D3E46BC2C3568DF230BD7D1FCDF2C20D1C9A1437B39E80, 51485), +(35137211, 214964, 'deDE', 3744420815, 0xAF317D83C433AC4C9FEEFEE4F54F1E283E13EDA4D1676FE5, 51485), +(35137211, 215003, 'deDE', 3744420815, 0x5620095989CE5875F61B258645A6EA59BC986F18FD0692EE, 51485), +(35137211, 214996, 'deDE', 3744420815, 0x4FD1551A62CE38319AE689C95F624635C69C226CDFD33D3D, 51485), +(35137211, 214994, 'deDE', 3744420815, 0x769125E12A4FD5963429FAAFF2D0822B1986DC2DCCB36433, 51485), +(35137211, 215001, 'deDE', 3744420815, 0x118EBC29F1F883D33728A2C1E837FC7325880B06C46F2371, 51485), +(35137211, 214992, 'deDE', 3744420815, 0xB6CF6E300A915CD0A2481821BC9AC28A09A22882A43CE112, 51485), +(35137211, 214637, 'deDE', 3744420815, 0xA353DF8A249CE373EC2D29A38A23CDA6B014C3C3AB274918, 51485), +(35137211, 214638, 'deDE', 3744420815, 0x54CD93D17AFCD550B9F63E7B117D518896E9FF2DB88635B0, 51485), +(35137211, 214639, 'deDE', 3744420815, 0xA61B85BC9951842BBBC1B4F1C5E1D6D5896D6AE31ACB09E0, 51485), +(35137211, 214966, 'deDE', 3744420815, 0xBD7A37C83254EAA3878E5D5FECC069FAE2B8E21222801344, 51485), +(35137211, 214979, 'deDE', 3744420815, 0x12F8B6EF4B87646A17A6CC570CF5E70A8CEB3D57B72B3193, 51485), +(35137211, 214989, 'deDE', 3744420815, 0xBF44C07607F041965913268633CCF039B408580CB33F6C55, 51485), +(35137211, 214971, 'deDE', 3744420815, 0xD2AD8FCFFAA9EC1363CDBC06EBA734BA50002F85CDF0F25B, 51485), +(35137211, 214970, 'deDE', 3744420815, 0x0EDED15B3AA6178D0E61DD35D25F15A395D27DB84A70D16B, 51485), +(35137211, 215004, 'deDE', 3744420815, 0x9725E71F28514FAB18C70DDBE44B69DD6BFC3360C1C78F8D, 51485), +(35137211, 214954, 'deDE', 3744420815, 0x8D1432002A88A021AC97F275E89C8B855167E7AFB7999665, 51485), +(35137211, 214963, 'deDE', 3744420815, 0x90C2F33E68C7FA865E236E334DD7C02C59BA58EA093435A3, 51485), +(35137211, 214960, 'deDE', 3744420815, 0x9F48D24B9D15CB900083063E6897AC5B5477D76002CC1861, 51485), +(35137211, 214961, 'deDE', 3744420815, 0x5FA4D092523DB233A15F353689C6A22C06464E93E560B035, 51485), +(35137211, 214962, 'deDE', 3744420815, 0xDA556420FA3306522833B95E14F4193B79E9C38627BD10EC, 51485), +(35137211, 214636, 'deDE', 3744420815, 0x43E6AAD69A0D945C2B318CEFDB91FDABE0139F52769413F5, 51485), +(35137211, 214089, 'deDE', 3744420815, 0xDCA9AF1D3CE510371B5BBC28909B706E3F6296FFC8BBD320, 51485), +(35137211, 215436, 'deDE', 3744420815, 0xBCC8E5376E263392EA21FC6DCF09D5E630E0D623D4E2978A, 51485), +(35137211, 214090, 'deDE', 3744420815, 0x1E9945844DFA1472E54BD9E8C1793313A1E93CB002E85741, 51485), +(35137211, 214104, 'deDE', 3744420815, 0x4105EDA0389A82F09DEB7E0F27C1C7C4A299122FEA883FFD, 51485), +(35137211, 214091, 'deDE', 3744420815, 0xB8557F40EF89F662DA86FB037F5EF1F7D3AA010EA34B5E10, 51485), +(35137211, 214105, 'deDE', 3744420815, 0xAFE2A57DFD298E423C4032B9019C71E83CE7C9D9538E708A, 51485), +(35137211, 214069, 'deDE', 3744420815, 0x2585386E20C157E96B62B03BB785DB9F38A4FF132D769F9F, 51485), +(35137211, 243553, 'deDE', 3744420815, 0x1A6940C7706E8D0146585C9FBC350C8A0270E4E1E73A3751, 51485);
\ No newline at end of file diff --git a/sql/updates/world/master/2023_11_10_00_world.sql b/sql/updates/world/master/2023_11_10_00_world.sql new file mode 100644 index 00000000000..a773bd7d9fd --- /dev/null +++ b/sql/updates/world/master/2023_11_10_00_world.sql @@ -0,0 +1,626 @@ +-- Sepulcher of the First Ones +SET @CGUID := 8000002; -- Insert highest based on your db +SET @OGUID := 8000012; -- Insert highest based on your db +SET @ATID := 49; +SET @ATSPAWNID := 49; + +-- Instance +DELETE FROM `access_requirement` WHERE `mapId`=2481; +INSERT INTO `access_requirement` (`mapId`, `difficulty`, `level_min`, `level_max`, `item`, `item2`, `quest_done_A`, `quest_done_H`, `completed_achievement`, `quest_failed_text`, `comment`) VALUES +(2481, 16, 60, 0, 0, 0, 0, 0, 0, NULL, 'Sepulcher of the First Ones - Mythic Mode'), +(2481, 15, 60, 0, 0, 0, 0, 0, 0, NULL, 'Sepulcher of the First Ones - Heroic Mode'), +(2481, 14, 60, 0, 0, 0, 0, 0, 0, NULL, 'Sepulcher of the First Ones - Normal Mode'), +(2481, 17, 60, 0, 0, 0, 0, 0, 0, NULL, 'Sepulcher of the First Ones - Looking for Raid Mode'); + +DELETE FROM `instance_template` WHERE `map`=2481; +INSERT INTO `instance_template` (`map`, `parent`, `script`) VALUES +(2481, 0, 'instance_sepulcher_of_the_first_ones'); + +DELETE FROM `world_state` WHERE `ID` IN (20839, 21302); +INSERT INTO `world_state` (`ID`, `DefaultValue`, `MapIDs`, `AreaIDs`, `ScriptName`, `Comment`) VALUES +(20839, 1, NULL, NULL, '', 'Sepulcher of the First Ones - Normal and Heroic Difficulty Open'), +(21302, 1, NULL, NULL, '', 'Sepulcher of the First Ones - Mythic Difficulty Open'); + +-- Game Objects +DELETE FROM `gameobject_template_addon` WHERE `entry` IN (375110, 375035, 375901); +INSERT INTO `gameobject_template_addon` (`entry`, `faction`, `flags`, `WorldEffectID`, `AIAnimKitID`) VALUES +(375110, 0, 16, 0, 0), -- Bridge to Anduin +(375035, 0, 16, 0, 0), -- Bridge after Anduin +(375901, 94, 2113568, 0, 0); -- Anduin Chest loot + +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+1; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID+0, 375110, 2481, 13742, 13965, '14,15,16,17', '0', 0, -3824.822265625, -2658.32080078125, 83.4433746337890625, 4.712392330169677734, 0, 0, -0.70710563659667968, 0.707107901573181152, 604800, 255, 1, 50747), +(@OGUID+1, 375035, 2481, 13742, 13965, '14,15,16,17', '0', 0, -3825.06591796875, -2785.4755859375, 88.5488128662109375, 1.570795774459838867, 0, 0, 0.707106590270996093, 0.707106947898864746, 604800, 255, 0, 50747); + +DELETE FROM `gameobject_addon` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+1; +INSERT INTO `gameobject_addon` (`guid`, `parent_rotation0`, `parent_rotation1`, `parent_rotation2`, `parent_rotation3`, `WorldEffectID`, `AIAnimKitID`) VALUES +(@OGUID+0, 0, 0, 1, -0.00000004371138828, 0, 0), -- Bridge to Anduin +(@OGUID+1, 0, 0, 1, -0.00000004371138828, 0, 0); -- Bridge after Anduin + +-- Smart Scripts +DELETE FROM `smart_scripts` WHERE `entryorguid`=184297; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param_string`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `action_param7`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(184297, 0, 0, 1, 62, 0, 100, 0, 27524, 0, 0, 0, 0, '', 85, 364475, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Dominated Translocator - Teleport to Cosmic Hub'), +(184297, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, '', 72, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Dominated Translocator - On Gossip Option selected - Close Menu'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=185843; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param_string`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `action_param7`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(185843, 0, 0, 1, 62, 0, 100, 0, 27687, 0, 0, 0, 0, '', 85, 368563, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Ancient Console - Teleport to Domination Grasp'), +(185843, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, '', 72, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Ancient Console - On Gossip Option selected - Close Menu'); + +-- Creature Templates +UPDATE `creature_template` SET `faction`=16, `BaseAttackTime`=2000, `unit_flags`=33554432, `unit_flags2`=2048, `unit_flags3`=524289 WHERE `entry`=184585; -- Befouled Barrier +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_uther', `faction`=35, `speed_walk`=1.60000002384185791, `BaseAttackTime`=2000, `unit_flags`=32832 WHERE `entry`=183665; -- Uther the Lightbringer +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_jaina', `faction`=35, `speed_walk`=1.60000002384185791, `BaseAttackTime`=2000, `unit_flags`=32832 WHERE `entry`=183664; -- Lady Jaina Proudmoore +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_sylvanas', `faction`=35, `speed_walk`=1.60000002384185791, `BaseAttackTime`=2000, `unit_flags`=32832 WHERE `entry`=183666; -- Sylvanas Windrunner +UPDATE `creature_template` SET `faction`=1665, `npcflag`=4224, `BaseAttackTime`=2000, `unit_flags`=33088, `unit_flags2`=2048, `unit_flags3`=1 WHERE `entry`=186785; -- Quartermaster Rahm +UPDATE `creature_template` SET `faction`=1665, `npcflag`=3, `BaseAttackTime`=2000, `unit_flags`=32768, `unit_flags2`=2048, `unit_flags3`=1 WHERE `entry`=184601; -- Highlord Bolvar Fordragon +UPDATE `creature_template` SET `faction`=1665, `BaseAttackTime`=2000, `unit_flags`=33024, `unit_flags2`=2048, `unit_flags3`=1 WHERE `entry`=184613; -- Knight of the Ebon Blade +UPDATE `creature_template` SET `faction`=1665, `BaseAttackTime`=2000, `unit_flags`=32768, `unit_flags2`=2048, `unit_flags3`=1 WHERE `entry`=184599; -- Thrall +UPDATE `creature_template` SET `ScriptName`='', `faction`=1665, `BaseAttackTime`=2000, `unit_flags`=32768, `unit_flags2`=2048, `unit_flags3`=1 WHERE `entry`=184589; -- Firim +UPDATE `creature_template` SET `faction`=35, `npcflag`=8192, `speed_run`=1, `BaseAttackTime`=2000, `unit_flags`=768, `unit_flags2`=67143680, `unit_flags3`=16777217 WHERE `entry` IN (182431, 184354); -- Ancient Translocator +UPDATE `creature_template` SET `AIName` = 'SmartAI', `faction`=14, `npcflag`=1, `speed_run`=1, `BaseAttackTime`=2000, `unit_flags`=768, `unit_flags2`=71354368, `unit_flags3`=16777217 WHERE `entry`=184297; -- Dominated Translocator +UPDATE `creature_template` SET `ScriptName`='boss_anduin_wrynn', `faction`=16, `speed_walk`=4.40000009536743164, `speed_run`=1.571428537368774414, `BaseAttackTime`=2000, `unit_flags`=262208, `mechanic_immune_mask`=617299827, `flags_extra` = 0x1 | 0x80000 WHERE `entry`=181954; -- Anduin Wrynn +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_anduin_despair', `faction`=14, `speed_walk`=5.599999904632568359, `speed_run`=2, `BaseAttackTime`=1500, `unit_flags2`=2048 WHERE `entry`=184520; -- Anduin's Despair +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_anduin_soul', `faction`=35, `BaseAttackTime`=2000, `unit_flags`=768, `unit_flags2`=67108864, `unit_flags3`=23068672 WHERE `entry`=184519; -- Anduin's Soul +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_anduin_doubt', `faction`=14, `BaseAttackTime`=2000, `unit_flags2`=2048, `unit_flags3`=4194304 WHERE `entry`=184494; -- Anduin's Doubt +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_anduin_hope', `faction`=35, `speed_walk`=0.219999998807907104, `speed_run`=0.078571431338787078, `BaseAttackTime`=2000, `unit_flags3`=6291456 WHERE `entry`=184493; -- Anduin's Hope +UPDATE `creature_template` SET `ScriptName`='boss_remnant_of_a_fallen_king', `faction`=14, `speed_walk`=5.599999904632568359, `speed_run`=2, `BaseAttackTime`=1250, `unit_flags3`=4194304 WHERE `entry`=183463; -- Remnant of a Fallen King +UPDATE `creature_template` SET `faction`=16, `speed_walk`=0.60000002384185791, `BaseAttackTime`=2000, `unit_flags`=33554432, `unit_flags2`=2048, `unit_flags3`=1 WHERE `entry`=183793; -- March of the Damned +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_monstrous_soul', `faction`=14, `speed_walk`=5.599999904632568359, `speed_run`=2, `BaseAttackTime`=2000, `unit_flags2`=2048, `unit_flags3`=0 WHERE `entry`=183671; -- Monstrous Soul +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_fiendish_soul', `faction`=14, `BaseAttackTime`=2000, `unit_flags2`=2048, `unit_flags3`=4718592 WHERE `entry`=183669; -- Fiendish Soul +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_lost_soul', `faction`=14, `BaseAttackTime`=2000, `unit_flags`=32768, `unit_flags2`=32816, `unit_flags3`=4718592 WHERE `entry`=185607; -- Lost Soul +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_beacon_of_hope', `faction`=35, `BaseAttackTime`=2000, `unit_flags`=33554432, `unit_flags2`=2048, `unit_flags3`=1 WHERE `entry`=184830; -- Beacon of Hope +UPDATE `creature_template` SET `AIName` = 'SmartAI', `faction`=35, `npcflag`=1, `speed_run`=1, `BaseAttackTime`=2000, `unit_flags`=768, `unit_flags2`=67160064, `unit_flags3`=16777217 WHERE `entry` IN (185843); -- Ancient Console +UPDATE `creature_template` SET `ScriptName`='npc_anduin_wrynn_grim_reflection', `faction`=16, `speed_walk`=1.20000004768371582, `speed_run`=1, `BaseAttackTime`=2000, `unit_flags`=32768, `unit_flags2`=2080, `unit_flags3`=4718592 WHERE `entry`=183033; -- Grim Reflection + +-- Template Addon +DELETE FROM `creature_template_addon` WHERE `entry` IN (184830,183671,183669,183793,183463,184519,184494,184493,183452,184585,184297,183033,181954); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES +(184830, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- 184830 (Beacon of Hope) - 362702 +(183671, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '362719'), -- 183671 (Monstrous Soul) - 362719 +(183669, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '368977'), -- 183669 (Fiendish Soul) - 368977 +(183793, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, '363116'), -- 183793 (March of the Damned) - 363116 +(183463, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '362490'), -- 183463 (Remnant of a Fallen King) - 362490 +(184519, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, '369016'), -- 184519 (Anduin's Soul) - 369016 +(184494, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '370833'), -- 184494 (Anduin's Doubt) - 370833 +(184493, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '365218'), -- 184493 (Anduin's Hope) - 365218 +(183452, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '362473'), -- 183452 (Empty Vessel) - 362473 +(184585, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '365633'), -- 184585 (Befouled Barrier) - 365633 +(184297, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, ''), -- 184297 (Dominated Translocator) +(183033, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '361685'), -- 183033 (Grim Reflection) - 361685 +(181954, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '365177'); -- 181954 (Anduin Wrynn) - 365177 + +-- Equip Template +DELETE FROM `creature_equip_template` WHERE (`ID`=1 AND `CreatureID` IN (183463,183666,181954,183665,183664,184601,184599,184589,176332,184613,186785)) +OR (`ID`=7 AND `CreatureID`=184613) OR (`ID`=6 AND `CreatureID`=184613) OR (`ID`=5 AND `CreatureID`=184613) OR (`ID`=3 AND `CreatureID`=184613) OR (`ID`=2 AND `CreatureID`=184613); +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `AppearanceModID1`, `ItemVisual1`, `ItemID2`, `AppearanceModID2`, `ItemVisual2`, `ItemID3`, `AppearanceModID3`, `ItemVisual3`, `VerifiedBuild`) VALUES +(183463, 1, 124542, 0, 0, 0, 0, 0, 0, 0, 0, 50747), -- Remnant of a Fallen King +(183666, 1, 0, 0, 0, 0, 0, 0, 42775, 0, 0, 50747), -- Sylvanas Windrunner +(181954, 1, 183938, 0, 0, 0, 0, 0, 0, 0, 0, 50747), -- Anduin Wrynn +(183665, 1, 173369, 0, 0, 0, 0, 0, 0, 0, 0, 50747), -- Uther the Lightbringer +(183664, 1, 153575, 0, 0, 0, 0, 0, 0, 0, 0, 50747), -- Lady Jaina Proudmoore +(184601, 1, 177838, 0, 0, 0, 0, 0, 0, 0, 0, 43206), -- Highlord Bolvar Fordragon +(184599, 1, 168268, 0, 0, 0, 0, 0, 0, 0, 0, 43206), -- Thrall +(184589, 1, 185331, 0, 0, 0, 0, 0, 0, 0, 0, 43206), -- Firim +(176332, 1, 117049, 0, 0, 0, 0, 0, 0, 0, 0, 43206), -- Knight of the Ebon Blade +(184613, 1, 75223, 0, 0, 0, 0, 0, 0, 0, 0, 43206), -- Knight of the Ebon Blade +(186785, 1, 117049, 0, 0, 0, 0, 0, 0, 0, 0, 43206), -- Quartermaster Rahm +(184613, 7, 171617, 0, 0, 0, 0, 0, 0, 0, 0, 50747), -- Knight of the Ebon Blade +(184613, 6, 75223, 0, 0, 0, 0, 0, 0, 0, 0, 50747), -- Knight of the Ebon Blade +(184613, 5, 174488, 0, 0, 0, 0, 0, 0, 0, 0, 50747), -- Knight of the Ebon Blade +(184613, 3, 164981, 0, 0, 0, 0, 0, 0, 0, 0, 43206), -- Knight of the Ebon Blade +(184613, 2, 117049, 0, 0, 0, 0, 0, 0, 0, 0, 43206); -- Knight of the Ebon Blade + +-- Model Info +UPDATE `creature_model_info` SET `BoundingRadius`=0.373567014932632446, `CombatReach`=2, `VerifiedBuild`=50747 WHERE `DisplayID`=105386; +UPDATE `creature_model_info` SET `BoundingRadius`=1, `CombatReach`=1, `VerifiedBuild`=50747 WHERE `DisplayID`=22234; +UPDATE `creature_model_info` SET `BoundingRadius`=0.875744104385375976, `CombatReach`=1, `VerifiedBuild`=50747 WHERE `DisplayID`=105398; +UPDATE `creature_model_info` SET `BoundingRadius`=1.842974543571472167, `CombatReach`=2.20000004768371582, `VerifiedBuild`=50747 WHERE `DisplayID`=105399; +UPDATE `creature_model_info` SET `BoundingRadius`=0.453419983386993408, `VerifiedBuild`=50747 WHERE `DisplayID`=105282; +UPDATE `creature_model_info` SET `BoundingRadius`=0.498761951923370361, `VerifiedBuild`=50747 WHERE `DisplayID`=105380; +UPDATE `creature_model_info` SET `BoundingRadius`=0.410923719406127929, `VerifiedBuild`=50747 WHERE `DisplayID`=105384; + +-- Summon groups +DELETE FROM `creature_summon_groups` WHERE `summonerId`=181954; +INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`, `Comment`) VALUES +(181954, 0, 0, 183666, -3819.48, -2687.19, 91.3485, 4.5587, 8, 0, 'Sylvanas - Anduin Wrynn Encounter'), +(181954, 0, 0, 183665, -3828.03, -2688.25, 91.3485, 5.46062, 8, 0, 'Uther - Anduin Wrynn Encounter'), +(181954, 0, 0, 183664, -3824.65, -2692.2, 91.3485, 4.64412, 8, 0, 'Jaina - Anduin Wrynn Encounter'); + +-- Mythic Difficulty +DELETE FROM `creature_template_difficulty` WHERE (`DifficultyID`=16 AND `Entry` IN (183666,183665,183664,184589,184613,184599,184601,186785,181954,184520,184519,184494,184493,183033,184830,183671,183669,183793,183463,183452,185607,184585,182431,184297,185843)); +INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `LevelScalingDeltaMin`, `LevelScalingDeltaMax`, `ContentTuningID`, `HealthScalingExpansion`, `HealthModifier`, `ManaModifier`, `CreatureDifficultyID`, `TypeFlags`, `TypeFlags2`, `VerifiedBuild`) VALUES +(183666, 16, 0, 0, 2167, 8, 100, 1, 207512, 4, 128, 50747), -- Sylvanas Windrunner +(183665, 16, 0, 0, 2167, 8, 100, 1, 207511, 4, 128, 50747), -- Uther the Lightbringer +(183664, 16, 0, 0, 2167, 8, 100, 1, 207510, 4, 128, 50747), -- Lady Jaina Proudmoore +(184589, 16, 0, 0, 2057, 8, 5, 1, 208644, 4, 16448, 50747), -- Firim +(184613, 16, 1, 1, 2167, 8, 10, 1, 208668, 0, 64, 50747), -- Knight of the Ebon Blade +(184599, 16, 2, 2, 2167, 8, 30, 1, 208654, 4, 16448, 50747), -- Thrall +(184601, 16, 2, 2, 2167, 8, 30, 1, 208656, 4, 16448, 50747), -- Highlord Bolvar Fordragon +(186785, 16, 1, 1, 2167, 8, 20, 1, 211194, 0, 64, 50747), -- Quartermaster Rahm +(181954, 16, 3, 3, 2167, 8, 1361.3499755859375, 1, 209716, 2097260, 65664, 50747), -- Anduin Wrynn +(184520, 16, 2, 2, 2167, 8, 15.84000015258789062, 1, 208851, 2097256, 128, 50747), -- Anduin's Despair +(184519, 16, 3, 3, 2167, 8, 1500, 1, 208570, 1612714108, 119537798, 50747), -- Anduin's Soul +(184494, 16, 1, 1, 2167, 8, 3.15000009536743164, 1, 208843, 18874376, 67109008, 50747), -- Anduin's Doubt +(184493, 16, 0, 0, 2167, 8, 1.399999976158142089, 1, 208847, 2101368, 69206144, 50747), -- Anduin's Hope +(183033, 16, 1, 1, 2166, 8, 28.5500004321999968, 1, 209637, 2097224, 128, 46366), -- Grim Reflection +(184830, 16, 0, 0, 2167, 8, 1, 1, 208911, 0, 128, 50747), -- Beacon of Hope +(183671, 16, 2, 2, 2167, 8, 86.6399993896484375, 1, 209643, 104, 128, 50747), -- Monstrous Soul +(183669, 16, 1, 1, 2167, 8, 13.5, 1, 209648, 16777320, 144, 50747), -- Fiendish Soul +(183793, 16, 0, 0, 2167, 8, 1, 1, 210438, 0, 128, 50747), -- March of the Damned +(183463, 16, 3, 3, 2167, 8, 1200, 1, 213556, 2097260, 128, 50747), -- Remnant of a Fallen King +(183452, 16, 0, 0, 2167, 8, 1, 1, 207292, 1610612752, 117457030, 50747), -- Empty Vessel +(185607, 16, 0, 0, 2167, 8, 4.5, 1, 209849, 2097224, 67108992, 50747), -- Lost Soul +(184585, 16, 0, 0, 2167, 8, 1, 1, 208640, 0, 128, 50747), -- Befouled Barrier +(182431, 16, 0, 0, 2165, 8, 1, 1, 206245, 1610612752, 117440582, 50747), -- Ancient Translocator +(184297, 16, 0, 0, 2165, 8, 1, 1, 208317, 1610612752, 117440582, 50747), -- Dominated Translocator +(185843, 16, 0, 0, 2165, 8, 1, 1, 210103, 1610612752, 117440582, 50747); -- Ancient Console + +-- Heroic Difficulty +DELETE FROM `creature_template_difficulty` WHERE (`DifficultyID`=15 AND `Entry` IN (183666,183665,183664,184589,184613,184599,184601,186785,181954,184520,184519,184494,184493,183033,184830,183671,183669,183793,183463,183452,185607,184585,182431,184297,185843)); +INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `LevelScalingDeltaMin`, `LevelScalingDeltaMax`, `ContentTuningID`, `HealthScalingExpansion`, `HealthModifier`, `ManaModifier`, `CreatureDifficultyID`, `TypeFlags`, `TypeFlags2`, `VerifiedBuild`) VALUES +(183666, 15, 0, 0, 2166, 8, 100, 1, 207512, 4, 128, 49570), -- Sylvanas Windrunner +(183665, 15, 0, 0, 2166, 8, 100, 1, 207511, 4, 128, 49570), -- Uther the Lightbringer +(183664, 15, 0, 0, 2166, 8, 100, 1, 207510, 4, 128, 49570), -- Lady Jaina Proudmoore +(184589, 15, 0, 0, 2057, 8, 5, 1, 208644, 4, 16448, 46366), -- Firim +(184613, 15, 1, 1, 2166, 8, 10, 1, 208668, 0, 64, 46366), -- Knight of the Ebon Blade +(184599, 15, 2, 2, 2166, 8, 30, 1, 208654, 4, 16448, 46366), -- Thrall +(184601, 15, 2, 2, 2166, 8, 30, 1, 208656, 4, 16448, 46366), -- Highlord Bolvar Fordragon +(186785, 15, 1, 1, 2166, 8, 20, 1, 211194, 0, 64, 46366), -- Quartermaster Rahm +(181954, 15, 3, 3, 2166, 8, 996.3599853515625, 1, 209715, 2097260, 65664, 46366), -- Anduin Wrynn +(184520, 15, 2, 2, 2166, 8, 9.539999961853027343, 1, 208850, 2097256, 128, 46366), -- Anduin's Despair +(184519, 15, 3, 3, 2166, 8, 1500, 1, 208570, 1612714108, 119537798, 46366), -- Anduin's Soul +(184494, 15, 1, 1, 2166, 8, 1.360000014305114746, 1, 208842, 18874376, 67109008, 46366), -- Anduin's Doubt +(184493, 15, 0, 0, 2166, 8, 0.920000016689300537, 1, 208846, 2101368, 69206144, 46366), -- Anduin's Hope +(183033, 15, 1, 1, 2166, 8, 10.07999992370605468, 1, 209636, 2097224, 128, 46366), -- Grim Reflection +(184830, 15, 0, 0, 2166, 8, 1, 1, 208911, 0, 128, 46366), -- Beacon of Hope +(183671, 15, 2, 2, 2166, 8, 85.7375030517578125, 1, 209642, 104, 128, 46366), -- Monstrous Soul +(183669, 15, 1, 1, 2166, 8, 10.125, 1, 209647, 16777320, 144, 46366), -- Fiendish Soul +(183793, 15, 0, 0, 2166, 8, 1, 1, 210437, 0, 128, 46366), -- March of the Damned +(183463, 15, 3, 3, 2166, 8, 1162, 1, 213555, 2097260, 128, 46366), -- Remnant of a Fallen King +(183452, 15, 0, 0, 2166, 8, 1, 1, 207292, 1610612752, 117457030, 46366), -- Empty Vessel +-- HEROIC has no Lost Soul +(184585, 15, 0, 0, 2166, 8, 1, 1, 208640, 0, 128, 46366), -- Befouled Barrier +(182431, 15, 0, 0, 2165, 8, 1, 1, 206245, 1610612752, 117440582, 49570), -- Ancient Translocator +(184297, 15, 0, 0, 2165, 8, 1, 1, 208317, 1610612752, 117440582, 46366), -- Dominated Translocator +(185843, 15, 0, 0, 2165, 8, 1, 1, 210103, 1610612752, 117440582, 46366); -- Ancient Console + +-- Normal Difficulty +DELETE FROM `creature_template_difficulty` WHERE (`DifficultyID`=14 AND `Entry` IN (183666,183665,183664,184589,184613,184599,184601,186785,181954,184520,184519,184494,184493,183033,184830,183671,183669,183793,183463,183452,185607,184585,182431,184297,185843)); +INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `LevelScalingDeltaMin`, `LevelScalingDeltaMax`, `ContentTuningID`, `HealthScalingExpansion`, `HealthModifier`, `ManaModifier`, `CreatureDifficultyID`, `TypeFlags`, `TypeFlags2`, `VerifiedBuild`) VALUES +(183666, 14, 0, 0, 2165, 8, 100, 1, 207512, 4, 128, 46549), -- Sylvanas Windrunner +(183665, 14, 0, 0, 2165, 8, 100, 1, 207511, 4, 128, 46549), -- Uther the Lightbringer +(183664, 14, 0, 0, 2165, 8, 100, 1, 207510, 4, 128, 46549), -- Lady Jaina Proudmoore +(184589, 14, 0, 0, 2057, 8, 5, 1, 208644, 4, 16448, 46549), -- Firim +(184613, 14, 1, 1, 2165, 8, 10, 1, 208668, 0, 64, 46549), -- Knight of the Ebon Blade +(184599, 14, 2, 2, 2165, 8, 30, 1, 208654, 4, 16448, 46549), -- Thrall +(184601, 14, 2, 2, 2165, 8, 30, 1, 208656, 4, 16448, 46549), -- Highlord Bolvar Fordragon +(186785, 14, 1, 1, 2165, 8, 20, 1, 211194, 0, 64, 46549), -- Quartermaster Rahm +(181954, 14, 3, 3, 2165, 8, 992.75, 1, 209714, 2097260, 65664, 46549), -- Anduin Wrynn +(184520, 14, 2, 2, 2165, 8, 9.720000267028808593, 1, 208849, 2097256, 128, 46549), -- Anduin's Despair +(184519, 14, 3, 3, 2165, 8, 1500, 1, 208570, 1612714108, 119537798, 46549), -- Anduin's Soul +(184494, 14, 1, 1, 2165, 8, 1.279999971389770507, 1, 208841, 18874376, 67109008, 46549), -- Anduin's Doubt +(184493, 14, 0, 0, 2165, 8, 0.920000016689300537, 1, 208845, 2101368, 69206144, 46549), -- Anduin's Hope +(183033, 14, 1, 1, 2165, 8, 10.07999992370605468, 1, 209635, 2097224, 128, 51485), -- Grim Reflection +(184830, 14, 0, 0, 2165, 8, 1, 1, 208911, 0, 128, 51485), -- Beacon of Hope +-- Normal has no Monstrous Soul +(183669, 14, 1, 1, 2165, 8, 9.75, 1, 209646, 16777320, 144, 46549), -- Fiendish Soul +(183793, 14, 0, 0, 2165, 8, 1, 1, 210436, 0, 128, 51485), -- March of the Damned +(183463, 14, 3, 3, 2165, 8, 1100, 1, 213554, 2097260, 128, 46549), -- Remnant of a Fallen King +(183452, 14, 0, 0, 2165, 8, 1, 1, 207292, 1610612752, 117457030, 46549), -- Empty Vessel +-- Normal has no Lost Soul +(184585, 14, 0, 0, 2165, 8, 1, 1, 208640, 0, 128, 46549), -- Befouled Barrier +(182431, 14, 0, 0, 2165, 8, 1, 1, 206245, 1610612752, 117440582, 46549), -- Ancient Translocator +(184297, 14, 0, 0, 2165, 8, 1, 1, 208317, 1610612752, 117440582, 46549), -- Dominated Translocator +(185843, 14, 0, 0, 2165, 8, 1, 1, 210103, 1610612752, 117440582, 51485); -- Ancient Console + +-- LFR Difficulty +DELETE FROM `creature_template_difficulty` WHERE (`DifficultyID`=17 AND `Entry` IN (183666,183665,183664,184589,184613,184599,184601,186785,181954,184520,184519,184494,184493,183033,184830,183671,183669,183793,183463,183452,185607,184585,182431,184297,185843)); +INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `LevelScalingDeltaMin`, `LevelScalingDeltaMax`, `ContentTuningID`, `HealthScalingExpansion`, `HealthModifier`, `ManaModifier`, `CreatureDifficultyID`, `TypeFlags`, `TypeFlags2`, `VerifiedBuild`) VALUES +(183666, 17, 0, 0, 2168, 8, 100, 1, 207512, 4, 128, 46597), -- Sylvanas Windrunner +(183665, 17, 0, 0, 2168, 8, 100, 1, 207511, 4, 128, 46597), -- Uther the Lightbringer +(183664, 17, 0, 0, 2168, 8, 100, 1, 207510, 4, 128, 46597), -- Lady Jaina Proudmoore +(184589, 17, 0, 0, 2057, 8, 5, 1, 208644, 4, 16448, 46597), -- Firim +(184613, 17, 1, 1, 2168, 8, 10, 1, 208668, 0, 64, 46597), -- Knight of the Ebon Blade +(184599, 17, 2, 2, 2168, 8, 30, 1, 208654, 4, 16448, 46597), -- Thrall +(184601, 17, 2, 2, 2168, 8, 30, 1, 208656, 4, 16448, 46597), -- Highlord Bolvar Fordragon +(186785, 17, 1, 1, 2168, 8, 20, 1, 211194, 0, 64, 46597), -- Quartermaster Rahm +(181954, 17, 3, 3, 2168, 8, 992.75, 1, 209717, 2097260, 65664, 46597), -- Anduin Wrynn +-- LFR has no Anduin's Despair +(184519, 17, 3, 3, 2168, 8, 1500, 1, 208570, 1612714108, 119537798, 46597), -- Anduin's Soul +-- LFR has no Anduin's Doubt +-- LFR has no Anduin's Hope +(183033, 17, 1, 1, 2168, 8, 8, 1, 209638, 2097224, 128, 46597), -- Grim Reflection +(184830, 17, 0, 0, 2168, 8, 1, 1, 208911, 0, 128, 46597), -- Beacon of Hope +-- LFR has no Monstrous Soul +(183669, 17, 1, 1, 2168, 8, 8, 1, 209649, 16777320, 144, 46597), -- Fiendish Soul +(183793, 17, 0, 0, 2168, 8, 1, 1, 210439, 0, 128, 51485), -- March of the Damned +(183463, 17, 3, 3, 2168, 8, 1045, 1, 213557, 2097260, 128, 46597), -- Remnant of a Fallen King +-- LFR has no Empty Vessel +-- LFR has no Lost Soul +(184585, 17, 0, 0, 2168, 8, 1, 1, 208640, 0, 128, 46597), -- Befouled Barrier +-- Ancient Translocator exists correct in DB +(184297, 17, 0, 0, 2165, 8, 1, 1, 208317, 1610612752, 117440582, 46597), -- Dominated Translocator +(185843, 17, 0, 0, 2165, 8, 1, 1, 210103, 1610612752, 117440582, 51485); -- Ancient Console + +-- Creatures INSERT +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+11; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `VerifiedBuild`) VALUES +(@CGUID+0, 181954, 2481, 13742, 13965, '14,15,16,17', '0', 0, 0, 1, -3825.05908203125, -2715.45654296875, 91.356658935546875, 1.626035571098327636, 604800, 0, 0, 149357790, 100, 0, NULL, NULL, 50747), -- Anduin Wrynn (Area: Domination's Grasp - Difficulty: Mythic) CreateObject1 (Auras: 365177 - Willpower) +(@CGUID+1, 184519, 2481, 13742, 13965, '14,15,16,17', '17797', 0, 0, 0, -3824.513916015625, -2715.24658203125, 91.35655975341796875, 1.59902, 604800, 0, 0, 164569500, 0, 0, NULL, NULL, 50747), -- Anduin's Soul (Area: Domination's Grasp - Difficulty: Mythic) CreateObject1 (Auras: 369016 - Ghost Visual Cosmetics) +(@CGUID+2, 184354, 2481, 13742, 13965, '14,15,16,17', '0', 0, 0, 0, -3824.87158203125, -2620.020751953125, 79.05169677734375, 1.562330603599548339, 604800, 0, 0, 34998, 0, 0, NULL, NULL, 50747), -- Ancient Translocator (Area: Domination's Grasp - Difficulty: Mythic) CreateObject1 Translocator Before Anduin +(@CGUID+3, 184297, 2481, 13742, 13965, '14,15,16,17', '0', 0, 0, 0, -3824.897705078125, -2885.59716796875, 96.2000732421875, 1.572753190994262695, 604800, 0, 0, 34998, 0, 0, NULL, NULL, 50747), -- Dominated Translocator (Area: Domination's Grasp - Difficulty: Mythic) CreateObject1 Dominated Translocator +(@CGUID+4, 182431, 2481, 13742, 13965, '14,15,16,17', '0', 0, 0, 0, -3830.3056640625, -2417.88720703125, 111.1949081420898437, 1.569366693496704101, 604800, 0, 0, 34998, 0, 0, NULL, NULL, 50747), -- Ancient Translocator (Area: Domination's Grasp - Difficulty: Mythic) CreateObject1 Translocator Immortal Hearth +(@CGUID+5, 184589, 2481, 13742, 13957, '14,15,16,17', '0', 0, 0, 1, -3840.5087890625, -2615.826416015625, 79.00555419921875, 5.047886848449707031, 604800, 0, 0, 181150, 0, 0, NULL, NULL, 49570), -- Firim (Area: Immortal Hearth - Difficulty: Heroic) CreateObject1 (Auras: ) +(@CGUID+6, 185843, 2481, 13742, 13969, '14,15,16,17', '0', 0, 0, 0, -5485.4287109375, -3870.298583984375, 128.5279388427734375, 6.061259746551513671, 604800, 0, 0, 34998, 0, 0, NULL, NULL, 50747), -- Ancient Console (Area: The Grand Design - Difficulty: Mythic) CreateObject1 +(@CGUID+7, 186785, 2481, 13742, 13957, '14,15,16,17', '0', 0, 0, 1, -3825.13720703125, -2627.935791015625, 79.021240234375, 4.63619089126586914, 604800, 0, 0, 868880, 0, 0, NULL, NULL, 49570), -- Quartermaster Rahm (Area: Immortal Hearth - Difficulty: Heroic) CreateObject1 (Auras: ) +(@CGUID+8, 184613, 2481, 13742, 13957, '14,15,16,17', '0', 0, 0, 7, -3816.84716796875, -2629.2587890625, 79.02005767822265625, 4.63619089126586914, 604800, 0, 0, 434440, 0, 0, NULL, NULL, 49570), -- Knight of the Ebon Blade (Area: Immortal Hearth - Difficulty: Heroic) CreateObject1 (Auras: ) +(@CGUID+9, 184599, 2481, 13742, 13957, '14,15,16,17', '0', 0, 0, 1, -3838.53466796875, -2625.407958984375, 79.0087432861328125, 5.201615810394287109, 604800, 0, 0, 1303320, 0, 0, NULL, NULL, 49570), -- Thrall (Area: Immortal Hearth - Difficulty: Heroic) CreateObject1 (Auras: ) +(@CGUID+10, 184601, 2481, 13742, 13957, '14,15,16,17', '0', 0, 0, 1, -3810.704833984375, -2624.717041015625, 79.0092010498046875, 4.327321052551269531, 604800, 0, 0, 1303320, 0, 0, NULL, NULL, 49570), -- Highlord Bolvar Fordragon (Area: Immortal Hearth - Difficulty: Heroic) CreateObject1 (Auras: ) +(@CGUID+11, 184613, 2481, 13742, 13957, '14,15,16,17', '0', 0, 0, 3, -3833.8837890625, -2629.6806640625, 79.02220916748046875, 4.63619089126586914, 604800, 0, 0, 434440, 0, 0, NULL, NULL, 49570); -- Knight of the Ebon Blade (Area: Immortal Hearth - Difficulty: Heroic) CreateObject1 (Auras: ) + +UPDATE `creature` SET `StringId`='left_knight' WHERE `guid`=@CGUID+8; +UPDATE `creature` SET `StringId`='right_knight' WHERE `guid`=@CGUID+11; + +-- Creature Addon +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+11; +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES +(@CGUID+0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- Anduin Wrynn +(@CGUID+1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, '369016 365650'), -- Anduin's Soul - 369016 - 369016, 365650 - 365650 +(@CGUID+7, 0, 0, 0, 0, 0, 1, 0, 333, 0, 0, 0, 0, ''), -- Quartermaster Rahm +(@CGUID+8, 0, 0, 0, 0, 0, 1, 0, 375, 0, 0, 0, 0, ''), -- Knight of the Ebon Blade +(@CGUID+9, 0, 0, 0, 0, 0, 1, 0, 333, 0, 0, 0, 0, ''), -- Thrall +(@CGUID+10, 0, 0, 0, 0, 0, 1, 0, 375, 0, 0, 0, 0, ''), -- Highlord Bolvar Fordragon +(@CGUID+11, 0, 0, 0, 0, 0, 1, 0, 375, 0, 0, 0, 0, ''); -- Knight of the Ebon Blade + +-- Spell Target Positions +DELETE FROM `spell_target_position` WHERE (`EffectIndex`=0 AND `ID` IN (368563,364475)); +INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES +(368563, 0, 2481, -3824.679931640625, -2865.5400390625, 95.98999786376953125, 46366), -- Spell: 368563 (Teleport: Domination's Grasp) Efffect: 252 (SPELL_EFFECT_TELEPORT_UNITS) +(364475, 0, 2481, -5477.43017578125, -3877.3798828125, 128.25, 46366); -- Spell: 364475 (Teleport: Cosmic Hub) Efffect: 252 (SPELL_EFFECT_TELEPORT_UNITS) + +-- Jump Charge Parameters +DELETE FROM `jump_charge_params` WHERE `id`=626; +INSERT INTO `jump_charge_params` (`id`, `speed`, `treatSpeedAsMoveTimeSeconds`, `jumpGravity`, `spellVisualId`, `progressCurveId`, `parabolicCurveId`) VALUES +(626, 0.751, 1, 70.9219, NULL, NULL, NULL); -- Necrotic Claws + +-- Conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=363023 AND `SourceId`=0 AND `ElseGroup`=0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 363023, 0, 0, 31, 0, 3, 181954, 0, 0, 0, 0, '', 'Anduin Wrynn Encounter - Return to Kingsmourne'); -- Return to Kingsmourne + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=365220 AND `SourceId`=0 AND `ElseGroup`=0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 365220, 0, 0, 31, 0, 3, 184519, 0, 0, 0, 0, '', 'Despair Anduin\'s Soul'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=13 AND `SourceGroup` IN(1, 2) AND `SourceEntry` = 365217 AND `SourceId`=0 AND `ElseGroup` IN(1, 2)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 365217, 0, 1, 31, 0, 3, 181954, 0, 0, 0, 0, '', 'Anduin Wrynn Encounter- Willpower'), +(13, 2, 365217, 0, 2, 31, 0, 3, 184519, 0, 0, 0, 0, '', 'Anduin Wrynn Encounter- Willpower'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=13 AND `SourceGroup` IN(1, 2) AND `SourceEntry` = 365228 AND `SourceId`=0 AND `ElseGroup` IN(1, 2)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 365228, 0, 1, 31, 0, 3, 181954, 0, 0, 0, 0, '', 'Anduin Wrynn Encounter- Willpower 2'), +(13, 2, 365228, 0, 2, 31, 0, 3, 184519, 0, 0, 0, 0, '', 'Anduin Wrynn Encounter- Willpower 2'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=364239 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=31 AND `ConditionTarget`=0 AND `ConditionValue1`=4 AND `ConditionValue2`=0 AND `ConditionValue3`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 364239, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Anduin Wrynn Blasphemy Pre Hit Players Only'); -- Blasphemy + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=13 AND `SourceGroup`= (1 | 2 | 4) AND `SourceEntry`=368986 AND `SourceId`=0 AND `ElseGroup`=0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1 | 2 | 4, 368986, 0, 0, 31, 0, 3, 183033, 0, 0, 0, 0, '', 'Dark Presence hit only Grim Reflections'); -- Dark Presence + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=13 AND `SourceGroup`= (1 | 2 ) AND `SourceEntry`=367932 AND `SourceId`=0 AND `ElseGroup`=0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1 | 2, 367932, 0, 0, 31, 0, 3, 183033, 0, 0, 0, 0, '', 'Grim Fate hit only Grim Reflections'); -- Grim Fate + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=14 AND `SourceGroup`=27524 AND `SourceEntry`=43880); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14, 27524, 43880, 0, 0, 13, 0, 7, 3, 2, 0, 0, 0, '', 'Show option teleport to Cosmic Hub if Anduin Wrynn is done'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=362405 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=31 AND `ConditionTarget`=0 AND `ConditionValue1`=4 AND `ConditionValue2`=0 AND `ConditionValue3`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 362405, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Anduin Wrynn Kingsmourne Hungers hit Players only'); -- Kingsmourne Hungers + +-- Areatriggers Create Properties +DELETE FROM `areatrigger_create_properties` WHERE `Id`IN (25025,24741,24740,24616,24599,24443,24429,24332,24322,24247,24093); +INSERT INTO `areatrigger_create_properties` (`Id`, `AreaTriggerId`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `TimeToTarget`, `TimeToTargetScale`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES +(25025, 28469, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 'at_anduin_wrynn_beacon_of_hope', 50747), +(24741, 28391, 0, 0, 0, 0, -1, 0, 0, 5228, 0, 4, 1.75, 1.75, 8, 8, 2, 2, 0, 0, 'at_anduin_wrynn_wicked_star', 43206), +(24740, 28391, 0, 0, 0, 0, -1, 0, 0, 5228, 0, 4, 1.75, 1.75, 8, 8, 2, 2, 0, 0, 'at_anduin_wrynn_wicked_star', 43206), +(24616, 28622, 0, 0, 0, 0, -1, 0, 0, 0, 10000, 0, 4, 4, 0, 0, 0, 0, 0, 0, 'at_anduin_wrynn_blasphemy', 43206), +(24599, 28391, 0, 0, 0, 0, -1, 0, 0, 5228, 0, 4, 1.75, 1.75, 8, 8, 2, 2, 0, 0, 'at_anduin_wrynn_empowered_wicked_star', 43206), +(24443, 28483, 0, 0, 0, 0, -1, 0, 0, 0, 29999, 0, 3, 3, 0, 0, 0, 0, 0, 0, 'at_anduin_wrynn_hopelessness', 43206), +(24429, 28470, 0, 0, 0, 0, -1, 0, 0, 0, 2750, 0, 3, 3, 0, 0, 0, 0, 0, 0, '', 50747), +(24332, 28422, 0, 0, 0, 0, -1, 0, 0, 0, 30000, 0, 1, 1, 0, 0, 0, 0, 0, 0, 'at_anduin_wrynn_befouled_barrier', 43206), +(24322, 28391, 0, 0, 0, 0, -1, 0, 0, 5228, 0, 4, 1.75, 1.75, 8, 8, 2, 2, 0, 0, 'at_anduin_wrynn_wicked_star', 43206), +(24247, 28469, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 'at_anduin_wrynn_beacon_of_hope', 43206), +(24093, @ATID+1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 16, 2.3, 2, 16, 2.3, 0, 0, 'at_anduin_wrynn_march_of_the_damned', 0); + +-- Areatrigger Template +DELETE FROM `areatrigger_template` WHERE ((`Id` IN (28391,28422,28469,28470,28483,28622,@ATID+1) AND `IsServerSide`=0) OR (`Id`=@ATID+0 AND `IsServerSide`=1)); +INSERT INTO `areatrigger_template` (`Id`, `IsServerSide`, `Type`, `Flags`, `Data0`, `Data1`, `Data2`, `Data3`, `Data4`, `Data5`, `Data6`, `Data7`, `VerifiedBuild`) VALUES +(28391, 0, 4, 0, 1.75, 1.75, 8, 8, 2, 2, 0, 0, 43206), -- Wicked Star +(28422, 0, 0, 4, 1, 1, 0, 0, 0, 0, 0, 0, 43206), -- Befouled Barrier +(28469, 0, 0, 4, 1, 1, 0, 0, 0, 0, 0, 0, 50747), -- Beacon of Hope +(28470, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 50747), -- Fragment of Hope +(28483, 0, 0, 4, 3, 3, 0, 0, 0, 0, 0, 0, 43206), -- Hopelessness +(28622, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 43206), -- Blasphemy +(@ATID+1, 0, 1, 4, 2, 16, 2.3, 2, 16, 2.3, 0, 0, 0), -- Custom AT March of the Damned +(@ATID+0, 1, 1, 0, 30, 50, 5, 30, 50, 5, 0, 0, 0); -- Introduction + +DELETE FROM `areatrigger` WHERE `SpawnId`=@ATSPAWNID+0; +INSERT INTO `areatrigger` (`SpawnId`, `AreaTriggerId`, `IsServerSide`, `MapId`, `SpawnDifficulties`, `PosX`, `PosY`, `PosZ`, `Orientation`, `PhaseUseFlags`, `PhaseId`, `PhaseGroup`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `SpellForVisuals`, `ScriptName`, `Comment`, `VerifiedBuild`) VALUES +(@ATSPAWNID+0, @ATID+0, 1, 2481, '14,15,16,17', -3824.87, -2620.02, 79.0517, 1.56233, 1, 0, 0, 1, 30, 50, 5, 30, 50, 5, 0, 0, NULL, 'at_anduin_wrynn_pre_introduction', '', 0); -- Introduction + +-- Creature Text +DELETE FROM `creature_text` WHERE `CreatureID` IN (181954, 183671); +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `SoundPlayType`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(181954, 0, 0, 'Your reality ends here!', 14, 0, 100, 0, 0, 190135, 0, 214636, 0, 'Aggro'), +(181954, 1, 0, 'Break!', 14, 0, 100, 0, 0, 190054, 0, 214962, 0, 'Hopebreaker'), +(181954, 2, 0, 'Darkness consumes light!', 14, 0, 100, 0, 0, 190056, 0, 214961, 0, 'Befouled Barrier'), +(181954, 3, 0, 'There is no balance!', 14, 0, 100, 0, 0, 190055, 0, 214960, 0, 'Blasphemy'), +(181954, 4, 0, '|TInterface\\ICONS\\Ability_Priest_FocusedWill.blp:20|t Anduin begins casting |cFFFF0000|Hspell:361989|h[Blasphemy]|h|r!', 41, 0, 100, 0, 0, 53980, 0, 0, 0, 'Blasphemy Warning'), +(181954, 5, 0, '|TInterface\\ICONS\\Ability_Deathknight_HungeringRuneblade.BLP:20|t Anduin begins casting |cFFFF0000|Hspell:362405|h[Kingsmourne Hungers]|h|r!', 41, 0, 100, 0, 0, 190057, 0, 0, 0, 'Kingsmourne Warning'), +(181954, 6, 0, 'Kingsmourne hungers!', 14, 0, 100, 0, 0, 190057, 0, 214963, 0, 'Kingsmourne Hungers'), +(181954, 7, 0, 'Your end has come!', 14, 0, 100, 0, 0, 190052, 0, 214954, 0, 'Wicked Star'), +(181954, 8, 0, '|TInterface\\ICONS\\Spell_Priest_DivineStar_Shadow2.blp:20|t Anduin targets you with |cFFFF0000|Hspell:365017|h[Wicked Star]|h|r!', 41, 0, 100, 0, 0, 0, 0, 0, 0, 'Wicked Star Warning'), +(181954, 9, 0, 'Terrors, arise and obey!', 14, 0, 100, 0, 0, 190058, 0, 214966, 0, 'Summoning'), +(181954, 10, 0, 'Kneel!', 14, 0, 100, 0, 0, 190120, 0, 214637, 0, 'Slay 01'), +(181954, 10, 1, 'Submit!', 14, 0, 100, 0, 0, 190121, 0, 214638, 0, 'Slay 02'), +(181954, 11, 0, 'Fall!', 14, 0, 100, 0, 0, 190053, 0, 214955, 0, 'Empowered Hopebreaker'), +(181954, 12, 0, 'The Light has abandoned you.', 14, 0, 100, 0, 0, 190122, 0, 214639, 0, 'Reset'), +(183671, 13, 0, '|TInterface\\\\ICONS\\\\Tradeskill_AbominationStitching_Abominations_Mid.BLP:20|t %s begins casting |cFFFF0000|Hspell:363024|h[Necrotic Detonation]|h|r!', 41, 0, 100, 0, 0, 0, 0, 0, 0, 'Monstrous Soul Detonation'), +(181954, 14, 0, '|TInterface\\ICONS\\Spell_Priest_DivineStar_Shadow2.blp:20|t Anduin targets you with |cFFFF0000|Hspell:367631|h[Empowered Wicked Star]|h|r!', 41, 0, 100, 0, 0, 0, 0, 0, 0, 'Empowered Wicked Star Warning'); + +-- Conversations Template +DELETE FROM `conversation_template` WHERE `Id` IN (17921, 17923, 17924, 17835, 17836); +INSERT INTO `conversation_template` (`Id`, `FirstLineId`, `TextureKitId`, `ScriptName`, `VerifiedBuild`) VALUES +(17921, 45676, 0, '', 46366), -- First Intermission +(17923, 45757, 0, '', 46366), -- Second Intermission +(17924, 45674, 0, '', 43206), -- Anduin Phase 3 +(17835, 45384, 0, '', 46549), -- Introduction +(17836, 45390, 0, '', 46597); -- Outroduction + +-- Conversation Actors +DELETE FROM `conversation_actors` WHERE `ConversationId`=17921; +INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `ConversationActorGuid`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES +(17921, 82831, @CGUID+0, 0, 181954, 0, 0, 0, 43206), +(17921, 83275, 0, 1, 183665, 0, 0, 0, 43206); + +DELETE FROM `conversation_actors` WHERE `ConversationId`=17923; +INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `ConversationActorGuid`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES +(17923, 82831, @CGUID+0, 0, 181954, 0, 0, 0, 43206), +(17923, 83276, 0, 1, 183666, 0, 0, 0, 43206); + +DELETE FROM `conversation_actors` WHERE `ConversationId`=17924; +INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `ConversationActorGuid`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES +(17924, 82831, @CGUID+0, 0, 181954, 0, 0, 0, 50747); + +DELETE FROM `conversation_actors` WHERE `ConversationId`=17835; +INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `ConversationActorGuid`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES +(17835, 83274, 0, 3, 183664, 0, 0, 0, 46549), +(17835, 83276, 0, 2, 183666, 0, 0, 0, 46549), +(17835, 83275, 0, 1, 183665, 0, 0, 0, 46549), +(17835, 83809, 0, 0, 181411, 100456, 0, 0, 46549); + +DELETE FROM `conversation_actors` WHERE `ConversationId`=17836; +INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `ConversationActorGuid`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES +(17836, 83787, 0, 4, 184589, 0, 0, 0, 46597), +(17836, 83275, 0, 3, 183665, 0, 0, 0, 46597), +(17836, 83276, 0, 2, 183666, 0, 0, 0, 46597), +(17836, 83274, 0, 1, 183664, 0, 0, 0, 46597), +(17836, 82831, @CGUID+0, 0, 181954, 0, 0, 0, 46597); + +-- Conversatoin Lines +DELETE FROM `conversation_line_template` WHERE `Id` IN (45665, 45664, 45663, 45662, 45676, 45389, 45388, 45387, 45386, 45385, 45384, 45399, 45398, 45397, 45396, 45675, 45674, 45673, 45672, 45671, 45670, 45757, 45988, 45987, 45986, 45336, 45335, 45334, 45333, 45353, 45352, 45351); +INSERT INTO `conversation_line_template` (`Id`, `UiCameraID`, `ActorIdx`, `Flags`, `ChatType`, `VerifiedBuild`) VALUES +(45665, 0, 0, 0, 1, 51485), +(45664, 0, 0, 0, 1, 51485), +(45663, 0, 0, 0, 1, 51485), +(45662, 0, 1, 0, 1, 51485), +(45676, 0, 0, 0, 1, 51485), +(45389, 0, 3, 1, 0, 51485), +(45388, 0, 2, 1, 0, 51485), +(45387, 0, 1, 1, 0, 51485), +(45386, 1547, 0, 0, 0, 51485), +(45385, 1547, 0, 0, 0, 51485), +(45384, 1547, 0, 0, 0, 51485), +(45399, 0, 2, 1, 0, 51485), +(45398, 0, 0, 1, 0, 51485), +(45397, 0, 1, 1, 0, 51485), +(45396, 0, 0, 1, 0, 51485), +(45675, 0, 0, 0, 1, 51485), +(45674, 0, 0, 0, 1, 51485), +(45673, 0, 0, 0, 1, 51485), +(45672, 0, 0, 0, 1, 51485), +(45671, 0, 0, 0, 1, 51485), +(45670, 0, 1, 0, 1, 51485), +(45757, 0, 0, 0, 1, 51485), +(45988, 1547, 1, 0, 0, 51485), +(45987, 1547, 1, 0, 0, 51485), +(45986, 1547, 1, 0, 0, 51485), +(45336, 0, 0, 0, 0, 51485), +(45335, 0, 0, 0, 0, 51485), +(45334, 0, 0, 0, 0, 51485), +(45333, 0, 0, 0, 0, 51485), +(45353, 0, 0, 0, 0, 51485), +(45352, 0, 0, 0, 0, 51485), +(45351, 0, 0, 0, 0, 51485); + +-- Template Gossip +DELETE FROM `creature_template_gossip` WHERE (`CreatureID`=184297 AND `MenuID`=27524) OR (`CreatureID`=185843 AND `MenuID`=27687); +INSERT INTO `creature_template_gossip` (`CreatureID`, `MenuID`, `VerifiedBuild`) VALUES +(184297, 27524, 51485), -- Dominated Translocator +(185843, 27687, 51485); -- Ancient Console + +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE (`MenuID`=27524 AND `TextID`=43880) OR (`MenuID`=27687 AND `TextID`=44097); +INSERT INTO `gossip_menu` (`MenuID`, `TextID`, `VerifiedBuild`) VALUES +(27524, 43880, 51485), -- 184297 (Dominated Translocator) +(27687, 44097, 51485); -- 185843 (Ancient Console) + +-- Gossip Menu Option +DELETE FROM `gossip_menu_option` WHERE (`OptionID`=0 AND `MenuID` IN (27524,27687)); +INSERT INTO `gossip_menu_option` (`GossipOptionID`, `MenuID`, `OptionID`, `OptionNpc`, `OptionText`, `OptionBroadcastTextId`, `Language`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `SpellID`, `Flags`, `OverrideIconID`, `GossipNpcOptionID`, `VerifiedBuild`) VALUES +(52440, 27524, 0, 0, 'Proceed.', 19484, 0, 0, 0, 0, 0, NULL, 0, NULL, 0, NULL, NULL, 51485), +(54619, 27687, 0, 0, 'Proceed.', 19484, 0, 0, 0, 0, 0, NULL, 0, NULL, 0, NULL, NULL, 51485); + +UPDATE `npc_text` SET `Probability0`=1 WHERE `ID`=43880; + +-- Sylvanas Waypoints +SET @WPID := 183666 * 100; +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@WPID, 0, -3819.6, -2631.98, 79.3011, 0, 0, 1, 0, 100, 0), +(@WPID, 1, -3817.85, -2636.98, 77.5977, 0, 0, 1, 0, 100, 0), +(@WPID, 2, -3815.1, -2638.98, 77.9912, 0, 0, 1, 0, 100, 0), +(@WPID, 3, -3814.62, -2641.23, 78.034, 0, 0, 1, 0, 100, 0), +(@WPID, 4, -3814.1, -2642.98, 78.3127, 0, 0, 1, 0, 100, 0), +(@WPID, 5, -3813.85, -2644.23, 78.3127, 0, 0, 1, 0, 100, 0), +(@WPID, 6, -3813.35, -2645.73, 78.3119, 0, 0, 1, 0, 100, 0), +(@WPID, 7, -3814.1, -2658.98, 85.1276, 0, 0, 1, 0, 100, 0), +(@WPID, 8, -3814.1, -2667.23, 89.5433, 0, 0, 1, 0, 100, 0), +(@WPID, 9, -3814.1, -2668.98, 90.478, 0, 0, 1, 0, 100, 0), +(@WPID, 10, -3814.85, -2670.23, 90.7048, 0, 0, 1, 0, 100, 0), +(@WPID, 11, -3816.6, -2672.98, 90.7669, 0, 0, 1, 0, 100, 0), +(@WPID, 12, -3816.35, -2677.23, 91.4469, 0, 0, 1, 0, 100, 0), +(@WPID, 13, -3819.48, -2687.19, 91.2658, 0, 0, 1, 0, 100, 0); + +-- Uther Waypoints +SET @WPID := 183665 * 100; +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@WPID, 0, -3831.11, -2632.01, 79.6914, 0, 0, 1, 0, 100, 0), +(@WPID, 1, -3831.61, -2633.76, 78.9414, 0, 0, 1, 0, 100, 0), +(@WPID, 2, -3832.11, -2637.26, 78.1914, 0, 0, 1, 0, 100, 0), +(@WPID, 3, -3831.36, -2646.26, 78.1914, 0, 0, 1, 0, 100, 0), +(@WPID, 4, -3830.86, -2651.76, 81.1914, 0, 0, 1, 0, 100, 0), +(@WPID, 5, -3830.36, -2658.01, 84.6914, 0, 0, 1, 0, 100, 0), +(@WPID, 6, -3829.86, -2670.26, 91.1914, 0, 0, 1, 0, 100, 0), +(@WPID, 7, -3832.61, -2676.51, 91.6914, 0, 0, 1, 0, 100, 0), +(@WPID, 8, -3831.61, -2679.01, 91.4414, 0, 0, 1, 0, 100, 0), +(@WPID, 9, -3828.03, -2688.25, 91.4532, 0, 0, 1, 0, 100, 0); + +-- Jaina Waypoints +SET @WPID := 183664 * 100; +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@WPID, 0, -3825.8, -2630.24, 79.7114, 0, 0, 1, 0, 100, 0), +(@WPID, 1, -3825.3, -2631.99, 79.7114, 0, 0, 1, 0, 100, 0), +(@WPID, 2, -3824.55, -2633.74, 78.9614, 0, 0, 1, 0, 100, 0), +(@WPID, 3, -3824.8, -2636.99, 78.2114, 0, 0, 1, 0, 100, 0), +(@WPID, 4, -3824.8, -2646.24, 78.2114, 0, 0, 1, 0, 100, 0), +(@WPID, 5, -3824.8, -2651.74, 81.2114, 0, 0, 1, 0, 100, 0), +(@WPID, 6, -3824.55, -2659.49, 85.4614, 0, 0, 1, 0, 100, 0), +(@WPID, 7, -3825.05, -2670.24, 91.2114, 0, 0, 1, 0, 100, 0), +(@WPID, 8, -3824.65, -2692.2, 91.4932, 0, 0, 1, 0, 100, 0); + +-- Firim Waypoints +SET @WPID := 184589 * 100; +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@WPID, 0, -3833, -2627.62, 79.4742, 0, 0, 1, 0, 100, 0), +(@WPID, 1, -3829.5, -2630.37, 79.7242, 0, 0, 1, 0, 100, 0), +(@WPID, 2, -3829.5, -2631.87, 79.7242, 0, 0, 1, 0, 100, 0), +(@WPID, 3, -3832, -2633.62, 78.9742, 0, 0, 1, 0, 100, 0), +(@WPID, 4, -3832.25, -2637.37, 78.2242, 0, 0, 1, 0, 100, 0), +(@WPID, 5, -3831.75, -2646.12, 78.2242, 0, 0, 1, 0, 100, 0), +(@WPID, 6, -3831.5, -2651.62, 81.2242, 0, 0, 1, 0, 100, 0), +(@WPID, 7, -3831, -2657.87, 84.7242, 0, 0, 1, 0, 100, 0), +(@WPID, 8, -3830.25, -2670.37, 91.2242, 0, 0, 1, 0, 100, 0), +(@WPID, 9, -3832.75, -2676.37, 91.7242, 0, 0, 1, 0, 100, 0), +(@WPID, 10,-3830.1892, -2688.1267, 91.43489, 0, 0, 1, 0, 100, 0); + +-- Thrall Waypoints +SET @WPID := 184599 * 100; +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@WPID, 0, -3832.8462, -2626.8916, 79.4441, 0, 0, 1, 0, 100, 0), +(@WPID, 1, -3832.5962, -2631.8916, 79.6941, 0, 0, 1, 0, 100, 0), +(@WPID, 2, -3832.0962, -2633.6416, 78.9441, 0, 0, 1, 0, 100, 0), +(@WPID, 3, -3832.3462, -2637.3916, 78.1941, 0, 0, 1, 0, 100, 0), +(@WPID, 4, -3834.5962, -2641.1416, 78.4441, 0, 0, 1, 0, 100, 0), +(@WPID, 5, -3835.0962, -2645.6416, 78.9441, 0, 0, 1, 0, 100, 0), +(@WPID, 6, -3836.3462, -2646.1416, 78.9441, 0, 0, 1, 0, 100, 0), +(@WPID, 7, -3835.5962, -2662.1416, 87.4441, 0, 0, 1, 0, 100, 0), +(@WPID, 8, -3833.8462, -2670.1416, 91.1941, 0, 0, 1, 0, 100, 0), +(@WPID, 9, -3832.8462, -2672.3916, 91.1941, 0, 0, 1, 0, 100, 0), +(@WPID, 10, -3833.0962, -2676.3916, 91.6941, 0, 0, 1, 0, 100, 0), +(@WPID, 11, -3833.0962, -2679.1416, 91.6941, 0, 0, 1, 0, 100, 0), +(@WPID, 12, -3833.0962, -2681.8916, 91.4441, 0, 0, 1, 0, 100, 0), +(@WPID, 13, -3833.2378, -2684.1145, 91.2652, 0, 0, 1, 0, 100, 0); + +-- Bolvar Waypoints +SET @WPID := 184601 * 100; +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@WPID, 0, -3816.6367, -2631.9243, 79.808624, 0, 0, 1, 0, 100, 0), +(@WPID, 1, -3815.1367, -2639.1743, 78.308624, 0, 0, 1, 0, 100, 0), +(@WPID, 2, -3814.6367, -2641.4243, 78.558624, 0, 0, 1, 0, 100, 0), +(@WPID, 3, -3814.1367, -2643.1743, 78.558624, 0, 0, 1, 0, 100, 0), +(@WPID, 4, -3813.8867, -2644.1743, 78.808624, 0, 0, 1, 0, 100, 0), +(@WPID, 5, -3813.3867, -2645.6743, 78.808624, 0, 0, 1, 0, 100, 0), +(@WPID, 6, -3814.1367, -2658.9243, 85.558624, 0, 0, 1, 0, 100, 0), +(@WPID, 7, -3814.1367, -2667.4243, 90.308624, 0, 0, 1, 0, 100, 0), +(@WPID, 8, -3814.1367, -2669.1743, 91.058624, 0, 0, 1, 0, 100, 0), +(@WPID, 9, -3814.6367, -2670.4243, 91.308624, 0, 0, 1, 0, 100, 0), +(@WPID, 10, -3816.3867, -2672.9243, 91.308624, 0, 0, 1, 0, 100, 0), +(@WPID, 11, -3816.1367, -2677.1743, 91.558624, 0, 0, 1, 0, 100, 0), +(@WPID, 12, -3817.2275, -2682.5625, 91.525320, 0, 0, 1, 0, 100, 0); + +-- Spell Scripts +DELETE FROM `spell_script_names` WHERE `spell_id` IN (367524,366848,369317,364247,361815,361817,361818,365293,365173,361989,361993,361992,365021,362405,365652,362055,362402,367769,362392,368913,363233,365120,365872,365806,365958,365966,362500,365291,362862,362863,362771,362543,362545,363021,363022,367632,363029,365816); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(367524, 'spell_anduin_wrynn_pre_introduction'), +(366848, 'spell_anduin_wrynn_energize_willpower_lfr'), +(369317, 'spell_anduin_wrynn_progression_aura'), +(364247, 'spell_anduin_wrynn_dark_zeal'), +(361815, 'spell_anduin_wrynn_hopebreaker'), +(361817, 'spell_anduin_wrynn_hopebreaker_periodic'), +(361818, 'spell_anduin_wrynn_hopebreaker_damage'), +(365293, 'spell_anduin_wrynn_befouled_barrier_absorb'), +(365173, 'spell_anduin_wrynn_befouled_barrier_expire'), +(361989, 'spell_anduin_wrynn_blasphemy'), +(361993, 'spell_anduin_wrynn_hopelessness_overconfidence'), +(361992, 'spell_anduin_wrynn_hopelessness_overconfidence'), +(365021, 'spell_anduin_wrynn_wicked_star_selector'), +(362405, 'spell_anduin_wrynn_kingsmourne_hungers'), +(365652, 'spell_anduin_soul_lost_soul'), +(362055, 'spell_anduin_wrynn_lost_soul'), +(362402, 'spell_anduin_wrynn_lost_soul_mirror_image'), +(367769, 'spell_anduin_wrynn_severed_soul'), +(362392, 'spell_anduin_rain_of_despair_player_selector'), +(368913, 'spell_anduin_wrynn_force_of_will'), +(363233, 'spell_anduin_wrynn_march_of_the_damned'), +(365120, 'spell_anduin_wrynn_grim_reflections'), +(365872, 'spell_anduin_wrynn_beacon_of_hope'), +(365806, 'spell_anduin_wrynn_hopebreaker'), +(365958, 'spell_anduin_wrynn_hopelessness'), +(365966, 'spell_anduin_wrynn_hopelessness_expire'), +(362500, 'spell_remnant_of_a_fallen_king_spawn'), +(365291, 'spell_remnant_of_a_fallen_king_energize_runic_power'), +(362862, 'spell_remnant_of_a_fallen_king_army_of_the_dead'), +(362863, 'spell_remnant_of_a_fallen_king_echoes_of_andorhal'), +(362771, 'spell_remnant_of_a_fallen_king_soul_reaper'), +(362543, 'spell_remnant_of_a_fallen_king_remorseless_winter_periodic'), +(362545, 'spell_remnant_of_a_fallen_king_remorseless_winter_damage'), +(363021, 'spell_remnant_of_a_fallen_king_return_to_kingsmourne'), +(363022, 'spell_remnant_of_a_fallen_king_return_to_kingsmourne_applied'), +(367632, 'spell_anduin_wrynn_empowered_wicked_star_selector'), +(363029, 'spell_friendish_soul_explosion'), +(365816, 'spell_anduin_wrynn_fragment_of_hope'); + +DELETE FROM `creature_template_sparring` WHERE `Entry` IN(183666, 183664, 183665, 181954, 183669, 183671, 183463, 183033); +INSERT INTO `creature_template_sparring` (`Entry`, `NoNPCDamageBelowHealthPct`) VALUES +(183666, 100), -- Sylvanas Windrunner +(183664, 100), -- Jaina Proudmoore +(183665, 100), -- Uther the Lightbringer +(181954, 100), -- Anduin +(183669, 100), -- Fiendish Soul +(183671, 100), -- Monstrous Soul +(183463, 100), -- Remnant +(183033, 100); -- Grim Reflection diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index cf0bce8711a..bc92cac0b64 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4671,6 +4671,72 @@ void SpellMgr::LoadSpellInfoCorrections() // ENDOF ANTORUS THE BURNING THRONE SPELLS // + // SEPULCHER OF THE FIRST ONES + // + + // Wicked Star (Marker) + ApplySpellFix({ 365021 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF; + }); + + // Empowered Wicked Star (Marker) + ApplySpellFix({ 367632 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF; + }); + + // Wicked Star Areatrigger + ApplySpellFix({ 365017 }, [](SpellInfo* spellInfo) + { + ApplySpellEffectFix(spellInfo, EFFECT_0, [](SpellEffectInfo* spellEffectInfo) + { + spellEffectInfo->TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); + }); + }); + + // Willpower Energize Large + ApplySpellFix({ 365228 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT; + }); + + // Willpower Energize Small + ApplySpellFix({ 365217 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT; + }); + + // Force of Will + ApplySpellFix({ 368913 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF; + }); + + // Fragment of Hope Areatrigger + ApplySpellFix({ 365816 }, [](SpellInfo* spellInfo) + { + ApplySpellEffectFix(spellInfo, EFFECT_0, [](SpellEffectInfo* spellEffectInfo) + { + spellEffectInfo->TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); + }); + ApplySpellEffectFix(spellInfo, EFFECT_1, [](SpellEffectInfo* spellEffectInfo) + { + spellEffectInfo->TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); + }); + }); + + // Shadestep + ApplySpellFix({ 363976 }, [](SpellInfo* spellInfo) + { + ApplySpellEffectFix(spellInfo, EFFECT_0, [](SpellEffectInfo* spellEffectInfo) + { + spellEffectInfo->TargetB = SpellImplicitTargetInfo(TARGET_DEST_DEST); + }); + }); + // END OF SEPULCHER OF THE FIRST ONES + + // // THE AZURE VAULT SPELLS // diff --git a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp new file mode 100644 index 00000000000..51b1b3d449e --- /dev/null +++ b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp @@ -0,0 +1,4039 @@ +/* + * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information + * + * 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, see <http://www.gnu.org/licenses/>. + */ + +#include "AreaTrigger.h" +#include "AreaTriggerAI.h" +#include "DB2Stores.h" +#include "CellImpl.h" +#include "TaskScheduler.h" +#include "CreatureAI.h" +#include "CreatureAIImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "G3DPosition.hpp" +#include "MoveSplineInitArgs.h" +#include <G3D/Box.h> +#include <G3D/CoordinateFrame.h> +#include "InstanceScript.h" +#include "Map.h" +#include "MotionMaster.h" +#include "MovementTypedefs.h" +#include "Object.h" +#include "ObjectAccessor.h" +#include "PathGenerator.h" +#include "Player.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellAuras.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" +#include "TemporarySummon.h" +#include "UpdateFields.h" +#include "G3D/Vector2.h" +#include "Unit.h" +#include "Weather.h" +#include "GameObjectAI.h" +#include "Containers.h" +#include "SpellMgr.h" +#include "ScriptedGossip.h" +#include "sepulcher_of_the_first_ones.h" + +enum AnduinWrynnSpells +{ + // Pre-Introduction + SPELL_BROKER_SPAWN = 367524, + + // Generic Spells + SPELL_ANDUIN_PLUNGE_KINGSMOURNE = 369125, + SPELL_POWER_DISPLAY_WILLPOWER = 365177, + SPELL_POWER_ENERGIZE_WILLPOWER_SMALL = 365217, + SPELL_POWER_ENERGIZE_WILLPOWER_LARGE = 365228, + SPELL_SOUL_DESPAWN = 362766, + SPELL_SHADESTEP = 363976, + SPELL_ANDUIN_PROGRESSION_AURA = 369317, + SPELL_ANDUIN_WILLPOWER_PERIODIC = 366848, + SPELL_ANDUIN_SOUL_GHOST = 369016, + + // Dark Zeal + SPELL_DARK_ZEAL_AURA = 364247, + SPELL_DARK_ZEAL_BUFF = 364248, + + // Hopebreaker + SPELL_HOPEBREAKER = 361815, + SPELL_HOPEBREAKER_DAMAGE = 361816, + SPELL_HOPEBREAKER_DEBUFF = 361817, + SPELL_HOPEBREAKER_DEBUFF_DAMAGE = 361818, + SPELL_HOPEBREAKER_CLEAR = 364237, + + // Domination Word: Pain + SPELL_DOMINATION_WORD_PAIN = 366849, + + // Befouled Barrier + SPELL_BEFOULED_BARRIER = 365295, + SPELL_BEFOULED_BARRIER_BLACK_RING = 365633, + SPELL_BEFOULED_ERUPTION = 365853, + SPELL_BEFOULED_BARRIER_SPHERE_AREATRIGGER = 365173, + SPELL_BEFOULED_BARRIER_DEBUFF = 365293, + SPELL_BEFOULED_BARRIER_CLEAR = 369871, + SPELL_BEFOULED_BARRIER_EXPLODE = 365300, + + // Blasphemy + SPELL_BLASPHEMY = 361989, + SPELL_BLASPHEMY_PRE_HIT = 364239, + SPELL_BLASPHEMY_OVERCONFIDENCE = 361990, + SPELL_BLASPHEMY_OVERCONFIDENCE_AREATRIGGER = 361992, + SPELL_BLASPHEMY_HOPELESSNESS = 361991, + SPELL_BLASPHEMY_HOPELESSNESS_AREATRIGGER = 361993, + SPELL_BLASPHEMY_SUCCESS = 362014, + SPELL_BLASPHEMY_EXPLODE = 361999, + SPELL_BLASPHEMY_EXPLODE_LFR_NORMAL = 366933, + SPELL_CANCEL_BLASPHEMY = 370161, + SPELL_BLASPHEMY_IMMUNE = 370407, + + // Kingsmourne Hungers + SPELL_KINGSMOURNE_HUNGERS = 362405, + SPELL_KINGSMOURNE_HUNGERS_DAMAGE_IDK = 362406, + SPELL_KINGSMOURNE_HUNGERS_DAMAGE = 362407, + SPELL_LOST_SOUL_DIMENSION = 362055, + SPELL_LOST_SOUL = 362472, + SPELL_LOST_SOUL_GRACE = 370068, + SPELL_LOST_SOUL_CLEAR = 365641, + SPELL_CANCEL_LOST_SOUL = 367774, + SPELL_SEVERED_SOUL = 367769, + SPELL_LOST_SOUL_MYTHIC = 367770, + SPELL_LOST_SOUL_MIRROR_IMAGE = 362402, + SPELL_SCARRED_SOUL = 365445, + SPELL_MIRROR_IMAGE = 362474, + SPELL_FEIGN_DEATH = 114371, + SPELL_BANISH_SOUL = 367771, + SPELL_MIRROR_IMAGE_IGNORE_PHASE_SHIFT = 362473, + SPELL_ANDUIN_LOST_SOUL_TRACKER = 369843, + + // Rain of Despair (Big add) + SPELL_RAIN_OF_DESPAIR = 362391, + SPELL_ANDUIN_SOUL_DESPAIR = 365220, + SPELL_RAIN_OF_DESPAIR_MELEE = 362393, + SPELL_RAIN_OF_DESPAIR_RANGED = 362396, + SPELL_RAIN_OF_DESPAIR_EXPLOSION = 362392, + + // Wicked Star + SPELL_WICKED_STAR = 365030, + SPELL_WICKED_STAR_POINTER = 365021, + SPELL_WICKED_STAR_AREATRIGGER = 365017, + SPELL_WICKED_STAR_DAMAGE_SILENCE = 365024, + SPELL_WICKED_STAR_EMPOWERMENT = 365112, + SPELL_WICKED_STAR_IDK = 365992, + SPELL_WICKED_STAR_TARGETED = 366674, + SPELL_WICKED_STAR_IDK_3 = 369280, + + // Empowered Wicked Star + SPELL_EMPOWERED_WICKED_STAR = 367631, + SPELL_EMPOWERED_WICKED_STAR_POINTER = 367632, + SPELL_EMPOWERED_WICKED_STAR_AREATRIGGER = 367621, + SPELL_EMPOWERED_WICKED_STAR_DAMAGE_SILENCE = 367634, + + // Force of Will + SPELL_FORCE_OF_WILL = 368913, + SPELL_CANCEL_FORCE_OF_WILL = 368978, + + // Fiendish Soul + SPELL_NECROTIC_CLAWS_LEAP = 363019, + SPELL_NECROTIC_CLAWS_DEBUFF = 363020, + SPELL_SOUL_EXPLOSION_TARGET = 363029, + SPELL_SOUL_EXPLOSION_TRIGGER_MISSILE = 363030, + SPELL_SOUL_EXPLOSION_DAMAGE = 363031, + + // Monstrous Soul + SPELL_UNRAVELING_FRENZY_PERIODIC = 363027, + SPELL_UNRAVELING_FRENZY = 363028, + SPELL_NECROTIC_DETONATION = 363024, + + // Grim Reflections + SPELL_GRIM_REFLECTIONS = 365120, + SPELL_GRIM_REFLECTIONS_SUMMON = 365121, + SPELL_GRIM_REFLECTIONS_DEST_SUMMON = 365039, + SPELL_CALAMITY_STATE_VISUAL = 361685, + SPELL_WICKED_STAR_PROTECTION = 370400, + SPELL_PSYCHIC_TERROR = 365008, + SPELL_GRIM_FATE = 367932, + + // Beacon of Hope + SPELL_BEACON_OF_HOPE = 365872, + SPELL_BEACON_OF_HOPE_AREATRIGGER = 362702, + + // Fragment of Hope + SPELL_FRAGMENT_OF_HOPE_AREATRIGGER = 365816, + SPELL_FRAGMENT_OF_HOPE_CLEAR_DEBUFF = 365828, + SPELL_FRAGMENT_OF_HOPE_DAMAGE = 365990, + + // Purging Light + SPELL_PURGING_LIGHT = 368428, + + // Hopelessness + SPELL_HOPELESSNESS = 365958, + SPELL_HOPELESSNESS_MISSILE = 365962, + SPELL_HOPELESSNESS_HOPELESSNESS_AREATRIGGER = 365966, + SPELL_HOPELESSNESS_EXPLODE = 365971, + + // Empowered Hopebreaker + SPELL_EMPOWERED_HOPEBREAKER = 365805, + SPELL_EMPOWERED_HOPEBREAKER_EXPLOSION = 365806, + + // Anduin's Soul + SPELL_LOST_SOUL_PERIODIC = 365650, + SPELL_LOST_SOUL_CONSUME = 365652, + + // Anduin's Hope + SPELL_ANDUIN_SLOW = 365218, + SPELL_GLOOM = 364031, + + // Anduin's Doubt + SPELL_GHOST_VISUAL_COSMETIC = 370833, + + // Remnant of a Fallen King + SPELL_DOMINATION_GRASP = 365216, + SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER = 362505, + SPELL_SHADE_VISUAL = 362490, + SPELL_REMNANT_SPAWN = 362500, + SPELL_DARK_PRESENCE = 368986, + SPELL_WEATHER_COSMETIC = 362493, + SPELL_SPAWN_REMNANT = 362497, + SPELL_REMNANT_TIMER = 365291, + SPELL_RETURN_TO_KINGSMOURNE = 363022, + SPELL_RETURN_TO_KINGSMOURNE_VISUALS = 363021, + SPELL_SHADE_DESPAWN_CEREMONY = 363023, + + // Remorseless Winter + SPELL_REMORSELESS_WINTER = 362542, + SPELL_REMORSELESS_WINTER_PERIODIC = 362543, + SPELL_REMORSELESS_WINTER_DEBUFF_DAMAGE = 362545, + SPELL_REMORSELESS_WINTER_CLEAR = 370619, + + // Army of the Dead + SPELL_ARMY_OF_THE_DEAD = 362862, + SPELL_ECHOES_OF_ANDORHAL = 362863, + SPELL_ECHOES_OF_ANDORHAL_FIENDISH_GHOULS = 362864, + SPELL_ECHOES_OF_ANDORHAL_MONSTROUS_SOUL = 363025, + + // March of the Damned + SPELL_MARCH_OF_THE_DAMNED = 363116, + SPELL_MARCH_OF_THE_DAMNED_PERIODIC = 363233, + SPELL_MARCH_OF_THE_DAMNED_AREATRIGGER = 363133, + SPELL_MARCH_OF_THE_DAMNED_DAMAGE = 364020, + SPELL_DESPAWN_WALLS = 371694, + + // Soul Reaper + SPELL_SOUL_REAPER = 362771, + SPELL_SOUL_REAPER_PHYSICAL_DAMAGE = 362772, + SPELL_SOUL_REAPER_SHADOWFROST_DAMAGE = 362773, + SPELL_SOUL_REAPER_DEBUFF = 362774, + SPELL_SOUL_REAPER_ATTACK_SPEED = 362775, + + // Finish Encounter + SPELL_ANDUIN_KNEEL_POSE = 369367, + SPELL_FINAL_MOVIE = 367306, + SPELL_AWARD_ANDUIN_KILL = 359476, + + // Berserk + SPELL_BERSERK = 26662, + + // Jaina Spells + SPELL_BLINK = 362844, + SPELL_FROSTBOLT = 362843, + SPELL_GENERIC_BLINK = 363984, + + // Sylvanas Spells + SPELL_SHOOT_BOW = 364068, + SPELL_TUMBLE = 364069, + + // Uther Spells + SPELL_BLADE_OF_JUSTICE = 363971, + SPELL_UTHER_CHARGE = 363972, + + // Translocators Teleport + SPELL_TELEPORT_COSMIC_HUB = 364475, + SPELL_TELEPORT_DOMINATIONS_GRASP = 368563, +}; + +enum AnduinWrynnPhases +{ + PHASE_ONE = 1, + PHASE_TWO, + PHASE_THREE, +}; + +enum AnduinWrynnEvents +{ + // Anduin Wrynn + EVENT_HOPEBREAKER = 1, + EVENT_DOMINATION_WORD_PAIN, + EVENT_BEFOULED_BARRIER, + EVENT_UPDATE_BEFOULED_BARRIER, + EVENT_BLASPHEMY, + EVENT_HOPELESSNESS, + EVENT_WICKED_STAR, + EVENT_EMPOWERED_WICKED_STAR, + EVENT_KINGSMOURNE_HUNGERS, + EVENT_INTERMISSION_ONE, + EVENT_INTERMISSION_TWO, + EVENT_GRIM_REFLECTIONS, + EVENT_BEACON_OF_HOPE, + EVENT_EMPOWERED_HOPEBREAKER, + EVENT_BANISH_SOUL, + EVENT_BERSERK, + + // Kingsmourne Room + EVENT_ANDUIN_SOUL, + + // Remnant of a Fallen King + EVENT_ARMY_OF_THE_DEAD, + EVENT_SOUL_REAPER, + EVENT_RETURN_TO_KINGSMOURNE, + + // Fiendish Soul + EVENT_GHOUL_LEAP, + EVENT_NECROTIC_CLAWS, + + // Monstrous Soul + EVENT_UNRAVELING_FRENZY, + EVENT_NECROTIC_DETONATION, + + // Grim Reflections + EVENT_PSYCHIC_TERROR, + EVENT_GRIM_REFLECTION_IMMUNITY, + + // Sylvanas Windrunner + EVENT_CANCEL_SYLVANAS_EVENTS, + EVENT_TUMBLE, + + // Uther the Lightbringer + EVENT_CANCEL_UTHER_EVENTS, + EVENT_BLADE_OF_JUSTICE, + + // Jaina Proudmoore + EVENT_CANCEL_JAINA_EVENTS, + EVENT_BLINK, +}; + +enum AnduinWrynnActions +{ + ACTION_START_PRE_INTRODUCTION = 1, + ACTION_START_MOVEMENT, + ACTION_START_INTRODUCTION, + ACTION_ARTHAS_INTERMISSION_UTHER, + ACTION_ARTHAS_INTERMISSION_SYLVANAS, + ACTION_EXIT_INTERMISSION, + ACTION_ACTIVATE_REMNANT, + ACTION_DESPAWN_REMNANT, + ACTION_SUMMON_KINGSMOURNE_SOULS, + ACTION_END_ENCOUNTER, + ACTION_START_OUTRODUCTION, + ACTION_DESPAIR_GONE, + ACTION_DOUBT_GONE, + ACTION_HOPE_RESTORED, + + // Monstrous Soul + ACTION_NECROTIC_DETONATION, + + // Outroduction + ACTION_MOVE_NPCS_ON_PLATFORM, +}; + +enum AnduinWrynnTexts +{ + SAY_AGGRO = 0, + SAY_HOPEBREAKER = 1, + SAY_BEFOULED_BARRIER = 2, + SAY_BLASPHEMY = 3, + SAY_ANNOUNCE_BLASPHEMY = 4, + SAY_ANNOUNCE_KINGSMOURNE_HUNGERS = 5, + SAY_KINGSMOURNE_HUNGERS = 6, + SAY_WICKED_STAR = 7, + SAY_ANNOUNCE_WICKED_STAR = 8, + SAY_GRIM_REFLECTIONS = 9, + SAY_SLAY = 10, + SAY_EMPOWERED_HOPEBREAKER = 11, + SAY_DISENGAGE = 12, + SAY_NECROTIC_DETONATION = 13, + SAY_ANNOUNCE_EMPOWERED_WICKED_STAR = 14, +}; + +enum AnduinWrynnConversations +{ + CONVERSATION_INTRO = 17835, + CONVERSATION_ARTHAS_UTHER = 17921, + CONVERSATION_ARTHAS_SYLVANAS = 17923, + CONVERSATION_ANDUIN_PHASE_THREE = 17924, + CONVERSATION_ANDUIN_OUTRODUCTION = 17836, +}; + +enum AnduinWrynnSpawnGroups +{ + SPAWN_GROUP_INITIAL = 0 +}; + +enum AnduinWrynnPoints +{ + POINT_START_INTRODUCTION = 1, + POINT_ANDUIN_SOUL = 2, + POINT_ESCAPE_PLATFORM = 3, + POINT_MARCH_OF_THE_DAMNED = 4, +}; + +enum AnduinWrynnPaths +{ + PATH_INTRODUCTION_JAINA = 183664 * 100, + PATH_INTRODUCTION_UTHER = 183665 * 100, + PATH_INTRODUCTION_SYLVANAS = 183666 * 100, + PATH_OUTRODUCTION_FIRIM = 184589 * 100, + PATH_OUTRODUCTION_THRALL = 184599 * 100, + PATH_OUTRODUCTION_BOLVAR = 184601 * 100, +}; + +enum AnduinWrynnSpellVisuals +{ + SPELL_VISUAL_CHEST_LOOT = 114023, +}; + +enum AnduinWrynnAchievements +{ + ACHIEVEMENT_ANDUIN_MYTHIC = 15486, +}; + +Position const PreIntroductionAssistersPositions[3] = +{ + { -3826.9548f, -2626.2761f, 78.9296f, 4.644121f }, // Jaina + { -3831.6807f, -2626.2761f, 78.9296f, 5.460620f }, // Uther + { -3818.7300f, -2626.2800f, 78.9296f, 4.558697f }, // Sylvanas +}; + +Position const AssistersSpawnPos[3] = +{ + { -3824.65f, -2692.20f, 91.3485f, 4.64412f}, // Jaina + { -3828.03f, -2688.25f, 91.3485f, 5.46062f}, // Uther + { -3819.48f, -2687.19f, 91.3485f, 4.55870f}, // Sylvanas +}; + +Position const FirimOutroductionPos = { -3830.0156f, -2676.7969f, 91.56402f }; +Position const QuartermasterRahmPos = { -3824.9565f, -2673.0190f, 91.44697f, 4.7163963f }; +Position const LeftKnightPosition = { -3815.4097f, -2677.1824f, 91.44697f, 4.742376f }; +Position const RightKnightPosition = { -3834.6807f, -2677.42360f, 91.44697f, 4.6956997f }; + +Position const DominationGraspCenter = { -3825.0601f, -2715.4600f, 91.3567f, 1.6260f }; + +Position const IntermissionAssistersTeleportPosition[3] = +{ + { -3828.472f, -2688.191f, 91.2652f, 1.9153f }, // Sylvanas + { -3819.519f, -2687.170f, 91.2652f, 2.1812f }, // Uther + { -3824.960f, -2692.550f, 91.2652f, 1.5733f }, // Jaina +}; + +Position const AnduinsDespairSpawnPosition = { -3828.355957f, -2704.1875f, 91.350716f, 4.982021f }; + +Position const AnduinsSoulSpawnPosition = { -3825.060059f, -2715.459961f, 91.356697f, 1.626040f }; + +Position const AnduinsDoubtSpawnPositions[4] = +{ + { -3852.638916f, -2687.373291f, 91.348526f, 5.560700f }, // Right of Uther + { -3852.845459f, -2742.732666f, 91.348534f, 0.961583f }, // Next Right + { -3797.704834f, -2686.685791f, 91.348526f, 3.804689f }, // Left of Sylvanas + { -3799.805664f, -2740.925293f, 91.348541f, 2.247305f }, // Next Left +}; + +Position const AnduinsHopeSpawnPosition[4] = +{ + { -3825.149414f, -2711.508789f, 91.354919f, 1.463445f }, // In front of Anduin + { -3828.751709f, -2715.171875f, 91.354919f, 3.221487f }, // Left of Anduin + { -3821.041748f, -2715.296875f, 91.354889f, 0.046978f }, // Right of Anduin + { -3825.180664f, -2719.208252f, 91.354820f, 4.741285f }, // Behind Anduin +}; + +Position const RemnantOfAFallenKingSpawnPosition = { -3825.2466f, -2700.0486f, 91.3650f, 1.3762f }; + +Position const GrimReflectionsSpawnPositions[4] = +{ + { -3825.389f, -2739.4202f, 91.431305f, 4.8445f}, // back side of Anduin + { -3849.8438f, -2715.0574f, 91.40953f, 2.9961f}, // left side of Anduin + { -3825.4966f, -2692.6199f, 91.487495f, 1.4654f}, // in front of Anduin + { -3800.6980f, -2715.4340f, 91.390780f, 6.2769f}, // right side of Anduin +}; + +Position const MarchOfTheDamnedSpawnPositions[8] = +{ + { -3839.8489f, -2679.7708f, 91.53031f, 5.1081f }, // First right + { -3860.8940f, -2701.0051f, 91.53032f, 5.9010f }, // Second Right + { -3860.5696f, -2729.7344f, 91.53032f, 0.3886f }, // Third Right + { -3839.6390f, -2750.8890f, 91.53032f, 1.1935f }, // Fourth Right + { -3811.0625f, -2679.6528f, 91.53031f, 4.3362f }, // First left + { -3789.8125f, -2700.5088f, 91.53032f, 3.5383f }, // Second Left + { -3789.2812f, -2729.3160f, 91.53032f, 2.7669f }, // Third Left + { -3810.4290f, -2751.0903f, 91.53032f, 1.9584f } // Fourth Left +}; + +Position const BeaconOfHopeSpawnPosition = { -3825.0417f, -2715.3923f, 91.3568f, 0.0f }; + +Position const ChestLootSpawnPosition = { -3840.9915f, -2741.7847f, 91.26521f, 1.334929f }; + +class ActivateGhouls : public BasicEvent +{ +public: + ActivateGhouls(Creature* summoner, Creature* owner) + : _summonerGuid(summoner->GetGUID()), _owner(owner) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) override + { + if (Creature* _summoner = ObjectAccessor::GetCreature(*_owner, _summonerGuid)) + { + if (Unit* target = _summoner->AI()->SelectTarget(SelectTargetMethod::Random, 0)) + { + _owner->SetReactState(REACT_AGGRESSIVE); + _owner->AI()->AttackStart(target); + } + } + return true; + } + +private: + ObjectGuid _summonerGuid; + Creature* _owner; +}; + +// 181954 - Anduin Wrynn +struct boss_anduin_wrynn : public BossAI +{ + boss_anduin_wrynn(Creature* creature) : BossAI(creature, DATA_ANDUIN_WRYNN), + _slayTextOnCooldown(false), _intermissionsDone(0), _encounterEnded(false) { } + + void HandleIntroduction() + { + if (instance->GetData(DATA_ANDUIN_WRYNN_INTRODUCTION) == DONE) + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_ATTACKABLE_1); + me->SetImmuneToAll(false); + me->SetSpeed(MOVE_RUN, 11.0f); + me->RemoveAurasDueToSpell(SPELL_ANDUIN_PLUNGE_KINGSMOURNE); + } + else + { + DoCastSelf(SPELL_ANDUIN_PLUNGE_KINGSMOURNE); + me->SetUnitFlag(UNIT_FLAG_NOT_ATTACKABLE_1); + me->SetImmuneToAll(true); + } + } + + void PrepareAssistersForIntermission() + { + if (Creature* sylvanas = instance->GetCreature(DATA_SYLVANAS_WINDRUNNER_ANDUIN)) + { + sylvanas->CastSpell(IntermissionAssistersTeleportPosition[0], SPELL_GENERIC_BLINK); + sylvanas->AttackStop(); + sylvanas->SetSheath(SHEATH_STATE_RANGED); + sylvanas->SetEmoteState(EMOTE_STATE_READY_BOW); + } + + if (Creature* uther = instance->GetCreature(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN)) + { + uther->CastSpell(IntermissionAssistersTeleportPosition[1], SPELL_GENERIC_BLINK); + uther->AttackStop(); + uther->SetSheath(SHEATH_STATE_MELEE); + uther->SetEmoteState(EMOTE_STATE_READY2H); + } + + if (Creature* jaina = instance->GetCreature(DATA_JAINA_PROUDMOORE_ANDUIN)) + { + jaina->CastSpell(IntermissionAssistersTeleportPosition[2], SPELL_GENERIC_BLINK); + jaina->AttackStop(); + jaina->SetSheath(SHEATH_STATE_RANGED); + jaina->SetEmoteState(EMOTE_STATE_READY2H); + } + } + + void ForceAssistersToAttackRemnant() + { + Unit* remnant = instance->GetCreature(DATA_REMNANT_OF_A_FALLEN_KING); + if (!remnant) + return; + + auto forceAttack = [this, remnant](uint32 data) + { + Creature* creature = instance->GetCreature(data); + if (!creature) + return; + + creature->AI()->AttackStart(remnant); + creature->SetReactState(REACT_AGGRESSIVE); + }; + + forceAttack(DATA_SYLVANAS_WINDRUNNER_ANDUIN); + forceAttack(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN); + forceAttack(DATA_JAINA_PROUDMOORE_ANDUIN); + } + + void MoveKnightsOnPlatform() + { + if (Creature* rahm = instance->GetCreature(DATA_QUARTERMASTER_RAHM_ANDUIN)) + rahm->NearTeleportTo(QuartermasterRahmPos); + + std::list<Creature*> knights; + me->GetCreatureListWithOptionsInGrid(knights, 150.0f, { .CreatureId = NPC_KNIGHT_OF_EBON_BLADE_ANDUIN }); + + for (Creature* knight : knights) + { + if (knight->HasStringId("left_knight")) + knight->NearTeleportTo(LeftKnightPosition); + else + knight->NearTeleportTo(RightKnightPosition); + } + } + + void ClearDebuffs() + { + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_HOPEBREAKER_DEBUFF); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLASPHEMY_OVERCONFIDENCE); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLASPHEMY_HOPELESSNESS); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DOMINATION_WORD_PAIN); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BEFOULED_BARRIER_DEBUFF); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BEFOULED_BARRIER_EXPLODE); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LOST_SOUL_DIMENSION); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_FORCE_OF_WILL); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_SCARRED_SOUL); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_WEATHER_COSMETIC); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_REMORSELESS_WINTER_PERIODIC); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_HOPELESSNESS_HOPELESSNESS_AREATRIGGER); + } + + void JustAppeared() override + { + scheduler.ClearValidator(); + HandleIntroduction(); + me->SetEmoteState(EMOTE_STATE_READY2H); + me->ModifyPower(me->GetPowerType(), 0); + DoCastSelf(SPELL_ANDUIN_PROGRESSION_AURA); + DoCastSelf(SPELL_POWER_DISPLAY_WILLPOWER, true); + DoCastSelf(SPELL_DARK_ZEAL_AURA, true); + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_ENCOUNTER_STARTED, 0); + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_INTERMISSION, 0); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + ClearDebuffs(); + Talk(SAY_DISENGAGE); + if (_encounterEnded == true) + return; + + _DespawnAtEvade(); + summons.DespawnAll(); + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_ENCOUNTER_STARTED, 0); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + } + + void Reset() override + { + _Reset(); + me->SummonCreatureGroup(SPAWN_GROUP_INITIAL); + events.Reset(); + scheduler.CancelAll(); + me->SetPower(POWER_ENERGY, 0); + + _slayTextOnCooldown = false; + _intermissionsDone = 0; + _encounterEnded = false; + } + + void KilledUnit(Unit* victim) override + { + if (_slayTextOnCooldown == false && !victim->IsPlayer()) + { + Talk(SAY_SLAY); + _slayTextOnCooldown = true; + scheduler.Schedule(3s, [this](TaskContext /*task*/) + { + _slayTextOnCooldown = false; + }); + } + } + + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + + switch (summon->GetEntry()) + { + case NPC_BEFOULED_BARRIER: + { + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell(summon, SPELL_BEFOULED_ERUPTION, true); + summon->CastSpell(summon, SPELL_BEFOULED_BARRIER_SPHERE_AREATRIGGER, true); + summon->CastSpell(summon, SPELL_BEFOULED_BARRIER_BLACK_RING, true); + break; + } + + case BOSS_REMNANT_OF_A_FALLEN_KING: + { + summon->SetReactState(REACT_PASSIVE); + summon->SetUninteractible(true); + summon->CastSpell(summon, SPELL_REMNANT_SPAWN); + break; + } + + case NPC_MARCH_OF_THE_DAMNED: + { + float marchSpeed = 0.0f; + switch (me->GetMap()->GetDifficultyID()) + { + case DIFFICULTY_LFR_NEW: + case DIFFICULTY_NORMAL_RAID: + case DIFFICULTY_HEROIC_RAID: + marchSpeed = 0.40f; + break; + case DIFFICULTY_MYTHIC_RAID: + marchSpeed = 0.60f; + break; + default: + marchSpeed = 0.40f; + break; + } + + summon->SetSpeedRate(MOVE_RUN, marchSpeed); + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell(summon, SPELL_MARCH_OF_THE_DAMNED_AREATRIGGER, true); + scheduler.Schedule(1s, [summon](TaskContext /*task*/) + { + Position exitPlatform = summon->GetFirstCollisionPosition(100.0f, summon->GetAbsoluteAngle(summon)); + summon->GetMotionMaster()->MovePoint(POINT_MARCH_OF_THE_DAMNED, exitPlatform, false, summon->GetOrientation()); + }); + break; + } + + case NPC_BEACON_OF_HOPE: + { + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell(summon, SPELL_BEACON_OF_HOPE_AREATRIGGER); + break; + } + + default: + break; + } + } + + void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override + { + if (summon->GetEntry() == NPC_GRIM_REFLECTION) + summon->DespawnOrUnsummon(3s); + } + + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); + PhaseEvents(PHASE_ONE); + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_ENCOUNTER_STARTED, PHASE_ONE); + Talk(SAY_AGGRO); + } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_START_PRE_INTRODUCTION: + { + auto teleportNamed = [this](uint32 data, Position const& position) + { + Creature* creature = instance->GetCreature(data); + if (!creature) + return; + + creature->NearTeleportTo(position); + creature->CastSpell(creature, SPELL_BROKER_SPAWN, true); + }; + + teleportNamed(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN, PreIntroductionAssistersPositions[0]); + teleportNamed(DATA_SYLVANAS_WINDRUNNER_ANDUIN, PreIntroductionAssistersPositions[1]); + teleportNamed(DATA_JAINA_PROUDMOORE_ANDUIN, PreIntroductionAssistersPositions[2]); + break; + } + case ACTION_START_MOVEMENT: + { + auto castBrokerSpawn = [this](uint32 data) + { + Creature* creature = instance->GetCreature(data); + if (!creature) + return; + + creature->CastSpell(creature, SPELL_BROKER_SPAWN, true); + }; + + castBrokerSpawn(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN); + castBrokerSpawn(DATA_SYLVANAS_WINDRUNNER_ANDUIN); + castBrokerSpawn(DATA_JAINA_PROUDMOORE_ANDUIN); + break; + } + case ACTION_START_INTRODUCTION: + { + instance->SetData(DATA_ANDUIN_WRYNN_INTRODUCTION, IN_PROGRESS); + scheduler.Schedule(1ms, [this](TaskContext /*task*/) + { + Creature* uther = instance->GetCreature(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN); + if (!uther) + return; + + Creature* sylvanas = instance->GetCreature(DATA_SYLVANAS_WINDRUNNER_ANDUIN); + if (!sylvanas) + return; + + Creature* jaina = instance->GetCreature(DATA_JAINA_PROUDMOORE_ANDUIN); + if (!jaina) + return; + + Conversation* convo = Conversation::CreateConversation(CONVERSATION_INTRO, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false); + if (!convo) + return; + + convo->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 1, uther->GetGUID()); + convo->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 2, sylvanas->GetGUID()); + convo->AddActor(NPC_LADY_JAINA_PROUDMOORE_ANDUIN, 3, jaina->GetGUID()); + convo->Start(); + }); + + scheduler.Schedule(35s, [this](TaskContext /*task*/) + { + instance->SetData(DATA_ANDUIN_WRYNN_INTRODUCTION, DONE); + HandleIntroduction(); + }); + break; + } + case ACTION_MOVE_NPCS_ON_PLATFORM: + { + if (Creature* bolvar = me->GetInstanceScript()->GetCreature(DATA_BOLVAR_FORDRAGON_ANDUIN)) + bolvar->GetMotionMaster()->MovePath(PATH_OUTRODUCTION_BOLVAR, false); + + if (Creature* thrall = me->GetInstanceScript()->GetCreature(DATA_THRALL_ANDUIN)) + thrall->GetMotionMaster()->MovePath(PATH_OUTRODUCTION_THRALL, false); + + scheduler.Schedule(10s, [this](TaskContext /*task*/) + { + MoveKnightsOnPlatform(); + }); + break; + } + case ACTION_START_OUTRODUCTION: + { + Creature* uther = instance->GetCreature(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN); + if (!uther) + break; + + Creature* sylvanas = instance->GetCreature(DATA_SYLVANAS_WINDRUNNER_ANDUIN); + if (!sylvanas) + break; + + Creature* jaina = instance->GetCreature(DATA_JAINA_PROUDMOORE_ANDUIN); + if (!jaina) + break; + + Creature* firim = instance->GetCreature(DATA_FIRIM_ANDUIN); + if (!firim) + break; + + firim->GetMotionMaster()->MovePath(PATH_OUTRODUCTION_FIRIM, false); + + Conversation* convo = Conversation::CreateConversation(CONVERSATION_ANDUIN_OUTRODUCTION, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false); + if (!convo) + break; + + convo->AddActor(NPC_LADY_JAINA_PROUDMOORE_ANDUIN, 1, jaina->GetGUID()); + convo->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 2, sylvanas->GetGUID()); + convo->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 3, uther->GetGUID()); + convo->AddActor(NPC_FIRIM_ANDUIN, 4, firim->GetGUID()); + convo->Start(); + break; + } + case ACTION_ARTHAS_INTERMISSION_UTHER: + { + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_INTERMISSION, 1); + if (Creature* uther = instance->GetCreature(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN)) + { + if (Conversation* convo = Conversation::CreateConversation(CONVERSATION_ARTHAS_UTHER, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false)) + { + convo->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 1, uther->GetGUID()); + convo->Start(); + } + } + break; + } + case ACTION_ARTHAS_INTERMISSION_SYLVANAS: + { + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_INTERMISSION, 2); + if (Creature* sylvanas = instance->GetCreature(DATA_SYLVANAS_WINDRUNNER_ANDUIN)) + { + if (Conversation* convo = Conversation::CreateConversation(CONVERSATION_ARTHAS_SYLVANAS, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false)) + { + convo->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 1, sylvanas->GetGUID()); + convo->Start(); + } + } + break; + } + case ACTION_EXIT_INTERMISSION: + { + if (_intermissionsDone == 0) + { + PhaseEvents(PHASE_TWO); + scheduler.Schedule(3s, [this](TaskContext /*task*/) + { + me->SetReactState(REACT_AGGRESSIVE); + }); + } + else if (_intermissionsDone == 1) + { + PhaseEvents(PHASE_THREE); + scheduler.Schedule(6s, [this](TaskContext /*task*/) + { + me->SetReactState(REACT_AGGRESSIVE); + }); + } + break; + } + case ACTION_END_ENCOUNTER: + { + EndEncounter(); + break; + } + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + scheduler.Update(diff); + + if (!UpdateVictim()) + return; + + Unit* victim = me->GetVictim(); + if (victim && !victim->IsPlayer()) + { + EnterEvadeMode(EvadeReason::NoHostiles); + return; + } + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_HOPEBREAKER: + { + DoCastSelf(SPELL_HOPEBREAKER); + Talk(SAY_HOPEBREAKER); + break; + } + case EVENT_EMPOWERED_HOPEBREAKER: + { + DoCastSelf(SPELL_EMPOWERED_HOPEBREAKER); + Talk(SAY_EMPOWERED_HOPEBREAKER); + if (IsMythic()) + events.Repeat(65500ms); + else + events.Repeat(58400ms); + break; + } + case EVENT_DOMINATION_WORD_PAIN: + { + DoCastSelf(SPELL_DOMINATION_WORD_PAIN); + break; + } + case EVENT_BEFOULED_BARRIER: + { + DoCastSelf(SPELL_BEFOULED_BARRIER); + Talk(SAY_BEFOULED_BARRIER); + break; + } + case EVENT_BLASPHEMY: + { + DoCastSelf(SPELL_BLASPHEMY); + Talk(SAY_ANNOUNCE_BLASPHEMY); + Talk(SAY_BLASPHEMY); + break; + } + case EVENT_HOPELESSNESS: + { + DoCastAOE(SPELL_HOPELESSNESS); + Talk(SAY_BLASPHEMY); + if (IsMythic()) + events.Repeat(65500ms); + else + events.Repeat(58500ms); + break; + } + case EVENT_WICKED_STAR: + { + DoCastSelf(SPELL_WICKED_STAR); + Talk(SAY_WICKED_STAR); + if (events.IsInPhase(PHASE_THREE)) + events.Repeat(58500ms); + break; + } + case EVENT_EMPOWERED_WICKED_STAR: + { + DoCastSelf(SPELL_EMPOWERED_WICKED_STAR, true); + Talk(SAY_WICKED_STAR); + if (IsMythic()) + events.Repeat(65500ms); + else + events.Repeat(58500ms); + break; + } + case EVENT_KINGSMOURNE_HUNGERS: + { + DoCastSelf(SPELL_KINGSMOURNE_HUNGERS); + Talk(SAY_ANNOUNCE_KINGSMOURNE_HUNGERS); + Talk(SAY_KINGSMOURNE_HUNGERS); + break; + } + case EVENT_GRIM_REFLECTIONS: + { + Talk(SAY_GRIM_REFLECTIONS); + DoCastSelf(SPELL_GRIM_REFLECTIONS); + break; + } + case EVENT_BEACON_OF_HOPE: + { + DoCastSelf(SPELL_BEACON_OF_HOPE); + break; + } + case EVENT_INTERMISSION_ONE: + { + StartIntermission(0); + break; + } + case EVENT_INTERMISSION_TWO: + { + StartIntermission(1); + break; + } + case EVENT_BERSERK: + { + DoCastSelf(SPELL_BERSERK); + break; + } + default: + break; + } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + } + + DoMeleeAttackIfReady(); + } + + void StartIntermission(uint8 intermissionNum) + { + auto SpawnRemnant = [this](TaskContext /*task*/) + { + if (Creature* arthas = instance->GetCreature(DATA_REMNANT_OF_A_FALLEN_KING)) + me->CastSpell(arthas, SPELL_SPAWN_REMNANT); + }; + + Seconds timeOffset = intermissionNum * 1s; + + scheduler.Schedule(1ms, [this](TaskContext /*task*/) + { + me->SetReactState(REACT_PASSIVE); + me->CastSpell(DominationGraspCenter, SPELL_SHADESTEP); + PrepareAssistersForIntermission(); + }); + + scheduler.Schedule(1204ms + timeOffset, [this, intermissionNum](TaskContext /*task*/) + { + DoAction(intermissionNum == 0 ? ACTION_ARTHAS_INTERMISSION_UTHER : ACTION_ARTHAS_INTERMISSION_SYLVANAS); + }); + + scheduler.Schedule(2204ms + timeOffset, [this](TaskContext /*task*/) + { + me->SetFacingTo(1.626040f); + }); + + scheduler.Schedule(4s + timeOffset, [this](TaskContext /*task*/) + { + DoCastSelf(SPELL_FORCE_OF_WILL); + DoCastSelf(SPELL_HOPEBREAKER_CLEAR); + DoCastSelf(SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER); + + if (Creature* arthas = me->SummonCreature(BOSS_REMNANT_OF_A_FALLEN_KING, RemnantOfAFallenKingSpawnPosition, TEMPSUMMON_MANUAL_DESPAWN)) + { + me->CastSpell(arthas, SPELL_DOMINATION_GRASP); + me->CastSpell(arthas, SPELL_SPAWN_REMNANT); + } + }); + + scheduler.Schedule(5s + timeOffset, SpawnRemnant); + + scheduler.Schedule(6s + timeOffset, SpawnRemnant); + + scheduler.Schedule(7s + timeOffset, SpawnRemnant); + + scheduler.Schedule(8s + timeOffset, [this, intermissionNum](TaskContext /*task*/) + { + if (intermissionNum == 1 || IsMythic()) + DoCastSelf(SPELL_MARCH_OF_THE_DAMNED_PERIODIC); + + if (Creature* arthas = instance->GetCreature(DATA_REMNANT_OF_A_FALLEN_KING)) + { + me->CastSpell(arthas, SPELL_SPAWN_REMNANT); + arthas->SetImmuneToAll(false); + ForceAssistersToAttackRemnant(); + } + }); + } + + void PhaseEvents(uint8 phase) + { + events.Reset(); + + switch (phase) + { + case PHASE_ONE: + { + events.SetPhase(PHASE_ONE); + events.ScheduleEventSeries(EVENT_HOPEBREAKER, { 5s, 31900ms, 28s, 29900ms, 29900ms }); + events.ScheduleEventSeries(EVENT_BEFOULED_BARRIER, { 17s, 51900ms, 48s }); + events.ScheduleEventSeries(EVENT_BLASPHEMY, { 30s, 49900ms, 54900ms }); + events.ScheduleEventSeries(EVENT_WICKED_STAR, { 55s, 35s, 30s }); + events.ScheduleEventSeries(EVENT_DOMINATION_WORD_PAIN, { 7s, 13s, 13s, 10s, 15s, 13100ms, 12900ms, 13s, 13900ms, 12200ms, 14800ms }); + events.ScheduleEvent(EVENT_INTERMISSION_ONE, 150s); + events.ScheduleEvent(EVENT_BERSERK, 15min); + + if (IsLFR()) + DoCastSelf(SPELL_ANDUIN_WILLPOWER_PERIODIC, true); + else + events.ScheduleEventSeries(EVENT_KINGSMOURNE_HUNGERS, { 45s, 1min }); + break; + } + + case PHASE_TWO: + { + _intermissionsDone = 1; + me->ModifyPower(me->GetPowerType(), 0); + events.SetPhase(PHASE_TWO); + events.ScheduleEventSeries(EVENT_GRIM_REFLECTIONS, { 8700ms, 87s }); + events.ScheduleEventSeries(EVENT_BEFOULED_BARRIER, { 80600ms, 47s }); + events.ScheduleEvent(EVENT_INTERMISSION_TWO, 169s); + + if (!IsMythic()) + { + events.ScheduleEventSeries(EVENT_DOMINATION_WORD_PAIN, { 11500ms, 13s, 13s, 17700ms, 8100ms, 13s, 13s, 14400ms, 11200ms, 12200ms }); + events.ScheduleEventSeries(EVENT_HOPEBREAKER, { 13600ms, 22s, 33300ms, 29s, 29s }); + events.ScheduleEventSeries(EVENT_WICKED_STAR, { 18500ms, 39s, 26s, 30500ms, 19s }); + } + else + { + events.ScheduleEventSeries(EVENT_DOMINATION_WORD_PAIN, { 10700ms, 13s, 13s, 17700ms, 8100ms, 13s, 13s, 14400ms, 11200ms, 12200ms }); + events.ScheduleEventSeries(EVENT_HOPEBREAKER, { 13600ms, 25s, 33s, 29s, 29100ms }); + events.ScheduleEventSeries(EVENT_WICKED_STAR, { 18500ms, 39s, 26s, 30900ms, 19100ms }); + } + + if (IsLFR()) + DoCastSelf(SPELL_ANDUIN_WILLPOWER_PERIODIC, true); + else + events.ScheduleEventSeries(EVENT_KINGSMOURNE_HUNGERS, { 48600ms, 1min }); + break; + } + + case PHASE_THREE: + { + _intermissionsDone = 2; + me->ModifyPower(me->GetPowerType(), 0); + Conversation::CreateConversation(CONVERSATION_ANDUIN_PHASE_THREE, me, me->GetPosition(), ObjectGuid::Empty, nullptr, true); + events.SetPhase(PHASE_THREE); + events.ScheduleEvent(EVENT_BEACON_OF_HOPE, 1ms); + events.ScheduleEvent(EVENT_EMPOWERED_HOPEBREAKER, 11500ms); + events.ScheduleEvent(EVENT_HOPELESSNESS, 21700ms); + + if (!IsMythic()) + events.ScheduleEvent(EVENT_WICKED_STAR, 41s); + else + events.ScheduleEvent(EVENT_EMPOWERED_WICKED_STAR, 41s); + break; + } + } + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override + { + if (_intermissionsDone < 2 && me->HealthBelowPctDamaged(10, damage)) + { + me->RemoveAurasDueToSpell(SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER); + me->RemoveAurasDueToSpell(SPELL_MARCH_OF_THE_DAMNED_PERIODIC); + scheduler.Schedule(6s, [this](TaskContext /*task*/) + { + me->SetReactState(REACT_AGGRESSIVE); + }); + + scheduler.CancelAll(); + me->SetReactState(REACT_AGGRESSIVE); + PhaseEvents(PHASE_THREE); + + std::list<Creature*> fiendishSouls; + GetCreatureListWithEntryInGrid(fiendishSouls, me, NPC_FIENDISH_SOUL, 50.0f); + + for (Creature* fiends : fiendishSouls) + { + fiends->CastSpell(fiends, SPELL_SOUL_DESPAWN); + fiends->DespawnOrUnsummon(500ms); + } + + std::list<Creature*> marches; + GetCreatureListWithEntryInGrid(marches, me, NPC_MARCH_OF_THE_DAMNED, 50.0f); + + for (Creature* march : marches) + march->DespawnOrUnsummon(); + + if (Creature* remnant = instance->GetCreature(DATA_REMNANT_OF_A_FALLEN_KING)) + remnant->GetAI()->DoAction(ACTION_DESPAWN_REMNANT); + } + } + + void EndEncounter() + { + ClearDebuffs(); + events.Reset(); + scheduler.CancelAll(); + _encounterEnded = true; + instance->SetBossState(DATA_ANDUIN_WRYNN, DONE); + _EnterEvadeMode(); + DoCastSelf(SPELL_ANDUIN_KNEEL_POSE); + + if (Creature* beacon = instance->GetCreature(DATA_BEACON_OF_HOPE)) + beacon->DespawnOrUnsummon(); + + me->SetReactState(REACT_PASSIVE); + me->SetFaction(FACTION_FRIENDLY); + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_ENCOUNTER_COMPLETED, 1); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + DoAction(ACTION_MOVE_NPCS_ON_PLATFORM); + + if (IsMythic()) + { + if (AchievementEntry const* mythicAnduin = sAchievementStore.LookupEntry(ACHIEVEMENT_ANDUIN_MYTHIC)) + { + me->GetMap()->DoOnPlayers([mythicAnduin](Player* player) + { + player->CompletedAchievement(mythicAnduin); + }); + } + } + + if (GameObject* chest = me->SummonGameObject(GAMEOBJECT_ANDUIN_CHEST_LOOT, ChestLootSpawnPosition, QuaternionData::fromEulerAnglesZYX(-225.0f, 0.0f, 0.0f), 7_days)) + { + chest->SetGoState(GO_STATE_ACTIVE); + chest->SetSpellVisualId(SPELL_VISUAL_CHEST_LOOT, ObjectGuid::Empty); + } + + scheduler.Schedule(5s, [this](TaskContext /*task*/) + { + instance->DoCastSpellOnPlayers(SPELL_FINAL_MOVIE); + }); + } + +private: + bool _slayTextOnCooldown; + uint8 _intermissionsDone; + bool _encounterEnded; + TaskScheduler scheduler; +}; + +// 184830 - Beacon of Hope +struct npc_anduin_wrynn_beacon_of_hope : public ScriptedAI +{ + npc_anduin_wrynn_beacon_of_hope(Creature* creature) : ScriptedAI(creature) { } + + void JustUnregisteredAreaTrigger(AreaTrigger* areaTrigger) override + { + switch (areaTrigger->GetSpellId()) + { + case SPELL_FRAGMENT_OF_HOPE_AREATRIGGER: + { + if (areaTrigger->GetInsideUnits().size()) + break; + + InstanceScript* instance = me->GetInstanceScript(); + if (!instance) + break; + + if (Creature* beacon = instance->GetCreature(DATA_BEACON_OF_HOPE)) + beacon->CastSpell(beacon, SPELL_FRAGMENT_OF_HOPE_DAMAGE, true); + break; + } + default: + break; + } + } +}; + +// 183452 - Empty Vessel +struct npc_anduin_wrynn_empty_vessel : public ScriptedAI +{ + npc_anduin_wrynn_empty_vessel(Creature* creature) : ScriptedAI(creature) { } + + void JustAppeared() override + { + me->SetReactState(REACT_PASSIVE); + } + + void IsSummonedBy(WorldObject* summoner) override + { + if (!summoner->IsPlayer()) + return; + + summoner->CastSpell(me, SPELL_MIRROR_IMAGE); + DoCast(me, SPELL_FEIGN_DEATH); + } +}; + +// 185607 - Lost Soul +struct npc_anduin_wrynn_lost_soul : public ScriptedAI +{ + npc_anduin_wrynn_lost_soul(Creature* creature) : ScriptedAI(creature) { } + + void JustAppeared() override + { + me->SetReactState(REACT_PASSIVE); + _events.ScheduleEvent(EVENT_BANISH_SOUL, 1ms); + } + + void IsSummonedBy(WorldObject* summoner) override + { + if (!summoner->IsPlayer()) + return; + + summoner->CastSpell(me, SPELL_LOST_SOUL_MIRROR_IMAGE); + } + + void JustDied(Unit* /*killer*/) override + { + TempSummon* summon = me->ToTempSummon(); + if (!summon) + return; + + if (Unit* summoner = summon->GetSummonerUnit()) + { + summoner->RemoveAurasDueToSpell(SPELL_SEVERED_SOUL); + summoner->NearTeleportTo(me->GetPosition()); + } + me->DespawnOrUnsummon(2s); + } + + void Reset() override + { + _events.Reset(); + } + + void UpdateAI(uint32 diff) override + { + UpdateVictim(); + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_BANISH_SOUL: + { + DoCastSelf(SPELL_BANISH_SOUL); + _events.Repeat(1ms); + break; + } + default: + break; + } + } + } + +private: + EventMap _events; +}; + +// 184519 - Anduin's Soul +struct npc_anduin_wrynn_anduin_soul : public ScriptedAI +{ + npc_anduin_wrynn_anduin_soul(Creature* creature) : ScriptedAI(creature), + _hopeRestored(0), _doubtGone(0), _despairGone(0), _summons(me) { } + + void CheckForReleaseFromKingsmourne() + { + if (_hopeRestored == 4 && _doubtGone == 4 && _despairGone == 1) + { + DoCastAOE(SPELL_LOST_SOUL_CLEAR, true); + _hopeRestored = 0; + _doubtGone = 0; + _despairGone = 0; + } + } + + void JustAppeared() override + { + me->SetDisableGravity(true, true); + me->SetHoverHeight(1.0); + me->SetPlayHoverAnim(true); + DoCastSelf(SPELL_LOST_SOUL_PERIODIC); + } + + void Reset() override + { + _summons.DespawnAll(); + DoCastSelf(SPELL_ANDUIN_SOUL_GHOST, true); + } + + void JustSummoned(Creature* who) override + { + _summons.Summon(who); + } + + void JustDied(Unit* /*killer*/) override + { + _summons.DespawnAll(); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + _summons.DespawnAll(); + DoCastSelf(SPELL_ANDUIN_SOUL_GHOST, true); + } + + void DoAction(int32 action) override + { + InstanceScript* instance = me->GetInstanceScript(); + if (!instance) + return; + + Creature* anduin = instance->GetCreature(DATA_ANDUIN_SOUL); + if (!anduin) + return; + + switch (action) + { + case ACTION_SUMMON_KINGSMOURNE_SOULS: + { + me->SummonCreature(NPC_ANDUIN_DESPAIR, AnduinsDespairSpawnPosition, TEMPSUMMON_TIMED_DESPAWN, 40s); + for (uint8 i = 0; i < 4; i++) + { + me->SummonCreature(NPC_ANDUIN_DOUBT, AnduinsDoubtSpawnPositions[i], TEMPSUMMON_TIMED_DESPAWN, 40s); + me->SummonCreature(NPC_ANDUIN_HOPE, AnduinsHopeSpawnPosition[i], TEMPSUMMON_TIMED_DESPAWN, 40s); + } + break; + } + case ACTION_DESPAIR_GONE: + _despairGone++; + CheckForReleaseFromKingsmourne(); + break; + + case ACTION_DOUBT_GONE: + _doubtGone++; + CheckForReleaseFromKingsmourne(); + break; + + case ACTION_HOPE_RESTORED: + _hopeRestored++; + CheckForReleaseFromKingsmourne(); + break; + + default: + break; + } + } + +public: + uint8 _hopeRestored; + uint8 _doubtGone; + uint8 _despairGone; + SummonList _summons; +}; + +// 184520 - Anduin's Despair +struct npc_anduin_wrynn_anduin_despair : public ScriptedAI +{ + npc_anduin_wrynn_anduin_despair(Creature* creature) : ScriptedAI(creature), + _instance(creature->GetInstanceScript()) { } + + void JustAppeared() override + { + DoCastSelf(SPELL_RAIN_OF_DESPAIR); + DoCastSelf(SPELL_ANDUIN_SOUL_DESPAIR); + } + + void JustDied(Unit* /*killer*/) override + { + DoCastSelf(SPELL_POWER_ENERGIZE_WILLPOWER_LARGE); + + if (Creature* soul = me->GetInstanceScript()->GetCreature(DATA_ANDUIN_SOUL)) + soul->GetAI()->DoAction(ACTION_DESPAIR_GONE); + } + +private: + InstanceScript* _instance; +}; + +// 184494 - Anduin's Doubt +struct npc_anduin_wrynn_anduin_doubt : public ScriptedAI +{ + npc_anduin_wrynn_anduin_doubt(Creature* creature) : ScriptedAI(creature) { } + + void JustAppeared() override + { + me->SetWalk(true); + DoCastSelf(SPELL_GHOST_VISUAL_COSMETIC, true); + DoZoneInCombat(); + me->GetMotionMaster()->MovePoint(POINT_ANDUIN_SOUL, AnduinsSoulSpawnPosition); + } + + void JustDied(Unit* /*killer*/) override + { + DoCastSelf(SPELL_POWER_ENERGIZE_WILLPOWER_SMALL); + DoCastSelf(SPELL_SOUL_DESPAWN); + + if (Creature* soul = me->GetInstanceScript()->GetCreature(DATA_ANDUIN_SOUL)) + soul->GetAI()->DoAction(ACTION_DOUBT_GONE); + } + + void UpdateAI(uint32 /*diff*/) override + { + UpdateVictim(); + } +}; + +// 184493 - Anduin's Hope +struct npc_anduin_wrynn_anduin_hope : public ScriptedAI +{ + npc_anduin_wrynn_anduin_hope(Creature* creature) : ScriptedAI(creature), + _instance(creature->GetInstanceScript()) { } + + void Reset() override + { + me->SetRegenerateHealth(false); + me->SetHealth(1); + me->SetReactState(REACT_PASSIVE); + } + + void JustAppeared() override + { + _instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 255); + me->SetWalk(true); + DoCastSelf(SPELL_ANDUIN_SLOW); + if (IsHeroic() || IsMythic()) + DoCastSelf(SPELL_GLOOM); + + _scheduler.Schedule(2s, [this](TaskContext /*task*/) + { + Position exitPlatform = me->GetFirstCollisionPosition(100.0f, 0); + me->GetMotionMaster()->MovePoint(POINT_ESCAPE_PLATFORM, exitPlatform, false, me->GetOrientation()); + }); + me->SetHealth(1); + + _scheduler.Schedule(40s, [this](TaskContext /*task*/) + { + me->DespawnOrUnsummon(); + }); + } + + void UpdateAI(uint32 diff) override + { + UpdateVictim(); + + _scheduler.Update(diff); + } + + void HealReceived(Unit* /*healer*/, uint32& heal) override + { + if (me->HealthAbovePctHealed(100, heal)) + { + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + DoCastSelf(SPELL_POWER_ENERGIZE_WILLPOWER_SMALL); + DoCastSelf(SPELL_SOUL_DESPAWN); + + if (Creature* soul = me->GetInstanceScript()->GetCreature(DATA_ANDUIN_SOUL)) + soul->GetAI()->DoAction(ACTION_HOPE_RESTORED); + } + } + + void MovementInform(uint32 type, uint32 pointId) override + { + if (type != POINT_MOTION_TYPE) + return; + + switch (pointId) + { + case POINT_ESCAPE_PLATFORM: + { + DoCastSelf(SPELL_SOUL_DESPAWN); + break; + } + default: + break; + } + } + +private: + InstanceScript* _instance; + TaskScheduler _scheduler; +}; + +// 183669 - Fiendish Soul +struct npc_anduin_wrynn_fiendish_soul : public ScriptedAI +{ + npc_anduin_wrynn_fiendish_soul(Creature* creature) : ScriptedAI(creature) { } + + void JustEngagedWith(Unit* /*who*/) override + { + _events.ScheduleEvent(EVENT_GHOUL_LEAP, 1s); + _events.ScheduleEvent(EVENT_NECROTIC_CLAWS, 10s); + } + + void JustDied(Unit* /*killer*/) override + { + if (IsHeroic() || IsMythic()) + DoCastSelf(SPELL_SOUL_EXPLOSION_TARGET); + + DoCastSelf(SPELL_SOUL_DESPAWN); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + me->DespawnOrUnsummon(); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_GHOUL_LEAP: + { + std::list<Player*> targetList; + GetPlayerListInGrid(targetList, me, 50.0f); + me->CastSpell(Trinity::Containers::SelectRandomContainerElement(targetList), SPELL_NECROTIC_CLAWS_LEAP); + _events.Repeat(10s); + break; + } + case EVENT_NECROTIC_CLAWS: + { + DoCastVictim(SPELL_NECROTIC_CLAWS_DEBUFF); + _events.Repeat(5s, 10s); + break; + } + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + +private: + EventMap _events; +}; + +// 183671 - Monstrous Soul +struct npc_anduin_wrynn_monstrous_soul : public ScriptedAI +{ + npc_anduin_wrynn_monstrous_soul(Creature* creature) : ScriptedAI(creature) { } + + void JustEngagedWith(Unit* /*who*/) override + { + me->GetInstanceScript()->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 255); + DoCastSelf(SPELL_UNRAVELING_FRENZY_PERIODIC, true); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override + { + if (me->HealthBelowPctDamaged(35, damage)) + _events.ScheduleEvent(EVENT_NECROTIC_DETONATION, 1ms); + } + + void Reset() override + { + _events.Reset(); + } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_NECROTIC_DETONATION: + { + Talk(SAY_NECROTIC_DETONATION); + DoCastSelf(SPELL_NECROTIC_DETONATION); + break; + } + default: + break; + } + } + + void JustDied(Unit* /*killer*/) override + { + me->GetInstanceScript()->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + me->GetInstanceScript()->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + me->DespawnOrUnsummon(); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_NECROTIC_DETONATION: + { + Talk(SAY_NECROTIC_DETONATION); + DoCastSelf(SPELL_NECROTIC_DETONATION); + break; + } + default: + break; + } + } + DoMeleeAttackIfReady(); + } + +private: + EventMap _events; +}; + +// 183463 - Remnant of a Fallen King +struct boss_remnant_of_a_fallen_king : public BossAI +{ + boss_remnant_of_a_fallen_king(Creature* creature) : BossAI(creature, DATA_REMNANT_OF_A_FALLEN_KING) { } + + void JustAppeared() override + { + scheduler.ClearValidator(); + DoCastSelf(SPELL_SHADE_VISUAL); + me->ModifyPower(me->GetPowerType(), 0); + me->SetPower(me->GetPowerType(), 0); + for (MapReference const& players : me->GetMap()->GetPlayers()) + { + if (Player* player = players.GetSource()) + me->CastSpell(player, SPELL_WEATHER_COSMETIC, true); + } + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_HOPEBREAKER); + me->SetReactState(REACT_PASSIVE); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + summons.DespawnAll(); + me->DespawnOrUnsummon(); + + if (Creature* anduin = instance->GetCreature(DATA_ANDUIN_WRYNN)) + anduin->AI()->EnterEvadeMode(EvadeReason::NoHostiles); + + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_WEATHER_COSMETIC); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_REMORSELESS_WINTER_PERIODIC); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_NECROTIC_CLAWS_DEBUFF); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_FORCE_OF_WILL); + } + + void ContinueAttacking() + { + if (Creature* sylvanas = instance->GetCreature(DATA_SYLVANAS_WINDRUNNER_ANDUIN)) + sylvanas->GetAI()->AttackStartCaster(me, 25.0f); + + if (Creature* uther = instance->GetCreature(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN)) + uther->GetAI()->AttackStart(me); + + if (Creature* jaina = instance->GetCreature(DATA_JAINA_PROUDMOORE_ANDUIN)) + jaina->GetAI()->AttackStartCaster(me, 25.0f); + } + + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + } + + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + + switch (summon->GetEntry()) + { + case NPC_FIENDISH_SOUL: + case NPC_MONSTROUS_SOUL: + summon->SetReactState(REACT_PASSIVE); + summon->m_Events.AddEvent(new ActivateGhouls(me, summon), summon->m_Events.CalculateTime(5s)); + break; + default: + break; + } + } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_ACTIVATE_REMNANT: + { + DoCastAOE(SPELL_DARK_PRESENCE); + DoZoneInCombat(); + + _scheduler.Schedule(1500ms, [this](TaskContext /*task*/) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 2); + me->SetUninteractible(false); + }); + + _scheduler.Schedule(2s, [this](TaskContext /*task*/) + { + DoCastSelf(SPELL_REMNANT_TIMER); + events.ScheduleEvent(EVENT_ARMY_OF_THE_DEAD, 1ms); + events.ScheduleEvent(EVENT_SOUL_REAPER, 8000ms); + events.ScheduleEvent(EVENT_RETURN_TO_KINGSMOURNE, 67500ms); + me->SetReactState(REACT_AGGRESSIVE); + ContinueAttacking(); + }); + break; + } + case ACTION_DESPAWN_REMNANT: + { + DoCastSelf(SPELL_SOUL_DESPAWN); + _scheduler.Schedule(500ms, [this](TaskContext /*task*/) + { + EnterEvadeMode(EvadeReason::Other); + }); + break; + } + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + _scheduler.Update(diff); + + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RETURN_TO_KINGSMOURNE: + { + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + me->InterruptNonMeleeSpells(true); + DoCastSelf(SPELL_RETURN_TO_KINGSMOURNE); + break; + } + case EVENT_ARMY_OF_THE_DEAD: + { + DoCastSelf(SPELL_ARMY_OF_THE_DEAD); + me->SetReactState(REACT_AGGRESSIVE); + if (!IsLFR()) + events.Repeat(36900ms); + break; + } + case EVENT_SOUL_REAPER: + { + DoCastVictim(SPELL_SOUL_REAPER); + events.Repeat(12s); + break; + } + } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + } + + DoMeleeAttackIfReady(); + } + +private: + EventMap events; + TaskScheduler _scheduler; +}; + +// 183033 - Grim Reflection +struct npc_anduin_wrynn_grim_reflection : public ScriptedAI +{ + npc_anduin_wrynn_grim_reflection(Creature* creature) : ScriptedAI(creature) { } + + void Reset() override + { + _events.Reset(); + } + + void JustAppeared() override + { + SetCombatMovement(false); + DoCastSelf(SPELL_CALAMITY_STATE_VISUAL); + DoZoneInCombat(); + me->SetReactState(REACT_AGGRESSIVE); + _events.ScheduleEvent(EVENT_PSYCHIC_TERROR, 1ms); + + if (IsLFR() || IsNormal()) + _events.ScheduleEvent(EVENT_GRIM_REFLECTION_IMMUNITY, 1ms); + } + + void JustDied(Unit* /*killer*/) override + { + if (IsMythic()) + DoCastAOE(SPELL_GRIM_FATE); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_PSYCHIC_TERROR: + { + DoCastSelf(SPELL_PSYCHIC_TERROR); + _events.Repeat(2s); + break; + } + case EVENT_GRIM_REFLECTION_IMMUNITY: + { + DoCastSelf(SPELL_WICKED_STAR_PROTECTION); + _events.Repeat(1s); + break; + } + default: + break; + } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + } + } + +private: + EventMap _events; +}; + +// 183666 - Sylvanas Windrunner +struct npc_anduin_wrynn_sylvanas : public ScriptedAI +{ + npc_anduin_wrynn_sylvanas(Creature* creature) : ScriptedAI(creature, DATA_SYLVANAS_WINDRUNNER_ANDUIN) { } + + void JustAppeared() override + { + me->SetReactState(REACT_AGGRESSIVE); + } + + void Reset() override + { + _events.Reset(); + } + + void JustEngagedWith(Unit* /*who*/) override + { + _events.ScheduleEvent(EVENT_TUMBLE, 10s); + } + + bool CanAIAttack(Unit const* target) const override + { + return !target->HasAura(SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TUMBLE: + { + DoCastSelf(SPELL_TUMBLE); + _events.Repeat(10s); + break; + } + default: + break; + } + } + + DoSpellAttackIfReady(SPELL_SHOOT_BOW); + } + +private: + EventMap _events; +}; + +// 183664 - Jaina Proudmoore +struct npc_anduin_wrynn_jaina : public ScriptedAI +{ + npc_anduin_wrynn_jaina(Creature* creature) : ScriptedAI(creature, DATA_JAINA_PROUDMOORE_ANDUIN) { } + + void JustAppeared() override + { + me->SetReactState(REACT_AGGRESSIVE); + } + + void Reset() override + { + _events.Reset(); + } + + void JustEngagedWith(Unit* /*who*/) override + { + _events.ScheduleEvent(EVENT_BLINK, 10s); + } + + bool CanAIAttack(Unit const* target) const override + { + return !target->HasAura(SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER); + } + + void WaypointPathEnded(uint32 /*nodeId*/, uint32 pathId) override + { + if (pathId != PATH_INTRODUCTION_JAINA) + return; + + if (Creature* anduin = me->GetInstanceScript()->GetCreature(DATA_ANDUIN_WRYNN)) + anduin->GetAI()->DoAction(ACTION_START_INTRODUCTION); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CANCEL_JAINA_EVENTS: + { + _events.CancelEvent(EVENT_BLINK); + break; + } + case EVENT_BLINK: + { + DoCastSelf(SPELL_BLINK); + _events.Repeat(60s); + break; + } + default: + break; + } + } + + DoSpellAttackIfReady(SPELL_FROSTBOLT); + } + +private: + EventMap _events; +}; + +// 183665 - Uther the Lightbringer +struct npc_anduin_wrynn_uther : public ScriptedAI +{ + npc_anduin_wrynn_uther(Creature* creature) : ScriptedAI(creature, DATA_UTHER_THE_LIGHTBRINGER_ANDUIN) { } + + void JustAppeared() override + { + me->SetReactState(REACT_AGGRESSIVE); + } + + void Reset() override + { + _events.Reset(); + } + + void JustEngagedWith(Unit* who) override + { + DoCast(who, SPELL_UTHER_CHARGE); + _events.ScheduleEvent(EVENT_BLADE_OF_JUSTICE, 3s); + } + + bool CanAIAttack(Unit const* target) const override + { + return !target->HasAura(SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CANCEL_UTHER_EVENTS: + { + _events.CancelEvent(EVENT_BLADE_OF_JUSTICE); + break; + } + case EVENT_BLADE_OF_JUSTICE: + { + DoCastVictim(SPELL_BLADE_OF_JUSTICE); + _events.Repeat(10s); + break; + } + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + +private: + EventMap _events; +}; + +// 367524 - Spawn Pre-Introduction +class spell_anduin_wrynn_pre_introduction : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_pre_introduction); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + switch (caster->GetEntry()) + { + case NPC_LADY_JAINA_PROUDMOORE_ANDUIN: + caster->NearTeleportTo(PreIntroductionAssistersPositions[0]); + break; + case NPC_UTHER_THE_LIGHTBRINGER_ANDUIN: + caster->NearTeleportTo(PreIntroductionAssistersPositions[1]); + break; + case NPC_SYLVANAS_WINDRUNNER_ANDUIN: + caster->NearTeleportTo(PreIntroductionAssistersPositions[2]); + break; + default: + break; + } + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + uint32 pathId = 0; + switch (caster->GetEntry()) + { + case NPC_LADY_JAINA_PROUDMOORE_ANDUIN: + pathId = PATH_INTRODUCTION_JAINA; + break; + case NPC_UTHER_THE_LIGHTBRINGER_ANDUIN: + pathId = PATH_INTRODUCTION_UTHER; + break; + case NPC_SYLVANAS_WINDRUNNER_ANDUIN: + pathId = PATH_INTRODUCTION_SYLVANAS; + break; + default: + break; + } + caster->GetMotionMaster()->MovePath(pathId, false); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_anduin_wrynn_pre_introduction::OnApply, EFFECT_1, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_anduin_wrynn_pre_introduction::OnRemove, EFFECT_2, SPELL_AURA_MOD_ROOT, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 369317 - Anduin Progression Aura (Can't be reduced < 1 hp) +class spell_anduin_wrynn_progression_aura : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_progression_aura); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_ANDUIN_PROGRESSION_AURA, SPELL_ANDUIN_KNEEL_POSE }); + } + +public: + bool Load() override + { + return true; + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + amount = -1; + canBeRecalculated = true; + } + + void Trigger(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount) + { + if (!GetTarget()->GetAura(SPELL_ANDUIN_PROGRESSION_AURA)) + return; + + if (dmgInfo.GetDamage() <= GetTarget()->GetHealth()) + return; + + if (dmgInfo.GetDamage() >= GetTarget()->GetHealth()) + { + absorbAmount = dmgInfo.GetDamage(); + if (_triggered) + return; + + GetTarget()->SetHealth(1); + GetTarget()->CastSpell(GetTarget(), SPELL_ANDUIN_KNEEL_POSE); + GetTarget()->GetAI()->DoAction(ACTION_END_ENCOUNTER); + _triggered = true; + } + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_anduin_wrynn_progression_aura::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_anduin_wrynn_progression_aura::Trigger, EFFECT_0); + } + +private: + bool _triggered = false; +}; + +// 366848 - Anduin Willpower Periodic (Only LFR) +class spell_anduin_wrynn_energize_willpower_lfr : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_energize_willpower_lfr); + + static constexpr std::array<int32, 22> AnduinRegenCycle = + { 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1 }; // 0.681 willpower per second on Retail + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + Unit* target = GetTarget(); + _powerGained = AnduinRegenCycle[_powerRegenCycle++]; + + if (_powerRegenCycle >= 22) + _powerRegenCycle = 0; + + target->ModifyPower(target->GetPowerType(), _powerGained); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_anduin_wrynn_energize_willpower_lfr::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + +private: + uint8 _powerRegenCycle = 0; + uint32 _powerGained = 0; +}; + +// 364247 - Dark Zeal +class spell_anduin_wrynn_dark_zeal : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_dark_zeal); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DARK_ZEAL_BUFF }); + } + + void OnProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo) + { + Unit* actionTarget = eventInfo.GetActionTarget(); + if (!actionTarget) + return; + + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_DARK_ZEAL_BUFF, true); + + if (actionTarget->GetGUID() == _currentTank) + return; + + target->RemoveAura(SPELL_DARK_ZEAL_BUFF); + _currentTank = actionTarget->GetGUID(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_anduin_wrynn_dark_zeal::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + } + +private: + ObjectGuid _currentTank; +}; + +// 361815 - Hopebreaker +// 365806 - Empowered Hopebreaker +class spell_anduin_wrynn_hopebreaker : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_hopebreaker); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HOPEBREAKER_DAMAGE, SPELL_HOPEBREAKER_DEBUFF }); + } + + void HandleHit(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_HOPEBREAKER_DAMAGE, true); + GetCaster()->CastSpell(GetHitUnit(), SPELL_HOPEBREAKER_DEBUFF, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_anduin_wrynn_hopebreaker::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 361817 - Hopebreaker Periodic +class spell_anduin_wrynn_hopebreaker_periodic : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_hopebreaker_periodic); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HOPEBREAKER_DEBUFF_DAMAGE }); + } + + void OnPeriodic(AuraEffect const* /*aurEff*/) + { + if (!GetCaster()) + return; + + GetCaster()->CastSpell(GetTarget(), SPELL_HOPEBREAKER_DEBUFF_DAMAGE, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_anduin_wrynn_hopebreaker_periodic::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } +}; + +// 361818 - Hopebreaker Damage +class spell_anduin_wrynn_hopebreaker_damage : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_hopebreaker_damage); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HOPEBREAKER_DEBUFF }); + } + + void HandleDamage(SpellEffIndex /*effIndex*/) + { + Unit* target = GetHitUnit(); + + Aura* hopebreaker = target->GetAura(SPELL_HOPEBREAKER_DEBUFF); + if (!hopebreaker) + return; + + uint8 hopebreakerStacks = hopebreaker->GetStackAmount(); + SetHitDamage(GetHitDamage() * hopebreakerStacks); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_anduin_wrynn_hopebreaker_damage::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + +// 363133 - March of the Damned, CreatePropertiesId - 24093 +struct at_anduin_wrynn_march_of_the_damned : AreaTriggerAI +{ + at_anduin_wrynn_march_of_the_damned(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { } + + void OnUnitEnter(Unit* unit) override + { + if (!unit->IsPlayer()) + return; + + Unit* caster = at->GetCaster(); + if (!caster) + return; + + caster->CastSpell(unit, SPELL_MARCH_OF_THE_DAMNED_DAMAGE, true); + } +}; + +float constexpr BEFOULED_BARRIER_MAX_RADIUS = 12.0f; +float constexpr BEFOULED_BARRIER_MIN_RADIUS = 4.0f; + +// 365173 - Befouled Barrier - CreatePropertiesId: 24332 +struct at_anduin_wrynn_befouled_barrier : AreaTriggerAI +{ + at_anduin_wrynn_befouled_barrier(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { } + + void OnInitialize() override + { + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BEFOULED_BARRIER_DEBUFF, at->GetMap()->GetDifficultyID())) + _absorbRequired = spellInfo->GetEffect(EFFECT_0).CalcValue(at->GetCaster()); + + at->SetTimeToTargetScale(30000); + + // The aura is handling it automatically + at->SetDuration(-1); + } + + void OnCreate(Spell const* /*creatingSpell*/) override + { + _scheduler.Schedule(500ms, [this](TaskContext task) + { + float startRadius = 1.0f; + + UpdateSize(startRadius, BEFOULED_BARRIER_MAX_RADIUS); + at->SetTimeToTargetScale(500); + + task.Schedule(Milliseconds(at->GetTimeToTargetScale()), [this](TaskContext task) + { + UpdateSizeBasedOnAbsorb(); + task.Repeat(); + }); + }); + } + + void UpdateSize(float radius, float targetRadius) const + { + std::array<DBCPosition2D, 2> points = + { { + { 0.0f, radius }, + { 1.0f, targetRadius } + } }; + + at->SetOverrideScaleCurve(points); + } + + void UpdateSizeBasedOnAbsorb() + { + Unit* target = at->GetTarget(); + if (!target) + return; + + float radiusMod = 1.0f - (_absorbDone / (float)_absorbRequired); + float targetRadius = BEFOULED_BARRIER_MAX_RADIUS * radiusMod; + float currentRadius = at->GetMaxSearchRadius(); + + if (G3D::fuzzyEq(currentRadius, targetRadius)) + return; + + // Players need to be able to actually enter the AT to heal it no sniff has a value lower than 4.0f + if (targetRadius <= BEFOULED_BARRIER_MIN_RADIUS) + return; + + UpdateSize(currentRadius, targetRadius); + } + + void OnUpdate(uint32 diff) override + { + _scheduler.Update(diff); + } + + void OnUnitEnter(Unit* unit) override + { + Unit* caster = at->GetCaster(); + if (!caster) + return; + + caster->CastSpell(unit, SPELL_BEFOULED_BARRIER_DEBUFF, true); + } + + void OnUnitExit(Unit* unit) override + { + unit->RemoveAura(SPELL_BEFOULED_BARRIER_DEBUFF); + } + + void Absorb(uint32 absorbAmount) + { + _absorbDone += absorbAmount; + + if (_absorbDone < _absorbRequired) + return; + + Unit* target = at->GetTarget(); + if (!target) + return; + + // remove barrier, we're done healing + if (Creature* creature = target->ToCreature()) + { + creature->CastSpell(creature, SPELL_BEFOULED_BARRIER_CLEAR, true); + creature->DespawnOrUnsummon(1s); + } + } + + uint32 GetRemainingAbsorb() + { + return _absorbRequired - _absorbDone; + } + +private: + uint32 _absorbDone = 0; + uint32 _absorbRequired = 0; + TaskScheduler _scheduler; +}; + +float constexpr BEACON_OF_HOPE_MAX_RADIUS = 12.0f; +float constexpr BEACON_OF_HOPE_MIN_RADIUS = 4.0f; + +// 362702 - Beacon of Hope - CreatePropertiesId: 25025 / 24247 +struct at_anduin_wrynn_beacon_of_hope : AreaTriggerAI +{ + at_anduin_wrynn_beacon_of_hope(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger), + _instance(at->GetInstanceScript()), _entries(0), _chargesRemaining(40) { } + + void OnInitialize() override + { + _entries = 0; + _chargesRemaining = 40; + } + + void OnCreate(Spell const* /*creatingSpell*/) override + { + _scheduler.Schedule(500ms, [this](TaskContext task) + { + float startRadius = 1.0f; + float targetRadius = BEACON_OF_HOPE_MAX_RADIUS; + + UpdateSize(startRadius, targetRadius); + at->SetTimeToTargetScale(500); + + task.Schedule(Milliseconds(at->GetTimeToTargetScale()), [this](TaskContext task) + { + UpdateSizeBasedOnCharges(); + task.Repeat(); + }); + }); + } + + void UpdateSize(float radius, float targetRadius) const + { + std::array<DBCPosition2D, 2> points = + { { + { 0.0f, radius }, + { 1.0f, targetRadius } + } }; + + at->SetOverrideScaleCurve(at->GetTimeSinceCreated()); + at->SetOverrideScaleCurve(points); + } + + void UpdateSizeBasedOnCharges() + { + float radiusMod = 0.205129f * _entries; + float targetRadius = BEACON_OF_HOPE_MAX_RADIUS - radiusMod; + + if (targetRadius <= BEACON_OF_HOPE_MIN_RADIUS || _chargesRemaining <= 0) + at->Remove(); + + float currentRadius = at->GetMaxSearchRadius(); + if (G3D::fuzzyEq(currentRadius, targetRadius)) + return; + + UpdateSize(currentRadius, targetRadius); + } + + void OnUpdate(uint32 diff) override + { + _scheduler.Update(diff); + } + + void OnUnitEnter(Unit* unit) override + { + if (!unit->IsPlayer()) + return; + + if (!at->GetCaster()) + return; + + Creature* beacon = _instance->GetCreature(DATA_BEACON_OF_HOPE); + if (!beacon) + return; + + beacon->CastSpell(beacon, SPELL_PURGING_LIGHT, true); + unit->RemoveAurasDueToSpell(SPELL_HOPELESSNESS_HOPELESSNESS_AREATRIGGER); + + if (at->GetMap()->IsMythic()) + { + _entries++; + _chargesRemaining--; + beacon->CastSpell(unit, SPELL_FRAGMENT_OF_HOPE_AREATRIGGER, true); + } + } + +private: + InstanceScript* _instance; + uint8 _entries; + uint8 _chargesRemaining; + TaskScheduler _scheduler; +}; + +// 365816 - Fragment of Hope +class spell_anduin_wrynn_fragment_of_hope : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_fragment_of_hope); + + void SetDest(SpellDestination& destination) + { + Unit* caster = GetCaster(); + Position dest = caster->GetPosition(); + + if (Creature* beacon = caster->GetInstanceScript()->GetCreature(DATA_BEACON_OF_HOPE)) + beacon->MovePositionToFirstCollision(dest, 30.0f, beacon->GetAbsoluteAngle(GetExplTargetWorldObject()) - beacon->GetOrientation()); + + destination.Relocate(dest); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_anduin_wrynn_fragment_of_hope::SetDest, EFFECT_0, TARGET_DEST_DEST); + } +}; + +// 365293 - Befouled Barrier +class spell_anduin_wrynn_befouled_barrier_absorb : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_befouled_barrier_absorb); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_BEFOULED_BARRIER_SPHERE_AREATRIGGER }); + } + + void OnHealAbsorb(AuraEffect* /*aurEff*/, HealInfo& healInfo, uint32& absorbAmount) + { + absorbAmount = CalculatePct(healInfo.GetHeal(), GetEffectInfo(EFFECT_2).CalcValue()); + + Unit* caster = GetCaster(); + if (!caster) + return; + + AreaTrigger* barrier = caster->GetAreaTrigger(SPELL_BEFOULED_BARRIER_SPHERE_AREATRIGGER); + if (!barrier) + return; + + at_anduin_wrynn_befouled_barrier* barrierScript = dynamic_cast<at_anduin_wrynn_befouled_barrier*>(barrier->AI()); + if (!barrierScript) + return; + + barrierScript->Absorb(absorbAmount); + } + + void Register() override + { + OnEffectAbsorbHeal += AuraEffectAbsorbHealFn(spell_anduin_wrynn_befouled_barrier_absorb::OnHealAbsorb, EFFECT_0); + } +}; + +// 365173 - Befouled Barrier Expire +class spell_anduin_wrynn_befouled_barrier_expire : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_befouled_barrier_expire); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_BEFOULED_BARRIER_SPHERE_AREATRIGGER, SPELL_BEFOULED_BARRIER_EXPLODE }); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) + { + AreaTrigger* barrier = GetTarget()->GetAreaTrigger(SPELL_BEFOULED_BARRIER_SPHERE_AREATRIGGER); + if (!barrier) + return; + + at_anduin_wrynn_befouled_barrier* barrierScript = dynamic_cast<at_anduin_wrynn_befouled_barrier*>(barrier->AI()); + if (!barrierScript) + return; + + target->CastSpell(target, SPELL_BEFOULED_BARRIER_EXPLODE, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_BASE_POINT1, barrierScript->GetRemainingAbsorb())); + } + + if (Creature* creatureTarget = target->ToCreature()) + creatureTarget->DespawnOrUnsummon(); + } + + void Register() override + { + OnEffectRemove += AuraEffectRemoveFn(spell_anduin_wrynn_befouled_barrier_expire::OnRemove, EFFECT_0, SPELL_AURA_AREA_TRIGGER, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 361989 - Blasphemy +class spell_anduin_wrynn_blasphemy : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_blasphemy); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_BLASPHEMY_PRE_HIT, SPELL_BLASPHEMY_OVERCONFIDENCE, SPELL_BLASPHEMY_HOPELESSNESS }); + } + + void OnPrecast() override + { + GetCaster()->CastSpell(GetCaster(), SPELL_BLASPHEMY_PRE_HIT, true); + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + targets.remove_if([](WorldObject* target) -> bool + { + if (!target->IsPlayer()) + return true; + + return false; + }); + + int8 hopelessnessAffected = static_cast<int8>(std::floor(targets.size() / 2)); + int8 maxAffected = hopelessnessAffected * 2; + Trinity::Containers::RandomResize(targets, maxAffected); + + for (WorldObject* target : targets) + { + if (hopelessnessAffected > 0) + { + _spellAssignments[target->GetGUID()] = SPELL_BLASPHEMY_HOPELESSNESS; + hopelessnessAffected--; + } + else + _spellAssignments[target->GetGUID()] = SPELL_BLASPHEMY_OVERCONFIDENCE; + + maxAffected--; + } + } + + void HandleDebuff(SpellEffIndex /*effIndex*/) + { + uint32* spellId = Trinity::Containers::MapGetValuePtr(_spellAssignments, GetHitUnit()->GetGUID()); + if (!spellId) + return; + + GetCaster()->CastSpell(GetHitUnit(), *spellId, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anduin_wrynn_blasphemy::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_anduin_wrynn_blasphemy::HandleDebuff, EFFECT_0, SPELL_EFFECT_DUMMY); + } + +private: + std::unordered_map<ObjectGuid /*player*/, uint32 /*spell*/> _spellAssignments; +}; + +// 361992 - Overconfidence CreatePropertiesId: 24616 +// 361993 - Hopelessness CreatePropertiesId: 24616 +struct at_anduin_wrynn_blasphemy : AreaTriggerAI +{ + at_anduin_wrynn_blasphemy(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { } + + void OnUnitEnter(Unit* unit) override + { + if (!unit->IsPlayer() || unit->HasAura(SPELL_BLASPHEMY_PRE_HIT)) + return; + + if (!unit->IsAlive()) + at->Remove(); + + if (unit->HasAura(at->GetSpellId())) + { + uint32 explodeSpellId = SPELL_BLASPHEMY_EXPLODE; + if (at->GetMap()->IsLFR() || at->GetMap()->IsNormal()) + explodeSpellId = SPELL_BLASPHEMY_EXPLODE_LFR_NORMAL; + + unit->CastSpell(unit, explodeSpellId, true); + unit->RemoveAurasDueToSpell(at->GetSpellId()); + if (Unit* target = at->GetTarget()) + { + target->CastSpell(target, explodeSpellId, true); + target->RemoveAurasDueToSpell(at->GetSpellId()); + } + } + else if (at->GetSpellId() == SPELL_BLASPHEMY_HOPELESSNESS_AREATRIGGER && unit->HasAura(SPELL_BLASPHEMY_OVERCONFIDENCE_AREATRIGGER)) + { + unit->RemoveAurasDueToSpell(SPELL_BLASPHEMY_OVERCONFIDENCE); + unit->RemoveAurasDueToSpell(SPELL_BLASPHEMY_OVERCONFIDENCE_AREATRIGGER); + unit->CastSpell(unit, SPELL_BLASPHEMY_SUCCESS, true); + if (Unit* target = at->GetTarget()) + { + target->RemoveAurasDueToSpell(SPELL_BLASPHEMY_HOPELESSNESS); + target->RemoveAurasDueToSpell(SPELL_BLASPHEMY_HOPELESSNESS_AREATRIGGER); + target->CastSpell(target, SPELL_BLASPHEMY_SUCCESS, true); + } + } + else if (at->GetSpellId() == SPELL_BLASPHEMY_OVERCONFIDENCE_AREATRIGGER && unit->HasAura(SPELL_BLASPHEMY_HOPELESSNESS_AREATRIGGER)) + { + unit->RemoveAurasDueToSpell(SPELL_BLASPHEMY_HOPELESSNESS); + unit->RemoveAurasDueToSpell(SPELL_BLASPHEMY_HOPELESSNESS_AREATRIGGER); + unit->CastSpell(unit, SPELL_BLASPHEMY_SUCCESS, true); + if (Unit* target = at->GetTarget()) + { + target->RemoveAurasDueToSpell(SPELL_BLASPHEMY_OVERCONFIDENCE); + target->RemoveAurasDueToSpell(SPELL_BLASPHEMY_OVERCONFIDENCE_AREATRIGGER); + target->CastSpell(target, SPELL_BLASPHEMY_SUCCESS, true); + } + } + else + { + // On Mythic players walking in with no debuff also trigger explosion + if (!at->GetMap()->IsMythic()) + return; + + if (!unit->HasAura(SPELL_BLASPHEMY_HOPELESSNESS_AREATRIGGER) || !unit->HasAura(SPELL_BLASPHEMY_OVERCONFIDENCE_AREATRIGGER)) + { + if (Unit* target = at->GetTarget()) + target->CastSpell(target, SPELL_BLASPHEMY_EXPLODE, true); + } + } + } +}; + +// 361992 - Overconfidence +// 361993 - Hopelessness +class spell_anduin_wrynn_hopelessness_overconfidence : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_hopelessness_overconfidence); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo( + { + SPELL_BLASPHEMY_EXPLODE, + SPELL_BLASPHEMY_EXPLODE_LFR_NORMAL + }); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) + { + Unit* target = GetTarget(); + uint32 explodeSpellId = SPELL_BLASPHEMY_EXPLODE; + if (target->GetMap()->IsLFR() || target->GetMap()->IsNormal()) + explodeSpellId = SPELL_BLASPHEMY_EXPLODE_LFR_NORMAL; + + target->CastSpell(target, explodeSpellId, true); + } + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_anduin_wrynn_hopelessness_overconfidence::OnRemove, EFFECT_0, SPELL_AURA_AREA_TRIGGER, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 365021 - Wicked Star +class spell_anduin_wrynn_wicked_star_selector : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_wicked_star_selector); + + void FilterTargets(std::list<WorldObject*>& targets) + { + uint32 rangedDpsCount = 0; + for (WorldObject* target : targets) + { + Player* targetPlayer = target->ToPlayer(); + if (!targetPlayer) + continue; + + ChrSpecializationEntry const* spec = targetPlayer->GetPrimarySpecializationEntry(); + if (!spec) + continue; + + if (!targetPlayer->IsAlive()) + continue; + + if ((spec->GetRole() == ChrSpecializationRole::Dps && spec->GetFlags().HasFlag(ChrSpecializationFlag::Caster)) || + (spec->GetRole() == ChrSpecializationRole::Dps && spec->GetFlags().HasFlag(ChrSpecializationFlag::Ranged))) + rangedDpsCount++; + } + + targets.remove_if([rangedDpsCount](WorldObject* target) -> bool + { + Player* player = target->ToPlayer(); + if (!player || player->HasAura(SPELL_WICKED_STAR_TARGETED)) + return true; + + if (player->GetPrimarySpecializationEntry()->GetRole() == ChrSpecializationRole::Tank) + return true; + + if (rangedDpsCount >= 3) + { + if (player->GetPrimarySpecializationEntry()->GetRole() == ChrSpecializationRole::Dps && player->GetPrimarySpecializationEntry()->GetFlags().HasFlag(ChrSpecializationFlag::Melee)) + return true; + + if (player->GetPrimarySpecializationEntry()->GetRole() == ChrSpecializationRole::Healer) + return true; + } + return false; + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anduin_wrynn_wicked_star_selector::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } +}; + +// 365021 - Wicked Star +class spell_anduin_wrynn_wicked_star_selector_AuraScript : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_wicked_star_selector_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_WICKED_STAR_TARGETED, GetAreaTriggerSpellID()}); + } + + virtual uint8 GetAnnounceGroupID() + { + return SAY_ANNOUNCE_WICKED_STAR; + } + + virtual uint32 GetAreaTriggerSpellID() + { + return SPELL_WICKED_STAR_AREATRIGGER; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + Unit* target = GetTarget(); + if (!caster) + return; + + caster->CastSpell(target, SPELL_WICKED_STAR_TARGETED, true); + + if (Creature* creature = caster->ToCreature()) + if (CreatureAI* anduinAI = creature->AI()) + anduinAI->Talk(GetAnnounceGroupID(), target); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + + Unit* caster = GetCaster(); + if (!caster) + return; + + float angle = caster->GetAbsoluteAngle(GetTarget()); + Position spellDest(caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), angle); + + if (InstanceScript* instance = GetTarget()->GetInstanceScript()) + { + if (Creature* anduin = instance->GetCreature(DATA_ANDUIN_WRYNN)) + anduin->CastSpell(spellDest, GetAreaTriggerSpellID(), true); + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_anduin_wrynn_wicked_star_selector_AuraScript::OnApply, EFFECT_0, SPELL_AURA_MOD_SCALE, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_anduin_wrynn_wicked_star_selector_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_SCALE, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 365017 - Wicked Star CreatePropertiesId: 24741 +struct at_anduin_wrynn_wicked_star : AreaTriggerAI +{ + at_anduin_wrynn_wicked_star(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { } + + static constexpr float GetWickedStarSpeed(Difficulty difficulty) + { + // in yards per second + switch (difficulty) + { + case DIFFICULTY_HEROIC_RAID: + case DIFFICULTY_MYTHIC_RAID: + return 18.0f; + default: // LFR + Normal + return 15.0f; + } + } + + void OnInitialize() override + { + if (Unit* caster = at->GetCaster()) + { + at->SetOrientation(caster->GetOrientation()); + + Position destPos = caster->GetPosition(); + at->MovePositionToFirstCollision(destPos, 100.0f, 0.0f); + + Movement::PointsArray splinePoints; + splinePoints.push_back(PositionToVector3(at->GetPosition())); + splinePoints.push_back(PositionToVector3(at->GetPosition())); + splinePoints.push_back(PositionToVector3(destPos)); + splinePoints.push_back(PositionToVector3(at->GetPosition())); + splinePoints.push_back(PositionToVector3(at->GetPosition())); + + float timeToTarget = at->GetDistance(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ()) * 2 / GetWickedStarSpeed(at->GetMap()->GetDifficultyID()) * 1000; + at->InitSplines(splinePoints, timeToTarget); + } + } + + void OnUnitEnter(Unit* unit) override + { + if (unit->GetEntry() == NPC_SYLVANAS_WINDRUNNER_ANDUIN || unit->GetEntry() == NPC_UTHER_THE_LIGHTBRINGER_ANDUIN || + unit->GetEntry() == NPC_LADY_JAINA_PROUDMOORE_ANDUIN || unit->GetEntry() == BOSS_ANDUIN_WRYNN) + return; + + Unit* caster = at->GetCaster(); + if (!caster) + return; + + if (caster->IsValidAttackTarget(unit)) + caster->CastSpell(unit, SPELL_WICKED_STAR_DAMAGE_SILENCE, CastSpellExtraArgs(TriggerCastFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS))); + else if (caster->IsValidAssistTarget(unit)) + caster->CastSpell(unit, SPELL_WICKED_STAR_EMPOWERMENT, CastSpellExtraArgs(TriggerCastFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS))); + } + + void OnDestinationReached() override + { + at->Remove(); + } +}; + +// 367632 - Empowered Wicked Star +class spell_anduin_wrynn_empowered_wicked_star_selector_AuraScript : public spell_anduin_wrynn_wicked_star_selector_AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_empowered_wicked_star_selector_AuraScript); + + uint8 GetAnnounceGroupID() override + { + return SAY_ANNOUNCE_EMPOWERED_WICKED_STAR; + } + + uint32 GetAreaTriggerSpellID() override + { + return SPELL_EMPOWERED_WICKED_STAR_AREATRIGGER; + } +}; + +// 367621 - Empowered Wicked Star CreatePropertiesId: 24599 +struct at_anduin_wrynn_empowered_wicked_star : public at_anduin_wrynn_wicked_star +{ + at_anduin_wrynn_empowered_wicked_star(AreaTrigger* areatrigger) : at_anduin_wrynn_wicked_star(areatrigger) { } + + static float constexpr EMPOWERED_WICKED_STAR_SPEED = 14.0f; // in yards per second + + void HandleMovement(float angle) + { + Unit* caster = at->GetCaster(); + if (!caster) + return; + + // hack: when reflection is implemented use at position instead of center; due to mmaps we are causing infinite loop if using at position after dest reach + Position destPos = DominationGraspCenter; + at->MovePositionToFirstCollision(destPos, 100.0f, angle); + + Movement::PointsArray splinePoints; + splinePoints.push_back(PositionToVector3(at)); + splinePoints.push_back(PositionToVector3(at)); + splinePoints.push_back(PositionToVector3(destPos)); + splinePoints.push_back(PositionToVector3(destPos)); + + float timeToTarget = at->GetDistance(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ()) / EMPOWERED_WICKED_STAR_SPEED * 1000; + at->InitSplines(splinePoints, timeToTarget); + } + + void OnInitialize() override + { + HandleMovement(0); + } + + void OnDestinationReached() override + { + // hack: angle should use physical laws for reflection + HandleMovement(frand(0, 2.0f * float(M_PI))); + } +}; + +// 362405 - Kingsmourne Hungers +class spell_anduin_wrynn_kingsmourne_hungers : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_kingsmourne_hungers); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_KINGSMOURNE_HUNGERS_DAMAGE, + SPELL_LOST_SOUL_DIMENSION, + SPELL_LOST_SOUL, + SPELL_SEVERED_SOUL + }); + } + + void HandleDummyEffect(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* hitUnit = GetHitUnit(); + caster->CastSpell(hitUnit, SPELL_KINGSMOURNE_HUNGERS_DAMAGE, true); + if (caster->GetMap()->IsMythic()) + hitUnit->CastSpell(hitUnit, SPELL_SEVERED_SOUL, true); + caster->CastSpell(hitUnit, SPELL_LOST_SOUL_DIMENSION); + hitUnit->CastSpell(hitUnit, SPELL_LOST_SOUL, true); + } + + void OnCast() + { + InstanceScript* instance = GetCaster()->GetInstanceScript(); + if (!instance) + return; + + if (Creature* anduinSoul = instance->GetCreature(DATA_ANDUIN_SOUL)) + anduinSoul->GetAI()->DoAction(ACTION_SUMMON_KINGSMOURNE_SOULS); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_anduin_wrynn_kingsmourne_hungers::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterCast += SpellCastFn(spell_anduin_wrynn_kingsmourne_hungers::OnCast); + } +}; + +// 362055 - Lost Soul +class spell_anduin_wrynn_lost_soul : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_lost_soul); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_LOST_SOUL_GRACE, + SPELL_SCARRED_SOUL + }); + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + _lostSoulPosition = target->GetPosition(); + target->CastSpell(target, SPELL_LOST_SOUL_GRACE, true); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + switch (GetTargetApplication()->GetRemoveMode()) + { + case AURA_REMOVE_BY_DEFAULT: + case AURA_REMOVE_BY_ENEMY_SPELL: + target->CastSpell(target, SPELL_SCARRED_SOUL, true); + break; + case AURA_REMOVE_BY_EXPIRE: + { + if (target->GetMap()->IsMythic()) + { + target->KillSelf(); + target->NearTeleportTo(_lostSoulPosition); + } + break; + } + case AURA_REMOVE_BY_DEATH: + { + target->CastSpell(target, SPELL_SCARRED_SOUL, true); + if (target->GetMap()->IsMythic()) + target->NearTeleportTo(_lostSoulPosition); + break; + } + default: + return; + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_anduin_wrynn_lost_soul::OnApply, EFFECT_0, SPELL_AURA_PHASE, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_anduin_wrynn_lost_soul::OnRemove, EFFECT_1, SPELL_AURA_SCREEN_EFFECT, AURA_EFFECT_HANDLE_REAL); + } + +private: + Position _lostSoulPosition; +}; + +// 362392 - Rain of Despair +class spell_anduin_rain_of_despair_player_selector : public SpellScript +{ + PrepareSpellScript(spell_anduin_rain_of_despair_player_selector); + + void HandleDespair(SpellEffIndex effIndex) + { + GetCaster()->CastSpell(GetHitUnit(), GetEffectInfo(effIndex).TriggerSpell, true); + } + + void Register() override + { + OnEffectLaunchTarget += SpellEffectFn(spell_anduin_rain_of_despair_player_selector::HandleDespair, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 362766 - Soul Despawn +class spell_anduin_wrynn_soul_despawn : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_soul_despawn); + + void OnCast() + { + if (Creature* creature = GetCaster()->ToCreature()) + { + if (creature->GetEntry() == NPC_ANDUIN_HOPE || creature->GetEntry() == NPC_ANDUIN_DOUBT) + creature->DespawnOrUnsummon(3s); + } + } + + void Register() override + { + AfterCast += SpellCastFn(spell_anduin_wrynn_soul_despawn::OnCast); + } +}; + +// 368913 - Force of Will +class spell_anduin_wrynn_force_of_will : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_force_of_will); + + void RecalculateHook(AuraEffect const* /*aurEffect*/, int32& amount, bool& canBeRecalculated) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + // at 100 will power = 200% Damage Done increase + int32 powerValue = caster->GetPower(caster->GetPowerType()); + amount = 2 * powerValue; + canBeRecalculated = false; + } + + void RecalculateHookDamageTaken(AuraEffect const* /*aurEffect*/, int32& amount, bool& canBeRecalculated) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + // Damage Taken reduction can only be capped to 90% + int32 powerValue = caster->GetPower(caster->GetPowerType()); + amount = -std::min(powerValue, 90); + canBeRecalculated = false; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + caster->SetPower(caster->GetPowerType(), 0); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_anduin_wrynn_force_of_will::OnApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_anduin_wrynn_force_of_will::RecalculateHook, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_anduin_wrynn_force_of_will::RecalculateHook, EFFECT_1, SPELL_AURA_MOD_SUMMON_DAMAGE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_anduin_wrynn_force_of_will::RecalculateHookDamageTaken, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); + } +}; + +// 363233 - March of the Damned +class spell_anduin_wrynn_march_of_the_damned : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_march_of_the_damned); + +public: + spell_anduin_wrynn_march_of_the_damned() + { + _availableSpawnPositions.assign(std::begin(MarchOfTheDamnedSpawnPositions), std::end(MarchOfTheDamnedSpawnPositions)); + } + + void OnPeriodic(AuraEffect const* aurEff) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + uint8 raidDifficulty = 0; + + switch (GetCaster()->GetMap()->GetDifficultyID()) + { + case DIFFICULTY_LFR_NEW: + case DIFFICULTY_NORMAL_RAID: + case DIFFICULTY_HEROIC_RAID: + raidDifficulty = 28; + break; + case DIFFICULTY_MYTHIC_RAID: + raidDifficulty = 21; + break; + default: + raidDifficulty = 28; + break; + } + + // Don't summon the wall on aura granted + if (aurEff->GetTickNumber() == 1) + return; + + if (_availableSpawnPositions.empty()) + return; + + Position chosenPosition = Trinity::Containers::SelectRandomContainerElement(_availableSpawnPositions); + auto it = std::find(_availableSpawnPositions.begin(), _availableSpawnPositions.end(), chosenPosition); + _availableSpawnPositions.erase(it); + + GetCaster()->SummonCreature(NPC_MARCH_OF_THE_DAMNED, chosenPosition, TEMPSUMMON_TIMED_DESPAWN, Seconds(raidDifficulty)); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_anduin_wrynn_march_of_the_damned::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + +private: + std::vector<Position> _availableSpawnPositions; +}; + +// 362500 - Shade Spawn Ceremony +class spell_remnant_of_a_fallen_king_spawn : public AuraScript +{ + PrepareAuraScript(spell_remnant_of_a_fallen_king_spawn); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) + GetTarget()->GetAI()->DoAction(ACTION_ACTIVATE_REMNANT); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_remnant_of_a_fallen_king_spawn::OnRemove, EFFECT_2, SPELL_AURA_TRIGGER_SPELL_ON_EXPIRE, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 365652 - Lost Soul +class spell_anduin_soul_lost_soul : public SpellScript +{ + PrepareSpellScript(spell_anduin_soul_lost_soul); + + void FilterTargets(std::list<WorldObject*>& unitList) + { + unitList.remove_if([this](WorldObject* target) + { + if (target->GetEntry() == NPC_ANDUIN_DOUBT && target->IsWithinDistInMap(GetCaster(), 0.2f)) + return false; + return true; + }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* creature = GetHitUnit()->ToCreature()) + creature->DespawnOrUnsummon(); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anduin_soul_lost_soul::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_anduin_soul_lost_soul::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 367769 - Severed Soul +class spell_anduin_wrynn_severed_soul : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_severed_soul); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_CANCEL_LOST_SOUL + }); + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + _soulPosition = caster->GetPosition(); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + caster->CastSpell(caster, SPELL_CANCEL_LOST_SOUL, true); + + if (TempSummon* summon = GetTarget()->ToTempSummon()) + { + if (summon->GetSummonerUnit() == caster) + caster->NearTeleportTo(_soulPosition); + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_anduin_wrynn_severed_soul::OnApply, EFFECT_0, SPELL_AURA_LINKED_SUMMON, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_anduin_wrynn_severed_soul::OnRemove, EFFECT_1, SPELL_AURA_TRIGGER_SPELL_ON_EXPIRE, AURA_EFFECT_HANDLE_REAL); + } + +private: + Position _soulPosition; +}; + +// 362402 - Lost Soul Mirror Image +class spell_anduin_wrynn_lost_soul_mirror_image : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_lost_soul_mirror_image); + + void FilterTargets(std::list<WorldObject*>& targets) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + ObjectGuid casterGuid = caster->GetGUID(); + + targets.remove_if([casterGuid](WorldObject* target) -> bool + { + Unit* unit = target->ToUnit(); + if (!unit) + return true; + + TempSummon* summon = unit->ToTempSummon(); + if (!summon) + return true; + + if (summon->GetSummonerGUID() != casterGuid) + return true; + + return false; + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anduin_wrynn_lost_soul_mirror_image::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anduin_wrynn_lost_soul_mirror_image::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anduin_wrynn_lost_soul_mirror_image::FilterTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anduin_wrynn_lost_soul_mirror_image::FilterTargets, EFFECT_3, TARGET_UNIT_SRC_AREA_ENTRY); + } +}; + +// 363029 - Soul Explosion +class spell_friendish_soul_explosion : public SpellScript +{ + PrepareSpellScript(spell_friendish_soul_explosion); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_SOUL_EXPLOSION_TRIGGER_MISSILE + }); + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + if (targets.empty()) + return; + + targets.remove_if([](WorldObject* target) + { + Player* player = target->ToPlayer(); + if (!player) + return true; + + return false; + }); + + std::vector<WorldObject*> rangedTargets; + for (WorldObject* target : targets) + { + if (target->GetDistance(GetCaster()) >= 5.0f) + { + rangedTargets.push_back(target); + break; + } + } + + if (!rangedTargets.empty()) + { + targets.clear(); + targets.push_back(Trinity::Containers::SelectRandomContainerElement(rangedTargets)); + } + } + + void HandleMissile(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_SOUL_EXPLOSION_TRIGGER_MISSILE, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_friendish_soul_explosion::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_friendish_soul_explosion::HandleMissile, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 363022 - Return to Kingsmourne +class spell_remnant_of_a_fallen_king_return_to_kingsmourne_applied : public AuraScript +{ + PrepareAuraScript(spell_remnant_of_a_fallen_king_return_to_kingsmourne_applied); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_RETURN_TO_KINGSMOURNE_VISUALS + }); + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + caster->CastSpell(caster, SPELL_RETURN_TO_KINGSMOURNE_VISUALS); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_remnant_of_a_fallen_king_return_to_kingsmourne_applied::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 363021 - Return to Kingsmourne +class spell_remnant_of_a_fallen_king_return_to_kingsmourne : public AuraScript +{ + PrepareAuraScript(spell_remnant_of_a_fallen_king_return_to_kingsmourne); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER, + SPELL_CANCEL_FORCE_OF_WILL + }); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + InstanceScript* instance = caster->GetInstanceScript(); + if (!instance) + return; + + if (Creature* arthas = instance->GetCreature(DATA_REMNANT_OF_A_FALLEN_KING)) + arthas->AI()->EnterEvadeMode(EvadeReason::Other); + + if (Creature* anduin = instance->GetCreature(DATA_ANDUIN_WRYNN)) + { + anduin->RemoveAurasDueToSpell(SPELL_DOMINATION_GRASP_ROOT_AREATRIGGER); + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_INTERMISSION, 0); + instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_ENCOUNTER_STARTED, 1); + if (anduin->IsAIEnabled()) + { + anduin->AI()->DoAction(ACTION_EXIT_INTERMISSION); + anduin->AI()->DoCastSelf(SPELL_CANCEL_FORCE_OF_WILL); + } + } + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_remnant_of_a_fallen_king_return_to_kingsmourne::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 365120 - Grim Reflections +class spell_anduin_wrynn_grim_reflections : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_grim_reflections); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_GRIM_REFLECTIONS_SUMMON + }); + } + + void HandleCast() + { + uint8 reflectionsNumber = GetCaster()->GetMap()->IsMythic() ? 4 : 3; + std::vector<Position> grimReflectionPositions(std::begin(GrimReflectionsSpawnPositions), std::end(GrimReflectionsSpawnPositions)); + Trinity::Containers::RandomResize(grimReflectionPositions, reflectionsNumber); + + for (uint8 i = 0; i < reflectionsNumber; i++) + GetCaster()->CastSpell(grimReflectionPositions[i], SPELL_GRIM_REFLECTIONS_SUMMON, true); + } + + void Register() override + { + OnCast += SpellCastFn(spell_anduin_wrynn_grim_reflections::HandleCast); + } +}; + +// 365872 - Beacon of Hope +class spell_anduin_wrynn_beacon_of_hope : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_beacon_of_hope); + + void OnCast() + { + GetCaster()->SummonCreature(NPC_BEACON_OF_HOPE, BeaconOfHopeSpawnPosition, TEMPSUMMON_MANUAL_DESPAWN); + } + + void Register() override + { + AfterCast += SpellCastFn(spell_anduin_wrynn_beacon_of_hope::OnCast); + } +}; + +// 365958 - Hopelessness +class spell_anduin_wrynn_hopelessness : public SpellScript +{ + PrepareSpellScript(spell_anduin_wrynn_hopelessness); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_BLASPHEMY_PRE_HIT, + SPELL_HOPELESSNESS_MISSILE + }); + } + + void OnPrecast() override + { + GetCaster()->CastSpell(GetCaster(), SPELL_BLASPHEMY_PRE_HIT, true); + } + + void HandleDebuff(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_HOPELESSNESS_MISSILE, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_anduin_wrynn_hopelessness::HandleDebuff, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 365966 - Hopelessness CreatePropertiesId 24443 +struct at_anduin_wrynn_hopelessness : AreaTriggerAI +{ + at_anduin_wrynn_hopelessness(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { } + + void OnUnitEnter(Unit* unit) override + { + if (!unit->IsPlayer() || unit->HasAura(SPELL_BLASPHEMY_PRE_HIT)) + return; + + if (!unit->IsAlive()) + { + at->Remove(); + return; + } + + if (unit->HasAura(at->GetSpellId())) + { + unit->CastSpell(unit, SPELL_BLASPHEMY_EXPLODE, true); + if (Unit* target = at->GetTarget()) + target->CastSpell(target, SPELL_BLASPHEMY_EXPLODE, true); + } + } + + void OnUnitExit(Unit* unit) override + { + if (!unit->IsAlive() && unit->HasAura(at->GetSpellId())) + unit->RemoveAurasDueToSpell(at->GetSpellId()); + } +}; + +// 365966 - Hopelessness +class spell_anduin_wrynn_hopelessness_expire : public AuraScript +{ + PrepareAuraScript(spell_anduin_wrynn_hopelessness_expire); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_HOPELESSNESS_EXPLODE }); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + switch (GetTargetApplication()->GetRemoveMode()) + { + case AURA_REMOVE_BY_ENEMY_SPELL: + case AURA_REMOVE_BY_EXPIRE: + case AURA_REMOVE_BY_DEATH: + GetTarget()->CastSpell(GetTarget(), SPELL_HOPELESSNESS_EXPLODE, true); + break; + default: + return; + } + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_anduin_wrynn_hopelessness_expire::OnRemove, EFFECT_0, SPELL_AURA_AREA_TRIGGER, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 365291 - Remnant Timer +class spell_remnant_of_a_fallen_king_energize_runic_power : public AuraScript +{ + PrepareAuraScript(spell_remnant_of_a_fallen_king_energize_runic_power); + + static constexpr std::array<int32, 3> RemnantRegenCycle = { 1, 1, 2 }; + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + Unit* target = GetTarget(); + int32 powerGained = RemnantRegenCycle[_powerRegenCycle++]; + + if (_powerRegenCycle > 2) + _powerRegenCycle = 1; + + target->ModifyPower(target->GetPowerType(), powerGained); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_remnant_of_a_fallen_king_energize_runic_power::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + +private: + uint8 _powerRegenCycle = 0; +}; + +// 362862 - Army of the Dead +class spell_remnant_of_a_fallen_king_army_of_the_dead : public SpellScript +{ + PrepareSpellScript(spell_remnant_of_a_fallen_king_army_of_the_dead); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo( + { + SPELL_ECHOES_OF_ANDORHAL_MONSTROUS_SOUL, + }); + } + + void HandleAfterCast() + { + if (GetCaster()->GetMap()->IsLFR()) + return; + + Position monstrousSoulSpawnPosition = GetCaster()->GetNearPosition(frand(30.0f, 50.0f), frand(0.0f, 3.5f)); + GetCaster()->CastSpell(monstrousSoulSpawnPosition, SPELL_ECHOES_OF_ANDORHAL_MONSTROUS_SOUL, true); + } + + void Register() override + { + AfterCast += SpellCastFn(spell_remnant_of_a_fallen_king_army_of_the_dead::HandleAfterCast); + } +}; + +// 362863 - Echoes of Andorhal +class spell_remnant_of_a_fallen_king_echoes_of_andorhal : public SpellScript +{ + PrepareSpellScript(spell_remnant_of_a_fallen_king_echoes_of_andorhal); + + void SetDest(SpellDestination& dest) + { + Position const echoesSummon = GetCaster()->GetRandomPoint(DominationGraspCenter, frand(20.5f, 30.0f)); + dest.Relocate(echoesSummon); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_remnant_of_a_fallen_king_echoes_of_andorhal::SetDest, EFFECT_0, TARGET_DEST_DEST_RANDOM); + } +}; + +// 362543 - Remorseless Winter +class spell_remnant_of_a_fallen_king_remorseless_winter_periodic : public AuraScript +{ + PrepareAuraScript(spell_remnant_of_a_fallen_king_remorseless_winter_periodic); + + void OnPeriodic(AuraEffect const* /*aurEff*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + caster->CastSpell(GetTarget(), SPELL_REMORSELESS_WINTER_DEBUFF_DAMAGE, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_remnant_of_a_fallen_king_remorseless_winter_periodic::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } +}; + +// 362545 - Remorseless Winter +class spell_remnant_of_a_fallen_king_remorseless_winter_damage : public SpellScript +{ + PrepareSpellScript(spell_remnant_of_a_fallen_king_remorseless_winter_damage); + + void HandleDamage(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + Aura* remorselessWinter = GetHitUnit()->GetAura(SPELL_REMORSELESS_WINTER_PERIODIC); + if (!remorselessWinter) + return; + + SetHitDamage(int32(GetHitDamage() * (uint8)remorselessWinter->GetStackAmount())); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_remnant_of_a_fallen_king_remorseless_winter_damage::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + +// 362771 - Soul Reaper +class spell_remnant_of_a_fallen_king_soul_reaper : public SpellScript +{ + PrepareSpellScript(spell_remnant_of_a_fallen_king_soul_reaper); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo + ({ + SPELL_SOUL_REAPER_PHYSICAL_DAMAGE, + SPELL_SOUL_REAPER_SHADOWFROST_DAMAGE, + SPELL_SOUL_REAPER_DEBUFF, + SPELL_SOUL_REAPER_ATTACK_SPEED, + }); + } + + void HandleDummyEffect(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* hitUnit = GetHitUnit(); + caster->CastSpell(hitUnit, SPELL_SOUL_REAPER_PHYSICAL_DAMAGE, true); + caster->CastSpell(hitUnit, SPELL_SOUL_REAPER_SHADOWFROST_DAMAGE, true); + caster->CastSpell(hitUnit, SPELL_SOUL_REAPER_DEBUFF, true); + caster->CastSpell(caster, SPELL_SOUL_REAPER_ATTACK_SPEED, true); + caster->resetAttackTimer(BASE_ATTACK); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_remnant_of_a_fallen_king_soul_reaper::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// Anduin Wrynn Introduction Custom AT +struct at_anduin_wrynn_pre_introduction : AreaTriggerAI +{ + at_anduin_wrynn_pre_introduction(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { } + + void OnUnitEnter(Unit* unit) override + { + Player* player = unit->ToPlayer(); + if (!player || player->IsGameMaster()) + return; + + InstanceScript* instance = at->GetInstanceScript(); + if (!instance) + return; + + if (Creature* anduin = instance->GetCreature(DATA_ANDUIN_WRYNN)) + anduin->GetAI()->DoAction(ACTION_START_PRE_INTRODUCTION); + + at->Remove(); + } +}; + +// 956 - Anduin End Movie +class movie_anduin_final : public PlayerScript +{ +public: + movie_anduin_final() : PlayerScript("movie_anduin_final") { } + + void MarkPlayerAsSkipped(uint32 playerId) + { + _skippedPlayers.insert(playerId); + } + + void OnMovieComplete(Player* player, uint32 /*movieId*/) override + { + InstanceScript* instance = player->GetInstanceScript(); + if (!instance) + return; + + Creature* anduin = instance->GetCreature(DATA_ANDUIN_WRYNN); + if (!anduin) + return; + + MarkPlayerAsSkipped(static_cast<uint32>(player->GetGUID().GetCounter())); + player->RemoveAurasDueToSpell(SPELL_FINAL_MOVIE); + + // Outroduction must start once every player skips or completes the movie + if (_skippedPlayers.size() == player->GetMap()->GetPlayersCountExceptGMs()) + anduin->GetAI()->DoAction(ACTION_START_OUTRODUCTION); + } + +private: + std::unordered_set<uint32> _skippedPlayers; +}; + +void AddSC_boss_anduin_wrynn() +{ + RegisterSepulcherOfTheFirstOnesCreatureAI(boss_anduin_wrynn); + RegisterSepulcherOfTheFirstOnesCreatureAI(boss_remnant_of_a_fallen_king); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_sylvanas); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_jaina); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_uther); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_empty_vessel); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_lost_soul); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_anduin_soul); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_anduin_despair); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_anduin_doubt); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_anduin_hope); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_monstrous_soul); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_fiendish_soul); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_grim_reflection); + RegisterSepulcherOfTheFirstOnesCreatureAI(npc_anduin_wrynn_beacon_of_hope); + + RegisterAreaTriggerAI(at_anduin_wrynn_pre_introduction); + RegisterSpellScript(spell_anduin_wrynn_pre_introduction); + RegisterSpellScript(spell_anduin_wrynn_progression_aura); + RegisterSpellScript(spell_anduin_wrynn_energize_willpower_lfr); + RegisterSpellScript(spell_anduin_wrynn_dark_zeal); + RegisterSpellScript(spell_anduin_wrynn_hopebreaker); + RegisterSpellScript(spell_anduin_wrynn_hopebreaker_periodic); + RegisterSpellScript(spell_anduin_wrynn_hopebreaker_damage); + RegisterAreaTriggerAI(at_anduin_wrynn_befouled_barrier); + RegisterSpellScript(spell_anduin_wrynn_befouled_barrier_absorb); + RegisterSpellScript(spell_anduin_wrynn_befouled_barrier_expire); + RegisterAreaTriggerAI(at_anduin_wrynn_blasphemy); + RegisterSpellScript(spell_anduin_wrynn_blasphemy); + RegisterSpellScript(spell_anduin_wrynn_hopelessness_overconfidence); + RegisterAreaTriggerAI(at_anduin_wrynn_wicked_star); + RegisterAreaTriggerAI(at_anduin_wrynn_empowered_wicked_star); + RegisterSpellAndAuraScriptPair(spell_anduin_wrynn_wicked_star_selector, spell_anduin_wrynn_wicked_star_selector_AuraScript); + RegisterSpellAndAuraScriptPairWithArgs(spell_anduin_wrynn_wicked_star_selector, spell_anduin_wrynn_empowered_wicked_star_selector_AuraScript, "spell_anduin_wrynn_empowered_wicked_star_selector"); + RegisterSpellScript(spell_anduin_wrynn_kingsmourne_hungers); + RegisterSpellScript(spell_anduin_soul_lost_soul); + RegisterSpellScript(spell_anduin_wrynn_lost_soul); + RegisterSpellScript(spell_anduin_wrynn_lost_soul_mirror_image); + RegisterSpellScript(spell_anduin_wrynn_severed_soul); + RegisterSpellScript(spell_anduin_wrynn_soul_despawn); + RegisterSpellScript(spell_anduin_rain_of_despair_player_selector); + RegisterSpellScript(spell_anduin_wrynn_force_of_will); + RegisterAreaTriggerAI(at_anduin_wrynn_march_of_the_damned); + RegisterSpellScript(spell_anduin_wrynn_march_of_the_damned); + RegisterSpellScript(spell_friendish_soul_explosion); + RegisterSpellScript(spell_anduin_wrynn_grim_reflections); + RegisterAreaTriggerAI(at_anduin_wrynn_beacon_of_hope); + RegisterSpellScript(spell_anduin_wrynn_beacon_of_hope); + RegisterAreaTriggerAI(at_anduin_wrynn_hopelessness); + RegisterSpellScript(spell_anduin_wrynn_hopelessness); + RegisterSpellScript(spell_anduin_wrynn_hopelessness_expire); + RegisterSpellScript(spell_anduin_wrynn_fragment_of_hope); + + RegisterSpellScript(spell_remnant_of_a_fallen_king_spawn); + RegisterSpellScript(spell_remnant_of_a_fallen_king_energize_runic_power); + RegisterSpellScript(spell_remnant_of_a_fallen_king_army_of_the_dead); + RegisterSpellScript(spell_remnant_of_a_fallen_king_echoes_of_andorhal); + RegisterSpellScript(spell_remnant_of_a_fallen_king_soul_reaper); + RegisterSpellScript(spell_remnant_of_a_fallen_king_remorseless_winter_periodic); + RegisterSpellScript(spell_remnant_of_a_fallen_king_remorseless_winter_damage); + RegisterSpellScript(spell_remnant_of_a_fallen_king_return_to_kingsmourne); + RegisterSpellScript(spell_remnant_of_a_fallen_king_return_to_kingsmourne_applied); + + new movie_anduin_final(); +} diff --git a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/instance_sepulcher_of_the_first_ones.cpp b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/instance_sepulcher_of_the_first_ones.cpp new file mode 100644 index 00000000000..4595546cb12 --- /dev/null +++ b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/instance_sepulcher_of_the_first_ones.cpp @@ -0,0 +1,158 @@ +/* + * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information + * + * 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, see <http://www.gnu.org/licenses/>. + */ + +#include "AreaBoundary.h" +#include "Creature.h" +#include "CreatureAI.h" +#include "GameObject.h" +#include "InstanceScript.h" +#include "Map.h" +#include "Player.h" +#include "ScriptMgr.h" +#include "sepulcher_of_the_first_ones.h" + +ObjectData const creatureData[] = +{ + // Anduin Wrynn + { BOSS_ANDUIN_WRYNN, DATA_ANDUIN_WRYNN }, + { BOSS_REMNANT_OF_A_FALLEN_KING, DATA_REMNANT_OF_A_FALLEN_KING }, + { NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, DATA_UTHER_THE_LIGHTBRINGER_ANDUIN }, + { NPC_LADY_JAINA_PROUDMOORE_ANDUIN, DATA_JAINA_PROUDMOORE_ANDUIN }, + { NPC_SYLVANAS_WINDRUNNER_ANDUIN, DATA_SYLVANAS_WINDRUNNER_ANDUIN }, + { NPC_THRALL_ANDUIN, DATA_THRALL_ANDUIN }, + { NPC_FIRIM_ANDUIN, DATA_FIRIM_ANDUIN }, + { NPC_ANDUIN_SOUL, DATA_ANDUIN_SOUL }, + { NPC_BEACON_OF_HOPE, DATA_BEACON_OF_HOPE }, + { NPC_QUARTERMASTER_RAHM_ANDUIN, DATA_QUARTERMASTER_RAHM_ANDUIN }, + { NPC_BOLVAR_FORDRAGON_ANDUIN, DATA_BOLVAR_FORDRAGON_ANDUIN }, + { 0, 0 } +}; + +BossBoundaryData const boundaries = +{ + { DATA_ANDUIN_WRYNN, new CircleBoundary({ -3825.0601f, -2715.4600f }, 45.0)}, +}; + +DoorData const doorData[] = +{ + { GAMEOBJECT_BRIDGE_TO_ANDUIN, DATA_ANDUIN_WRYNN, EncounterDoorBehavior::OpenWhenInProgress }, + { GAMEOBJECT_BRIDGE_AFTER_ANDUIN, DATA_ANDUIN_WRYNN, EncounterDoorBehavior::OpenWhenNotDone }, + { 0, 0, EncounterDoorBehavior::OpenWhenInProgress } +}; + +DungeonEncounterData const encounters[] = +{ + { DATA_ANDUIN_WRYNN, {{ 2546 }} }, +}; + +class instance_sepulcher_of_the_first_ones : public InstanceMapScript +{ +public: + instance_sepulcher_of_the_first_ones() : InstanceMapScript(SFOScriptName, 2481) { } + + struct instance_sepulcher_of_the_first_ones_InstanceMapScript : public InstanceScript + { + instance_sepulcher_of_the_first_ones_InstanceMapScript(InstanceMap* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + SetBossNumber(EncounterCount); + LoadDungeonEncounterData(encounters); + LoadBossBoundaries(boundaries); + LoadObjectData(creatureData, nullptr); + LoadDoorData(doorData); + + AnduinIntroductionState = NOT_STARTED; + } + + bool SetBossState(uint32 id, EncounterState state) override + { + if (!InstanceScript::SetBossState(id, state)) + return false; + + switch (id) + { + case DATA_ANDUIN_WRYNN: + { + if (state == NOT_STARTED) + DoUpdateWorldState(WORLD_STATE_ANDUIN_ENCOUNTER_STARTED, 0); + else if (state == IN_PROGRESS) + { + Creature* anduin = GetCreature(DATA_ANDUIN_WRYNN); + if (!anduin) + return false; + + DoUpdateWorldState(WORLD_STATE_ANDUIN_ENCOUNTER_STARTED, 1); + + // @TODO: uther, sylvanas and jaina should attack anduin but keep faction 35; we lack core support + if (Creature* uther = GetCreature(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN)) + uther->AI()->AttackStart(anduin); + + for (uint32 data : { DATA_SYLVANAS_WINDRUNNER_ANDUIN, DATA_JAINA_PROUDMOORE_ANDUIN }) + { + if (Creature* creature = GetCreature(data)) + creature->AI()->AttackStartCaster(anduin, 25.0f); + } + } + break; + } + default: + break; + } + return true; + } + + void SetData(uint32 type, uint32 data) override + { + switch (type) + { + case DATA_ANDUIN_WRYNN_INTRODUCTION: + { + AnduinIntroductionState = data; + break; + } + default: + break; + } + } + + uint32 GetData(uint32 type) const override + { + switch (type) + { + case DATA_ANDUIN_WRYNN_INTRODUCTION: + return AnduinIntroductionState; + default: + break; + } + + return 0; + } + + protected: + uint8 AnduinIntroductionState; + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const override + { + return new instance_sepulcher_of_the_first_ones_InstanceMapScript(map); + } +}; + +void AddSC_instance_sepulcher_of_the_first_ones() +{ + new instance_sepulcher_of_the_first_ones(); +} diff --git a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/sepulcher_of_the_first_ones.h b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/sepulcher_of_the_first_ones.h new file mode 100644 index 00000000000..e6efa615e2b --- /dev/null +++ b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/sepulcher_of_the_first_ones.h @@ -0,0 +1,132 @@ +/* + * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information + * + * 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef DEF_SEPULCHER_OF_THE_FIRST_ONES_H_ +#define DEF_SEPULCHER_OF_THE_FIRST_ONES_H_ + +#include "CreatureAIImpl.h" + +#define DataHeader "SepulcherOfTheFirstOnes" +#define SFOScriptName "instance_sepulcher_of_the_first_ones" + +uint32 const EncounterCount = 11; + +enum SepulcherOfTheFirstOnesDataTypes +{ + // Bosses + DATA_VIGILANT_CUSTODIAN = 0, + DATA_SKOLEX = 1, + DATA_ARTIFICER_XYMOX = 2, + DATA_HALONDRUS = 3, + DATA_DAUSEGNE = 4, + DATA_PROTOTYPE_PANTHEON = 5, + DATA_LIHUVIM = 6, + DATA_ANDUIN_WRYNN = 7, + DATA_LORDS_OF_DREAD = 8, + DATA_RYGELON = 10, + DATA_JAILER = 11, + + // Anduin Wrynn Encounter + DATA_ANDUIN_WRYNN_INTRODUCTION, + DATA_REMNANT_OF_A_FALLEN_KING, + DATA_SYLVANAS_WINDRUNNER_ANDUIN, + DATA_ANDUIN_SOUL, + DATA_BEACON_OF_HOPE, + DATA_JAINA_PROUDMOORE_ANDUIN, + DATA_UTHER_THE_LIGHTBRINGER_ANDUIN, + DATA_FIRIM_ANDUIN, + DATA_ANDUIN_TREASURE, + DATA_BOLVAR_FORDRAGON_ANDUIN, + DATA_THRALL_ANDUIN, + DATA_QUARTERMASTER_RAHM_ANDUIN, +}; + +enum SepulcherOfTheFirstOnesCreatureIds +{ + // Bosses + BOSS_VIGILANT_CUSTODIAN = 184522, + BOSS_VIGILANT_GUARDIAN = 180773, + BOSS_ANDUIN_WRYNN = 181954, + BOSS_REMNANT_OF_A_FALLEN_KING = 183463, + + // Anduin Wrynn Encounter + NPC_LADY_JAINA_PROUDMOORE_ANDUIN = 183664, + NPC_UTHER_THE_LIGHTBRINGER_ANDUIN = 183665, + NPC_SYLVANAS_WINDRUNNER_ANDUIN = 183666, + NPC_FIRIM_ANDUIN = 184589, + NPC_BEFOULED_BARRIER = 184585, + NPC_ANDUIN_SOUL = 184519, + NPC_ANDUIN_DESPAIR = 184520, + NPC_ANDUIN_HOPE = 184493, + NPC_ANDUIN_DOUBT = 184494, + NPC_EMPTY_VESSEL = 183452, + NPC_LOST_SOUL = 185607, + NPC_MONSTROUS_SOUL = 183671, + NPC_FIENDISH_SOUL = 183669, + NPC_MARCH_OF_THE_DAMNED = 183793, + NPC_GRIM_REFLECTION = 183033, + NPC_BEACON_OF_HOPE = 184830, + NPC_BOLVAR_FORDRAGON_ANDUIN = 184601, + NPC_QUARTERMASTER_RAHM_ANDUIN = 186785, + NPC_THRALL_ANDUIN = 184599, + NPC_KNIGHT_OF_EBON_BLADE_ANDUIN = 184613, +}; + +enum SepulcherOfTheFirstOnesTranslocatorIds +{ + NPC_ANCIENT_TRANSLOCATOR = 182431, +}; + +enum SepulcherOfTheFirstOnesGameObjectIds +{ + GAMEOBJECT_BRIDGE_TO_ANDUIN = 375110, + GAMEOBJECT_BRIDGE_AFTER_ANDUIN = 375035, + GAMEOBJECT_ANDUIN_CHEST_LOOT = 375901, +}; + +enum SepulcherOfTheFirstOnesEvents +{ + EVENT_RESET_PLAYERS_ON_TRANSLOCATOR = 1 +}; + +enum SepulcherOfTheFirstOnesActions +{ + ACTION_START_ANDUIN_OUTRODUCTION = 1, +}; + +enum SepulcherOfTheFirstOnesAreas +{ + AREA_DOMINATION_GRASP = 13965, + AREA_SEPULCHER_OF_THE_FIRST_ONES = 13742, +}; + +enum SepulcherOfTheFirstOnesWorldStates +{ + WORLD_STATE_ANDUIN_ENCOUNTER_STARTED = 21243, + WORLD_STATE_ANDUIN_INTERMISSION = 21433, + WORLD_STATE_ANDUIN_ENCOUNTER_COMPLETED = 21242, +}; + +template <class AI, class T> +inline AI* GetSepulcherOfTheFirstOnesAI(T* obj) +{ + return GetInstanceAI<AI>(obj, SFOScriptName); +} + +#define RegisterSepulcherOfTheFirstOnesCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetSepulcherOfTheFirstOnesAI) + +#endif diff --git a/src/server/scripts/Shadowlands/shadowlands_script_loader.cpp b/src/server/scripts/Shadowlands/shadowlands_script_loader.cpp index a21eae2a9f4..6fd260d7d7c 100644 --- a/src/server/scripts/Shadowlands/shadowlands_script_loader.cpp +++ b/src/server/scripts/Shadowlands/shadowlands_script_loader.cpp @@ -22,6 +22,9 @@ void AddSC_torghast_spell_scripts(); void AddSC_boss_sylvanas_windrunner(); void AddSC_instance_sanctum_of_domination(); +void AddSC_boss_anduin_wrynn(); +void AddSC_instance_sepulcher_of_the_first_ones(); + // The name of this function should match: // void Add${NameOfDirectory}Scripts() void AddShadowlandsScripts() @@ -32,4 +35,8 @@ void AddShadowlandsScripts() // Sanctum of Domination AddSC_boss_sylvanas_windrunner(); AddSC_instance_sanctum_of_domination(); + + // Sepulcher of The First Ones + AddSC_boss_anduin_wrynn(); + AddSC_instance_sepulcher_of_the_first_ones(); } |
