diff options
756 files changed, 11899 insertions, 6399 deletions
diff --git a/README b/README deleted file mode 100644 index 294f3149451..00000000000 --- a/README +++ /dev/null @@ -1,80 +0,0 @@ -= TrinityCore -- General information = - -Copyright (C) TrinityCore (http://www.trinitycore.org) - - Trinity Core is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - In addition, as a special exception, the Trinity Core project - gives permission to link the code of its release of Trinity Core with - the OpenSSL project's "OpenSSL" library (or with modified versions of - it that use the same license as the "OpenSSL" library), and distribute - the linked executables. You must obey the GNU General Public License - in all respects for all of the code used other than "OpenSSL". If you - modify this file, you may extend this exception to your version of the - file, but you are not obligated to do so. If you do not wish to do - so, delete this exception statement from your version. - -TrinityCore is a MMORPG Framework based mostly on C++. It is completely -open source, and is community supported. It is derived -from MaNGOS, the Massive Network Game Object Server, and is based on the -code of that project with extensive changes over time to optimize, improve -and cleanup the codebase at the same time as improving the ingame mechanics -and functionality. If you wish to contribute ideas or code please visit -our site linked below or make pull requests to our github repo at -https://github.com/TrinityCore/TrinityCore - -For further information on the TrinityCore project, please visit our -project website at http://www.TrinityCore.org - -Documentation including installation instructions can be found inside -the doc directory. - -SQL files to create the databases can be found in the sql/create and -sql/base directories. -You need to run sql/create/create_mysql.sql 1st and then -sql/base/auth_database.sql and sql/base/characters_database.sql -You need to download world database from http://www.trinitycore.org/f/files/ -be sure you get the higher numbered database. -When installing a core the 1st time you need to import also all the files at -sql/updates/world directory. -sql/updates/auth and sql/updates/characters databases only needs to be run -when updating one existing server. -To save time importing multiple files, you can use copy *.sql world_updates.sql -under Windows or cat *.sql > world_updates under Linux. - -You need to update your core (recompile and overwrite binaries) when updating -your database, usually you can't use one older core with a newer database or a -newer core with an older database. -When updating your core you also need to import the files at sql/updates/auth -and sql/updates/characters along with the sql/updates/world files. -You can't merge all the sql files on sql/updates into a single file, because -they belong to 3 different databases and they don't use database name. - -TrinityCore Requirements -Platform: Linux, Windows or Mac -Processor with SSE2 support -ACE ≥ 5.8.3 -MySQL ≥ 5.1.0 -CMake ≥ 2.8.0 -OpenSSL ≥ 0.9.8o -GCC ≥ 4.3 (Linux only) -MS Visual Studio ≥ 9 (2008) (Windows only) -A bit of brain, wiki can become outdated with the release of new TDB versions -if wiki refers to TDB 50 and you see TDB 52 get the higher number. -Some reading skills, search forum, read http://www.trinitycore.org/f/topic/1518- -and http://www.trinitycore.org/f/topic/37- before posting a bug report or ask for -help on forum. -Search for existing bug reports before posting your own bug reports; don't post multiple -bugs on a single ticket. diff --git a/README.md b/README.md new file mode 100644 index 00000000000..0bb14f928e1 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +#  TrinityCore + + +## Introduction + +TrinityCore is a *MMORPG* Framework based mostly in C++. + +It is derived from *MaNGOS*, the *Massive Network Game Object Server*, and is +based on the code of that project with extensive changes over time to optimize, +improve and cleanup the codebase at the same time as improving the in-game +mechanics and functionality. + +It is completely open source; community involvement is highly encouraged. + +If you wish to contribute ideas or code please visit our site linked below or +make pull requests to our [Github repository](https://github.com/TrinityCore/TrinityCore). + +For further information on the TrinityCore project, please visit our project +website at [TrinityCore.org](http://www.trinitycore.org). + + +## Requirements + ++ Platform: Linux, Windows or Mac ++ Processor with SSE2 support ++ ACE ≥ 5.8.3 (included for Windows) ++ MySQL ≥ 5.1.0 (included for Windows) ++ CMake ≥ 2.8.0 ++ OpenSSL ≥ 0.9.8o ++ GCC ≥ 4.3 (Linux only) ++ MS Visual Studio ≥ 9 (2008) (Windows only) + + +## Install + +Detailed installation guides are available in the wiki for +[Windows](http://collab.kpsn.org/display/tc/How-to_Win), +[Linux](http://collab.kpsn.org/display/tc/How-to_Linux) and +[Mac OSX](http://collab.kpsn.org/display/tc/How-to_Mac). + + +## Reporting issues + +Issues can be reported via the [Github issue tracker](https://github.com/TrinityCore/TrinityCore/issues?labels=Branch-3.3.5a). + +Please take the time to review existing issues before submitting your own to +prevent duplicates. + +In addition, thoroughly read through the [issue tracker guide](http://www.trinitycore.org/f/topic/37-the-trinitycore-issuetracker-and-you/) to ensure +your report contains the required information. Incorrect or poorly formed +reports are wasteful and are subject to deletion. + + +## Submitting fixes + +Fixes are submitted as pull requests via Github. For more information on how to +properly submit a pull request, read the [how-to: maintain a remote fork](http://www.trinitycore.org/f/topic/6037-howto-maintain-a-remote-fork-for-pull-requests-tortoisegit/). + + +## Copyright + +License: GPL 2.0 + +Read file [COPYING](COPYING) + + +## Authors & Contributors + +Read file [THANKS](THANKS) + + +## Links + +[Site](http://www.trinitycore.org) + +[Wiki](http://trinitycore.info) + +[Documentation](http://www.trinitycore.net) (powered by Doxygen) + +[Forums](http://www.trinitycore.org/f/) diff --git a/dep/PackageList.txt b/dep/PackageList.txt index 4f52dfca906..f932591ae32 100644 --- a/dep/PackageList.txt +++ b/dep/PackageList.txt @@ -30,7 +30,7 @@ SFMT (SIMD-oriented Fast Mersenne Twister) utf8-cpp (UTF-8 with C++ in a Portable Way) http://utfcpp.sourceforge.net/ - Version: 2.3.2 + Version: 2.3.4 zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library) http://www.zlib.net/ diff --git a/dep/utf8cpp/utf8/checked.h b/dep/utf8cpp/utf8/checked.h index 3b00644444c..13311551381 100644 --- a/dep/utf8cpp/utf8/checked.h +++ b/dep/utf8cpp/utf8/checked.h @@ -109,13 +109,13 @@ namespace utf8 case internal::NOT_ENOUGH_ROOM: throw not_enough_room(); case internal::INVALID_LEAD: - utf8::append (replacement, out); + out = utf8::append (replacement, out); ++start; break; case internal::INCOMPLETE_SEQUENCE: case internal::OVERLONG_SEQUENCE: case internal::INVALID_CODE_POINT: - utf8::append (replacement, out); + out = utf8::append (replacement, out); ++start; // just one replacement mark for the sequence while (start != end && utf8::internal::is_trail(*start)) @@ -270,7 +270,7 @@ namespace utf8 octet_iterator range_start; octet_iterator range_end; public: - iterator () {}; + iterator () {} explicit iterator (const octet_iterator& octet_it, const octet_iterator& range_start, const octet_iterator& range_end) : diff --git a/dep/utf8cpp/utf8/unchecked.h b/dep/utf8cpp/utf8/unchecked.h index b4547fad945..cb2427166b1 100644 --- a/dep/utf8cpp/utf8/unchecked.h +++ b/dep/utf8cpp/utf8/unchecked.h @@ -179,7 +179,7 @@ namespace utf8 class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> { octet_iterator it; public: - iterator () {}; + iterator () {} explicit iterator (const octet_iterator& octet_it): it(octet_it) {} // the default "big three" are OK octet_iterator base () const { return it; } diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 46b6a1a2bdb..f414424cfd3 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1339,7 +1339,7 @@ CREATE TABLE `corpse` ( `posZ` float NOT NULL DEFAULT '0', `orientation` float NOT NULL DEFAULT '0', `mapId` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', - `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', + `phaseMask` int(10) unsigned NOT NULL DEFAULT '1', `displayId` int(10) unsigned NOT NULL DEFAULT '0', `itemCache` text NOT NULL, `bytes1` int(10) unsigned NOT NULL DEFAULT '0', diff --git a/sql/old/3.3.5a/TDB49_to_TDB50_updates/world/2012_12_18_00_characters_worldstates.sql b/sql/old/3.3.5a/TDB49_to_TDB50_updates/characters/2012_12_18_00_characters_worldstates.sql index 98fabde6776..98fabde6776 100644 --- a/sql/old/3.3.5a/TDB49_to_TDB50_updates/world/2012_12_18_00_characters_worldstates.sql +++ b/sql/old/3.3.5a/TDB49_to_TDB50_updates/characters/2012_12_18_00_characters_worldstates.sql diff --git a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_01_27_00_auth_realmlist.sql b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_01_27_00_auth_realmlist.sql index 0c3b18448e6..0c3b18448e6 100644 --- a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_01_27_00_auth_realmlist.sql +++ b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_01_27_00_auth_realmlist.sql diff --git a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_04_00_auth_misc.sql b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_04_00_auth_misc.sql index d8a508e4e7b..d8a508e4e7b 100644 --- a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_04_00_auth_misc.sql +++ b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_04_00_auth_misc.sql diff --git a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_04_01_auth_account.sql b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_04_01_auth_account.sql index 9af73d41ee3..9af73d41ee3 100644 --- a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_04_01_auth_account.sql +++ b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_04_01_auth_account.sql diff --git a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_05_00_auth_account.sql b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_05_00_auth_account.sql index 2f32c5e3e3e..2f32c5e3e3e 100644 --- a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_05_00_auth_account.sql +++ b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_05_00_auth_account.sql diff --git a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_07_00_auth_account.sql b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_07_00_auth_account.sql index 03bdf8cdcd5..03bdf8cdcd5 100644 --- a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_07_00_auth_account.sql +++ b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_07_00_auth_account.sql diff --git a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_08_00_auth_account.sql b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_08_00_auth_account.sql index 49948781444..49948781444 100644 --- a/sql/old/3.3.5a/TDB50_to_TDB51_updates/world/2013_02_08_00_auth_account.sql +++ b/sql/old/3.3.5a/TDB50_to_TDB51_updates/auth/2013_02_08_00_auth_account.sql diff --git a/sql/updates/auth/2013_02_25_00_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_00_auth_misc.sql index 8769060ba9d..8769060ba9d 100644 --- a/sql/updates/auth/2013_02_25_00_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_00_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_01_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_01_auth_misc.sql index f5cb6c01d19..f5cb6c01d19 100644 --- a/sql/updates/auth/2013_02_25_01_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_01_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_02_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_02_auth_misc.sql index 11e235c91d9..11e235c91d9 100644 --- a/sql/updates/auth/2013_02_25_02_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_02_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_03_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_03_auth_misc.sql index 5f290ebf0cd..5f290ebf0cd 100644 --- a/sql/updates/auth/2013_02_25_03_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_03_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_04_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_04_auth_misc.sql index bf42990a1bd..bf42990a1bd 100644 --- a/sql/updates/auth/2013_02_25_04_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_04_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_05_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_05_auth_misc.sql index e3ee3f00572..e3ee3f00572 100644 --- a/sql/updates/auth/2013_02_25_05_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_05_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_06_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_06_auth_misc.sql index 92eae3d782d..92eae3d782d 100644 --- a/sql/updates/auth/2013_02_25_06_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_06_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_07_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_07_auth_misc.sql index 4c6dadf4eaa..4c6dadf4eaa 100644 --- a/sql/updates/auth/2013_02_25_07_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_07_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_08_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_08_auth_misc.sql index 244b1848d0c..244b1848d0c 100644 --- a/sql/updates/auth/2013_02_25_08_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_08_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_09_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_09_auth_misc.sql index 6297bf7427a..6297bf7427a 100644 --- a/sql/updates/auth/2013_02_25_09_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_09_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_10_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_10_auth_misc.sql index ccca7c74f06..ccca7c74f06 100644 --- a/sql/updates/auth/2013_02_25_10_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_10_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_11_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_11_auth_misc.sql index b5f9767ca7b..b5f9767ca7b 100644 --- a/sql/updates/auth/2013_02_25_11_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_11_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_12_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_12_auth_misc.sql index 30e203ea4b3..30e203ea4b3 100644 --- a/sql/updates/auth/2013_02_25_12_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_12_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_13_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_13_auth_misc.sql index 9a7806ede68..9a7806ede68 100644 --- a/sql/updates/auth/2013_02_25_13_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_13_auth_misc.sql diff --git a/sql/updates/auth/2013_02_25_14_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_14_auth_misc.sql index 59189304342..59189304342 100644 --- a/sql/updates/auth/2013_02_25_14_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_02_25_14_auth_misc.sql diff --git a/sql/updates/auth/2013_03_08_00_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_03_08_00_auth_misc.sql index 46e687b5da5..46e687b5da5 100644 --- a/sql/updates/auth/2013_03_08_00_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_03_08_00_auth_misc.sql diff --git a/sql/updates/auth/2013_03_11_00_auth_rbac_security_level_groups.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_03_11_00_auth_rbac_security_level_groups.sql index 533d3f7a196..533d3f7a196 100644 --- a/sql/updates/auth/2013_03_11_00_auth_rbac_security_level_groups.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_03_11_00_auth_rbac_security_level_groups.sql diff --git a/sql/updates/auth/2013_04_22_00_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_04_22_00_auth_misc.sql index 508c0aab944..508c0aab944 100644 --- a/sql/updates/auth/2013_04_22_00_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_04_22_00_auth_misc.sql diff --git a/sql/updates/auth/2013_04_27_00_auth_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_04_27_00_auth_misc.sql index 383b19ebd55..383b19ebd55 100644 --- a/sql/updates/auth/2013_04_27_00_auth_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_04_27_00_auth_misc.sql diff --git a/sql/updates/auth/2013_05_26_00_auth_rbac.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_05_26_00_auth_rbac.sql index aa05c842932..aa05c842932 100644 --- a/sql/updates/auth/2013_05_26_00_auth_rbac.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_05_26_00_auth_rbac.sql diff --git a/sql/updates/auth/2013_06_02_00_auth_autobroadcast.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_06_02_00_auth_autobroadcast.sql index 2e689ffd64d..2e689ffd64d 100644 --- a/sql/updates/auth/2013_06_02_00_auth_autobroadcast.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/auth/2013_06_02_00_auth_autobroadcast.sql diff --git a/sql/updates/characters/2013_03_04_00_characters_character_queststatus_rewarded.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/characters/2013_03_04_00_characters_character_queststatus_rewarded.sql index e4dbf73ad7a..e4dbf73ad7a 100644 --- a/sql/updates/characters/2013_03_04_00_characters_character_queststatus_rewarded.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/characters/2013_03_04_00_characters_character_queststatus_rewarded.sql diff --git a/sql/updates/characters/2013_04_05_00_characters_banned_addons.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/characters/2013_04_05_00_characters_banned_addons.sql index 4f286b2326c..4f286b2326c 100644 --- a/sql/updates/characters/2013_04_05_00_characters_banned_addons.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/characters/2013_04_05_00_characters_banned_addons.sql diff --git a/sql/updates/characters/2013_06_23_00_characters_game_event.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/characters/2013_06_23_00_characters_game_event.sql index d8a58832ce1..d8a58832ce1 100644 --- a/sql/updates/characters/2013_06_23_00_characters_game_event.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/characters/2013_06_23_00_characters_game_event.sql diff --git a/sql/updates/world/2013_02_14_00_world_version.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_14_00_world_version.sql index b3186b9c4e6..b3186b9c4e6 100644 --- a/sql/updates/world/2013_02_14_00_world_version.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_14_00_world_version.sql diff --git a/sql/updates/world/2013_02_15_00_world_waypoint_data.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_15_00_world_waypoint_data.sql index 8af0531b2f3..8af0531b2f3 100644 --- a/sql/updates/world/2013_02_15_00_world_waypoint_data.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_15_00_world_waypoint_data.sql diff --git a/sql/updates/world/2013_02_16_00_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_00_world_creature_template.sql index d8efe46b573..d8efe46b573 100644 --- a/sql/updates/world/2013_02_16_00_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_00_world_creature_template.sql diff --git a/sql/updates/world/2013_02_16_01_world_spell_target_position.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_01_world_spell_target_position.sql index c262ecf450f..c262ecf450f 100644 --- a/sql/updates/world/2013_02_16_01_world_spell_target_position.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_01_world_spell_target_position.sql diff --git a/sql/updates/world/2013_02_16_02_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_02_world_creature_text.sql index d7250b0b49c..d7250b0b49c 100644 --- a/sql/updates/world/2013_02_16_02_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_02_world_creature_text.sql diff --git a/sql/updates/world/2013_02_16_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_03_world_sai.sql index fb89bf4ced0..fb89bf4ced0 100644 --- a/sql/updates/world/2013_02_16_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_03_world_sai.sql diff --git a/sql/updates/world/2013_02_16_04_world_creature_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_04_world_creature_loot_template.sql index 6819b7aeb45..6819b7aeb45 100644 --- a/sql/updates/world/2013_02_16_04_world_creature_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_04_world_creature_loot_template.sql diff --git a/sql/updates/world/2013_02_16_05_world_quest_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_05_world_quest_template.sql index 81a8e38f25d..81a8e38f25d 100644 --- a/sql/updates/world/2013_02_16_05_world_quest_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_16_05_world_quest_template.sql diff --git a/sql/updates/world/2013_02_17_00_world_spell_script_names.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_17_00_world_spell_script_names.sql index e47b22b1c6b..e47b22b1c6b 100644 --- a/sql/updates/world/2013_02_17_00_world_spell_script_names.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_17_00_world_spell_script_names.sql diff --git a/sql/updates/world/2013_02_18_00_world_misc_equip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_00_world_misc_equip.sql index d591481fc76..d591481fc76 100644 --- a/sql/updates/world/2013_02_18_00_world_misc_equip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_00_world_misc_equip.sql diff --git a/sql/updates/world/2013_02_18_01_world_trinity_string.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_01_world_trinity_string.sql index 84d28222fe7..84d28222fe7 100644 --- a/sql/updates/world/2013_02_18_01_world_trinity_string.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_01_world_trinity_string.sql diff --git a/sql/updates/world/2013_02_18_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_02_world_misc.sql index 8ca97fe3130..8ca97fe3130 100644 --- a/sql/updates/world/2013_02_18_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_02_world_misc.sql diff --git a/sql/updates/world/2013_02_18_03_world_spell_area.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_03_world_spell_area.sql index 28752bdaea7..28752bdaea7 100644 --- a/sql/updates/world/2013_02_18_03_world_spell_area.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_18_03_world_spell_area.sql diff --git a/sql/updates/world/2013_02_19_00_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_00_world_creature_template.sql index eb1344c8d4b..eb1344c8d4b 100644 --- a/sql/updates/world/2013_02_19_00_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_00_world_creature_template.sql diff --git a/sql/updates/world/2013_02_19_01_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_01_world_creature_template.sql index ba7c6bf132a..ba7c6bf132a 100644 --- a/sql/updates/world/2013_02_19_01_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_01_world_creature_template.sql diff --git a/sql/updates/world/2013_02_19_02_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_02_world_conditions.sql index 87c964937ef..87c964937ef 100644 --- a/sql/updates/world/2013_02_19_02_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_02_world_conditions.sql diff --git a/sql/updates/world/2013_02_19_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_03_world_sai.sql index ad2c9beeab1..ad2c9beeab1 100644 --- a/sql/updates/world/2013_02_19_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_03_world_sai.sql diff --git a/sql/updates/world/2013_02_19_04_world_misc_equip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_04_world_misc_equip.sql index dacf5515439..dacf5515439 100644 --- a/sql/updates/world/2013_02_19_04_world_misc_equip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_19_04_world_misc_equip.sql diff --git a/sql/updates/world/2013_02_23_00_world_gameobject.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_23_00_world_gameobject.sql index 48694505704..48694505704 100644 --- a/sql/updates/world/2013_02_23_00_world_gameobject.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_23_00_world_gameobject.sql diff --git a/sql/updates/world/2013_02_23_01_world_areatrigger_teleport.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_23_01_world_areatrigger_teleport.sql index 3b34e18a682..3b34e18a682 100644 --- a/sql/updates/world/2013_02_23_01_world_areatrigger_teleport.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_23_01_world_areatrigger_teleport.sql diff --git a/sql/updates/world/2013_02_24_00_world_creature_summon_groups.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_00_world_creature_summon_groups.sql index 409f79bb2aa..409f79bb2aa 100644 --- a/sql/updates/world/2013_02_24_00_world_creature_summon_groups.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_00_world_creature_summon_groups.sql diff --git a/sql/updates/world/2013_02_24_01_world_areatrigger_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_01_world_areatrigger_scripts.sql index 2aebe1d2edd..2aebe1d2edd 100644 --- a/sql/updates/world/2013_02_24_01_world_areatrigger_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_01_world_areatrigger_scripts.sql diff --git a/sql/updates/world/2013_02_24_02_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_02_world_smart_scripts.sql index 7b41c82b6fa..7b41c82b6fa 100644 --- a/sql/updates/world/2013_02_24_02_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_02_world_smart_scripts.sql diff --git a/sql/updates/world/2013_02_24_03_world_waypoint_data.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_03_world_waypoint_data.sql index e97f0758304..e97f0758304 100644 --- a/sql/updates/world/2013_02_24_03_world_waypoint_data.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_03_world_waypoint_data.sql diff --git a/sql/updates/world/2013_02_24_04_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_04_world_creature_template.sql index c9acc0d2a1a..c9acc0d2a1a 100644 --- a/sql/updates/world/2013_02_24_04_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_04_world_creature_template.sql diff --git a/sql/updates/world/2013_02_24_05_world_command.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_05_world_command.sql index 0b153be15bc..0b153be15bc 100644 --- a/sql/updates/world/2013_02_24_05_world_command.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_24_05_world_command.sql diff --git a/sql/updates/world/2013_02_25_00_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_25_00_world_smart_scripts.sql index b1576d4189e..b1576d4189e 100644 --- a/sql/updates/world/2013_02_25_00_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_25_00_world_smart_scripts.sql diff --git a/sql/updates/world/2013_02_25_01_world_creature_ai_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_25_01_world_creature_ai_scripts.sql index e095414552c..e095414552c 100644 --- a/sql/updates/world/2013_02_25_01_world_creature_ai_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_25_01_world_creature_ai_scripts.sql diff --git a/sql/updates/world/2013_02_25_02_world_areatrigger_teleport.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_25_02_world_areatrigger_teleport.sql index aa74fd46810..aa74fd46810 100644 --- a/sql/updates/world/2013_02_25_02_world_areatrigger_teleport.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_25_02_world_areatrigger_teleport.sql diff --git a/sql/updates/world/2013_02_27_00_world_command.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_27_00_world_command.sql index a83e7ec3c04..a83e7ec3c04 100644 --- a/sql/updates/world/2013_02_27_00_world_command.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_27_00_world_command.sql diff --git a/sql/updates/world/2013_02_28_00_world_eye_of_eternity.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_28_00_world_eye_of_eternity.sql index 9aef8f358d2..9aef8f358d2 100644 --- a/sql/updates/world/2013_02_28_00_world_eye_of_eternity.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_28_00_world_eye_of_eternity.sql diff --git a/sql/updates/world/2013_02_28_00_world_playercreateinfo_spell.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_28_00_world_playercreateinfo_spell.sql index 9f0ce0d8533..9f0ce0d8533 100644 --- a/sql/updates/world/2013_02_28_00_world_playercreateinfo_spell.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_02_28_00_world_playercreateinfo_spell.sql diff --git a/sql/updates/world/2013_03_01_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_01_00_world_misc.sql index d7d2d391f0b..d7d2d391f0b 100644 --- a/sql/updates/world/2013_03_01_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_01_00_world_misc.sql diff --git a/sql/updates/world/2013_03_01_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_01_02_world_misc.sql index eb54e0453dd..eb54e0453dd 100644 --- a/sql/updates/world/2013_03_01_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_01_02_world_misc.sql diff --git a/sql/updates/world/2013_03_02_00_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_02_00_world_conditions.sql index 074add78476..074add78476 100644 --- a/sql/updates/world/2013_03_02_00_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_02_00_world_conditions.sql diff --git a/sql/updates/world/2013_03_03_00_world_eye_of_eternity.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_03_00_world_eye_of_eternity.sql index e41f2723e5f..e41f2723e5f 100644 --- a/sql/updates/world/2013_03_03_00_world_eye_of_eternity.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_03_00_world_eye_of_eternity.sql diff --git a/sql/updates/world/2013_03_03_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_03_01_world_misc.sql index a81da8352e3..a81da8352e3 100644 --- a/sql/updates/world/2013_03_03_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_03_01_world_misc.sql diff --git a/sql/updates/world/2013_03_03_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_03_02_world_sai.sql index ad1ebfd64f2..ad1ebfd64f2 100644 --- a/sql/updates/world/2013_03_03_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_03_02_world_sai.sql diff --git a/sql/updates/world/2013_03_04_01_world_waypoint_data.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_01_world_waypoint_data.sql index 3a2001e7e36..3a2001e7e36 100644 --- a/sql/updates/world/2013_03_04_01_world_waypoint_data.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_01_world_waypoint_data.sql diff --git a/sql/updates/world/2013_03_04_02_world_quest_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_02_world_quest_template.sql index 82f01a39a85..82f01a39a85 100644 --- a/sql/updates/world/2013_03_04_02_world_quest_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_02_world_quest_template.sql diff --git a/sql/updates/world/2013_03_04_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_03_world_sai.sql index 6cb234cc805..6cb234cc805 100644 --- a/sql/updates/world/2013_03_04_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_03_world_sai.sql diff --git a/sql/updates/world/2013_03_04_04_world_player_factionchange_quests.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_04_world_player_factionchange_quests.sql index 163383cf0a5..163383cf0a5 100644 --- a/sql/updates/world/2013_03_04_04_world_player_factionchange_quests.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_04_world_player_factionchange_quests.sql diff --git a/sql/updates/world/2013_03_04_05_world_player_factionchange_quests.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_05_world_player_factionchange_quests.sql index cd08b4cbcc9..cd08b4cbcc9 100644 --- a/sql/updates/world/2013_03_04_05_world_player_factionchange_quests.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_04_05_world_player_factionchange_quests.sql diff --git a/sql/updates/world/2013_03_06_00_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_06_00_world_conditions.sql index b7faaa379e6..b7faaa379e6 100644 --- a/sql/updates/world/2013_03_06_00_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_06_00_world_conditions.sql diff --git a/sql/updates/world/2013_03_07_00_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_07_00_world_conditions.sql index 31b9d1a1d25..31b9d1a1d25 100644 --- a/sql/updates/world/2013_03_07_00_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_07_00_world_conditions.sql diff --git a/sql/updates/world/2013_03_07_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_07_01_world_misc.sql index af284fda6a3..af284fda6a3 100644 --- a/sql/updates/world/2013_03_07_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_07_01_world_misc.sql diff --git a/sql/updates/world/2013_03_08_00_world_borrowed_technology.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_08_00_world_borrowed_technology.sql index 06363183836..06363183836 100644 --- a/sql/updates/world/2013_03_08_00_world_borrowed_technology.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_08_00_world_borrowed_technology.sql diff --git a/sql/updates/world/2013_03_09_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_00_world_misc.sql index 61e4378a038..61e4378a038 100644 --- a/sql/updates/world/2013_03_09_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_00_world_misc.sql diff --git a/sql/updates/world/2013_03_09_01_world_gameobject_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_01_world_gameobject_template.sql index 229ad5f49a5..229ad5f49a5 100644 --- a/sql/updates/world/2013_03_09_01_world_gameobject_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_01_world_gameobject_template.sql diff --git a/sql/updates/world/2013_03_09_02_world_command_deserter.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_02_world_command_deserter.sql index 62b60e973c7..62b60e973c7 100644 --- a/sql/updates/world/2013_03_09_02_world_command_deserter.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_02_world_command_deserter.sql diff --git a/sql/updates/world/2013_03_09_03_world_trinity_string.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_03_world_trinity_string.sql index 3e93289711a..3e93289711a 100644 --- a/sql/updates/world/2013_03_09_03_world_trinity_string.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_03_world_trinity_string.sql diff --git a/sql/updates/world/2013_03_09_04_world_trinity_string.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_04_world_trinity_string.sql index dea2a044c99..dea2a044c99 100644 --- a/sql/updates/world/2013_03_09_04_world_trinity_string.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_04_world_trinity_string.sql diff --git a/sql/updates/world/2013_03_09_05_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_05_world_misc.sql index 0384f435c16..0384f435c16 100644 --- a/sql/updates/world/2013_03_09_05_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_09_05_world_misc.sql diff --git a/sql/updates/world/2013_03_10_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_10_00_world_misc.sql index cd8b7215e39..cd8b7215e39 100644 --- a/sql/updates/world/2013_03_10_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_10_00_world_misc.sql diff --git a/sql/updates/world/2013_03_11_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_11_00_world_misc.sql index 58b38397b9f..58b38397b9f 100644 --- a/sql/updates/world/2013_03_11_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_11_00_world_misc.sql diff --git a/sql/updates/world/2013_03_11_01_world_playercreateinfo_spell.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_11_01_world_playercreateinfo_spell.sql index 3a8f0501916..3a8f0501916 100644 --- a/sql/updates/world/2013_03_11_01_world_playercreateinfo_spell.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_11_01_world_playercreateinfo_spell.sql diff --git a/sql/updates/world/2013_03_12_00_world_playercreateinfo_spell_custom.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_12_00_world_playercreateinfo_spell_custom.sql index 76f7a43eaa0..76f7a43eaa0 100644 --- a/sql/updates/world/2013_03_12_00_world_playercreateinfo_spell_custom.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_12_00_world_playercreateinfo_spell_custom.sql diff --git a/sql/updates/world/2013_03_13_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_00_world_misc.sql index f579a82f5d5..f579a82f5d5 100644 --- a/sql/updates/world/2013_03_13_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_00_world_misc.sql diff --git a/sql/updates/world/2013_03_13_01_world_creature_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_01_world_creature_loot_template.sql index ce1fbd0cec4..ce1fbd0cec4 100644 --- a/sql/updates/world/2013_03_13_01_world_creature_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_01_world_creature_loot_template.sql diff --git a/sql/updates/world/2013_03_13_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_02_world_sai.sql index 70709b0ffcd..70709b0ffcd 100644 --- a/sql/updates/world/2013_03_13_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_02_world_sai.sql diff --git a/sql/updates/world/2013_03_13_03_world_playercreateinfo_spell.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_03_world_playercreateinfo_spell.sql index 0212fef5cd1..0212fef5cd1 100644 --- a/sql/updates/world/2013_03_13_03_world_playercreateinfo_spell.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_13_03_world_playercreateinfo_spell.sql diff --git a/sql/updates/world/2013_03_15_00_world_playercreateinfo_spell.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_15_00_world_playercreateinfo_spell.sql index b8d9b13bc52..b8d9b13bc52 100644 --- a/sql/updates/world/2013_03_15_00_world_playercreateinfo_spell.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_15_00_world_playercreateinfo_spell.sql diff --git a/sql/updates/world/2013_03_15_01_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_15_01_world_smart_scripts.sql index 63561342f3c..63561342f3c 100644 --- a/sql/updates/world/2013_03_15_01_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_15_01_world_smart_scripts.sql diff --git a/sql/updates/world/2013_03_15_02_world_trinity_strings.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_15_02_world_trinity_strings.sql index b81c22711c4..b81c22711c4 100644 --- a/sql/updates/world/2013_03_15_02_world_trinity_strings.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_15_02_world_trinity_strings.sql diff --git a/sql/updates/world/2013_03_16_00_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_16_00_world_conditions.sql index 0a8f347ac35..0a8f347ac35 100644 --- a/sql/updates/world/2013_03_16_00_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_16_00_world_conditions.sql diff --git a/sql/updates/world/2013_03_17_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_00_world_misc.sql index f2f05eb6671..f2f05eb6671 100644 --- a/sql/updates/world/2013_03_17_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_00_world_misc.sql diff --git a/sql/updates/world/2013_03_17_01_world_creature_template_addon.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_01_world_creature_template_addon.sql index 3942ee46d34..3942ee46d34 100644 --- a/sql/updates/world/2013_03_17_01_world_creature_template_addon.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_01_world_creature_template_addon.sql diff --git a/sql/updates/world/2013_03_17_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_02_world_sai.sql index f75d4455a45..f75d4455a45 100644 --- a/sql/updates/world/2013_03_17_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_02_world_sai.sql diff --git a/sql/updates/world/2013_03_17_03_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_03_world_misc.sql index 17468c626d3..17468c626d3 100644 --- a/sql/updates/world/2013_03_17_03_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_17_03_world_misc.sql diff --git a/sql/updates/world/2013_03_20_00_world_guardians_of_the_altar.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_20_00_world_guardians_of_the_altar.sql index ce15a034185..ce15a034185 100644 --- a/sql/updates/world/2013_03_20_00_world_guardians_of_the_altar.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_20_00_world_guardians_of_the_altar.sql diff --git a/sql/updates/world/2013_03_23_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_00_world_sai.sql index 75a960af2f8..75a960af2f8 100644 --- a/sql/updates/world/2013_03_23_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_00_world_sai.sql diff --git a/sql/updates/world/2013_03_23_01_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_01_world_creature_text.sql index d2b84cb0ef1..d2b84cb0ef1 100644 --- a/sql/updates/world/2013_03_23_01_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_01_world_creature_text.sql diff --git a/sql/updates/world/2013_03_23_02_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_02_world_creature.sql index 874068599f0..874068599f0 100644 --- a/sql/updates/world/2013_03_23_02_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_02_world_creature.sql diff --git a/sql/updates/world/2013_03_23_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_03_world_sai.sql index e70dd7166ae..e70dd7166ae 100644 --- a/sql/updates/world/2013_03_23_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_03_world_sai.sql diff --git a/sql/updates/world/2013_03_23_04_world_waypoint_data.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_04_world_waypoint_data.sql index b2467c93c2a..b2467c93c2a 100644 --- a/sql/updates/world/2013_03_23_04_world_waypoint_data.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_23_04_world_waypoint_data.sql diff --git a/sql/updates/world/2013_03_24_00_world_spell_target_position.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_24_00_world_spell_target_position.sql index d71a96708e7..d71a96708e7 100644 --- a/sql/updates/world/2013_03_24_00_world_spell_target_position.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_24_00_world_spell_target_position.sql diff --git a/sql/updates/world/2013_03_24_01_world_creature_ai_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_24_01_world_creature_ai_scripts.sql index 9e49ff5f51d..9e49ff5f51d 100644 --- a/sql/updates/world/2013_03_24_01_world_creature_ai_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_24_01_world_creature_ai_scripts.sql diff --git a/sql/updates/world/2013_03_24_02_world_quest_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_24_02_world_quest_template.sql index 7d0950d0cbd..7d0950d0cbd 100644 --- a/sql/updates/world/2013_03_24_02_world_quest_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_24_02_world_quest_template.sql diff --git a/sql/updates/world/2013_03_26_00_world_a_heros_headgear.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_26_00_world_a_heros_headgear.sql index 9a0ccd58fb2..9a0ccd58fb2 100644 --- a/sql/updates/world/2013_03_26_00_world_a_heros_headgear.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_26_00_world_a_heros_headgear.sql diff --git a/sql/updates/world/2013_03_27_00_world_spell_target_position.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_27_00_world_spell_target_position.sql index 4991fb35aa8..4991fb35aa8 100644 --- a/sql/updates/world/2013_03_27_00_world_spell_target_position.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_27_00_world_spell_target_position.sql diff --git a/sql/updates/world/2013_03_28_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_28_00_world_misc.sql index 78e420872ba..78e420872ba 100644 --- a/sql/updates/world/2013_03_28_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_28_00_world_misc.sql diff --git a/sql/updates/world/2013_03_29_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_29_00_world_misc.sql index 1a7e88b3d59..1a7e88b3d59 100644 --- a/sql/updates/world/2013_03_29_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_29_00_world_misc.sql diff --git a/sql/updates/world/2013_03_29_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_29_01_world_misc.sql index bf59a7196c7..bf59a7196c7 100644 --- a/sql/updates/world/2013_03_29_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_29_01_world_misc.sql diff --git a/sql/updates/world/2013_03_29_02_world_waypoint_data.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_29_02_world_waypoint_data.sql index edee2e67b48..edee2e67b48 100644 --- a/sql/updates/world/2013_03_29_02_world_waypoint_data.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_03_29_02_world_waypoint_data.sql diff --git a/sql/updates/world/2013_04_01_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_01_00_world_misc.sql index 39b5d231c0f..39b5d231c0f 100644 --- a/sql/updates/world/2013_04_01_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_01_00_world_misc.sql diff --git a/sql/updates/world/2013_04_02_00_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_02_00_world_smart_scripts.sql index 1687df8ff2d..1687df8ff2d 100644 --- a/sql/updates/world/2013_04_02_00_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_02_00_world_smart_scripts.sql diff --git a/sql/updates/world/2013_04_02_01_world_gameobject.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_02_01_world_gameobject.sql index 120dd66eb0d..120dd66eb0d 100644 --- a/sql/updates/world/2013_04_02_01_world_gameobject.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_02_01_world_gameobject.sql diff --git a/sql/updates/world/2013_04_02_02_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_02_02_world_creature.sql index 194eee288d2..194eee288d2 100644 --- a/sql/updates/world/2013_04_02_02_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_02_02_world_creature.sql diff --git a/sql/updates/world/2013_04_03_00_world_command.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_03_00_world_command.sql index 3ce73686db3..3ce73686db3 100644 --- a/sql/updates/world/2013_04_03_00_world_command.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_03_00_world_command.sql diff --git a/sql/updates/world/2013_04_03_01_world_trinity_string.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_03_01_world_trinity_string.sql index b370664e4cf..b370664e4cf 100644 --- a/sql/updates/world/2013_04_03_01_world_trinity_string.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_03_01_world_trinity_string.sql diff --git a/sql/updates/world/2013_04_03_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_03_02_world_sai.sql index 83c968a2788..83c968a2788 100644 --- a/sql/updates/world/2013_04_03_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_03_02_world_sai.sql diff --git a/sql/updates/world/2013_04_05_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_05_00_world_sai.sql index 4e304843d4f..4e304843d4f 100644 --- a/sql/updates/world/2013_04_05_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_05_00_world_sai.sql diff --git a/sql/updates/world/2013_04_05_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_05_01_world_misc.sql index 816a4f5c0fa..816a4f5c0fa 100644 --- a/sql/updates/world/2013_04_05_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_05_01_world_misc.sql diff --git a/sql/updates/world/2013_04_05_02_world_creature_ai_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_05_02_world_creature_ai_scripts.sql index 311ae1781f8..311ae1781f8 100644 --- a/sql/updates/world/2013_04_05_02_world_creature_ai_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_05_02_world_creature_ai_scripts.sql diff --git a/sql/updates/world/2013_04_06_00_world_quest_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_00_world_quest_template.sql index ebd4ad2ffcc..ebd4ad2ffcc 100644 --- a/sql/updates/world/2013_04_06_00_world_quest_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_00_world_quest_template.sql diff --git a/sql/updates/world/2013_04_06_01_world_npc_trainer.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_01_world_npc_trainer.sql index b975f29d8c8..b975f29d8c8 100644 --- a/sql/updates/world/2013_04_06_01_world_npc_trainer.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_01_world_npc_trainer.sql diff --git a/sql/updates/world/2013_04_06_02_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_02_world_creature.sql index e2658210522..e2658210522 100644 --- a/sql/updates/world/2013_04_06_02_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_02_world_creature.sql diff --git a/sql/updates/world/2013_04_06_03_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_03_world_misc.sql index 6cc441d9e5a..6cc441d9e5a 100644 --- a/sql/updates/world/2013_04_06_03_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_06_03_world_misc.sql diff --git a/sql/updates/world/2013_04_07_00_world_areatrigger_teleport.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_07_00_world_areatrigger_teleport.sql index b9669aaf9c0..b9669aaf9c0 100644 --- a/sql/updates/world/2013_04_07_00_world_areatrigger_teleport.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_07_00_world_areatrigger_teleport.sql diff --git a/sql/updates/world/2013_04_08_00_world_areatrigger_teleport.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_08_00_world_areatrigger_teleport.sql index 10e1668136c..10e1668136c 100644 --- a/sql/updates/world/2013_04_08_00_world_areatrigger_teleport.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_08_00_world_areatrigger_teleport.sql diff --git a/sql/updates/world/2013_04_11_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_00_world_misc.sql index 53e2ffcb716..53e2ffcb716 100644 --- a/sql/updates/world/2013_04_11_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_00_world_misc.sql diff --git a/sql/updates/world/2013_04_11_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_01_world_misc.sql index 699f65f1c5a..699f65f1c5a 100644 --- a/sql/updates/world/2013_04_11_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_01_world_misc.sql diff --git a/sql/updates/world/2013_04_11_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_02_world_misc.sql index be9652a13bb..be9652a13bb 100644 --- a/sql/updates/world/2013_04_11_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_02_world_misc.sql diff --git a/sql/updates/world/2013_04_11_03_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_03_world_misc.sql index 5f1e89d631d..5f1e89d631d 100644 --- a/sql/updates/world/2013_04_11_03_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_11_03_world_misc.sql diff --git a/sql/updates/world/2013_04_12_00_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_12_00_world_smart_scripts.sql index 6e7dddee60c..6e7dddee60c 100644 --- a/sql/updates/world/2013_04_12_00_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_12_00_world_smart_scripts.sql diff --git a/sql/updates/world/2013_04_13_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_00_world_misc.sql index b2c6d11d9d9..b2c6d11d9d9 100644 --- a/sql/updates/world/2013_04_13_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_00_world_misc.sql diff --git a/sql/updates/world/2013_04_13_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_01_world_misc.sql index 8b8afe05026..8b8afe05026 100644 --- a/sql/updates/world/2013_04_13_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_01_world_misc.sql diff --git a/sql/updates/world/2013_04_13_02_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_02_world_smart_scripts.sql index 78ef1e82a00..78ef1e82a00 100644 --- a/sql/updates/world/2013_04_13_02_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_02_world_smart_scripts.sql diff --git a/sql/updates/world/2013_04_13_03_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_03_world_smart_scripts.sql index 15302e15008..15302e15008 100644 --- a/sql/updates/world/2013_04_13_03_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_13_03_world_smart_scripts.sql diff --git a/sql/updates/world/2013_04_14_00_world_game_event.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_14_00_world_game_event.sql index 82929053e8c..82929053e8c 100644 --- a/sql/updates/world/2013_04_14_00_world_game_event.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_14_00_world_game_event.sql diff --git a/sql/updates/world/2013_04_14_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_14_00_world_misc.sql index 1f239cf0d1f..1f239cf0d1f 100644 --- a/sql/updates/world/2013_04_14_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_14_00_world_misc.sql diff --git a/sql/updates/world/2013_04_16_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_16_00_world_sai.sql index c45fd63a256..c45fd63a256 100644 --- a/sql/updates/world/2013_04_16_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_16_00_world_sai.sql diff --git a/sql/updates/world/2013_04_16_01_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_16_01_world_smart_scripts.sql index 02af2caf3b3..02af2caf3b3 100644 --- a/sql/updates/world/2013_04_16_01_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_16_01_world_smart_scripts.sql diff --git a/sql/updates/world/2013_04_16_02_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_16_02_world_creature_text.sql index 034c632d12a..034c632d12a 100644 --- a/sql/updates/world/2013_04_16_02_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_16_02_world_creature_text.sql diff --git a/sql/updates/world/2013_04_19_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_19_00_world_sai.sql index 9ea635824ea..9ea635824ea 100644 --- a/sql/updates/world/2013_04_19_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_19_00_world_sai.sql diff --git a/sql/updates/world/2013_04_20_00_world_creature_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_20_00_world_creature_loot_template.sql index 70bb2735f90..70bb2735f90 100644 --- a/sql/updates/world/2013_04_20_00_world_creature_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_20_00_world_creature_loot_template.sql diff --git a/sql/updates/world/2013_04_20_01_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_20_01_world_conditions.sql index 3f4ce559256..3f4ce559256 100644 --- a/sql/updates/world/2013_04_20_01_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_20_01_world_conditions.sql diff --git a/sql/updates/world/2013_04_21_00_world_gameobject_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_00_world_gameobject_loot_template.sql index 54b91b9fd44..54b91b9fd44 100644 --- a/sql/updates/world/2013_04_21_00_world_gameobject_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_00_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2013_04_21_00_world_skinning_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_00_world_skinning_loot_template.sql index b9daf120d7a..b9daf120d7a 100644 --- a/sql/updates/world/2013_04_21_00_world_skinning_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_00_world_skinning_loot_template.sql diff --git a/sql/updates/world/2013_04_21_01_world_gameobject_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_01_world_gameobject_template.sql index 6888545c123..6888545c123 100644 --- a/sql/updates/world/2013_04_21_01_world_gameobject_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_01_world_gameobject_template.sql diff --git a/sql/updates/world/2013_04_21_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_02_world_sai.sql index 75dc64161ef..75dc64161ef 100644 --- a/sql/updates/world/2013_04_21_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_21_02_world_sai.sql diff --git a/sql/updates/world/2013_04_22_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_22_00_world_misc.sql index 99eee20ffef..99eee20ffef 100644 --- a/sql/updates/world/2013_04_22_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_22_00_world_misc.sql diff --git a/sql/updates/world/2013_04_27_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_27_00_world_misc.sql index 4c7561a0e69..4c7561a0e69 100644 --- a/sql/updates/world/2013_04_27_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_27_00_world_misc.sql diff --git a/sql/updates/world/2013_04_27_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_27_01_world_misc.sql index c07a3f76b5f..c07a3f76b5f 100644 --- a/sql/updates/world/2013_04_27_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_27_01_world_misc.sql diff --git a/sql/updates/world/2013_04_29_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_29_00_world_misc.sql index 716a77be584..716a77be584 100644 --- a/sql/updates/world/2013_04_29_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_04_29_00_world_misc.sql diff --git a/sql/updates/world/2013_05_04_00_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_04_00_world_creature_template.sql index 01037f835de..01037f835de 100644 --- a/sql/updates/world/2013_05_04_00_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_04_00_world_creature_template.sql diff --git a/sql/updates/world/2013_05_04_01_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_04_01_world_creature_template.sql index 899a912fca5..899a912fca5 100644 --- a/sql/updates/world/2013_05_04_01_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_04_01_world_creature_template.sql diff --git a/sql/updates/world/2013_05_11_00_world_spell_target_position.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_11_00_world_spell_target_position.sql index 0e6b14682ae..0e6b14682ae 100644 --- a/sql/updates/world/2013_05_11_00_world_spell_target_position.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_11_00_world_spell_target_position.sql diff --git a/sql/updates/world/2013_05_12_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_12_00_world_misc.sql index 88e79b8a409..88e79b8a409 100644 --- a/sql/updates/world/2013_05_12_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_12_00_world_misc.sql diff --git a/sql/updates/world/2013_05_13_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_13_00_world_misc.sql index af20a0f5c02..af20a0f5c02 100644 --- a/sql/updates/world/2013_05_13_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_13_00_world_misc.sql diff --git a/sql/updates/world/2013_05_13_00_world_spell_target_position.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_13_00_world_spell_target_position.sql index c4ef5521094..c4ef5521094 100644 --- a/sql/updates/world/2013_05_13_00_world_spell_target_position.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_13_00_world_spell_target_position.sql diff --git a/sql/updates/world/2013_05_14_00_world_instance_ulduar.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_14_00_world_instance_ulduar.sql index 1594a8c44a9..1594a8c44a9 100644 --- a/sql/updates/world/2013_05_14_00_world_instance_ulduar.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_14_00_world_instance_ulduar.sql diff --git a/sql/updates/world/2013_05_16_00_world_spell_target_position.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_16_00_world_spell_target_position.sql index 421fcae0d01..421fcae0d01 100644 --- a/sql/updates/world/2013_05_16_00_world_spell_target_position.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_16_00_world_spell_target_position.sql diff --git a/sql/updates/world/2013_05_20_00_world_creature_addon.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_20_00_world_creature_addon.sql index 5ba69949241..5ba69949241 100644 --- a/sql/updates/world/2013_05_20_00_world_creature_addon.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_20_00_world_creature_addon.sql diff --git a/sql/updates/world/2013_05_20_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_20_01_world_misc.sql index 55eda1e80a5..55eda1e80a5 100644 --- a/sql/updates/world/2013_05_20_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_20_01_world_misc.sql diff --git a/sql/updates/world/2013_05_20_02_world_areatrigger_teleport.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_20_02_world_areatrigger_teleport.sql index 4b6220161bd..4b6220161bd 100644 --- a/sql/updates/world/2013_05_20_02_world_areatrigger_teleport.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_20_02_world_areatrigger_teleport.sql diff --git a/sql/updates/world/2013_05_21_00_world_trinity_strings.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_21_00_world_trinity_strings.sql index a8cae5aa19c..a8cae5aa19c 100644 --- a/sql/updates/world/2013_05_21_00_world_trinity_strings.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_21_00_world_trinity_strings.sql diff --git a/sql/updates/world/2013_05_21_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_21_01_world_misc.sql index 59a7c67833c..59a7c67833c 100644 --- a/sql/updates/world/2013_05_21_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_21_01_world_misc.sql diff --git a/sql/updates/world/2013_05_22_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_00_world_sai.sql index d3dbd8185c0..d3dbd8185c0 100644 --- a/sql/updates/world/2013_05_22_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_00_world_sai.sql diff --git a/sql/updates/world/2013_05_22_01_world_gameobject.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_01_world_gameobject.sql index 2485b74969b..2485b74969b 100644 --- a/sql/updates/world/2013_05_22_01_world_gameobject.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_01_world_gameobject.sql diff --git a/sql/updates/world/2013_05_22_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_02_world_sai.sql index 705fb879151..705fb879151 100644 --- a/sql/updates/world/2013_05_22_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_02_world_sai.sql diff --git a/sql/updates/world/2013_05_22_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_03_world_sai.sql index 440739f9f82..440739f9f82 100644 --- a/sql/updates/world/2013_05_22_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_22_03_world_sai.sql diff --git a/sql/updates/world/2013_05_23_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_23_00_world_misc.sql index b6b00ce7cf3..b6b00ce7cf3 100644 --- a/sql/updates/world/2013_05_23_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_23_00_world_misc.sql diff --git a/sql/updates/world/2013_05_23_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_23_01_world_misc.sql index 143bc3410c6..143bc3410c6 100644 --- a/sql/updates/world/2013_05_23_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_23_01_world_misc.sql diff --git a/sql/updates/world/2013_05_24_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_24_00_world_misc.sql index 4506dcb1cd3..4506dcb1cd3 100644 --- a/sql/updates/world/2013_05_24_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_24_00_world_misc.sql diff --git a/sql/updates/world/2013_05_26_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_00_world_sai.sql index 14879241a25..14879241a25 100644 --- a/sql/updates/world/2013_05_26_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_00_world_sai.sql diff --git a/sql/updates/world/2013_05_26_01_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_01_world_sai.sql index 0c70f665c27..0c70f665c27 100644 --- a/sql/updates/world/2013_05_26_01_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_01_world_sai.sql diff --git a/sql/updates/world/2013_05_26_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_02_world_sai.sql index a30b6c8be43..a30b6c8be43 100644 --- a/sql/updates/world/2013_05_26_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_02_world_sai.sql diff --git a/sql/updates/world/2013_05_26_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_03_world_sai.sql index 6a3225266e7..6a3225266e7 100644 --- a/sql/updates/world/2013_05_26_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_03_world_sai.sql diff --git a/sql/updates/world/2013_05_26_04_world_waypoints.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_04_world_waypoints.sql index 58f1e50bf23..58f1e50bf23 100644 --- a/sql/updates/world/2013_05_26_04_world_waypoints.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_04_world_waypoints.sql diff --git a/sql/updates/world/2013_05_26_05_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_05_world_misc.sql index e819f7a93bc..e819f7a93bc 100644 --- a/sql/updates/world/2013_05_26_05_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_05_world_misc.sql diff --git a/sql/updates/world/2013_05_26_05_world_waypoints.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_05_world_waypoints.sql index 6596851cd33..6596851cd33 100644 --- a/sql/updates/world/2013_05_26_05_world_waypoints.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_26_05_world_waypoints.sql diff --git a/sql/updates/world/2013_05_27_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_27_00_world_sai.sql index 9c0002572c3..9c0002572c3 100644 --- a/sql/updates/world/2013_05_27_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_27_00_world_sai.sql diff --git a/sql/updates/world/2013_05_30_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_30_00_world_misc.sql index 0e81b2debaa..0e81b2debaa 100644 --- a/sql/updates/world/2013_05_30_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_30_00_world_misc.sql diff --git a/sql/updates/world/2013_05_31_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_31_00_world_misc.sql index 1bc46748f96..1bc46748f96 100644 --- a/sql/updates/world/2013_05_31_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_05_31_00_world_misc.sql diff --git a/sql/updates/world/2013_06_01_00_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_01_00_world_creature_template.sql index 1c56f1979f8..1c56f1979f8 100644 --- a/sql/updates/world/2013_06_01_00_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_01_00_world_creature_template.sql diff --git a/sql/updates/world/2013_06_01_01_world_fishing_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_01_01_world_fishing_loot_template.sql index 0a0d8f842fa..0a0d8f842fa 100644 --- a/sql/updates/world/2013_06_01_01_world_fishing_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_01_01_world_fishing_loot_template.sql diff --git a/sql/updates/world/2013_06_02_00_world_achievement_criteria_data.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_00_world_achievement_criteria_data.sql index 053ade0486d..053ade0486d 100644 --- a/sql/updates/world/2013_06_02_00_world_achievement_criteria_data.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_00_world_achievement_criteria_data.sql diff --git a/sql/updates/world/2013_06_02_01_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_01_world_conditions.sql index 4f3993bd1e0..4f3993bd1e0 100644 --- a/sql/updates/world/2013_06_02_01_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_01_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_02_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_02_world_conditions.sql index 9d1b80e7a3f..9d1b80e7a3f 100644 --- a/sql/updates/world/2013_06_02_02_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_02_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_03_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_03_world_conditions.sql index f38ce3caf3e..f38ce3caf3e 100644 --- a/sql/updates/world/2013_06_02_03_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_03_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_04_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_04_world_conditions.sql index 82ee44df19d..82ee44df19d 100644 --- a/sql/updates/world/2013_06_02_04_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_04_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_05_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_05_world_conditions.sql index fdee846a275..fdee846a275 100644 --- a/sql/updates/world/2013_06_02_05_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_05_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_06_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_06_world_conditions.sql index b2605b97d26..b2605b97d26 100644 --- a/sql/updates/world/2013_06_02_06_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_06_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_07_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_07_world_conditions.sql index 696c69ca62e..696c69ca62e 100644 --- a/sql/updates/world/2013_06_02_07_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_07_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_08_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_08_world_conditions.sql index 2fe812c1934..2fe812c1934 100644 --- a/sql/updates/world/2013_06_02_08_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_08_world_conditions.sql diff --git a/sql/updates/world/2013_06_02_09_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_09_world_conditions.sql index 647e608df87..647e608df87 100644 --- a/sql/updates/world/2013_06_02_09_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_02_09_world_conditions.sql diff --git a/sql/updates/world/2013_06_03_00_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_00_world_conditions.sql index 518479930f2..518479930f2 100644 --- a/sql/updates/world/2013_06_03_00_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_00_world_conditions.sql diff --git a/sql/updates/world/2013_06_03_00_world_trinity_string.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_00_world_trinity_string.sql index 80ad953b3b7..80ad953b3b7 100644 --- a/sql/updates/world/2013_06_03_00_world_trinity_string.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_00_world_trinity_string.sql diff --git a/sql/updates/world/2013_06_03_02_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_02_world_conditions.sql index 6b542fef131..6b542fef131 100644 --- a/sql/updates/world/2013_06_03_02_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_02_world_conditions.sql diff --git a/sql/updates/world/2013_06_03_03_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_03_world_conditions.sql index 3edbde56d5b..3edbde56d5b 100644 --- a/sql/updates/world/2013_06_03_03_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_03_world_conditions.sql diff --git a/sql/updates/world/2013_06_03_04_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_04_world_conditions.sql index f18492fc34a..f18492fc34a 100644 --- a/sql/updates/world/2013_06_03_04_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_04_world_conditions.sql diff --git a/sql/updates/world/2013_06_03_05_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_05_world_gossip.sql index 7f21d072162..7f21d072162 100644 --- a/sql/updates/world/2013_06_03_05_world_gossip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_03_05_world_gossip.sql diff --git a/sql/updates/world/2013_06_04_00_world_game_event_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_00_world_game_event_creature.sql index fb4fc759528..fb4fc759528 100644 --- a/sql/updates/world/2013_06_04_00_world_game_event_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_00_world_game_event_creature.sql diff --git a/sql/updates/world/2013_06_04_01_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_01_world_sai.sql index 7b9c1b644bd..7b9c1b644bd 100644 --- a/sql/updates/world/2013_06_04_01_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_01_world_sai.sql diff --git a/sql/updates/world/2013_06_04_02_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_02_world_conditions.sql index 1f850571a04..1f850571a04 100644 --- a/sql/updates/world/2013_06_04_02_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_02_world_conditions.sql diff --git a/sql/updates/world/2013_06_04_03_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_03_world_conditions.sql index 63d3b5ec210..63d3b5ec210 100644 --- a/sql/updates/world/2013_06_04_03_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_04_03_world_conditions.sql diff --git a/sql/updates/world/2013_06_05_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_05_00_world_sai.sql index 9dc2b4bfcf1..9dc2b4bfcf1 100644 --- a/sql/updates/world/2013_06_05_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_05_00_world_sai.sql diff --git a/sql/updates/world/2013_06_05_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_05_01_world_misc.sql index 6e11d0ce0d3..6e11d0ce0d3 100644 --- a/sql/updates/world/2013_06_05_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_05_01_world_misc.sql diff --git a/sql/updates/world/2013_06_07_00_world_creature_ai_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_07_00_world_creature_ai_scripts.sql index c6abfaf4039..c6abfaf4039 100644 --- a/sql/updates/world/2013_06_07_00_world_creature_ai_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_07_00_world_creature_ai_scripts.sql diff --git a/sql/updates/world/2013_06_08_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_08_00_world_misc.sql index 856f77111d5..856f77111d5 100644 --- a/sql/updates/world/2013_06_08_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_08_00_world_misc.sql diff --git a/sql/updates/world/2013_06_09_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_09_00_world_misc.sql index 0f81ec4de06..0f81ec4de06 100644 --- a/sql/updates/world/2013_06_09_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_09_00_world_misc.sql diff --git a/sql/updates/world/2013_06_09_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_09_01_world_misc.sql index 7408d88dc1b..7408d88dc1b 100644 --- a/sql/updates/world/2013_06_09_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_09_01_world_misc.sql diff --git a/sql/updates/world/2013_06_10_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_10_00_world_sai.sql index 0cf752e5038..0cf752e5038 100644 --- a/sql/updates/world/2013_06_10_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_10_00_world_sai.sql diff --git a/sql/updates/world/2013_06_10_01_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_10_01_world_gossip.sql index eed996b22ba..eed996b22ba 100644 --- a/sql/updates/world/2013_06_10_01_world_gossip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_10_01_world_gossip.sql diff --git a/sql/updates/world/2013_06_10_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_10_02_world_sai.sql index bc8107cbc8f..bc8107cbc8f 100644 --- a/sql/updates/world/2013_06_10_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_10_02_world_sai.sql diff --git a/sql/updates/world/2013_06_11_00_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_11_00_world_creature_template.sql index f3804796caf..f3804796caf 100644 --- a/sql/updates/world/2013_06_11_00_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_11_00_world_creature_template.sql diff --git a/sql/updates/world/2013_06_11_01_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_11_01_world_sai.sql index 8ec59c8561d..8ec59c8561d 100644 --- a/sql/updates/world/2013_06_11_01_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_11_01_world_sai.sql diff --git a/sql/updates/world/2013_06_12_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_12_00_world_misc.sql index 64689d14927..64689d14927 100644 --- a/sql/updates/world/2013_06_12_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_12_00_world_misc.sql diff --git a/sql/updates/world/2013_06_12_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_12_01_world_misc.sql index c7b84d811e2..c7b84d811e2 100644 --- a/sql/updates/world/2013_06_12_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_12_01_world_misc.sql diff --git a/sql/updates/world/2013_06_13_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_00_world_misc.sql index 09e3a3cb92b..09e3a3cb92b 100644 --- a/sql/updates/world/2013_06_13_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_00_world_misc.sql diff --git a/sql/updates/world/2013_06_13_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_01_world_misc.sql index 08c1c90ab08..08c1c90ab08 100644 --- a/sql/updates/world/2013_06_13_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_01_world_misc.sql diff --git a/sql/updates/world/2013_06_13_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_02_world_misc.sql index 6b74abd4aa9..6b74abd4aa9 100644 --- a/sql/updates/world/2013_06_13_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_02_world_misc.sql diff --git a/sql/updates/world/2013_06_13_03_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_03_world_creature.sql index 06a6bdfdf45..06a6bdfdf45 100644 --- a/sql/updates/world/2013_06_13_03_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_03_world_creature.sql diff --git a/sql/updates/world/2013_06_13_04_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_04_world_sai.sql index d3279d691c2..d3279d691c2 100644 --- a/sql/updates/world/2013_06_13_04_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_04_world_sai.sql diff --git a/sql/updates/world/2013_06_13_05_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_05_world_sai.sql index 8f510380a95..8f510380a95 100644 --- a/sql/updates/world/2013_06_13_05_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_13_05_world_sai.sql diff --git a/sql/updates/world/2013_06_15_00_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_00_world_creature.sql index a9db8f93583..a9db8f93583 100644 --- a/sql/updates/world/2013_06_15_00_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_00_world_creature.sql diff --git a/sql/updates/world/2013_06_15_01_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_01_world_gossip.sql index 14da6211f93..14da6211f93 100644 --- a/sql/updates/world/2013_06_15_01_world_gossip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_01_world_gossip.sql diff --git a/sql/updates/world/2013_06_15_02_world_spelldifficulty_dbc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_02_world_spelldifficulty_dbc.sql index 3c68f4e5b33..3c68f4e5b33 100644 --- a/sql/updates/world/2013_06_15_02_world_spelldifficulty_dbc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_02_world_spelldifficulty_dbc.sql diff --git a/sql/updates/world/2013_06_15_03_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_03_world_creature_template.sql index d4673e08a15..d4673e08a15 100644 --- a/sql/updates/world/2013_06_15_03_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_15_03_world_creature_template.sql diff --git a/sql/updates/world/2013_06_16_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_00_world_misc.sql index 49f8d4cab6e..49f8d4cab6e 100644 --- a/sql/updates/world/2013_06_16_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_00_world_misc.sql diff --git a/sql/updates/world/2013_06_16_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_01_world_misc.sql index 8a31fa8118e..8a31fa8118e 100644 --- a/sql/updates/world/2013_06_16_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_01_world_misc.sql diff --git a/sql/updates/world/2013_06_16_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_02_world_misc.sql index b02062bc163..b02062bc163 100644 --- a/sql/updates/world/2013_06_16_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_02_world_misc.sql diff --git a/sql/updates/world/2013_06_16_03_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_03_world_misc.sql index 86418513a08..86418513a08 100644 --- a/sql/updates/world/2013_06_16_03_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_03_world_misc.sql diff --git a/sql/updates/world/2013_06_16_04_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_04_world_creature_text.sql index 3f08495f884..3f08495f884 100644 --- a/sql/updates/world/2013_06_16_04_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_16_04_world_creature_text.sql diff --git a/sql/updates/world/2013_06_17_00_world_warden_checks.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_17_00_world_warden_checks.sql index 030fee68d37..030fee68d37 100644 --- a/sql/updates/world/2013_06_17_00_world_warden_checks.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_17_00_world_warden_checks.sql diff --git a/sql/updates/world/2013_06_17_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_17_01_world_misc.sql index d5c6ea6d29d..d5c6ea6d29d 100644 --- a/sql/updates/world/2013_06_17_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_17_01_world_misc.sql diff --git a/sql/updates/world/2013_06_17_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_17_02_world_misc.sql index b938ea45e95..b938ea45e95 100644 --- a/sql/updates/world/2013_06_17_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_17_02_world_misc.sql diff --git a/sql/updates/world/2013_06_18_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_00_world_misc.sql index 9403c8ee0f4..9403c8ee0f4 100644 --- a/sql/updates/world/2013_06_18_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_00_world_misc.sql diff --git a/sql/updates/world/2013_06_18_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_01_world_misc.sql index 2046eb81609..2046eb81609 100644 --- a/sql/updates/world/2013_06_18_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_01_world_misc.sql diff --git a/sql/updates/world/2013_06_18_02_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_02_world_creature.sql index 26067837dfe..26067837dfe 100644 --- a/sql/updates/world/2013_06_18_02_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_02_world_creature.sql diff --git a/sql/updates/world/2013_06_18_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_03_world_sai.sql index 914299ba57f..914299ba57f 100644 --- a/sql/updates/world/2013_06_18_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_03_world_sai.sql diff --git a/sql/updates/world/2013_06_18_04_world_spell_script_names.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_04_world_spell_script_names.sql index 8c749c485cf..8c749c485cf 100644 --- a/sql/updates/world/2013_06_18_04_world_spell_script_names.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_04_world_spell_script_names.sql diff --git a/sql/updates/world/2013_06_18_05_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_05_world_misc.sql index 7971ea5e89a..7971ea5e89a 100644 --- a/sql/updates/world/2013_06_18_05_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_05_world_misc.sql diff --git a/sql/updates/world/2013_06_18_06_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_06_world_conditions.sql index 07bbf69bf39..07bbf69bf39 100644 --- a/sql/updates/world/2013_06_18_06_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_06_world_conditions.sql diff --git a/sql/updates/world/2013_06_18_07_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_07_world_gossip.sql index 733ccab0748..733ccab0748 100644 --- a/sql/updates/world/2013_06_18_07_world_gossip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_18_07_world_gossip.sql diff --git a/sql/updates/world/2013_06_19_00_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_19_00_world_creature.sql index 7ac3cd694f9..7ac3cd694f9 100644 --- a/sql/updates/world/2013_06_19_00_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_19_00_world_creature.sql diff --git a/sql/updates/world/2013_06_20_00_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_00_world_creature.sql index 1ce9bce76d7..1ce9bce76d7 100644 --- a/sql/updates/world/2013_06_20_00_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_00_world_creature.sql diff --git a/sql/updates/world/2013_06_20_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_01_world_misc.sql index 426e898f601..426e898f601 100644 --- a/sql/updates/world/2013_06_20_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_01_world_misc.sql diff --git a/sql/updates/world/2013_06_20_02_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_02_world_creature_text.sql index 416ead95371..416ead95371 100644 --- a/sql/updates/world/2013_06_20_02_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_02_world_creature_text.sql diff --git a/sql/updates/world/2013_06_20_03_world_spell_script_names.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_03_world_spell_script_names.sql index 5863a4031aa..5863a4031aa 100644 --- a/sql/updates/world/2013_06_20_03_world_spell_script_names.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_03_world_spell_script_names.sql diff --git a/sql/updates/world/2013_06_20_04_world_waypoints.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_04_world_waypoints.sql index 2828f320835..2828f320835 100644 --- a/sql/updates/world/2013_06_20_04_world_waypoints.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_20_04_world_waypoints.sql diff --git a/sql/updates/world/2013_06_21_00_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_00_world_creature.sql index 7749b46d5e4..7749b46d5e4 100644 --- a/sql/updates/world/2013_06_21_00_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_00_world_creature.sql diff --git a/sql/updates/world/2013_06_21_01_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_01_world_creature.sql index 64b0de97f34..64b0de97f34 100644 --- a/sql/updates/world/2013_06_21_01_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_01_world_creature.sql diff --git a/sql/updates/world/2013_06_21_02_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_02_world_creature.sql index 29c83f882da..29c83f882da 100644 --- a/sql/updates/world/2013_06_21_02_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_02_world_creature.sql diff --git a/sql/updates/world/2013_06_21_03_world_instance_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_03_world_instance_template.sql index 2a22dfcf774..2a22dfcf774 100644 --- a/sql/updates/world/2013_06_21_03_world_instance_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_21_03_world_instance_template.sql diff --git a/sql/updates/world/2013_06_23_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_23_00_world_misc.sql index 981f1236dfd..981f1236dfd 100644 --- a/sql/updates/world/2013_06_23_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_23_00_world_misc.sql diff --git a/sql/updates/world/2013_06_23_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_23_01_world_misc.sql index f98b1f2f7ab..f98b1f2f7ab 100644 --- a/sql/updates/world/2013_06_23_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_23_01_world_misc.sql diff --git a/sql/updates/world/2013_06_24_00_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_24_00_world_creature_text.sql index 6419e43ad14..6419e43ad14 100644 --- a/sql/updates/world/2013_06_24_00_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_24_00_world_creature_text.sql diff --git a/sql/updates/world/2013_06_24_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_24_01_world_misc.sql index 54487e129de..54487e129de 100644 --- a/sql/updates/world/2013_06_24_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_24_01_world_misc.sql diff --git a/sql/updates/world/2013_06_24_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_24_02_world_misc.sql index 9468fd00b8b..9468fd00b8b 100644 --- a/sql/updates/world/2013_06_24_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_24_02_world_misc.sql diff --git a/sql/updates/world/2013_06_25_00_world_player_factionchange_spells.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_00_world_player_factionchange_spells.sql index ee50f3ea952..ee50f3ea952 100644 --- a/sql/updates/world/2013_06_25_00_world_player_factionchange_spells.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_00_world_player_factionchange_spells.sql diff --git a/sql/updates/world/2013_06_25_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_00_world_sai.sql index cd316bf4732..cd316bf4732 100644 --- a/sql/updates/world/2013_06_25_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_00_world_sai.sql diff --git a/sql/updates/world/2013_06_25_01_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_01_world_sai.sql index c2c54eebcc3..c2c54eebcc3 100644 --- a/sql/updates/world/2013_06_25_01_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_01_world_sai.sql diff --git a/sql/updates/world/2013_06_25_02_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_02_world_sai.sql index c394f74b51f..c394f74b51f 100644 --- a/sql/updates/world/2013_06_25_02_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_02_world_sai.sql diff --git a/sql/updates/world/2013_06_25_03_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_03_world_misc.sql index 7b3b208dd15..7b3b208dd15 100644 --- a/sql/updates/world/2013_06_25_03_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_03_world_misc.sql diff --git a/sql/updates/world/2013_06_25_04_world_item_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_04_world_item_template.sql index 215d0583d53..215d0583d53 100644 --- a/sql/updates/world/2013_06_25_04_world_item_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_04_world_item_template.sql diff --git a/sql/updates/world/2013_06_25_05_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_05_world_misc.sql index 378b362aa83..378b362aa83 100644 --- a/sql/updates/world/2013_06_25_05_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_05_world_misc.sql diff --git a/sql/updates/world/2013_06_25_06_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_06_world_creature_template.sql index 709776de6c4..709776de6c4 100644 --- a/sql/updates/world/2013_06_25_06_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_06_world_creature_template.sql diff --git a/sql/updates/world/2013_06_25_07_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_07_world_creature_text.sql index dc7ec7f563e..dc7ec7f563e 100644 --- a/sql/updates/world/2013_06_25_07_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_25_07_world_creature_text.sql diff --git a/sql/updates/world/2013_06_26_00_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_00_world_conditions.sql index bb1467d7bfe..bb1467d7bfe 100644 --- a/sql/updates/world/2013_06_26_00_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_00_world_conditions.sql diff --git a/sql/updates/world/2013_06_26_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_01_world_misc.sql index 2e54cb9497e..2e54cb9497e 100644 --- a/sql/updates/world/2013_06_26_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_01_world_misc.sql diff --git a/sql/updates/world/2013_06_26_02_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_02_world_gossip.sql index 56c41e18b38..56c41e18b38 100644 --- a/sql/updates/world/2013_06_26_02_world_gossip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_02_world_gossip.sql diff --git a/sql/updates/world/2013_06_26_03_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_03_world_creature_template.sql index dae5f5869c3..dae5f5869c3 100644 --- a/sql/updates/world/2013_06_26_03_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_26_03_world_creature_template.sql diff --git a/sql/updates/world/2013_06_29_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_00_world_misc.sql index 175f37041e2..175f37041e2 100644 --- a/sql/updates/world/2013_06_29_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_00_world_misc.sql diff --git a/sql/updates/world/2013_06_29_01_world_creature_addon.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_01_world_creature_addon.sql index e7ec3a48752..e7ec3a48752 100644 --- a/sql/updates/world/2013_06_29_01_world_creature_addon.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_01_world_creature_addon.sql diff --git a/sql/updates/world/2013_06_29_02_world_creature_addon.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_02_world_creature_addon.sql index c8ee431909b..c8ee431909b 100644 --- a/sql/updates/world/2013_06_29_02_world_creature_addon.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_02_world_creature_addon.sql diff --git a/sql/updates/world/2013_06_29_03_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_03_world_misc.sql index db9a7525517..db9a7525517 100644 --- a/sql/updates/world/2013_06_29_03_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_29_03_world_misc.sql diff --git a/sql/updates/world/2013_06_30_00_world_waypoints.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_00_world_waypoints.sql index f2a4c58fcf8..f2a4c58fcf8 100644 --- a/sql/updates/world/2013_06_30_00_world_waypoints.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_00_world_waypoints.sql diff --git a/sql/updates/world/2013_06_30_01_world_smart_scripts.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_01_world_smart_scripts.sql index 65b4a9923fa..65b4a9923fa 100644 --- a/sql/updates/world/2013_06_30_01_world_smart_scripts.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_01_world_smart_scripts.sql diff --git a/sql/updates/world/2013_06_30_02_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_02_world_creature_template.sql index 617d49667f2..617d49667f2 100644 --- a/sql/updates/world/2013_06_30_02_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_02_world_creature_template.sql diff --git a/sql/updates/world/2013_06_30_03_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_03_world_conditions.sql index 934a20cd025..934a20cd025 100644 --- a/sql/updates/world/2013_06_30_03_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_03_world_conditions.sql diff --git a/sql/updates/world/2013_06_30_04_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_04_world_sai.sql index 61ec09c9ff4..61ec09c9ff4 100644 --- a/sql/updates/world/2013_06_30_04_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_04_world_sai.sql diff --git a/sql/updates/world/2013_06_30_05_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_05_world_sai.sql index e43c840e85a..e43c840e85a 100644 --- a/sql/updates/world/2013_06_30_05_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_05_world_sai.sql diff --git a/sql/updates/world/2013_06_30_06_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_06_world_sai.sql index 3eeed904df9..3eeed904df9 100644 --- a/sql/updates/world/2013_06_30_06_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_06_world_sai.sql diff --git a/sql/updates/world/2013_06_30_07_world_creature_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_07_world_creature_loot_template.sql index 402e00d685e..402e00d685e 100644 --- a/sql/updates/world/2013_06_30_07_world_creature_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_07_world_creature_loot_template.sql diff --git a/sql/updates/world/2013_06_30_08_world_player_factionchange_spells.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_08_world_player_factionchange_spells.sql index 1d3da3eb33b..1d3da3eb33b 100644 --- a/sql/updates/world/2013_06_30_08_world_player_factionchange_spells.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_08_world_player_factionchange_spells.sql diff --git a/sql/updates/world/2013_06_30_09_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_09_world_misc.sql index 10708ed06b3..10708ed06b3 100644 --- a/sql/updates/world/2013_06_30_09_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_09_world_misc.sql diff --git a/sql/updates/world/2013_06_30_10_world_creature_addon.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_10_world_creature_addon.sql index 3a38356e295..3a38356e295 100644 --- a/sql/updates/world/2013_06_30_10_world_creature_addon.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_10_world_creature_addon.sql diff --git a/sql/updates/world/2013_06_30_11_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_11_world_misc.sql index 81765d1657a..81765d1657a 100644 --- a/sql/updates/world/2013_06_30_11_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_11_world_misc.sql diff --git a/sql/updates/world/2013_06_30_12_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_12_world_misc.sql index f3a020acfd7..f3a020acfd7 100644 --- a/sql/updates/world/2013_06_30_12_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_12_world_misc.sql diff --git a/sql/updates/world/2013_06_30_13_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_13_world_misc.sql index 936c47ec132..936c47ec132 100644 --- a/sql/updates/world/2013_06_30_13_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_13_world_misc.sql diff --git a/sql/updates/world/2013_06_30_14_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_14_world_misc.sql index 1db707352f8..1db707352f8 100644 --- a/sql/updates/world/2013_06_30_14_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_14_world_misc.sql diff --git a/sql/updates/world/2013_06_30_15_world_waypoints.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_15_world_waypoints.sql index 7d77c68a96c..7d77c68a96c 100644 --- a/sql/updates/world/2013_06_30_15_world_waypoints.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_15_world_waypoints.sql diff --git a/sql/updates/world/2013_06_30_16_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_16_world_misc.sql index 7e7494e58cd..7e7494e58cd 100644 --- a/sql/updates/world/2013_06_30_16_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_06_30_16_world_misc.sql diff --git a/sql/updates/world/2013_07_01_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_00_world_misc.sql index f1812ed2b49..f1812ed2b49 100644 --- a/sql/updates/world/2013_07_01_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_00_world_misc.sql diff --git a/sql/updates/world/2013_07_01_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_01_world_misc.sql index 0ffd041aa7c..0ffd041aa7c 100644 --- a/sql/updates/world/2013_07_01_01_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_01_world_misc.sql diff --git a/sql/updates/world/2013_07_01_02_world_creature.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_02_world_creature.sql index 3e8e00f9779..3e8e00f9779 100644 --- a/sql/updates/world/2013_07_01_02_world_creature.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_02_world_creature.sql diff --git a/sql/updates/world/2013_07_01_03_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_03_world_creature_template.sql index 6813f7d5156..6813f7d5156 100644 --- a/sql/updates/world/2013_07_01_03_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_03_world_creature_template.sql diff --git a/sql/updates/world/2013_07_01_04_world_gameobject.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_04_world_gameobject.sql index f53850871fe..f53850871fe 100644 --- a/sql/updates/world/2013_07_01_04_world_gameobject.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_04_world_gameobject.sql diff --git a/sql/updates/world/2013_07_01_05_world_creature_text.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_05_world_creature_text.sql index 808022ada14..808022ada14 100644 --- a/sql/updates/world/2013_07_01_05_world_creature_text.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_05_world_creature_text.sql diff --git a/sql/updates/world/2013_07_01_06_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_06_world_gossip.sql index 88dcc711c23..88dcc711c23 100644 --- a/sql/updates/world/2013_07_01_06_world_gossip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_01_06_world_gossip.sql diff --git a/sql/updates/world/2013_07_02_00_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_02_00_world_gossip.sql index 3537ddb0f82..3537ddb0f82 100644 --- a/sql/updates/world/2013_07_02_00_world_gossip.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_02_00_world_gossip.sql diff --git a/sql/updates/world/2013_07_04_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_00_world_misc.sql index 5e7d7839f5d..5e7d7839f5d 100644 --- a/sql/updates/world/2013_07_04_00_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_00_world_misc.sql diff --git a/sql/updates/world/2013_07_04_01_world_razorfen_kraul.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_01_world_razorfen_kraul.sql index a05037d791f..a05037d791f 100644 --- a/sql/updates/world/2013_07_04_01_world_razorfen_kraul.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_01_world_razorfen_kraul.sql diff --git a/sql/updates/world/2013_07_04_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_02_world_misc.sql index 95d836122d8..95d836122d8 100644 --- a/sql/updates/world/2013_07_04_02_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_02_world_misc.sql diff --git a/sql/updates/world/2013_07_04_03_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_03_world_sai.sql index 003919faefa..003919faefa 100644 --- a/sql/updates/world/2013_07_04_03_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_04_03_world_sai.sql diff --git a/sql/updates/world/2013_07_05_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_00_world_sai.sql index 06781cc63a1..06781cc63a1 100644 --- a/sql/updates/world/2013_07_05_00_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_00_world_sai.sql diff --git a/sql/updates/world/2013_07_05_01_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_01_world_creature_template.sql index 117df2273a9..117df2273a9 100644 --- a/sql/updates/world/2013_07_05_01_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_01_world_creature_template.sql diff --git a/sql/updates/world/2013_07_05_02_world_QuestchainSOH.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_02_world_QuestchainSOH.sql index 14a3ea7c1a0..14a3ea7c1a0 100644 --- a/sql/updates/world/2013_07_05_02_world_QuestchainSOH.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_02_world_QuestchainSOH.sql diff --git a/sql/updates/world/2013_07_05_03_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_03_world_misc.sql index 435a37613c3..435a37613c3 100644 --- a/sql/updates/world/2013_07_05_03_world_misc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_03_world_misc.sql diff --git a/sql/updates/world/2013_07_05_04_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_04_world_sai.sql index dc493837814..dc493837814 100644 --- a/sql/updates/world/2013_07_05_04_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_05_04_world_sai.sql diff --git a/sql/updates/world/2013_07_06_00_world_spelldifficulty_dbc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_00_world_spelldifficulty_dbc.sql index 07be40f8565..07be40f8565 100644 --- a/sql/updates/world/2013_07_06_00_world_spelldifficulty_dbc.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_00_world_spelldifficulty_dbc.sql diff --git a/sql/updates/world/2013_07_06_01_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_01_world_conditions.sql index fd26b9a3409..fd26b9a3409 100644 --- a/sql/updates/world/2013_07_06_01_world_conditions.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_01_world_conditions.sql diff --git a/sql/updates/world/2013_07_06_02_world_gobj_loot_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_02_world_gobj_loot_template.sql index 8b06691321a..8b06691321a 100644 --- a/sql/updates/world/2013_07_06_02_world_gobj_loot_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_02_world_gobj_loot_template.sql diff --git a/sql/updates/world/2013_07_06_03_world_creature_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_03_world_creature_template.sql index 04d8f545d45..04d8f545d45 100644 --- a/sql/updates/world/2013_07_06_03_world_creature_template.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_03_world_creature_template.sql diff --git a/sql/updates/world/2013_07_06_04_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_04_world_sai.sql index 77bd130d8b6..77bd130d8b6 100644 --- a/sql/updates/world/2013_07_06_04_world_sai.sql +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_06_04_world_sai.sql diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_07_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_07_00_world_misc.sql new file mode 100644 index 00000000000..65fe90423e8 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_07_00_world_misc.sql @@ -0,0 +1,8 @@ +-- Fix some runtime errors +UPDATE `creature` SET `MovementType`=0 WHERE `guid` IN (142347,142368,142371,142376,142378,142379); +UPDATE `creature` SET `modelid`=0 WHERE `id` = 30169; +-- Add missing doors on old Hyjal +DELETE FROM `gameobject` WHERE `guid` IN (4658,4695); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(4658, 182060, 534, 1, 1, 4270.964, -4143.027, 870.7232, 6.020715, 0, 0, 0.8829476, -0.4694716, 7200, 255, 1), +(4695, 182061, 534, 1, 1, 4204.479, -4112.277, 877.9128, 4.985382, 0, 0, 0.8829476, -0.4694716, 7200, 255, 1); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_07_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_07_01_world_misc.sql new file mode 100644 index 00000000000..e6e9e07e04e --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_07_01_world_misc.sql @@ -0,0 +1,19 @@ +-- Add missing Gameobjects into The Shattered Halls +DELETE FROM `gameobject` WHERE `guid` IN (4700,4712,4713,4719,4720,4752,4756,4779,4796,4806,4842,4853,4857,4932,4940,4944); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(4700, 182539, 540, 1, 1, 141.5157, 266.3664, -11.56821, 3.141593, 0, 0, 1, 0, 7200, 255, 1), +(4712, 182540, 540, 1, 1, 214.4881, 266.1671, -11.51811, 0, 0, 0, 1, 0, 7200, 255, 1), +(4713, 181915, 540, 1, 1, 464.7611, 315.0286, 1.929426, 4.204196, 0, 0, 0, 1, 7200, 255, 1), +(4719, 181915, 540, 1, 1, 403.0749, 322.5745, 1.894548, 2.034194, 0, 0, 0, 1, 7200, 255, 1), +(4720, 181915, 540, 1, 1, 469.9535, 313.0817, 1.918688, 5.924535, 0, 0, 0, 1, 7200, 255, 1), +(4752, 181915, 540, 1, 1, 445.6028, 316.2987, 1.912614, 3.658597, 0, 0, 0, 1, 7200, 255, 1), +(4756, 181671, 540, 1, 1, 330.7506, 74.20586, 1.079237, 3.159062, 0, 0, 0, 1, 7200, 255, 1), +(4779, 181671, 540, 1, 1, 330.7946, 41.02605, 1.070399, 0.01745246, 0, 0, 0, 1, 7200, 255, 1), +(4796, 181439, 540, 1, 1, 260.3188, -79.31659, -6.418934, 5.846854, 0, 0, 1, 0, 7200, 255, 1), +(4806, 181438, 540, 1, 1, 257.0056, -102.1912, -5.668888, 4.450591, 0, 0, 1, 0, 7200, 255, 1), +(4842, 181435, 540, 1, 1, 242.159, -75.06284, -9.304095, 4.886921, 0, 0, 1, 0, 7200, 255, 1), +(4853, 181436, 540, 1, 1, 232.8329, -98.32433, -11.76173, 0.6981294, 0, 0, 1, 0, 7200, 255, 1), +(4857, 181441, 540, 1, 1, 220.3093, -54.90799, -6.456299, 2.007125, 0, 0, 1, 0, 7200, 255, 1), +(4932, 181437, 540, 1, 1, 222.6859, -78.63619, -11.1251, 3.752462, 0, 0, 1, 0, 7200, 255, 1), +(4940, 181440, 540, 1, 1, 215.4215, -112.6428, -6.456299, 2.007125, 0, 0, 1, 0, 7200, 255, 1), +(4944, 181442, 540, 1, 1, 197.2586, -84.19016, -7.345709, 2.007125, 0, 0, 1, 0, 7200, 255, 1); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_00_world_gameobject.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_00_world_gameobject.sql new file mode 100644 index 00000000000..bd628379002 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_00_world_gameobject.sql @@ -0,0 +1 @@ +UPDATE `gameobject` SET `spawnMask`=3 WHERE `guid` IN (4700,4712,4713,4719,4720,4752,4756,4779,4796,4806,4842,4853,4857,4932,4940,4944); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_01_world_misc.sql new file mode 100644 index 00000000000..ae116a3059d --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_01_world_misc.sql @@ -0,0 +1,77 @@ +-- Pathing for Akama Entry: 23191 +SET @PATH := 847160; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,517.4877,400.7993,112.7837,0,0,0,0,100,0), +(@PATH,2,517.4877,400.7993,112.7837,3.118662,0,0,0,100,0); + +SET @GOSSIP := 21335; +SET @TEXTID := 10866; +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=23191; +UPDATE `creature_template` SET `gossip_menu_id`=0 WHERE `entry`=22990; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTID; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (@GOSSIP, @TEXTID); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`box_text`) VALUES +(@GOSSIP, 0, 0, 'I am ready to fight alongside you, Akama.', 1, 1, ''); + +UPDATE `creature` SET `id`=23191,`position_x`=547.1864,`position_y`=400.5344,`position_z`=112.8671,`orientation`=3.124139 WHERE `guid`=84716; +UPDATE `creature_template` SET `speed_walk`=1.6, `ScriptName` = 'npc_akama_shade' WHERE `entry`=23191; +UPDATE `creature_template` SET `ScriptName` = 'npc_creature_generator_akama' WHERE `entry`=23210; +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry`=22990; + +UPDATE `creature_template` SET `speed_run`=1.7143, `AIName`= '', `flags_extra`=0, `ScriptName` = 'npc_ashtongue_defender' WHERE `entry`=23216; +DELETE FROM `smart_scripts` WHERE `entryorguid`=23216; +DELETE FROM `creature_equip_template` WHERE `entry`=23216 AND `id`=1; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(23216,1,18983,31468,0); + +UPDATE `creature_template` SET `speed_run`=1.7143, `ScriptName` = 'npc_ashtongue_sorcerer' WHERE `entry`=23215; +DELETE FROM `creature_equip_template` WHERE `entry`=23215 AND `id`=1; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(23215,1,29685,0,0); + +UPDATE `creature_template` SET `speed_run`=1.7143, `baseattacktime`=1600, `AIName`= '', `ScriptName` = 'npc_ashtongue_rogue' WHERE `entry`=23318; +DELETE FROM `smart_scripts` WHERE `entryorguid`=23318; + +DELETE FROM `creature_equip_template` WHERE `entry`=23318 AND `id`=1; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(23318,1,10612,10612,0); + +UPDATE `creature_template` SET `speed_run`=0.99206, `faction_A`=1813, `faction_H`=1813 WHERE `entry`=22847; +DELETE FROM `creature_equip_template` WHERE `entry`=22847 AND `id`=1; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(22847,1,29651,13924,0); + +UPDATE `creature_template` SET `speed_run`=0.99206, `faction_A`=1813, `faction_H`=1813 WHERE `entry`=22845; +DELETE FROM `creature_equip_template` WHERE `entry`=22845 AND `id`=1; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(22845,1,29685,0,0); + +UPDATE `creature_template` SET `speed_walk`=2, `faction_A`=1813, `faction_H`=1813 WHERE `entry`=22849; + +UPDATE `creature_template` SET `speed_run`=0.99206, `faction_A`=1813, `faction_H`=1813 WHERE `entry`=22846; + +DELETE FROM `creature_text` WHERE `entry`=23191; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(23191, 0, 0, 'Broken of the Ashtongue tribe, your leader speaks!', 14, 0, 100, 0, 0, 0, 'Akama SAY_BROKEN_FREE_0'), +(23191, 1, 0, 'The Betrayer no longer holds sway over us. His dark magic over the Ashtongue soul has been destroyed!', 14, 0, 100, 0, 0, 0, 'Akama SAY_BROKEN_FREE_1'), +(23191, 2, 0, 'Come out from the shadows! I''ve returned to lead you against our true enemy! Shed your chains and raise your weapons against your Illidari masters!', 14, 0, 100, 0, 0, 0, 'Akama SAY_BROKEN_FREE_2'); + +DELETE FROM `creature` WHERE `guid` BETWEEN 53919 AND 53929; +UPDATE `creature` SET `modelid`=0 WHERE `id`=23033; +UPDATE `creature_template` SET `AIName`='', `flags_extra`=128 WHERE `entry`=23033; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=40607; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,40607,0,0,31,0,3,22841,0,0,'','Spell Fixate targets Shade of Akama'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=41602; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,41602,0,0,31,0,3,23191,0,0,'','Spell Threat targets Akama'); + +DELETE FROM `creature_addon` WHERE `guid`=12777; +DELETE FROM `creature_template_addon` WHERE `entry`=22841; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (22841, 1, '40973'); +UPDATE `creature_template` SET `speed_walk`=0.8 WHERE `entry`=22841; +UPDATE `creature_template` SET `speed_walk`=1, `unit_flags`=33587200, `unit_flags2`=0 WHERE `entry`=23421; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_02_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_02_world_misc.sql new file mode 100644 index 00000000000..782d4620e56 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_08_02_world_misc.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_ashtongue_channeler' WHERE `entry`=23421; +DELETE FROM `waypoint_data` WHERE `id`=847160; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_10_00_world_gameobject.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_10_00_world_gameobject.sql new file mode 100644 index 00000000000..0b7b1211826 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_10_00_world_gameobject.sql @@ -0,0 +1,20 @@ +-- Spawn some missing gameobjects +DELETE FROM `gameobject` WHERE `id`= 192081; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(4946, 192081, 571, 1, 4, 7766.29, -3291.49, 867.549, 3.4413, 0, 0, 0.988793, -0.149295, 300, 0, 1), +(4953, 192081, 571, 1, 4, 7777.38, -3315.96, 870.557, 3.64289, 0, 0, 0.968752, -0.248033, 300, 0, 1), +(4972, 192081, 571, 1, 4, 7793.63, -3335.38, 874.607, 5.71525, 0, 0, 0.280166, -0.959952, 300, 0, 1), +(4980, 192081, 571, 1, 4, 7847.24, -3328.97, 860.566, 3.49149, 0, 0, 0.984736, -0.174056, 300, 0, 1), +(5025, 192081, 571, 1, 4, 7848.67, -3297.97, 858.592, 2.65853, 0, 0, 0.970973, 0.239191, 300, 0, 1), +(5030, 192081, 571, 1, 4, 7833.79, -3273.39, 858.925, 2.02126, 0, 0, 0.847168, 0.531325, 300, 0, 1), +(5042, 192081, 571, 1, 4, 7834.22, -3234.66, 854.051, 2.17682, 0, 0, 0.88589, 0.463896, 300, 0, 1), +(5052, 192081, 571, 1, 4, 7861.13, -3221.38, 851.222, 0.199794, 0, 0, 0.099731, 0.995014, 300, 0, 1), +(5064, 192081, 571, 1, 4, 7891.3, -3204.92, 856.156, 1.95869, 0, 0, 0.830133, 0.557565, 300, 0, 1), +(5076, 192081, 571, 1, 4, 7912.37, -3223.15, 854.569, 5.38674, 0, 0, 0.433365, -0.901218, 300, 0, 1), +(5081, 192081, 571, 1, 4, 7931.66, -3258.14, 858.264, 4.92008, 0, 0, 0.629999, -0.776596, 300, 0, 1), +(5113, 192081, 571, 1, 4, 7916.21, -3301.92, 858.29, 3.82118, 0, 0, 0.942824, -0.333292, 300, 0, 1), +(5130, 192081, 571, 1, 4, 7896.12, -3340.67, 857.777, 5.03497, 0, 0, 0.584373, -0.811485, 300, 0, 1), +(5170, 192081, 571, 1, 4, 7900.34, -3376.97, 861.646, 4.64358, 0, 0, 0.731011, -0.682366, 300, 0, 1), +(5185, 192081, 571, 1, 4, 7892.06, -3408.05, 864.871, 4.50853, 0, 0, 0.775386, -0.631488, 300, 0, 1), +(5194, 192081, 571, 1, 4, 7863.29, -3388.16, 863.473, 2.74226, 0, 0, 0.980133, 0.198341, 300, 0, 1), +(5198, 192081, 571, 1, 4, 7827.1, -3354.03, 865.865, 2.67201, 0, 0, 0.972563, 0.232639, 300, 0, 1); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_10_01_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_10_01_world_misc.sql new file mode 100644 index 00000000000..8a2430215df --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_10_01_world_misc.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `AIName`= '', `ScriptName` = 'npc_ashtongue_elementalist' WHERE `entry`=23523; +DELETE FROM smart_scripts WHERE entryorguid=23523; + +UPDATE `creature_template` SET `AIName`= '', `ScriptName` = 'npc_ashtongue_spiritbinder' WHERE `entry`=23524; +DELETE FROM smart_scripts WHERE entryorguid=23524; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_00_world_sai.sql new file mode 100644 index 00000000000..aaf95553f18 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_00_world_sai.sql @@ -0,0 +1,3 @@ +-- Sandfury Shadowhunter spam fix +UPDATE `smart_scripts` SET `event_flags`=3 WHERE `entryorguid`=7246 AND `source_type`=0 AND `id`=15 AND `link`=16; +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=7246 AND `source_type`=0 AND `id`=16 AND `link`=0; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_01_world_waypoints.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_01_world_waypoints.sql new file mode 100644 index 00000000000..504dfad5631 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_01_world_waypoints.sql @@ -0,0 +1,444 @@ +-- Pathing for Illidari Fearbringer Entry: 22954 +SET @NPC := 52768; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=612.1008,`position_y`=715.0594,`position_z`=77.48019 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,612.1008,715.0594,77.48019,0,0,0,0,100,0), +(@PATH,2,626.8418,715.1508,75.81075,0,0,0,0,100,0), +(@PATH,3,643.162,716.2298,70.8769,0,0,0,0,100,0), +(@PATH,4,663.4116,720.2251,70.52241,0,0,0,0,100,0), +(@PATH,5,682.2949,737.6859,68.97373,0,0,0,0,100,0), +(@PATH,6,692.6406,756.8541,66.75413,0,0,0,0,100,0), +(@PATH,7,682.2949,737.6859,68.97373,0,0,0,0,100,0), +(@PATH,8,663.4116,720.2251,70.52241,0,0,0,0,100,0), +(@PATH,9,643.162,716.2298,70.8769,0,0,0,0,100,0), +(@PATH,10,626.8418,715.1508,75.81075,0,0,0,0,100,0); + +-- Pathing for Illidari Fearbringer Entry: 22954 +SET @NPC := 52773; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=680.5127,`position_y`=736.589,`position_z`=68.98032 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,680.5127,736.589,68.98032,0,0,0,0,100,0), +(@PATH,2,689.7178,752.5954,67.10484,0,0,0,0,100,0), +(@PATH,3,690.7227,773.5752,65.17497,0,0,0,0,100,0), +(@PATH,4,682.0201,797.8951,63.36504,0,0,0,0,100,0), +(@PATH,5,679.8043,821.2305,61.06209,0,0,0,0,100,0), +(@PATH,6,680.7047,848.535,58.56005,0,0,0,0,100,0), +(@PATH,7,679.8043,821.2305,61.06209,0,0,0,0,100,0), +(@PATH,8,682.0201,797.8951,63.36504,0,0,0,0,100,0), +(@PATH,9,690.7438,773.907,65.11858,0,0,0,0,100,0), +(@PATH,10,689.7178,752.5954,67.10484,0,0,0,0,100,0); + +-- Pathing for Illidari Fearbringer Entry: 22954 +SET @NPC := 52769; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=713.0262,`position_y`=704.147,`position_z`=70.84101 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,713.0262,704.147,70.84101,0,0,0,0,100,0), +(@PATH,2,733.0706,690.4993,71.98522,0,0,0,0,100,0), +(@PATH,3,769.0543,692.4883,71.78658,0,0,0,0,100,0), +(@PATH,4,790.8868,701.6238,73.08874,0,0,0,0,100,0), +(@PATH,5,801.6542,721.7141,70.07971,0,0,0,0,100,0), +(@PATH,6,790.8868,701.6238,73.08874,0,0,0,0,100,0), +(@PATH,7,769.0543,692.4883,71.78658,0,0,0,0,100,0), +(@PATH,8,733.0706,690.4993,71.98522,0,0,0,0,100,0); + +-- Pathing for Illidari Fearbringer Entry: 22954 +SET @NPC := 52772; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=721.4406,`position_y`=728.4247,`position_z`=68.65119 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,721.4406,728.4247,68.65119,0,0,0,0,100,0), +(@PATH,2,721.3423,745.3929,67.11169,0,0,0,0,100,0), +(@PATH,3,716.5741,774.6444,64.54839,0,0,0,0,100,0), +(@PATH,4,724.2047,803.066,62.11536,0,0,0,0,100,0), +(@PATH,5,735.2154,833.7368,58.94956,0,0,0,0,100,0), +(@PATH,6,734.4446,863.5928,56.50595,0,0,0,0,100,0), +(@PATH,7,735.2154,833.7368,58.94956,0,0,0,0,100,0), +(@PATH,8,724.2047,803.066,62.11536,0,0,0,0,100,0), +(@PATH,9,716.5741,774.6444,64.54839,0,0,0,0,100,0), +(@PATH,10,721.3423,745.3929,67.11169,0,0,0,0,100,0); + +-- Pathing for Aqueous Lord Entry: 22878 +SET @NPC := 12866; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=312.8537,`position_y`=813.1077,`position_z`=-17.58058 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,312.8537,813.1077,-17.58058,0,0,0,0,100,0), +(@PATH,2,341.3598,812.8531,-6.117754,0,0,0,0,100,0), +(@PATH,3,381.8092,812.6519,9.062115,0,0,0,0,100,0), +(@PATH,4,341.4501,812.8524,-6.08468,0,0,0,0,100,0); + +-- Pathing for Aqueous Lord Entry: 22878 +SET @NPC := 12869; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=252.3342,`position_y`=893.9015,`position_z`=-30.78079 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,252.3342,893.9015,-30.78079,0,0,0,0,100,0), +(@PATH,2,252.6844,922.2958,-44.67338,0,0,0,0,100,0), +(@PATH,3,252.5329,943.3651,-55.76704,0,0,0,0,100,0), +(@PATH,4,252.6844,922.2958,-44.67338,0,0,0,0,100,0); + +-- Pathing for Priestess of Dementia Entry: 22957 +SET @NPC := 52857; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=946.3522,`position_y`=337.5683,`position_z`=191.208 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,946.3522,337.5683,191.208,0,0,0,0,100,0), +(@PATH,2,946.4788,358.0963,191.208,0,0,0,0,100,0), +(@PATH,3,946.3522,337.5683,191.208,0,0,0,0,100,0), +(@PATH,4,946.2967,310.864,191.208,0,0,0,0,100,0), +(@PATH,5,946.0381,284.1759,191.208,0,0,0,0,100,0), +(@PATH,6,945.9597,259.7708,191.208,0,0,0,0,100,0), +(@PATH,7,945.9167,242.3769,191.208,0,0,0,0,100,0), +(@PATH,8,945.6511,224.3957,191.208,0,0,0,0,100,0), +(@PATH,9,945.9167,242.3769,191.208,0,0,0,0,100,0), +(@PATH,10,945.9597,259.7708,191.208,0,0,0,0,100,0), +(@PATH,11,946.0381,284.1759,191.208,0,0,0,0,100,0), +(@PATH,12,946.2967,310.864,191.208,0,0,0,0,100,0), +(@PATH,13,946.3522,337.5683,191.208,0,0,0,0,100,0), +(@PATH,14,946.4788,358.0963,191.208,0,0,0,0,100,0); + +-- Pathing for Promenade Sentinel Entry: 23394 +SET @NPC := 12884; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=761.1854,`position_y`=161.5995,`position_z`=218.4323 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,4097,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,761.1854,161.5995,218.4323,0,0,0,0,100,0), +(@PATH,2,762.2211,175.3375,218.453,0,0,0,0,100,0), +(@PATH,3,788.6677,173.3627,212.4686,0,0,0,0,100,0), +(@PATH,4,813.4553,170.9617,204.7675,0,0,0,0,100,0), +(@PATH,5,812.7894,149.1826,204.7681,0,0,0,0,100,0), +(@PATH,6,812.5944,127.2771,204.7675,0,0,0,0,100,0), +(@PATH,7,788.8348,125.6381,212.1583,0,0,0,0,100,0), +(@PATH,8,760.3759,122.2594,218.5355,0,0,0,0,100,0), +(@PATH,9,760.9326,144.1558,218.4856,0,0,0,0,100,0); + +-- Pathing for Promenade Sentinel Entry: 23394 +SET @NPC := 12886; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=624.8207,`position_y`=173.8407,`position_z`=253.2433 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,4097,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,624.8207,173.8407,253.2433,0,0,0,0,100,0), +(@PATH,2,640.5691,173.9213,245.0594,0,0,0,0,100,0), +(@PATH,3,642.4141,149.8184,245.0508,0,0,0,0,100,0), +(@PATH,4,639.9938,127.3701,245.0583,0,0,0,0,100,0), +(@PATH,5,626.2823,127.0409,251.9054,0,0,0,0,100,0), +(@PATH,6,611.546,126.5545,258.8932,0,0,0,0,100,0), +(@PATH,7,606.4694,138.4668,258.7596,0,0,0,0,100,0), +(@PATH,8,607.1602,162.4693,258.7508,0,0,0,0,100,0), +(@PATH,9,613.0195,175.0303,258.9398,0,0,0,0,100,0), +(@PATH,10,624.8207,173.8407,253.2433,0,0,0,0,100,0); + +-- Pathing for Promenade Sentinel Entry: 23394 +SET @NPC := 12888; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=548.1619,`position_y`=222.5298,`position_z`=271.9026 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,4097,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,548.1619,222.5298,271.9026,4.712389,33000,0,0,100,0), +(@PATH,2,548.1752,204.6016,265.1634,0,0,0,0,100,0), +(@PATH,3,548.1595,190.8972,258.734,0,0,0,0,100,0), +(@PATH,4,548.0938,205.5043,265.7878,0,0,0,0,100,0); + +-- Pathing for Promenade Sentinel Entry: 23394 +SET @NPC := 12889; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=696.7759,`position_y`=173.015,`position_z`=232.0304 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,4097,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,696.7759,173.015,232.0304,0,0,0,0,100,0), +(@PATH,2,711.6221,149.6127,231.9982,0,0,0,0,100,0), +(@PATH,3,696.7689,127.0203,232.0802,0,0,0,0,100,0), +(@PATH,4,679.1018,126.4796,239.9357,0,0,0,0,100,0), +(@PATH,5,664.3721,125.8799,245.6465,0,0,0,0,100,0), +(@PATH,6,656.2635,131.5955,245.4032,0,0,0,0,100,0), +(@PATH,7,656.2786,146.7755,245.3991,0,0,0,0,100,0), +(@PATH,8,656.2986,153.3558,245.3982,0,0,0,0,100,0), +(@PATH,9,656.5179,169.0384,245.4051,0,0,0,0,100,0), +(@PATH,10,663.8251,173.6144,245.7881,0,0,0,0,100,0), +(@PATH,11,678.0536,173.7249,240.8454,0,0,0,0,100,0); + +-- Pathing for Bonechewer Behemoth Entry: 23196 +SET @NPC := 52739; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=909.464,`position_y`=245.1965,`position_z`=85.64125 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,909.464,245.1965,85.64125,0,0,0,0,100,0), +(@PATH,2,936.0223,259.309,85.6412,0,0,0,0,100,0), +(@PATH,3,941.6469,283.9179,85.64117,0,0,0,0,100,0), +(@PATH,4,924.2444,298.756,86.15284,0,0,0,0,100,0), +(@PATH,5,941.6469,283.9179,85.64117,0,0,0,0,100,0), +(@PATH,6,936.0223,259.309,85.6412,0,0,0,0,100,0), +(@PATH,7,909.464,245.1965,85.64125,0,0,0,0,100,0), +(@PATH,8,881.7233,244.0528,84.85726,0,0,0,0,100,0); + +-- Pathing for Bonechewer Behemoth Entry: 23196 +SET @NPC := 52740; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=899.0332,`position_y`=197.8294,`position_z`=86.16103 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,899.0332,197.8294,86.16103,0,0,0,0,100,0), +(@PATH,2,897.7601,186.8322,86.16117,0,0,0,0,100,0), +(@PATH,3,899.0332,197.8294,86.16103,0,0,0,0,100,0), +(@PATH,4,897.392,207.5867,86.1609,0,0,0,0,100,0), +(@PATH,5,921.5169,224.1364,85.64123,0,0,0,0,100,0), +(@PATH,6,930.8919,235.1188,85.64124,0,0,0,0,100,0), +(@PATH,7,940.9707,239.6061,85.64124,0,0,0,0,100,0), +(@PATH,8,950.1663,237.9947,86.16045,0,0,0,0,100,0), +(@PATH,9,956.6059,230.0929,86.16039,0,0,0,0,100,0), +(@PATH,10,956.8278,213.7176,86.16056,0,0,0,0,100,0), +(@PATH,11,957.555,199.413,86.1607,0,0,0,0,100,0), +(@PATH,12,956.8278,213.7176,86.16056,0,0,0,0,100,0), +(@PATH,13,956.6059,230.0929,86.16039,0,0,0,0,100,0), +(@PATH,14,950.1663,237.9947,86.16045,0,0,0,0,100,0), +(@PATH,15,940.9707,239.6061,85.64124,0,0,0,0,100,0), +(@PATH,16,930.8919,235.1188,85.64124,0,0,0,0,100,0), +(@PATH,17,921.5169,224.1364,85.64123,0,0,0,0,100,0), +(@PATH,18,897.392,207.5867,86.1609,0,0,0,0,100,0), +(@PATH,19,899.0332,197.8294,86.16103,0,0,0,0,100,0), +(@PATH,20,897.7601,186.8322,86.16117,0,0,0,0,100,0); + +-- Pathing for Bonechewer Behemoth Entry: 23196 +SET @NPC := 52542; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=872.4788,`position_y`=65.84342,`position_z`=112.7412 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,872.4788,65.84342,112.7412,0,0,0,0,100,0), +(@PATH,2,935.6211,65.98904,112.7535,0,0,0,0,100,0), +(@PATH,3,899.9241,69.37424,112.7376,0,0,0,0,100,0), +(@PATH,4,869.3976,68.47385,112.7417,0,0,0,0,100,0), +(@PATH,5,826.9479,67.30523,112.7454,0,0,0,0,100,0), +(@PATH,6,869.2424,69.2244,112.7418,0,0,0,0,100,0), +(@PATH,7,863.1619,63.82265,112.7426,0,0,0,0,100,0), +(@PATH,8,868.8893,72.09175,112.7419,0,0,0,0,100,0), +(@PATH,9,861.7059,67.34996,112.7429,0,0,0,0,100,0), +(@PATH,10,867.9327,69.0042,112.742,0,0,0,0,100,0), +(@PATH,11,825.1594,65.52496,112.7448,0,0,0,0,100,0), +(@PATH,12,874.6883,67.74924,112.7409,0,0,0,0,100,0), +(@PATH,13,899.5973,69.61382,112.7372,0,0,0,0,100,0), +(@PATH,14,927.8147,64.82682,112.7534,0,0,0,0,100,0), +(@PATH,15,870.0113,69.63828,112.7417,0,0,0,0,100,0), +(@PATH,16,870.6498,66.78909,112.7415,0,0,0,0,100,0); + +-- Pathing for Bonechewer Behemoth Entry: 23196 +SET @NPC := 52743; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=763.4602,`position_y`=121.2597,`position_z`=112.5469 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,763.4602,121.2597,112.5469,0,0,0,0,100,0), +(@PATH,2,765.515,120.5528,112.4407,0,0,0,0,100,0), +(@PATH,3,761.6171,120.877,112.6373,0,0,0,0,100,0), +(@PATH,4,763.0114,122.1931,112.5738,0,0,0,0,100,0), +(@PATH,5,762.4429,119.6596,112.5902,0,0,0,0,100,0), +(@PATH,6,762.847,118.4683,112.5643,0,0,0,0,100,0), +(@PATH,7,764.7086,116.9735,112.464,0,0,0,0,100,0), +(@PATH,8,762.533,120.0672,112.5876,0,0,0,0,100,0), +(@PATH,9,760.8773,120.2691,112.6714,0,0,0,0,100,0), +(@PATH,10,761.802,117.5317,112.6121,0,0,0,0,100,0), +(@PATH,11,765.24,118.7345,112.4458,0,0,0,0,100,0), +(@PATH,12,762.7466,119.8271,112.5758,0,0,0,0,100,0), +(@PATH,13,759.4903,118.7799,112.7338,0,0,0,0,100,0), +(@PATH,14,760.2434,121.535,112.7092,0,0,0,0,100,0), +(@PATH,15,767.4446,120.2948,112.3428,0,0,0,0,100,0), +(@PATH,16,752.21,117.786,112.7387,0,0,0,0,100,0), +(@PATH,17,735.6179,101.9004,112.7494,0,0,0,0,100,0), +(@PATH,18,724.5951,75.40408,113.4761,0,0,0,0,100,0), +(@PATH,19,756.7452,71.75539,112.7374,0,0,0,0,100,0), +(@PATH,20,756.4152,69.2236,112.7374,0,0,0,0,100,0), +(@PATH,21,730.9688,65.39399,113.2859,0,0,0,0,100,0), +(@PATH,22,775.8292,75.42676,112.7374,0,0,0,0,100,0), +(@PATH,23,772.0274,107.9498,112.6996,0,0,0,0,100,0); + +-- Pathing for Bonechewer Taskmaster Entry: 23028 +SET @NPC := 53816; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=775.0792,`position_y`=766.9516,`position_z`=66.16946 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,775.0792,766.9516,66.16946,0,0,0,0,100,0), +(@PATH,2,776.4752,758.1284,68.59184,0,0,0,0,100,0), +(@PATH,3,776.7239,748.5446,70.04276,0,0,0,0,100,0), +(@PATH,4,771.1584,744.486,69.7692,0,0,0,0,100,0), +(@PATH,5,776.7239,748.5446,70.04276,0,0,0,0,100,0), +(@PATH,6,776.4752,758.1284,68.59184,0,0,0,0,100,0), +(@PATH,7,775.0792,766.9516,66.16946,0,0,0,0,100,0), +(@PATH,8,776.6424,775.2938,65.64797,0,0,0,0,100,0), +(@PATH,9,779.1,781.9779,65.93484,0,0,0,0,100,0), +(@PATH,10,776.9979,791.3973,65.63259,0,0,0,0,100,0), +(@PATH,11,779.1,781.9779,65.93484,0,0,0,0,100,0), +(@PATH,12,776.6424,775.2938,65.64797,0,0,0,0,100,0); + +-- Pathing for Suffering Soul Fragment Entry: 23399 +SET @NPC := 40526; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=496.5382,`position_y`=84.75467,`position_z`=108.4162 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,496.5382,84.75467,108.4162,0,0,0,0,100,0), +(@PATH,2,521.0706,76.54764,112.8559,0,0,0,0,100,0), +(@PATH,3,496.5382,84.75467,108.4162,0,0,0,0,100,0), +(@PATH,4,474.7787,75.08279,111.861,0,0,0,0,100,0); + +-- Pathing for Suffering Soul Fragment Entry: 23399 +SET @NPC := 52411; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=557.008,`position_y`=29.39996,`position_z`=112.4988 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,557.008,29.39996,112.4988,0,0,0,0,100,0), +(@PATH,2,519.227,48.72656,113.3207,0,0,0,0,100,0), +(@PATH,3,477.2372,27.49957,112.5984,0,0,0,0,100,0), +(@PATH,4,519.227,48.72656,113.3207,0,0,0,0,100,0); + +-- Pathing for Suffering Soul Fragment Entry: 23399 +SET @NPC := 46817; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=609.3162,`position_y`=98.43359,`position_z`=112.342 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,609.3162,98.43359,112.342,0,0,0,0,100,0), +(@PATH,2,580.6458,90.18815,111.1614,0,0,0,0,100,0), +(@PATH,3,609.3162,98.43359,112.342,0,0,0,0,100,0), +(@PATH,4,629.5143,77.47526,112.7921,0,0,0,0,100,0); + +-- Pathing for Suffering Soul Fragment Entry: 23399 +SET @NPC := 40446; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=535.6982,`position_y`=75.88596,`position_z`=112.9535 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,535.6982,75.88596,112.9535,0,0,0,0,100,0), +(@PATH,2,560.1788,80.13477,113.2281,0,0,0,0,100,0), +(@PATH,3,574.8022,104.9709,113.0734,0,0,0,0,100,0), +(@PATH,4,560.1788,80.13477,113.2281,0,0,0,0,100,0); + +-- Pathing for Suffering Soul Fragment Entry: 23399 +SET @NPC := 42920; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=629.0891,`position_y`=47.3309,`position_z`=112.7773 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,629.0891,47.3309,112.7773,0,0,0,0,100,0), +(@PATH,2,601.5073,37.56067,112.7347,0,0,0,0,100,0), +(@PATH,3,575.1098,56.30285,111.0313,0,0,0,0,100,0), +(@PATH,4,601.2772,37.47917,112.7411,0,0,0,0,100,0); + +-- Pathing for Hungering Soul Fragment Entry: 23401 +SET @NPC := 52420; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=620.9159,`position_y`=30.22016,`position_z`=112.7356 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '41248'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,620.9159,30.22016,112.7356,0,0,0,0,100,0), +(@PATH,2,607.7153,64.61448,111.7263,0,0,0,0,100,0), +(@PATH,3,589.4402,39.24023,112.765,0,0,0,0,100,0), +(@PATH,4,607.5776,64.42328,111.7202,0,0,0,0,100,0); + +-- Pathing for Hungering Soul Fragment Entry: 23401 +SET @NPC := 52424; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=518.9474,`position_y`=74.61002,`position_z`=112.9129 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '41248'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,518.9474,74.61002,112.9129,0,0,0,0,100,0), +(@PATH,2,473.2182,73.22733,111.8457,0,0,0,0,100,0); + +-- Pathing for Hungering Soul Fragment Entry: 23401 +SET @NPC := 52418; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=617.4402,`position_y`=102.7646,`position_z`=112.7506 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '41248'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,617.4402,102.7646,112.7506,0,0,0,0,100,0), +(@PATH,2,601.6309,74.0624,111.239,0,0,0,0,100,0), +(@PATH,3,578.1609,98.96626,113.0465,0,0,0,0,100,0), +(@PATH,4,601.5496,73.97516,111.2432,0,0,0,0,100,0); + +-- Pathing for Hungering Soul Fragment Entry: 23401 +SET @NPC := 52427; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=552.3234,`position_y`=97.95421,`position_z`=112.4811 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '41248'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,552.3234,97.95421,112.4811,0,0,0,0,100,0), +(@PATH,2,536.0945,78.04199,113.071,0,0,0,0,100,0), +(@PATH,3,552.3234,97.95421,112.4811,0,0,0,0,100,0), +(@PATH,4,573.4583,103.4899,113.1861,0,0,0,0,100,0); + +-- Pathing for Hungering Soul Fragment Entry: 23401 +SET @NPC := 52423; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=512.1553,`position_y`=30.04926,`position_z`=113.648 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '41248'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,512.1553,30.04926,113.648,0,0,0,0,100,0), +(@PATH,2,487.4863,43.71723,112.3249,0,0,0,0,100,0), +(@PATH,3,512.1553,30.04926,113.648,0,0,0,0,100,0), +(@PATH,4,550.6255,48.4656,112.5677,0,0,0,0,100,0); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_02_world_waypoints.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_02_world_waypoints.sql new file mode 100644 index 00000000000..0fcce3f25cf --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_11_02_world_waypoints.sql @@ -0,0 +1,351 @@ +-- Pathing for Sister of Pain Entry: 22956 +SET @NPC := 52847; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=927.6238,`position_y`=341.3523,`position_z`=192.8381 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,927.6238,341.3523,192.8381,0,0,0,0,100,0), +(@PATH,2,933.1646,349.9787,192.8489,0,0,0,0,100,0), +(@PATH,3,946.3496,351.5887,191.208,0,0,0,0,100,0), +(@PATH,4,957.402,349.1798,192.8489,0,0,0,0,100,0), +(@PATH,5,959.1028,340.2523,192.8339,0,0,0,0,100,0), +(@PATH,6,958.7474,315.7549,192.85,0,0,0,0,100,0), +(@PATH,7,958.1597,284.2602,192.8316,0,0,0,0,100,0), +(@PATH,8,957.9045,261.2944,192.8105,0,0,0,0,100,0), +(@PATH,9,934.2908,249.2501,192.8218,0,0,0,0,100,0), +(@PATH,10,924.9614,242.9601,192.8321,0,0,0,0,100,0), +(@PATH,11,923.0469,232.589,192.8392,0,0,0,0,100,0), +(@PATH,12,936.2947,223.5277,192.8423,0,0,0,0,100,0), +(@PATH,13,956.1213,223.5726,192.8414,0,0,0,0,100,0), +(@PATH,14,957.9364,265.2702,192.8146,0,0,0,0,100,0), +(@PATH,15,958.333,291.847,192.8519,0,0,0,0,100,0), +(@PATH,16,958.7474,315.7549,192.85,0,0,0,0,100,0), +(@PATH,17,926.8249,319.8605,192.8298,0,0,0,0,100,0); +-- 0xF13059AC00000970 .go 927.6238 341.3523 192.8381 + +-- Pathing for Sister of Pleasure Entry: 22964 +SET @NPC := 53055; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=925.0996,`position_y`=342.9736,`position_z`=192.8381 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,925.0996,342.9736,192.8381,0,0,0,0,100,0), +(@PATH,2,932.8010,352.9566,192.8489,0,0,0,0,100,0), +(@PATH,3,946.9885,354.5199,191.2080,0,0,0,0,100,0), +(@PATH,4,960.3490,349.7412,192.8489,0,0,0,0,100,0), +(@PATH,5,962.1025,340.2088,192.8339,0,0,0,0,100,0), +(@PATH,6,961.7469,315.6989,192.8500,0,0,0,0,100,0), +(@PATH,7,961.1595,284.2269,192.8316,0,0,0,0,100,0), +(@PATH,8,959.2676,258.6220,192.8105,0,0,0,0,100,0), +(@PATH,9,935.9679,246.7626,192.8218,0,0,0,0,100,0), +(@PATH,10,927.9116,242.4155,192.8321,0,0,0,0,100,0), +(@PATH,11,924.7406,235.0652,192.8392,0,0,0,0,100,0), +(@PATH,12,936.2879,226.5277,192.8423,0,0,0,0,100,0), +(@PATH,13,953.1241,223.7031,192.8414,0,0,0,0,100,0), +(@PATH,14,954.9367,265.3150,192.8146,0,0,0,0,100,0), +(@PATH,15,955.3335,291.8990,192.8519,0,0,0,0,100,0), +(@PATH,16,958.3647,312.7794,192.8500,0,0,0,0,100,0), +(@PATH,17,923.8270,319.9719,192.8298,0,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=52847; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(52847,52847,0,0,2), +(52847,53055,3,270,2); + +-- Pathing for Sister of Pain Entry: 22956 +SET @NPC := 52848; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=939.6501,`position_y`=392.5455,`position_z`=192.2012 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,939.6501,392.5455,192.2012,0,0,0,0,100,0), +(@PATH,2,955.7531,392.462,192.8371,0,0,0,0,100,0), +(@PATH,3,962.5223,393.8847,192.8374,0,0,0,0,100,0), +(@PATH,4,969.5388,399.207,192.8365,0,0,0,0,100,0), +(@PATH,5,970.2259,412.7339,192.8371,0,0,0,0,100,0), +(@PATH,6,971.1399,429.8507,192.8395,0,0,0,0,100,0), +(@PATH,7,971.1545,441.883,192.8399,0,0,0,0,100,0), +(@PATH,8,963.2639,447.4974,192.8385,0,0,0,0,100,0), +(@PATH,9,950.0648,453.577,192.8389,0,0,0,0,100,0), +(@PATH,10,938.3679,452.2439,192.8379,0,0,0,0,100,0), +(@PATH,11,927.6536,446.5119,192.8374,0,0,0,0,100,0), +(@PATH,12,920.3358,436.4881,192.841,0,0,0,0,100,0), +(@PATH,13,920.5208,411.5176,192.8447,0,0,0,0,100,0), +(@PATH,14,922.6708,402.1874,192.8461,0,0,0,0,100,0), +(@PATH,15,931.1328,395.2974,192.8446,0,0,0,0,100,0); +-- 0xF13059AC00000972 .go 939.6501 392.5455 192.2012 + +-- Pathing for Sister of Pleasure Entry: 22964 +SET @NPC := 53056; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=939.6657,`position_y`=395.5455,`position_z`=192.2012 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,939.6657,395.5455,192.2012,0,0,0,0,100,0), +(@PATH,2,955.1361,395.3979,192.8371,0,0,0,0,100,0), +(@PATH,3,960.7093,396.2749,192.8374,0,0,0,0,100,0), +(@PATH,4,966.5427,399.3592,192.8365,0,0,0,0,100,0), +(@PATH,5,967.2302,412.8939,192.8371,0,0,0,0,100,0), +(@PATH,6,968.1399,429.8543,192.8395,0,0,0,0,100,0), +(@PATH,7,969.4152,439.4386,192.8399,0,0,0,0,100,0), +(@PATH,8,962.0088,444.7726,192.8385,0,0,0,0,100,0), +(@PATH,9,950.4045,450.5963,192.8389,0,0,0,0,100,0), +(@PATH,10,939.7831,449.5987,192.8379,0,0,0,0,100,0), +(@PATH,11,930.0766,444.7430,192.8374,0,0,0,0,100,0), +(@PATH,12,923.3357,436.5103,192.8410,0,0,0,0,100,0), +(@PATH,13,923.4442,412.1912,192.8447,0,0,0,0,100,0), +(@PATH,14,924.5650,404.5138,192.8461,0,0,0,0,100,0), +(@PATH,15,932.0551,398.1521,192.8446,0,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=52848; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(52848,52848,0,0,2), +(52848,53056,3,270,2); + +-- Pathing for Sister of Pain Entry: 22956 +SET @NPC := 52855; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=946.1318,`position_y`=109.8686,`position_z`=192.8489 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,946.1318,109.8686,192.8489,0,0,0,0,100,0), +(@PATH,2,927.7674,117.2716,192.8514,0,0,0,0,100,0), +(@PATH,3,918.4934,131.3158,192.8362,0,0,0,0,100,0), +(@PATH,4,919.8276,156.7103,192.8208,0,0,0,0,100,0), +(@PATH,5,924.041,177.5718,192.8279,0,0,0,0,100,0), +(@PATH,6,935.0341,190.2466,192.8337,0,0,0,0,100,0), +(@PATH,7,946.1438,190.5046,192.0657,0,0,0,0,100,0), +(@PATH,8,957.5206,190.2688,192.8344,0,0,0,0,100,0), +(@PATH,9,967.0856,176.6067,192.8276,0,0,0,0,100,0), +(@PATH,10,970.228,156.7281,192.829,0,0,0,0,100,0), +(@PATH,11,971.1368,131.5664,192.8254,0,0,0,0,100,0), +(@PATH,12,963.462,116.8087,192.829,0,0,0,0,100,0); +-- 0xF13059AC00000975 .go 946.1318 109.8686 192.8489 + +-- Pathing for Sister of Pleasure Entry: 22964 +SET @NPC := 53059; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=945.0102,`position_y`=107.0862,`position_z`=192.8489 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,945.0102,107.0862,192.8489,0,0,0,0,100,0), +(@PATH,2,925.2640,115.6185,192.8514,0,0,0,0,100,0), +(@PATH,3,915.4975,131.4732,192.8362,0,0,0,0,100,0), +(@PATH,4,916.8870,157.3042,192.8208,0,0,0,0,100,0), +(@PATH,5,921.7747,179.5374,192.8279,0,0,0,0,100,0), +(@PATH,6,934.9644,193.2458,192.8337,0,0,0,0,100,0), +(@PATH,7,946.2060,193.5040,192.0657,0,0,0,0,100,0), +(@PATH,8,959.9782,191.9894,192.8344,0,0,0,0,100,0), +(@PATH,9,970.0488,177.0751,192.8276,0,0,0,0,100,0), +(@PATH,10,973.2260,156.8364,192.8290,0,0,0,0,100,0), +(@PATH,11,973.7984,130.1822,192.8254,0,0,0,0,100,0), +(@PATH,12,964.5773,114.0237,192.8290,0,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=52855; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(52855,52855,0,0,2), +(52855,53059,3,270,2); + +-- Pathing for Sister of Pain Entry: 22956 +SET @NPC := 52846; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=832.2903,`position_y`=526.5916,`position_z`=165.7311 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,832.2903,526.5916,165.7311,0,0,0,0,100,0), +(@PATH,2,818.8309,520.7764,165.9885,0,0,0,0,100,0), +(@PATH,3,812.696,514.7813,166.1044,0,0,0,0,100,0), +(@PATH,4,812.6564,506.3056,170.2904,0,0,0,0,100,0), +(@PATH,5,812.5226,493.5983,180.3996,0,0,0,0,100,0), +(@PATH,6,812.2745,477.484,192.7058,0,0,0,0,100,0), +(@PATH,7,812.5706,466.9394,192.7913,0,0,0,0,100,0), +(@PATH,8,812.2745,477.484,192.7058,0,0,0,0,100,0), +(@PATH,9,812.5226,493.5983,180.3996,0,0,0,0,100,0), +(@PATH,10,812.6564,506.3056,170.2904,0,0,0,0,100,0), +(@PATH,11,812.696,514.7813,166.1044,0,0,0,0,100,0), +(@PATH,12,818.8309,520.7764,165.9885,0,0,0,0,100,0), +(@PATH,13,832.2903,526.5916,165.7311,0,0,0,0,100,0), +(@PATH,14,837.6116,532.7322,165.7527,0,0,0,0,100,0), +(@PATH,15,840.6443,543.301,165.6792,0,0,0,0,100,0), +(@PATH,16,849.1154,543.5079,165.8225,0,0,0,0,100,0), +(@PATH,17,862.1961,543.5349,156.2316,0,0,0,0,100,0), +(@PATH,18,874.82,543.4052,146.1888,0,0,0,0,100,0), +(@PATH,19,890.8995,543.0212,139.3036,0,0,0,0,100,0), +(@PATH,20,874.82,543.4052,146.1888,0,0,0,0,100,0), +(@PATH,21,862.1961,543.5349,156.2316,0,0,0,0,100,0), +(@PATH,22,849.1154,543.5079,165.8225,0,0,0,0,100,0), +(@PATH,23,840.6443,543.301,165.6792,0,0,0,0,100,0), +(@PATH,24,837.6116,532.7322,165.7527,0,0,0,0,100,0); +-- 0xF13059AC000009CB .go 832.2903 526.5916 165.7311 + +-- Pathing for Sister of Pleasure Entry: 22964 +SET @NPC := 53054; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=833.4802,`position_y`=523.8377,`position_z`=165.7311 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,833.4802,523.8377,165.7311,0,0,0,0,100,0), +(@PATH,2,820.9276,518.6308,165.9885,0,0,0,0,100,0), +(@PATH,3,815.6960,514.7673,166.1044,0,0,0,0,100,0), +(@PATH,4,815.6562,506.2740,170.2904,0,0,0,0,100,0), +(@PATH,5,815.5222,493.5521,180.3996,0,0,0,0,100,0), +(@PATH,6,815.2733,477.5682,192.7058,0,0,0,0,100,0), +(@PATH,7,815.5694,467.0236,192.7913,0,0,0,0,100,0), +(@PATH,8,815.2741,477.4378,192.7058,0,0,0,0,100,0), +(@PATH,9,815.5224,493.5667,180.3996,0,0,0,0,100,0), +(@PATH,10,815.6564,506.2916,170.2904,0,0,0,0,100,0), +(@PATH,11,814.7927,512.6357,166.1044,0,0,0,0,100,0), +(@PATH,12,820.0208,518.0225,165.9885,0,0,0,0,100,0), +(@PATH,13,834.5575,524.6269,165.7311,0,0,0,0,100,0), +(@PATH,14,840.4952,531.9047,165.7527,0,0,0,0,100,0), +(@PATH,15,840.7176,540.3019,165.6792,0,0,0,0,100,0), +(@PATH,16,849.1216,540.5079,165.8225,0,0,0,0,100,0), +(@PATH,17,862.1653,540.5351,156.2316,0,0,0,0,100,0), +(@PATH,18,874.7484,540.4061,146.1888,0,0,0,0,100,0), +(@PATH,19,890.8279,540.0221,139.3036,0,0,0,0,100,0), +(@PATH,20,874.7892,540.4054,146.1888,0,0,0,0,100,0), +(@PATH,21,862.2023,540.5349,156.2316,0,0,0,0,100,0), +(@PATH,22,849.1887,540.5088,165.8225,0,0,0,0,100,0), +(@PATH,23,843.5279,542.4735,165.6792,0,0,0,0,100,0), +(@PATH,24,839.8788,530.7675,165.7527,0,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=52846; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(52846,52846,0,0,2), +(52846,53054,3,270,2); + +-- Pathing for Sister of Pain Entry: 22956 +SET @NPC := 52854; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=897.643,`position_y`=368.6811,`position_z`=112.7681 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,897.643,368.6811,112.7682,0,0,0,0,100,0), +(@PATH,2,891.4086,375.0052,112.7682,0,0,0,0,100,0), +(@PATH,3,886.6258,392.1916,112.7681,0,0,0,0,100,0), +(@PATH,4,889.0926,406.6414,112.7681,0,0,0,0,100,0), +(@PATH,5,895.0201,414.2144,112.7681,0,0,0,0,100,0), +(@PATH,6,907.2474,422.6099,112.7681,0,0,0,0,100,0), +(@PATH,7,917.291,427.4965,112.7681,0,0,0,0,100,0), +(@PATH,8,917.538,443.7802,112.7681,0,0,0,0,100,0), +(@PATH,9,918.18,480.8549,121.0903,0,0,0,0,100,0), +(@PATH,10,918.1483,469.0587,112.768,0,0,0,0,100,0), +(@PATH,11,917.9372,449.7168,112.7681,0,0,0,0,100,0), +(@PATH,12,917.7559,427.5167,112.7681,0,0,0,0,100,0), +(@PATH,13,928.2393,423.6823,112.768,0,0,0,0,100,0), +(@PATH,14,942.3116,412.3955,112.768,0,0,0,0,100,0), +(@PATH,15,947.6193,400.7702,112.768,0,0,0,0,100,0), +(@PATH,16,947.3901,388.0476,112.768,0,0,0,0,100,0), +(@PATH,17,944.3997,375.4843,112.768,0,0,0,0,100,0), +(@PATH,18,934.3572,366.3027,112.7681,0,0,0,0,100,0), +(@PATH,19,922.269,361.623,112.7681,0,0,0,0,100,0), +(@PATH,20,907.52,362.9464,112.7682,0,0,0,0,100,0); +-- 0xF13059AC000009CE .go 917.291 427.4965 112.7681 + +-- Pathing for Sister of Pleasure Entry: 22964 +SET @NPC := 53058; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=895.5066,`position_y`=366.5750,`position_z`=112.7681 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,895.5066,366.5750,112.7682,0,0,0,0,100,0), +(@PATH,2,888.5184,374.2009,112.7682,0,0,0,0,100,0), +(@PATH,3,883.6686,392.6964,112.7681,0,0,0,0,100,0), +(@PATH,4,886.7302,408.4905,112.7681,0,0,0,0,100,0), +(@PATH,5,893.3220,416.6875,112.7681,0,0,0,0,100,0), +(@PATH,6,905.9349,425.3075,112.7681,0,0,0,0,100,0), +(@PATH,7,914.2913,427.5420,112.7681,0,0,0,0,100,0), +(@PATH,8,914.5384,443.8321,112.7681,0,0,0,0,100,0), +(@PATH,9,915.1800,480.8630,121.0903,0,0,0,0,100,0), +(@PATH,10,915.1485,469.0914,112.7680,0,0,0,0,100,0), +(@PATH,11,914.9373,449.7413,112.7681,0,0,0,0,100,0), +(@PATH,12,916.7254,424.6992,112.7681,0,0,0,0,100,0), +(@PATH,13,930.1163,426.0226,112.7680,0,0,0,0,100,0), +(@PATH,14,945.0406,413.6415,112.7680,0,0,0,0,100,0), +(@PATH,15,950.6188,400.7162,112.7680,0,0,0,0,100,0), +(@PATH,16,950.3086,387.3529,112.7680,0,0,0,0,100,0), +(@PATH,17,946.4240,373.2702,112.7680,0,0,0,0,100,0), +(@PATH,18,935.4403,363.5050,112.7681,0,0,0,0,100,0), +(@PATH,19,922.0009,358.6350,112.7681,0,0,0,0,100,0), +(@PATH,20,906.0137,360.3520,112.7682,0,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=52854; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(52854,52854,0,0,2), +(52854,53058,3,270,2); + +-- Pathing for Sister of Pain Entry: 22956 +SET @NPC := 52850; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=863.5932,`position_y`=404.4617,`position_z`=192.8021 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,863.5932,404.4617,192.8021,0,0,0,0,100,0), +(@PATH,2,857.1285,400.2212,192.8021,0,0,0,0,100,0), +(@PATH,3,841.5421,399.2611,192.8021,0,0,0,0,100,0), +(@PATH,4,824.6133,403.406,192.8021,0,0,0,0,100,0), +(@PATH,5,809.0944,408.0469,192.8021,0,0,0,0,100,0), +(@PATH,6,803.2555,409.021,192.8021,0,0,0,0,100,0), +(@PATH,7,798.0318,415.624,192.8021,0,0,0,0,100,0), +(@PATH,8,797.907,434.2558,192.8021,0,0,0,0,100,0), +(@PATH,9,803.9134,446.4958,192.8102,0,0,0,0,100,0), +(@PATH,10,822.2453,446.5771,192.8121,0,0,0,0,100,0), +(@PATH,11,832.8823,444.5272,192.8021,0,0,0,0,100,0), +(@PATH,12,841.865,440.6642,192.8021,0,0,0,0,100,0), +(@PATH,13,857.7858,440.4023,192.8021,0,0,0,0,100,0), +(@PATH,14,868.998,422.5621,192.8202,0,0,0,0,100,0), +(@PATH,15,892.9637,421.5781,192.8236,0,0,0,0,100,0), +(@PATH,16,869.101,417.053,192.80818,0,0,0,0,100,0); +-- 0xF13059AC00000B10 .go 863.5932 404.4617 192.8021 + +-- Pathing for Sister of Pleasure Entry: 22964 +SET @NPC := 53057; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=865.2386,`position_y`=401.9532,`position_z`=192.8021 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,865.2386,401.9532,192.8021,0,0,0,0,100,0), +(@PATH,2,857.3129,397.2269,192.8021,0,0,0,0,100,0), +(@PATH,3,840.8286,396.3472,192.8021,0,0,0,0,100,0), +(@PATH,4,823.7538,400.5318,192.8021,0,0,0,0,100,0), +(@PATH,5,808.6007,405.0878,192.8021,0,0,0,0,100,0), +(@PATH,6,800.9027,407.1597,192.8021,0,0,0,0,100,0), +(@PATH,7,795.0319,415.6039,192.8021,0,0,0,0,100,0), +(@PATH,8,795.2138,435.5774,192.8021,0,0,0,0,100,0), +(@PATH,9,803.9001,449.4958,192.8102,0,0,0,0,100,0), +(@PATH,10,822.8130,449.5229,192.8121,0,0,0,0,100,0), +(@PATH,11,834.0675,447.2832,192.8021,0,0,0,0,100,0), +(@PATH,12,841.9143,443.6638,192.8021,0,0,0,0,100,0), +(@PATH,13,860.3258,441.9986,192.8021,0,0,0,0,100,0), +(@PATH,14,869.1211,425.5596,192.8202,0,0,0,0,100,0), +(@PATH,15,893.0868,424.5756,192.8236,0,0,0,0,100,0), +(@PATH,16,868.987,420.166,192.80742,0,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=52850; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(52850,52850,0,0,2), +(52850,53057,3,270,2); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_12_00_world_sai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_12_00_world_sai.sql new file mode 100644 index 00000000000..cf2c80f580f --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_12_00_world_sai.sql @@ -0,0 +1,7 @@ +-- Fixes Blowing Hodir's Horn (12977) +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=29974; +DELETE FROM `smart_scripts` WHERE `entryorguid`=29974 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(29974, 0, 0, 0, 0, 0, 100, 0, 1000, 5000, 8000, 13000, 11, 57454, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Niffelem Forefather - IC - Cast Ice Spike'), +(29974, 0, 1, 2, 8, 0, 100, 0, 55983, 0, 0, 0, 33, 30138, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Niffelem Forefather - On Spellhit - Give Kill Credit'), +(29974, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Niffelem Forefather - Linked with Previous Event Despawn'); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_12_01_world_eai.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_12_01_world_eai.sql new file mode 100644 index 00000000000..c36b6d0f3c6 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_12_01_world_eai.sql @@ -0,0 +1 @@ +DELETE FROM `creature_ai_scripts` WHERE `creature_id` = 29974; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_13_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_13_00_world_misc.sql new file mode 100644 index 00000000000..b34e96a0811 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_13_00_world_misc.sql @@ -0,0 +1,5 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=40094; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,40094,0,0,31,0,3,22953,0,0,'','Spell summom channel targets Wrathbone Flayer'); +UPDATE `creature_template` SET `AIName`= '', `ScriptName` = 'npc_wrathbone_flayer' WHERE `entry`=22953; +DELETE FROM smart_scripts WHERE entryorguid=22953; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_14_00_world_errors.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_14_00_world_errors.sql new file mode 100644 index 00000000000..f6ce6c2c0aa --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_14_00_world_errors.sql @@ -0,0 +1,4 @@ +-- Fix "There is no waypoint which links to the waypoint script 332" + +DELETE FROM `waypoint_scripts` WHERE `id`=332; +DELETE FROM `db_script_string` WHERE `entry`=2000005146; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_14_01_world_item_template.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_14_01_world_item_template.sql new file mode 100644 index 00000000000..ab372605f4b --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_14_01_world_item_template.sql @@ -0,0 +1,14 @@ +UPDATE `item_template` SET `Flags`=0x80000000 WHERE `entry`=23614; +UPDATE `item_template` SET `Flags`=0x80000800 WHERE `entry`=28635; +UPDATE `item_template` SET `Flags`=0x80000800 WHERE `entry`=28636; +UPDATE `item_template` SET `Flags`=0x80000800 WHERE `entry`=28637; +UPDATE `item_template` SET `Flags`=0x80000000 WHERE `entry`=30503; +UPDATE `item_template` SET `Flags`=0x80000000 WHERE `entry`=34868; +UPDATE `item_template` SET `Flags`=0x80000000 WHERE `entry`=37020; +UPDATE `item_template` SET `Flags`=0x80010000 WHERE `entry`=37200; +UPDATE `item_template` SET `Flags`=0x80000040 WHERE `entry`=40652; +UPDATE `item_template` SET `Flags`=0x80000040 WHERE `entry`=40970; +UPDATE `item_template` SET `Flags`=0x80000800 WHERE `entry`=41843; +UPDATE `item_template` SET `Flags`=0x80000800 WHERE `entry`=42782; + +ALTER TABLE `item_template` CHANGE `Flags` `Flags` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_00_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_00_world_gossip.sql new file mode 100644 index 00000000000..33467ad43be --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_00_world_gossip.sql @@ -0,0 +1,25 @@ +-- Add SAI for Sputtervalve <Independent Contractor> Quest 6981 +UPDATE `creature_template` SET `gossip_menu_id`=21,`ScriptName`='' WHERE `entry`=3442; +DELETE FROM `smart_scripts` WHERE `entryorguid`=3442 AND `source_type`=0 AND `id`=1; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(3442, 0, 1, 0, 62, 0, 100, 0, 21, 1, 0, 0, 15, 6981, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Sputtervalve - Gossip Option 1 - Complete quest 6981'); +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry`=21199; +DELETE FROM `gossip_menu` WHERE `entry` IN (21,22,21340); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +('21','518'), ('21','519'), ('22','520'), (21340,2013); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id`=21; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(21,0,0, 'How can I help?',1,1,22), +(21,1,0, 'Can you tell me about this shard?',1,1,21340); +-- Gossip Menu Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=21; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,21,518,0,0,27,0,10,3,0,0,'','Gossip text requires level 10 or higher'), +(15,21,519,0,0,27,0,10,2,0,0,'','Gossip text requires lower than level 10'); +-- Gossip Options Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=21; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,21,0,0,0,27,0,10,3,0,0,'','Gossip Option requires level 10 or higher'), +(15,21,1,0,0,9,0,6981,0,0,0,'','Gossip Option requires quest not complete'); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_01_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_01_world_gossip.sql new file mode 100644 index 00000000000..b59feae2c5c --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_01_world_gossip.sql @@ -0,0 +1,15 @@ +-- Gossip fixup for Drull and Tog'thar +UPDATE `creature_template` SET `gossip_menu_id`=262 WHERE `entry`=2239; +DELETE FROM `gossip_menu` WHERE `entry` IN (261,262,263); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +('261','760'), ('262','759'), ('263','762'); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (262,264); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(262,0,0, 'Where is the key to this lock?',1,1,261), +(264,1,0, 'Where is the key to this lock?',1,1,263); +-- Gossip Options Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (262,264); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,262,0,0,0,9,0,498,0,0,0,'','Gossip Option requires quest not complete'), +(15,264,1,0,0,9,0,498,0,0,0,'','Gossip Option requires quest not complete'); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_02_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_02_world_gossip.sql new file mode 100644 index 00000000000..9e54b17899a --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_02_world_gossip.sql @@ -0,0 +1,8 @@ +-- Gossip fixup for Morridune +UPDATE `creature_template` SET `gossip_menu_id`=321 WHERE `entry`=6729; +DELETE FROM `gossip_menu` WHERE `entry` IN (321); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (321,818); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (321); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(321,0,0, 'Please port me to Darnassus.',1,1,0); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_03_world_gossip.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_03_world_gossip.sql new file mode 100644 index 00000000000..1193522b273 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_15_03_world_gossip.sql @@ -0,0 +1,37 @@ +-- Gossip fixup for Aleanna Edune +UPDATE `creature_template` SET `gossip_menu_id`=361 WHERE `entry`=24734; +DELETE FROM `gossip_menu` WHERE `entry` IN (361); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (361,838); + +-- Gossip fixup for Marli Wishrunner +UPDATE `creature_template` SET `gossip_menu_id`=1421 WHERE `entry`=7773; +DELETE FROM `gossip_menu` WHERE `entry` IN (1421); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (1421,2053); + +-- Gossip fixup for Kalin Windflight "This guy may be missing a script" +UPDATE `creature_template` SET `gossip_menu_id`=1422 WHERE `entry`=7772; +DELETE FROM `gossip_menu` WHERE `entry` IN (1422); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (1422,2054); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1422); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(1422,0,1, 'Can you help me get down?',3,128,0); + +-- Gossip fixup for Henry Stern +UPDATE `creature_template` SET `gossip_menu_id`=1443 WHERE `entry`=8696; +DELETE FROM `gossip_menu` WHERE `entry` IN (1442,1443,1444,1501,1502); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(1442,2115),(1443,2113),(1444,2114),(1501,2173),(1502,2174); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1443); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(1443,0,0, 'You can cook? So can I! Is there a recipe you can teach me?',1,1,0), +(1443,1,0, 'You''re an alchemist? So am I. Perhaps you can teach me what you know...',1,1,0); + +-- Gossip Options Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1443; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1443,0,0,0,7,0,185,0,0,0,0,'','Gossip Option requires cooking skill'), +(15,1443,0,0,1,25,0,13028,0,0,1,0,'','Gossip Option requires player not learned spell'), +(15,1443,1,0,0,7,0,171,0,0,0,0,'','Gossip Option requires alchemy skill'), +(15,1443,1,0,1,25,0,3451,0,0,1,0,'','Gossip Option requires player not learned spell'); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_00_world_misc.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_00_world_misc.sql new file mode 100644 index 00000000000..449919e44e2 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_00_world_misc.sql @@ -0,0 +1,19 @@ +-- No longer used as of patch 3.3.0 +DELETE FROM `areatrigger_teleport` WHERE `id`=4156; + +UPDATE `game_graveyard_zone` SET `faction`=469 WHERE `id`=1308; -- Alliance Only + +DELETE FROM `game_graveyard_zone` WHERE `id`=1309; +INSERT INTO `game_graveyard_zone` (`id`, `ghost_zone`, `faction`) VALUES +(1309, 3456, 67); -- Dragonblight, Forsaken East GY - Horde Only + +DELETE FROM `gameobject` WHERE `guid` IN (5216, 5222); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(5216, 202277, 533, 3, 1, 3495.97, -5357.84, 144.9645, 0.5410506, 0, 0, 0, 1, 7200, 255, 1), -- Orb of Naxxramas +(5222, 202278, 533, 3, 1, 2997.675, -3437.799, 304.1996, 1.151916, 0, 0, 0, 1, 7200, 255, 1); -- Orb of Naxxramas + +-- Teleportation positions for Orbs from sniff - TODO: add db coords for spell 72613 +DELETE FROM `spell_target_position` WHERE `id` IN (28444, 72617); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES +(28444, 533, 3005.74, -3434.27, 304.196, 0), -- Portal Effect: Deathknight Wing +(72617, 533, 3498.22, -5349.36, 144.969, 1.32679); -- Naxxramas Teleport - Sapphiron Entry diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_01_world_gameobject.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_01_world_gameobject.sql new file mode 100644 index 00000000000..ef5624ee090 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_01_world_gameobject.sql @@ -0,0 +1 @@ +UPDATE `gameobject` SET `spawnMask`=3 WHERE `guid` IN (5216,5222); diff --git a/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_02_world_conditions.sql b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_02_world_conditions.sql new file mode 100644 index 00000000000..5b89e1b93d3 --- /dev/null +++ b/sql/old/3.3.5a/TDB51_to_TDB52_updates/world/2013_07_16_02_world_conditions.sql @@ -0,0 +1 @@ +UPDATE `conditions` SET `ConditionValue2`=1 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1443 AND `ConditionTypeOrReference`=7 AND `ConditionValue1` IN (171,185); diff --git a/sql/updates/characters/2013_07_19_00_characters_corpse.sql b/sql/updates/characters/2013_07_19_00_characters_corpse.sql new file mode 100644 index 00000000000..da52c91e875 --- /dev/null +++ b/sql/updates/characters/2013_07_19_00_characters_corpse.sql @@ -0,0 +1 @@ +ALTER TABLE `corpse` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1'; diff --git a/sql/updates/world/2013_07_17_00_world_version.sql b/sql/updates/world/2013_07_17_00_world_version.sql new file mode 100644 index 00000000000..a780826ad48 --- /dev/null +++ b/sql/updates/world/2013_07_17_00_world_version.sql @@ -0,0 +1 @@ +UPDATE `version` SET `db_version`='TDB 335.52', `cache_id`=52 LIMIT 1; diff --git a/sql/updates/world/2013_07_17_01_world_conditions.sql b/sql/updates/world/2013_07_17_01_world_conditions.sql new file mode 100644 index 00000000000..4528d39943c --- /dev/null +++ b/sql/updates/world/2013_07_17_01_world_conditions.sql @@ -0,0 +1,10 @@ +-- Gossip Menu Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=21; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,21,518,0,0,27,0,10,3,0,0,'','Gossip text requires level 10 or higher'), +(14,21,519,0,0,27,0,10,2,0,0,'','Gossip text requires lower than level 10'); +-- Gossip Options Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=21; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,21,0,0,0,27,0,10,3,0,0,'','Gossip Option requires level 10 or higher'), +(15,21,1,0,0,9,0,6981,0,0,0,'','Gossip Option requires quest not complete'); diff --git a/sql/updates/world/2013_07_17_02_world_gossip.sql b/sql/updates/world/2013_07_17_02_world_gossip.sql new file mode 100644 index 00000000000..0ec238efb05 --- /dev/null +++ b/sql/updates/world/2013_07_17_02_world_gossip.sql @@ -0,0 +1,22 @@ +-- Add SAI for Royal Historian Archesonus Quest 3702 +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`= '' WHERE `entry`=8879; +DELETE FROM `smart_scripts` WHERE `entryorguid`=8879 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(8879, 0, 0, 1, 62, 0, 100, 0, 1563, 0, 0, 0, 15, 3702, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Royal Historian Archesonus - Gossip Option 0 - Complete quest 3702'), +(8879, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Royal Historian Archesonus - Gossip Option 0 - Close Gossip'); +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry` IN (1562,1563,1564,1565); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(1562,2238), (1563,2239), (1564,2237), (1565,2236); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1561,1562,1563,1564,1565); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(1561,0,0, 'I am ready, Historian Archesonus.',1,1,1565), +(1562,0,0, 'Unbelievable! How dare they??',1,1,1563), +(1563,0,0, 'Of course I will help!',1,1,0), +(1564,0,0, 'Interesting, continue please.',1,1,1562), +(1565,0,0, 'That is tragic. How did this happen?',1,1,1564); +-- Gossip Options Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1561; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1561,0,0,0,9,0,3702,0,0,0,'','Gossip Option requires quest taken'); diff --git a/sql/updates/world/2013_07_17_03_world_gossip.sql b/sql/updates/world/2013_07_17_03_world_gossip.sql new file mode 100644 index 00000000000..f3c79890fde --- /dev/null +++ b/sql/updates/world/2013_07_17_03_world_gossip.sql @@ -0,0 +1,53 @@ +-- Captain Vanessa Beltis +UPDATE `creature_template` SET `gossip_menu_id`=1641 WHERE `entry`=8380; +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry` IN (1641); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (1641,2293); + +-- Franclorn Forgewright 8888 +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry` IN (1664,1665,1666); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(1664,2316), (1665,2317), (1666,2318); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1663,1664,1665); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(1663,0,0, 'Amazing! I''ve never spoken to a ghost. I wish to learn!',1,1,1664), +(1664,0,0, 'Continue please.',1,1,1665), +(1665,0,0, 'Fascinating. Please, tell me more.',1,1,1666); + +-- Ribbly Screwspigot +UPDATE `creature_template` SET `gossip_menu_id`=1970 WHERE `entry`=9543; +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry` IN (1970); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (1970,2643); + +-- Arei "npc has two text, possible scripting required" +UPDATE `creature_template` SET `gossip_menu_id`=2063 WHERE `entry`=9598; +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry` IN (2063); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (2063,2726), (2063,2809); + +-- Add SAI for Un'Goro Crystal Pylon Quests 4285, 4287, 4288 +UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI',`ScriptName`= '' WHERE `entry` IN (164955,164957,164956); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (164955,164957,164956) AND `source_type`=1; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(164955, 1, 0, 0, 62, 0, 100, 0, 2177, 0, 0, 0, 15, 4285, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Northern Crystal Pylon - Gossip Option 0 - Complete quest 4285'), +(164957, 1, 0, 0, 62, 0, 100, 0, 2178, 0, 0, 0, 15, 4287, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Eastern Crystal Pylon - Gossip Option 0 - Complete quest 4287'), +(164956, 1, 0, 0, 62, 0, 100, 0, 2179, 0, 0, 0, 15, 4288, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Western Crystal Pylon - Gossip Option 0 - Complete quest 4288'); +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry` IN (2177,2178,2179,2180,2181,2182); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(2177,2810),(2177,2933),(2178,2810),(2178,2933),(2179,2810),(2179,2933),(2180,2811),(2181,2812),(2182,2813); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (2177,2178,2179); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(2177,0,0, 'I want to examine this pylon.',1,1,2181), +(2178,0,0, 'I want to examine this pylon.',1,1,2180), +(2179,0,0, 'I want to examine this pylon.',1,1,2182); +-- Gossip Options Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (2177,2178,2179); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,2177,0,0,0,9,0,4285,0,0,0,'','Gossip Option requires quest not complete'), +(15,2178,0,0,0,9,0,4287,0,0,0,'','Gossip Option requires quest not complete'), +(15,2179,0,0,0,9,0,4288,0,0,0,'','Gossip Option requires quest not complete'); diff --git a/sql/updates/world/2013_07_17_04_world_spell_script_names.sql b/sql/updates/world/2013_07_17_04_world_spell_script_names.sql new file mode 100644 index 00000000000..acec312eb92 --- /dev/null +++ b/sql/updates/world/2013_07_17_04_world_spell_script_names.sql @@ -0,0 +1,4 @@ +UPDATE `spell_script_names` SET `ScriptName`='spell_gen_clone' WHERE `ScriptName`='spell_generic_clone'; +UPDATE `spell_script_names` SET `ScriptName`='spell_gen_clone_weapon' WHERE `ScriptName`='spell_generic_clone_weapon'; +UPDATE `spell_script_names` SET `ScriptName`='spell_gen_30pct_count_pct_from_max_hp' WHERE `ScriptName`='spell_gen_touch_the_nightmare'; +UPDATE `spell_script_names` SET `ScriptName`='spell_gen_creature_permanent_feign_death' WHERE `ScriptName`='spell_creature_permanent_feign_death'; diff --git a/sql/updates/world/2013_07_18_00_world_conditions.sql b/sql/updates/world/2013_07_18_00_world_conditions.sql new file mode 100644 index 00000000000..90a16d32fb3 --- /dev/null +++ b/sql/updates/world/2013_07_18_00_world_conditions.sql @@ -0,0 +1,2 @@ +-- Fix There's Something About the Squire +UPDATE `conditions` SET `ConditionTarget`=1 WHERE `SourceTypeOrReferenceId`=17 AND `SourceGroup`=0 AND `SourceEntry`=63126 AND `ConditionTypeOrReference`=9; diff --git a/sql/updates/world/2013_07_18_01_world_koralon.sql b/sql/updates/world/2013_07_18_01_world_koralon.sql new file mode 100644 index 00000000000..a67df5222ca --- /dev/null +++ b/sql/updates/world/2013_07_18_01_world_koralon.sql @@ -0,0 +1,15 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (66725,68161,66808,68160,66765,67333,66809,67331); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(66725, 'spell_koralon_meteor_fists'), +(68161, 'spell_koralon_meteor_fists'), +(66808, 'spell_flame_warder_meteor_fists'), +(68160, 'spell_flame_warder_meteor_fists'), +(66765, 'spell_koralon_meteor_fists_damage'), +(67333, 'spell_koralon_meteor_fists_damage'), +(66809, 'spell_koralon_meteor_fists_damage'), +(67331, 'spell_koralon_meteor_fists_damage'); + +DELETE FROM `spell_proc_event` WHERE `entry` IN (66808,68160); +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(66808,0,0,0,0,0,0x4,0,0,0,0), +(68160,0,0,0,0,0,0x4,0,0,0,0); diff --git a/sql/updates/world/2013_07_18_02_world_spell_script_names.sql b/sql/updates/world/2013_07_18_02_world_spell_script_names.sql new file mode 100644 index 00000000000..89463a861aa --- /dev/null +++ b/sql/updates/world/2013_07_18_02_world_spell_script_names.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (69051,69023,69048); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(69051, 'spell_devourer_of_souls_mirrored_soul'), +(69023, 'spell_devourer_of_souls_mirrored_soul_proc'), +(69048, 'spell_devourer_of_souls_mirrored_soul_target_selector'); diff --git a/sql/updates/world/2013_07_18_02_world_the_flesh_giant_slayer.sql b/sql/updates/world/2013_07_18_02_world_the_flesh_giant_slayer.sql new file mode 100644 index 00000000000..c8d7773c461 --- /dev/null +++ b/sql/updates/world/2013_07_18_02_world_the_flesh_giant_slayer.sql @@ -0,0 +1,26 @@ +-- TEXT INSERTS +DELETE FROM `creature_text` WHERE `entry` IN (31301, 31428, 31306); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(31301, 0, 0, "You dare to think you have thwarted my will? That you have broken my plans?", 12, 0, 100, 25, 0, 0, "LK SAY 1"), +(31301, 1, 0, "You have accomplished nothing!", 12, 0, 100, 22, 0, 0, "LK SAY 2"), +(31301, 2, 0, "Your feeble resistance has only hastened your doom.", 12, 0, 100, 25, 0, 0, "LK SAY 3"), +(31301, 3, 0, "So spout your platitudes and flail until you are spent. In the end, you will be mine, and Morbidus will be the harbinger of your death!", 12, 0, 100, 22, 0, 0, "LK SAY 4"), +(31301, 4, 0, "Morbidus, show them what happens to those who defy the will of their king!", 12, 0, 100, 25, 0, 0, "LK SAY 5"), +(31428, 0, 0, "You will pay for what you've done! For the Argent Crusade!", 12, 0, 100, 0, 0, 0, "OLAKIN SAY 1"), +(31306, 0, 0, "Knights of the Ebon Blade, prepare for battle!", 12, 0, 100, 1, 0, 0, 'DHAKAR SAY 1'); + +-- ScriptName Updates +UPDATE `creature_template` SET `ScriptName`='npc_margrave_dhakar' WHERE `entry`=31306; +UPDATE `creature_template` SET `ScriptName`='npc_morbidus' WHERE `entry`=30698; + +-- Template updates +UPDATE `creature_template` SET `faction_A`=2102, `faction_H`=2102, `exp`=2, `minlevel`=80, `maxlevel`=80, `unit_flags`=`unit_flags`|832, `speed_run`=0.99206, `VehicleId`=271 WHERE `entry`=30698; -- Morbidus +UPDATE `creature_template` SET `faction_A`=1770, `faction_H`=1770, `npcflag`=`npcflag`|1, `gossip_menu_id`=10060 WHERE `entry`=31306; -- Margrave Dhakar + +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=7.5,`gender`=0 WHERE `modelid`=31176; -- Morbidus +UPDATE `creature_model_info` SET `bounding_radius`=0.3825,`combat_reach`=1.875,`gender`=0 WHERE `modelid`=27558; -- Margrave Dhakar + +DELETE FROM `creature_template_addon` WHERE `entry` IN (30698, 31306); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30698,0,0,1,0, NULL), -- Morbidus +(31306,0,0,1,0, NULL); -- Margrave Dhakar diff --git a/sql/updates/world/2013_07_18_03_world_equipment.sql b/sql/updates/world/2013_07_18_03_world_equipment.sql new file mode 100644 index 00000000000..4097327637b --- /dev/null +++ b/sql/updates/world/2013_07_18_03_world_equipment.sql @@ -0,0 +1,4 @@ +-- equipment for Margrave Dhakar +DELETE FROM `creature_equip_template` WHERE `entry` = 31306; +INSERT INTO `creature_equip_template` (`entry`, `id`, `itemEntry1`, `itemEntry2`, `itemEntry3`) VALUES +(31306, 1, 41371, 0, 0); diff --git a/sql/updates/world/2013_07_19_00_world_misc.sql b/sql/updates/world/2013_07_19_00_world_misc.sql new file mode 100644 index 00000000000..b5f08a058e6 --- /dev/null +++ b/sql/updates/world/2013_07_19_00_world_misc.sql @@ -0,0 +1,2 @@ +ALTER TABLE `gameobject` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1'; diff --git a/sql/updates/world/2013_07_20_00_world_gameobject.sql b/sql/updates/world/2013_07_20_00_world_gameobject.sql new file mode 100644 index 00000000000..7262b76ffef --- /dev/null +++ b/sql/updates/world/2013_07_20_00_world_gameobject.sql @@ -0,0 +1,15 @@ +-- DTK instance entrance portals +DELETE FROM `gameobject` WHERE `guid`=151225; +SET @OGUID := 6120; -- (need 3) +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+2; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+0,192585,571,1,1,4774.532,-2020.723,232.3105,-1.579522,0,0,0.9999905,0.004363241,120,255,1), +(@OGUID+1,192776,571,1,1,4774.532,-2020.723,232.3105,-1.579522,0,0,0.9999905,0.004363241,120,255,1), +(@OGUID+2,192775,571,1,1,4774.532,-2020.723,232.3105,-1.579522,0,0,0.9999905,0.004363241,120,255,1); + +-- Gundrak south instance entrance portals +SET @OGUID := 5287; -- (need 2) +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+1; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+0,192635,571,1,1,6700.195,-4662.38,446.7864,3.909541,0,0,0.3746067,0.9271838,120,255,1), +(@OGUID+1,192170,571,1,1,6700.195,-4662.38,446.7864,3.909541,0,0,0.3746067,0.9271838,120,255,1); diff --git a/sql/updates/world/2013_07_20_01_world_misc.sql b/sql/updates/world/2013_07_20_01_world_misc.sql new file mode 100644 index 00000000000..273d9070930 --- /dev/null +++ b/sql/updates/world/2013_07_20_01_world_misc.sql @@ -0,0 +1,170 @@ +/* + # Collection of Feedback-PatchFixes / 20.07.2013 + # + # Including sql codestyle updates and check for accuracy. (one by one) + # by FireEmerald / Thx @DDuarte for the base pull request. + # + # Including: + # DB/Spell: Update: Correct Spell Power Coefficient (107.43%) for Tranquility | by lendan (@6232) + # DB/LOS: Add: Ignore LOS for Ignite Horde Siege Engine | by dr-j (@6718) + # DB/SmartAI: Update: Correct casted spell by Defias Rogue Wizard | by Rochet2 (@9976) + # DB/Quest: Fix: Bloody Imp-ossible! (10924) | by Kirkhammett (@10276) + # DB/Quest: Fix: Mistcaller Yngvar (14102) / Add missing event script and conditions. | (@3563) + # DB/SmartAI: Update: Give quest credit for The Ring of Blood: The Final Challenge (9977) | by JunkyBulgaria (@7724) + # DB/Waypoints: Add: Missing waypoints for Mmmrrrggglll | by Hobbilis (@9602) + # DB/Conditions: Add: Missing conditions for Displacing Temporal Rift | by FireEmerald +*/ + +-- DB/Spell: Update: Correct Spell Power Coefficient (107.43%) for Tranquility | by lendan (@6232) +SET @SPELL := 44203; -- Tranquility + +UPDATE `spell_bonus_data` SET `direct_bonus` = 1.0743 WHERE `entry` = @SPELL; + +-- DB/Quest: Fix: A Dire Situation (10506) | by Rohlik & Exodius (@6283) +SET @WOLF := 20058; -- Bloodmaul Dire Wolf +SET @SPELL_INVIS := 18950; -- Invisibility and Stealth Detection +SET @WOLF_TRIGGER := 21176; -- Bloodmaul Dire Wolf Trigger +SET @SPELL_POWDER := 36310; -- Rina's Diminution Powder + +DELETE FROM `creature_ai_scripts` WHERE `creature_id` = @WOLF; +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @WOLF; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = @WOLF AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@WOLF, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 75, @SPELL_INVIS, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodmaul Dire Wolf - On spawn - Add Invisibility and Stealth Detection Aura on self'); + +DELETE FROM `event_scripts` WHERE `id` = 13584; +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`) VALUES +(13584, 2, 8, @WOLF_TRIGGER); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 17 AND `SourceEntry` = @SPELL_POWDER; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,@SPELL_POWDER,0,31,1,3,@WOLF,0,0,0,'', 'Rina''s Diminution Powder can be used only on Bloodmaul Dire Wolf'); + +-- DB/LOS: Add: Ignore LOS for Ignite Horde Siege Engine | by dr-j (@6718) +SET @IGNITE := 32979; -- Ignite Horde Siege Engine + +DELETE FROM `disables` WHERE `sourceType` = 0 AND `entry` = @IGNITE; +INSERT INTO `disables`(`sourceType`,`entry`,`flags`,`comment`) VALUES +(0,@IGNITE,64,'Ignore LOS on Ignite Horde Siege Engine'); + +-- DB/SmartAI: Update: Correct casted spell by Defias Rogue Wizard | by Rochet2 (@9976) +SET @WIZARD := 474; -- Rogue Wizard +SET @SPELL := 13322; -- Frostbolt + +UPDATE `smart_scripts` SET `action_param2`= @SPELL WHERE `entryorguid` = @WIZARD AND `source_type` = 0 AND `id` = 0 AND `link` = 0; + +-- DB/Quest: Fix: Bloody Imp-ossible! (10924) | by Kirkhammett (@10276) +SET @CHASER := 18884; -- Warp Chaser +SET @ZEPPIT := 22484; -- Zeppit +SET @SPELL_INVIS := 32942; -- Phasing Invisibility +SET @SPELL_CHARGE := 37417; -- Warp Charge +SET @SPELL_BITE := 32739; -- Venomous Bite +SET @SPELL_BLOOD := 39244; -- Gather Warp Chaser Blood + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @CHASER; +DELETE FROM `creature_ai_scripts` WHERE `creature_id` = @CHASER; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = @CHASER; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@CHASER,0,0,0,11,0,100,0,0,0,0,0,11,@SPELL_INVIS,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Warp Chaser - On Spawn - Cast Phasing Invisibility'), +(@CHASER,0,1,0,0,0,100,0,500,2000,7000,15000,11,@SPELL_CHARGE,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Warp Chaser - In Combat - Cast Charge'), +(@CHASER,0,2,0,0,0,100,0,3000,5000,10000,15000,11,@SPELL_BITE,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Warp Chaser - In Combat - Cast Venomous Bite'), +(@CHASER,0,3,0,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,@ZEPPIT,10,0,0,0,0,0, 'Warp Chaser - On Death - Set Data on Zeppit'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @ZEPPIT; +DELETE FROM `creature_ai_scripts` WHERE `creature_id` = @ZEPPIT; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = @ZEPPIT; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ZEPPIT,0,0,0,38,0,100,0,1,1,0,0,11,@SPELL_BLOOD,0,0,0,0,0,21,10,0,0,0,0,0,0, 'Zeppit - On Data Set - Cast on Master'); + +-- DB/Quest: Fix: Mistcaller Yngvar (14102) / Add missing event script and conditions. | (@3563) +SET @ENTRY := 34965; -- Mistcaller Yngvar +SET @SPELL := 66621; -- Summon the Mistcaller +SET @QUEST := 14102; -- Mistcaller Yngvar (Quest) + +DELETE FROM `event_scripts` WHERE `id` = 21997 AND `command` = 10; +INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(21997, 2, 10, @ENTRY, 120000, 0, 10181.96, 1183.417, 76.12115, 5.934119); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 17 AND `SourceEntry` = @SPELL; +INSERT INTO `conditions` (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, comment ) VALUES +(17, 0, @SPELL, 0, 0, 29, @ENTRY, 40, 0, 1, 0, "Cant use Mistcallers Charm within 40 yards of Yngvar"), +(17, 0, @SPELL, 0, 0, 28, @QUEST, 0, 0, 1, 0, "Cant use Mistcallers Charm, if player has quest objective completed, but not yet rewarded."); + +-- DB/SmartAI: Update: Give quest credit for The Ring of Blood: The Final Challenge (9977) | by JunkyBulgaria (@7724) +SET @MOGOR := 18069; -- Mogor <Hero of the Warmaul> +SET @QUEST := 9977; -- The Ring of Blood: The Final Challenge + +DELETE FROM `smart_scripts` WHERE `entryorguid` = @MOGOR AND `source_type` = 0 AND `id` = 14; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@MOGOR, 0, 14, 0, 6, 0, 100, 1, 0, 0, 0, 0, 15, @QUEST, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 'Mogor - On Death - Give Quest Credit'); + +-- DB/Waypoints: Add: Missing waypoints for Mmmrrrggglll | by Hobbilis (@9602) +SET @MURLOC := 15937; -- Mmmrrrggglll +SET @GUID := 41792; +SET @PATH := 417920; + +-- Set creature location +UPDATE `creature` SET `MovementType`=2,`position_x`=8869.872,`position_y`=-5775.960,`position_z`=0.405, `spawnDist`=0, `currentwaypoint`=1 WHERE `guid`=@GUID; +DELETE FROM `creature_addon` WHERE `guid`=@GUID; +INSERT INTO `creature_addon` (`guid`, `path_id`, `bytes2`) VALUES (@GUID, @PATH, 1); + +-- Waypoint Data +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH, 1, 8880.688, -5754.608, 0.25531, 0, 0, 0, 0, 100, 0), +(@PATH, 2, 8873.341, -5735.012, 0.43308, 0, 0, 0, 0, 100, 0), +(@PATH, 3, 8862.790, -5722.625, 0.42263, 0, 0, 0, 0, 100, 0), +(@PATH, 4, 8846.429, -5720.661, 0.49396, 0, 0, 0, 0, 100, 0), +(@PATH, 5, 8836.920, -5726.737, 0.83736, 0, 0, 0, 0, 100, 0), +(@PATH, 6, 8828.789, -5743.622, 0.82590, 0, 0, 0, 0, 100, 0), +(@PATH, 7, 8818.041, -5755.890, 0.64673, 0, 0, 0, 0, 100, 0), +(@PATH, 8, 8804.548, -5762.792, 0.51199, 0, 0, 0, 0, 100, 0), +(@PATH, 9, 8791.789, -5762.271, 0.45083, 0, 0, 0, 0, 100, 0), +(@PATH, 10, 8777.225, -5753.970, 0.55571, 0, 0, 0, 0, 100, 0), +(@PATH, 11, 8776.860, -5738.229, 0.61609, 0, 0, 0, 0, 100, 0), +(@PATH, 12, 8785.234, -5722.790, 0.75764, 0, 0, 0, 0, 100, 0), +(@PATH, 13, 8786.402, -5701.790, 0.67103, 0, 0, 0, 0, 100, 0), +(@PATH, 14, 8771.277, -5696.080, 0.67596, 0, 0, 0, 0, 100, 0), +(@PATH, 15, 8758.604, -5694.220, 0.55669, 0, 0, 0, 0, 100, 0), +(@PATH, 16, 8746.010, -5704.514, 0.50786, 0, 0, 0, 0, 100, 0), +(@PATH, 17, 8735.815, -5722.942, 0.94607, 0, 0, 0, 0, 100, 0), +(@PATH, 18, 8720.269, -5730.856, 0.89406, 0, 0, 0, 0, 100, 0), +(@PATH, 19, 8706.965, -5730.076, 0.77437, 0, 0, 0, 0, 100, 0), +(@PATH, 20, 8693.575, -5720.971, 0.86999, 0, 0, 0, 0, 100, 0), +(@PATH, 21, 8679.183, -5710.540, 1.10842, 0, 0, 0, 0, 100, 0), +(@PATH, 22, 8656.022, -5704.337, 1.80973, 0, 0, 0, 0, 100, 0), +(@PATH, 23, 8640.976, -5691.507, 0.47690, 0, 0, 0, 0, 100, 0), +(@PATH, 24, 8635.418, -5689.706, 0.53144, 0, 0, 0, 0, 100, 0), +(@PATH, 25, 8620.438, -5687.679, 0.86486, 0, 0, 0, 0, 100, 0), +(@PATH, 26, 8601.687, -5688.443, 0.49338, 1.930, 36000, 0, 0, 100, 0), +(@PATH, 27, 8619.985, -5679.970, 0.75128, 0, 0, 0, 0, 100, 0), +(@PATH, 28, 8635.668, -5671.577, 0.53144, 0, 0, 0, 0, 100, 0), +(@PATH, 29, 8648.297, -5670.150, 0.49488, 0, 0, 0, 0, 100, 0), +(@PATH, 30, 8664.989, -5679.421, 0.55752, 0, 0, 0, 0, 100, 0), +(@PATH, 31, 8679.183, -5710.540, 1.10842, 0, 0, 0, 0, 100, 0), +(@PATH, 32, 8693.575, -5720.971, 0.86999, 0, 0, 0, 0, 100, 0), +(@PATH, 33, 8706.965, -5730.076, 0.77437, 0, 0, 0, 0, 100, 0), +(@PATH, 34, 8721.716, -5745.012, 0.62278, 0, 0, 0, 0, 100, 0), +(@PATH, 35, 8735.529, -5753.923, 1.24721, 0, 0, 0, 0, 100, 0), +(@PATH, 36, 8767.193, -5758.179, 0.50536, 0, 0, 0, 0, 100, 0), +(@PATH, 37, 8791.789, -5762.271, 0.45083, 0, 0, 0, 0, 100, 0), +(@PATH, 38, 8804.548, -5762.792, 0.51199, 0, 0, 0, 0, 100, 0), +(@PATH, 39, 8818.041, -5755.890, 0.64673, 0, 0, 0, 0, 100, 0), +(@PATH, 40, 8828.789, -5743.622, 0.82590, 0, 0, 0, 0, 100, 0), +(@PATH, 41, 8836.920, -5726.737, 0.83736, 0, 0, 0, 0, 100, 0), +(@PATH, 42, 8846.429, -5720.661, 0.49396, 0, 0, 0, 0, 100, 0), +(@PATH, 43, 8873.341, -5735.012, 0.43308, 0, 0, 0, 0, 100, 0), +(@PATH, 44, 8880.688, -5754.608, 0.25531, 6.105, 60000, 0, 0, 100, 0); + +-- DB/Conditions: Add: Missing conditions for Displacing Temporal Rift | by FireEmerald +SET @PARASITE := 10717; -- Temporal Parasite +SET @SPELL := 16613; -- Displacing Temporal Rift +SET @QUEST := 4971; -- A Matter of Time + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 17 AND `SourceEntry` = @SPELL; +INSERT INTO `conditions` (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, comment ) VALUES +(17, 0, @SPELL, 0, 0, 29, @PARASITE, 100, 0, 1, 0, "Cant use Temporal Displacer within 100 yards of Temporal Parasite"), +(17, 0, @SPELL, 0, 0, 28, @QUEST, 0, 0, 1, 0, "Cant use Temporal Displacer, if player has quest objective completed, but not yet rewarded"); diff --git a/sql/updates/world/2013_07_23_00_world_misc.sql b/sql/updates/world/2013_07_23_00_world_misc.sql new file mode 100644 index 00000000000..8e69c7bb785 --- /dev/null +++ b/sql/updates/world/2013_07_23_00_world_misc.sql @@ -0,0 +1,7 @@ +UPDATE `gameobject_template` SET `flags`=48, `ScriptName`='go_activation_crystal' WHERE `entry`=193611; + +UPDATE `creature_template` SET `flags_extra`=130, `ScriptName`='npc_violet_hold_arcane_sphere' WHERE `entry`=30837; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=57930; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 57930, 0, 0, 32, 0, 16, 0, 0, 1, 0, 0, '', 'Spell Arcane Lightning hit players'); diff --git a/sql/updates/world/2013_07_23_02_world_creature_template.sql b/sql/updates/world/2013_07_23_02_world_creature_template.sql new file mode 100644 index 00000000000..b55999040f1 --- /dev/null +++ b/sql/updates/world/2013_07_23_02_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `InhabitType` = 5 WHERE `entry` = 10184; diff --git a/sql/updates/world/2013_07_24_00_world_spell_script_names.sql b/sql/updates/world/2013_07_24_00_world_spell_script_names.sql new file mode 100644 index 00000000000..8c156fb2e57 --- /dev/null +++ b/sql/updates/world/2013_07_24_00_world_spell_script_names.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (63310,50421,23780,33896,37594,37705,23551,23552,23572); +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(63310,'spell_warl_glyph_of_shadowflame'), +(50421,'spell_dk_scent_of_blood'), +(23780,'spell_item_aegis_of_preservation'), +(33896,'spell_item_desperate_defense'), +(37594,'spell_pri_item_greater_heal_refund'), +(37705,'spell_pal_item_healing_discount'), +(23551,'spell_sha_item_lightning_shield'), +(23552,'spell_sha_item_lightning_shield_trigger'), +(23572,'spell_sha_item_mana_surge'); diff --git a/sql/updates/world/2013_07_24_01_world_spell_ranks_335.sql b/sql/updates/world/2013_07_24_01_world_spell_ranks_335.sql new file mode 100644 index 00000000000..db1d9803596 --- /dev/null +++ b/sql/updates/world/2013_07_24_01_world_spell_ranks_335.sql @@ -0,0 +1,682 @@ +DELETE FROM `spell_ranks` WHERE `first_spell_id` IN ( +5923, +5952, +9452, +9453, +9799, +11069, +11070, +11071, +11078, +11083, +11094, +11095, +11100, +11103, +11108, +11115, +11119, +11124, +11151, +11160, +11170, +11175, +11180, +11185, +11189, +11190, +11207, +11210, +11213, +11222, +11232, +11237, +11242, +11247, +11252, +11255, +12163, +12281, +12282, +12284, +12285, +12286, +12287, +12289, +12290, +12295, +12297, +12298, +12299, +12300, +12301, +12308, +12311, +12312, +12313, +12317, +12318, +12319, +12320, +12321, +12322, +12324, +12329, +12700, +12797, +12834, +12862, +13705, +13706, +13709, +13712, +13713, +13715, +13732, +13733, +13741, +13742, +13743, +13754, +13958, +13960, +13975, +13976, +13981, +13983, +14057, +14076, +14079, +14082, +14113, +14128, +14138, +14144, +14156, +14158, +14162, +14165, +14168, +14171, +14174, +14179, +14186, +14520, +14521, +14522, +14523, +14531, +14747, +14748, +14749, +14750, +14889, +14892, +14898, +14901, +14908, +14909, +14910, +14911, +14912, +14913, +15058, +15257, +15259, +15260, +15270, +15273, +15274, +15275, +15318, +15337, +15392, +16035, +16038, +16039, +16040, +16043, +16086, +16089, +16173, +16176, +16178, +16179, +16180, +16181, +16182, +16184, +16187, +16194, +16252, +16254, +16255, +16256, +16258, +16259, +16261, +16262, +16266, +16462, +16487, +16493, +16513, +16538, +16578, +16757, +16814, +16819, +16821, +16833, +16836, +16845, +16850, +16858, +16880, +16896, +16909, +16929, +16934, +16940, +16942, +16947, +16966, +16972, +16998, +17002, +17003, +17050, +17056, +17063, +17069, +17074, +17104, +17106, +17111, +17118, +17123, +17322, +17485, +17778, +17783, +17788, +17793, +17804, +17810, +17815, +17917, +17927, +17954, +17959, +18094, +18096, +18119, +18126, +18135, +18174, +18179, +18182, +18213, +18218, +18271, +18427, +18459, +18462, +18530, +18551, +18692, +18694, +18697, +18703, +18705, +18709, +18731, +18754, +18767, +18769, +18827, +19159, +19168, +19184, +19255, +19286, +19290, +19295, +19370, +19376, +19407, +19416, +19421, +19426, +19454, +19461, +19464, +19485, +19498, +19507, +19549, +19552, +19559, +19572, +19578, +19583, +19590, +19598, +19609, +19616, +19621, +20042, +20049, +20060, +20096, +20101, +20111, +20117, +20127, +20138, +20143, +20174, +20177, +20196, +20205, +20210, +20224, +20234, +20237, +20244, +20254, +20257, +20262, +20335, +20359, +20468, +20487, +20500, +20502, +20504, +23584, +23785, +24443, +24968, +25956, +26022, +27789, +27811, +27839, +27900, +28574, +28996, +28999, +29062, +29074, +29082, +29140, +29187, +29192, +29206, +29438, +29441, +29447, +29590, +29593, +29598, +29721, +29723, +29759, +29787, +29834, +29836, +29888, +30054, +30060, +30143, +30160, +30242, +30288, +30293, +30299, +30319, +30664, +30672, +30675, +30802, +30812, +30816, +30864, +30867, +30872, +30881, +30892, +30894, +30902, +30919, +31122, +31124, +31130, +31208, +31211, +31216, +31221, +31226, +31228, +31234, +31244, +31380, +31569, +31571, +31574, +31579, +31584, +31638, +31641, +31656, +31667, +31670, +31674, +31679, +31682, +31785, +31822, +31825, +31828, +31833, +31837, +31844, +31848, +31850, +31858, +31866, +31871, +31876, +31879, +32043, +32381, +32385, +32477, +33142, +33150, +33158, +33167, +33186, +33191, +33201, +33213, +33221, +33589, +33592, +33597, +33600, +33603, +33851, +33853, +33859, +33872, +33879, +33881, +33886, +34151, +34293, +34297, +34453, +34455, +34462, +34466, +34475, +34482, +34485, +34491, +34494, +34497, +34500, +34506, +34753, +34908, +34935, +34948, +34950, +35029, +35100, +35104, +35363, +35446, +35541, +35578, +35691, +37116, +44378, +44394, +44397, +44400, +44404, +44442, +44445, +44449, +44543, +44546, +44557, +44566, +44745, +45234, +46854, +46859, +46865, +46867, +46908, +46910, +46913, +46945, +46951, +47195, +47198, +47201, +47220, +47230, +47236, +47245, +47258, +47266, +47294, +47507, +47509, +47516, +47535, +47558, +47562, +47569, +47573, +47580, +47586, +48384, +48389, +48409, +48411, +48432, +48483, +48488, +48492, +48496, +48506, +48516, +48532, +48535, +48539, +48962, +48963, +48965, +48977, +48978, +48979, +48985, +48987, +48988, +48997, +49004, +49006, +49013, +49015, +49018, +49023, +49024, +49027, +49032, +49036, +49042, +49137, +49140, +49145, +49146, +49149, +49175, +49182, +49186, +49188, +49189, +49200, +49202, +49208, +49217, +49219, +49220, +49223, +49224, +49226, +49455, +49467, +49471, +49588, +50040, +50117, +50187, +50365, +50384, +50391, +50685, +50880, +51099, +51123, +51179, +51459, +51466, +51468, +51474, +51480, +51483, +51521, +51523, +51525, +51528, +51554, +51556, +51560, +51562, +51625, +51627, +51632, +51634, +51664, +51672, +51682, +51685, +51692, +51698, +51708, +51745, +51883, +52234, +52783, +52795, +53137, +53175, +53178, +53180, +53182, +53186, +53203, +53215, +53221, +53228, +53234, +53241, +53252, +53256, +53262, +53290, +53295, +53298, +53302, +53375, +53379, +53380, +53409, +53427, +53450, +53481, +53483, +53486, +53501, +53511, +53514, +53527, +53551, +53554, +53556, +53569, +53583, +53590, +53620, +53660, +53671, +53695, +53709, +53754, +54037, +54117, +54347, +54639, +54747, +55061, +55091, +55107, +55129, +55620, +55666, +56314, +56333, +56339, +56342, +56636, +56927, +57470, +57810, +57849, +57873, +57878, +58414, +58872, +59088, +61154, +61216, +61680, +61682, +61686, +61689, +62097, +62758, +62759, +62764, +62905, +63117, +63156, +63349, +63370, +63373, +63410, +63504, +63534, +63625, +63646, +63730, +64127, +64353, +65661, +66799); diff --git a/sql/updates/world/2013_07_24_02_world_trinity_strings.sql b/sql/updates/world/2013_07_24_02_world_trinity_strings.sql new file mode 100644 index 00000000000..b14e60c2c9d --- /dev/null +++ b/sql/updates/world/2013_07_24_02_world_trinity_strings.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE entry = 850; +INSERT INTO `trinity_string` (entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8) VALUES +(850, '├─ Rank: %s (ID: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/sql/updates/world/2013_07_24_03_world_spell_proc_event_335.sql b/sql/updates/world/2013_07_24_03_world_spell_proc_event_335.sql new file mode 100644 index 00000000000..0e179e54ec8 --- /dev/null +++ b/sql/updates/world/2013_07_24_03_world_spell_proc_event_335.sql @@ -0,0 +1,876 @@ +ALTER TABLE `spell_proc_event` + CHANGE `entry` `entry` MEDIUMINT(8) DEFAULT 0 NOT NULL; + +DELETE FROM `spell_proc_event` WHERE `entry` IN ( +325, +905, +945, +8134, +8494, +8495, +10191, +10192, +10193, +10431, +10432, +11120, +12487, +12488, +12574, +12575, +12576, +12577, +12598, +12668, +12724, +12725, +12726, +12727, +12799, +12812, +12813, +12814, +12815, +12846, +12847, +12848, +12849, +12867, +12872, +12873, +12958, +12967, +12968, +12969, +12970, +12971, +12972, +12973, +12974, +13867, +14070, +14071, +14160, +14161, +14190, +14193, +14194, +14195, +14318, +14319, +14320, +14321, +14322, +14774, +15338, +15362, +15363, +16196, +16198, +16235, +16240, +16277, +16278, +16279, +16280, +16281, +16282, +16283, +16284, +16489, +16492, +16544, +16923, +16924, +16954, +16961, +17107, +17108, +17796, +17801, +17802, +17803, +18073, +18095, +18120, +19387, +19388, +19573, +20056, +20057, +20179, +20180, +20181, +20182, +20212, +20213, +20214, +20215, +20235, +20336, +20337, +20501, +20927, +20928, +23695, +24398, +25296, +25469, +25472, +25988, +27044, +27131, +27179, +27815, +27816, +28592, +28593, +29075, +29076, +29179, +29180, +29444, +29594, +29838, +30295, +30296, +30301, +30302, +30678, +30679, +30705, +30883, +30884, +30885, +30886, +31126, +31245, +31570, +31572, +31657, +31658, +31835, +31836, +31872, +31877, +31878, +32387, +32392, +32393, +32394, +32593, +32594, +33145, +33146, +33154, +33192, +33193, +33736, +33882, +33883, +34498, +34499, +34502, +34503, +34859, +34860, +34916, +34917, +34938, +34939, +34954, +35102, +35550, +35551, +35552, +35553, +43019, +43020, +44443, +44446, +44448, +44469, +44470, +44471, +44472, +44560, +44561, +45243, +45244, +46855, +46914, +46915, +46949, +47196, +47197, +47202, +47203, +47204, +47205, +47246, +47247, +47259, +47260, +47264, +47265, +47511, +47515, +47517, +47570, +47581, +47582, +48110, +48111, +48112, +48113, +48159, +48160, +48484, +48485, +48499, +48500, +48510, +48511, +48521, +48525, +48544, +48545, +48951, +48952, +49280, +49281, +49283, +49284, +49503, +49504, +49508, +49509, +49529, +49530, +49599, +49627, +49628, +49654, +49655, +50033, +50034, +50115, +50884, +50885, +50886, +50887, +51462, +51463, +51464, +51465, +51478, +51479, +51522, +51524, +51557, +51558, +51563, +51564, +51565, +51566, +51626, +51628, +51629, +51635, +51636, +51665, +51667, +51668, +51669, +51674, +51679, +51696, +51989, +52004, +52005, +52007, +52008, +52129, +52131, +52134, +52136, +52138, +52797, +52798, +52799, +52800, +53179, +53216, +53217, +53222, +53224, +53232, +53237, +53238, +53259, +53260, +53291, +53292, +53376, +53381, +53382, +53488, +53502, +53503, +53530, +53552, +53553, +53576, +53673, +53696, +53710, +53711, +54151, +54154, +54155, +54637, +54638, +54749, +55667, +56343, +56344, +56611, +56612, +56613, +56614, +56637, +56638, +56822, +56834, +56835, +57472, +57880, +57881, +57960, +58874, +59057, +59089, +61345, +61346, +61847, +62765, +63158, +63245, +63374, +63733, +63737, +64129, +66191, +66192, +66814, +66815, +66816, +66817); + +DELETE FROM `spell_proc_event` WHERE `entry` IN ( +324, +974, +1463, +5952, +9799, +11095, +11119, +11180, +11185, +11213, +11255, +12281, +12289, +12298, +12311, +12319, +12797, +12834, +12966, +13165, +13754, +13983, +14156, +14186, +14531, +14892, +15337, +16086, +16176, +16180, +16256, +16257, +16487, +16850, +16880, +16952, +16958, +17106, +17793, +18094, +18096, +18119, +19184, +19572, +20049, +20177, +20210, +20234, +20335, +20500, +20925, +27811, +29074, +29441, +29593, +29834, +30160, +30293, +30299, +30675, +30701, +30881, +31124, +31244, +31569, +31571, +31656, +31833, +31871, +31876, +32385, +33076, +33142, +33150, +33191, +33881, +34497, +34500, +34753, +34914, +34935, +34950, +35100, +35541, +41635, +44442, +44445, +44449, +44557, +45234, +46854, +46867, +46913, +46945, +47195, +47201, +47245, +47258, +47263, +47509, +47516, +47569, +47580, +48483, +48496, +48506, +48516, +48539, +48988, +49004, +49018, +49149, +49188, +49208, +49217, +49219, +49223, +49467, +50880, +51459, +51474, +51521, +51523, +51556, +51562, +51625, +51627, +51634, +51664, +51672, +51692, +51940, +52127, +52795, +53178, +53215, +53221, +53228, +53234, +53256, +53290, +53375, +53380, +53486, +53501, +53527, +53551, +53569, +53671, +53695, +53709, +54639, +54747, +55666, +56342, +56636, +57470, +57878, +58872, +59088, +61846, +62764, +63156, +63373, +63730, +64127, +65661, +66799, +-324, +-974, +-1463, +-5952, +-9799, +-11095, +-11119, +-11180, +-11185, +-11213, +-11255, +-12281, +-12289, +-12298, +-12311, +-12319, +-12797, +-12834, +-12966, +-13165, +-13754, +-13983, +-14156, +-14186, +-14531, +-14892, +-15337, +-16086, +-16176, +-16180, +-16256, +-16257, +-16487, +-16850, +-16880, +-16952, +-16958, +-17106, +-17793, +-18094, +-18096, +-18119, +-19184, +-19572, +-20049, +-20177, +-20210, +-20234, +-20335, +-20500, +-20925, +-27811, +-29074, +-29441, +-29593, +-29834, +-30160, +-30293, +-30299, +-30675, +-30701, +-30881, +-31124, +-31244, +-31569, +-31571, +-31656, +-31833, +-31871, +-31876, +-32385, +-33076, +-33142, +-33150, +-33191, +-33881, +-34497, +-34500, +-34753, +-34914, +-34935, +-34950, +-35100, +-35541, +-41635, +-44442, +-44445, +-44449, +-44557, +-45234, +-46854, +-46867, +-46913, +-46945, +-47195, +-47201, +-47245, +-47258, +-47263, +-47509, +-47516, +-47569, +-47580, +-48483, +-48496, +-48506, +-48516, +-48539, +-48988, +-49004, +-49018, +-49149, +-49188, +-49208, +-49217, +-49219, +-49223, +-49467, +-50880, +-51459, +-51474, +-51521, +-51523, +-51556, +-51562, +-51625, +-51627, +-51634, +-51664, +-51672, +-51692, +-51940, +-52127, +-52795, +-53178, +-53215, +-53221, +-53228, +-53234, +-53256, +-53290, +-53375, +-53380, +-53486, +-53501, +-53527, +-53551, +-53569, +-53671, +-53695, +-53709, +-54639, +-54747, +-55666, +-56342, +-56636, +-57470, +-57878, +-58872, +-59088, +-61846, +-62764, +-63156, +-63373, +-63730, +-64127, +-65661, +-66799); + +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(-324,0,0,0,0,0,0,0,0,0,3), +(-974,0,0,0,0,0,139944,0,0,0,3), +(-1463,0,0,0,0,0,0,1024,0,0,0), +(-5952,0,8,0,1,0,0,0,0,0,0), +(-9799,0,0,0,0,0,0,2,0,0,0), +(-11095,0,3,16,0,0,0,0,0,0,0), +(-11119,4,3,0,0,0,0,2,0,0,0), +(-11180,16,3,0,0,0,0,0,0,0,0), +(-11185,0,3,128,0,0,327680,0,0,0,0), +(-11213,0,3,0,0,0,0,0,0,0,0), +(-11255,0,3,16384,0,0,0,0,0,0,0), +(-12281,0,4,2858419268,4194565,0,0,0,0,0,6), +(-12289,0,4,2,0,0,0,0,0,0,0), +(-12298,0,0,0,0,0,0,112,0,0,0), +(-12311,0,4,2048,1,0,0,0,0,0,0), +(-12319,0,0,0,0,0,0,2,0,0,0), +(-12797,0,4,1024,0,0,0,0,0,0,0), +(-12834,0,0,0,0,0,0,2,0,0,0), +(-12966,0,0,0,0,0,0,65536,0,0,0), +(-13165,0,0,0,0,0,64,0,0,0,0), +(-13754,0,8,16,0,0,0,0,0,0,0), +(-13983,0,0,0,0,0,0,24,0,0,0), +(-14156,0,8,4063232,8,0,0,0,0,0,0), +(-14186,0,8,1082131720,6,0,0,2,0,0,1), +(-14531,0,0,0,0,0,0,2,0,0,0), +(-14892,0,6,268443136,65540,0,0,2,0,0,0), +(-15337,0,6,8396800,2,0,0,2,0,0,0), +(-16086,4,11,0,262144,0,196608,0,0,0,0), +(-16176,0,11,448,0,16,0,2,0,0,0), +(-16180,0,11,448,0,16,0,2,0,100,0), +(-16256,0,0,0,0,0,0,2,0,0,0), +(-16257,0,0,0,0,0,0,65536,0,0,0), +(-16487,0,0,0,0,0,0,2,0,0,0), +(-16850,0,7,4,0,0,0,0,0,0,0), +(-16880,72,7,103,58720258,0,0,2,0,0,0), +(-16952,0,7,233472,1024,262144,0,2,0,0,0), +(-16958,0,0,0,0,0,0,2,0,0,0), +(-17106,0,7,524288,0,0,0,0,0,0,0), +(-17793,0,5,1,0,0,0,0,0,0,0), +(-18094,0,5,10,0,0,0,0,0,0,0), +(-18096,0,5,256,8388608,0,0,2,0,0,0), +(-18119,0,5,0,8388608,0,0,0,0,0,0), +(-19184,0,9,16,8192,0,0,0,0,0,0), +(-19572,0,9,8388608,0,0,16384,0,0,0,0), +(-20049,0,0,0,0,0,0,2,0,0,0), +(-20177,0,0,0,0,0,0,67,0,0,0), +(-20210,0,10,3221225472,65536,0,0,2,0,0,0), +(-20234,0,10,32768,0,0,0,0,0,0,0), +(-20335,0,10,8388608,0,8,16,0,0,100,0), +(-20500,0,4,268435456,0,0,0,0,0,0,0), +(-20925,0,0,0,0,0,0,64,0,0,0), +(-27811,0,0,0,0,0,0,2,0,0,0), +(-29074,20,3,0,0,0,0,2,0,0,0), +(-29441,0,0,0,0,0,0,8,0,0,1), +(-29593,0,0,0,0,0,0,112,0,0,0), +(-29834,0,0,0,0,0,0,65536,0,0,0), +(-30160,0,0,0,0,0,0,2,0,0,0), +(-30293,0,5,897,8519872,0,0,0,0,0,0), +(-30299,126,0,0,0,0,0,0,0,0,0), +(-30675,0,11,3,0,0,0,0,0,0,0), +(-30701,28,0,0,0,0,664232,0,0,100,0), +(-30881,0,0,0,0,0,0,0,0,0,30), +(-31124,0,8,16777222,0,0,0,0,0,0,0), +(-31244,0,8,4063232,9,0,0,52,0,0,0), +(-31569,0,3,65536,0,0,0,0,0,0,0), +(-31571,0,3,0,34,0,16384,0,0,0,0), +(-31656,4,3,134217728,0,0,0,0,0,0,0), +(-31833,0,10,2147483648,0,0,0,0,0,0,0), +(-31871,0,10,16,0,0,16384,0,0,0,0), +(-31876,0,10,8388608,0,0,0,262144,0,0,0), +(-32385,0,5,1,262144,0,0,0,0,0,0), +(-33076,0,0,0,0,0,664232,0,0,0,0), +(-33142,0,0,0,0,0,0,2,0,0,0), +(-33150,0,0,0,0,0,0,2,0,0,0), +(-33191,0,6,32768,1024,64,0,0,0,0,0), +(-33881,0,0,0,0,0,0,2,0,0,0), +(-34497,0,0,0,0,0,0,2,0,0,0), +(-34500,0,0,0,0,0,0,2,0,0,0), +(-34753,0,6,6144,4,4096,0,2,0,0,0), +(-34914,0,6,8192,0,0,0,0,0,0,0), +(-34935,0,0,0,0,0,0,0,0,0,8), +(-34950,0,0,0,0,0,0,2,0,0,0), +(-35100,0,9,4096,0,1,0,0,0,0,0), +(-35541,0,0,0,0,0,8388608,0,0,0,0), +(-41635,0,0,0,0,0,664232,0,0,0,0), +(-44442,0,3,8388608,64,0,0,65536,0,0,1), +(-44445,0,3,19,69632,0,0,0,0,0,0), +(-44449,0,3,551686775,102472,0,0,2,0,0,0), +(-44557,0,3,32,0,0,0,0,0,0,0), +(-45234,0,0,0,0,0,0,2,0,0,0), +(-46854,0,0,0,0,0,0,2,0,0,0), +(-46867,0,0,0,0,0,0,2,0,0,0), +(-46913,0,4,64,1028,0,0,262144,0,0,0), +(-46945,0,4,0,65536,0,0,0,0,0,0), +(-47195,0,5,2,0,0,0,0,0,0,0), +(-47201,0,5,16393,262144,0,0,0,0,0,0), +(-47245,0,5,2,0,0,0,1,0,0,0), +(-47258,0,5,0,8388608,0,0,65536,0,0,0), +(-47263,32,5,0,0,0,0,2,0,0,20), +(-47509,0,0,0,0,0,0,2,0,0,0), +(-47516,0,6,6144,65536,0,0,0,0,0,0), +(-47569,0,6,16384,0,0,16384,0,0,0,0), +(-47580,0,6,0,0,64,0,65536,0,0,0), +(-48483,0,7,34816,1088,0,0,0,0,0,0), +(-48496,0,7,96,33554434,0,0,2,0,0,0), +(-48506,0,7,5,0,0,0,0,0,0,0), +(-48516,0,7,5,0,0,0,2,0,0,30), +(-48539,0,7,16,67108864,0,262144,0,0,0,0), +(-48988,0,0,0,0,0,0,2,0,0,0), +(-49004,0,0,0,0,0,0,51,0,0,0), +(-49018,0,15,20971520,0,0,0,0,0,0,0), +(-49149,0,15,6,131074,0,0,0,0,0,0), +(-49188,0,15,0,131072,0,0,0,0,0,0), +(-49208,0,15,4194304,65536,0,0,0,0,0,0), +(-49217,0,15,0,0,2,0,0,0,0,1), +(-49219,0,0,0,0,0,4,0,0,0,0), +(-49223,0,15,17,134348800,0,0,0,0,0,0), +(-49467,0,15,16,131072,0,0,0,0,0,0), +(-50880,0,15,0,67108864,0,0,0,0,0,0), +(-51459,0,0,0,0,0,4,0,0,0,0), +(-51474,0,0,0,0,0,0,65536,0,0,0), +(-51521,0,11,0,16777216,0,0,0,0,0,0), +(-51523,0,11,0,1,0,65536,0,0,50,0), +(-51556,0,11,192,0,16,0,2,0,0,0), +(-51562,0,11,256,0,16,0,0,0,0,0), +(-51625,0,8,268476416,0,0,0,0,0,0,0), +(-51627,0,0,0,0,0,0,112,0,0,0), +(-51634,0,0,0,0,0,0,2,0,0,0), +(-51664,0,8,131072,8,0,0,0,0,0,0), +(-51672,0,0,0,0,0,0,16,0,0,1), +(-51692,0,8,516,0,0,0,0,0,0,0), +(-51940,0,0,0,0,0,0,0,0,20,0), +(-52127,0,0,0,0,0,0,0,0,0,3), +(-52795,0,6,1,0,0,0,0,0,0,0), +(-53178,0,9,0,268435456,0,65536,0,0,100,0), +(-53215,0,9,1,0,0,0,0,0,0,0), +(-53221,0,9,0,1,0,0,0,0,0,0), +(-53228,0,9,32,16777216,0,0,0,0,0,0), +(-53234,0,9,131072,1,1,0,2,0,0,0), +(-53256,0,9,2048,8388609,0,0,2,0,0,0), +(-53290,0,9,2048,1,512,0,2,0,0,0), +(-53375,0,10,0,8192,0,1024,0,0,0,6), +(-53380,0,10,8388608,163840,0,0,262146,0,0,0), +(-53486,0,10,8388608,163840,0,0,262146,0,0,0), +(-53501,0,0,0,0,0,0,2,0,0,0), +(-53527,1,10,0,0,4,1024,1,0,100,0), +(-53551,0,10,4096,0,0,0,0,0,0,0), +(-53569,0,10,1075838976,65536,0,0,0,0,0,0), +(-53671,0,10,8388608,0,0,0,0,0,0,0), +(-53695,0,10,8388608,0,8,16,0,0,0,0), +(-53709,2,10,16384,0,0,0,0,0,0,0), +(-54639,0,15,4194304,65536,0,0,0,0,0,0), +(-54747,0,0,0,0,0,0,65536,0,0,0), +(-55666,0,15,1,134217728,0,0,0,0,0,0), +(-56342,0,9,24,134217728,147456,0,0,0,0,22), +(-56636,0,4,32,0,0,0,262144,0,0,6), +(-57470,0,6,1,0,0,0,0,0,0,0), +(-57878,0,0,0,0,0,0,16,0,0,0), +(-58872,0,0,0,0,0,0,270403,0,0,0), +(-59088,0,4,0,2,0,1024,0,0,0,0), +(-61846,0,0,0,0,0,64,0,0,0,0), +(-62764,0,9,0,268435456,0,65536,0,0,100,0), +(-63156,0,5,1,192,0,0,0,0,0,0), +(-63373,0,11,2147483648,0,0,65536,0,0,0,0), +(-63730,0,6,2048,4,0,0,0,0,0,0), +(-64127,0,6,1,1,0,0,0,0,0,0), +(-65661,0,15,4194321,537001988,0,16,0,0,100,0), +(-66799,0,15,4194304,0,0,0,0,0,0,0); diff --git a/sql/updates/world/2013_07_25_00_world_spell_script_names.sql b/sql/updates/world/2013_07_25_00_world_spell_script_names.sql new file mode 100644 index 00000000000..14e6d16df44 --- /dev/null +++ b/sql/updates/world/2013_07_25_00_world_spell_script_names.sql @@ -0,0 +1,22 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_warl_banish', +'spell_dru_enrage', +'spell_pri_mana_burn', +'spell_pri_guardian_spirit', +'spell_dk_improved_blood_presence', +'spell_dk_improved_frost_presence', +'spell_dk_improved_unholy_presence', +'spell_dk_presence' +); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-710, 'spell_warl_banish'), +(5229, 'spell_dru_enrage'), +(8129, 'spell_pri_mana_burn'), +(47788, 'spell_pri_guardian_spirit'), +(-50365,'spell_dk_improved_blood_presence'), +(-50384,'spell_dk_improved_frost_presence'), +(-50391,'spell_dk_improved_unholy_presence'), +(48266, 'spell_dk_presence'), +(48263, 'spell_dk_presence'), +(48265, 'spell_dk_presence'); diff --git a/sql/updates/world/2013_07_25_01_world_conditions.sql b/sql/updates/world/2013_07_25_01_world_conditions.sql new file mode 100644 index 00000000000..1990fe3094b --- /dev/null +++ b/sql/updates/world/2013_07_25_01_world_conditions.sql @@ -0,0 +1,2 @@ +-- Fix gossip condition for Bat Handler Camille <Bat Handler> +UPDATE `conditions` SET `ConditionTypeOrReference`=28 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8894 AND `SourceEntry`=0 AND `ConditionValue1`=11229; diff --git a/sql/updates/world/2013_07_27_00_world_spell_script_names.sql b/sql/updates/world/2013_07_27_00_world_spell_script_names.sql new file mode 100644 index 00000000000..a3f49d9e4f9 --- /dev/null +++ b/sql/updates/world/2013_07_27_00_world_spell_script_names.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (31821,64364,-20254,-20138,31869,-53379,63510,63514,63531); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(31821, 'spell_pal_aura_mastery'), +(64364, 'spell_pal_aura_mastery_immune'), +(-20254,'spell_pal_improved_concentraction_aura'), +(-20138,'spell_pal_improved_devotion_aura'), +(31869, 'spell_pal_sanctified_retribution'), +(-53379,'spell_pal_swift_retribution'), +(63510, 'spell_pal_improved_concentraction_aura_effect'), +(63514, 'spell_pal_improved_devotion_aura_effect'), +(63531, 'spell_pal_sanctified_retribution_effect'); diff --git a/sql/updates/world/2013_07_28_00_world_gameobjects.sql b/sql/updates/world/2013_07_28_00_world_gameobjects.sql new file mode 100644 index 00000000000..cb352339bd5 --- /dev/null +++ b/sql/updates/world/2013_07_28_00_world_gameobjects.sql @@ -0,0 +1,75 @@ +SET @OGUID := 76732; -- Discarded Soul Crystal & Aura Trap Blue Short (cosmetic) + +DELETE FROM `gameobject` WHERE `id` IN (195344, 195346, 193984); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID, 195344, 571, 1, 1, 7830.25, 2497.806, 402.5372, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: 0) +(@OGUID+1, 195346, 571, 1, 1, 7830.25, 2497.806, 402.5372, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: 0) +(@OGUID+2, 195344, 571, 1, 1, 7796.588, 2463.793, 393.2891, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: 0) +(@OGUID+3, 195346, 571, 1, 1, 7796.588, 2463.793, 393.2891, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: 0) +(@OGUID+4, 195344, 571, 1, 1, 7845.074, 2444.608, 400.5993, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: 0) +(@OGUID+5, 195346, 571, 1, 1, 7845.074, 2444.608, 400.5993, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: 0) +(@OGUID+6, 195344, 571, 1, 1, 7888.031, 2486.691, 412.1846, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: 0) +(@OGUID+7, 195346, 571, 1, 1, 7888.031, 2486.691, 412.1846, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: 0) +(@OGUID+8, 195344, 571, 1, 1, 7890.981, 2435.66, 407.6983, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: 0) +(@OGUID+9, 195346, 571, 1, 1, 7890.981, 2435.66, 407.6983, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: 0) +(@OGUID+10, 195344, 571, 1, 1, 7879.325, 2381.498, 395.9927, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+11, 195346, 571, 1, 1, 7879.325, 2381.498, 395.9927, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+12, 195344, 571, 1, 1, 7772.191, 2523.408, 397.5526, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+13, 195346, 571, 1, 1, 7772.191, 2523.408, 397.5526, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+14, 195344, 571, 1, 1, 7792.491, 2552.295, 404.7368, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+15, 195346, 571, 1, 1, 7792.491, 2552.295, 404.7368, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+16, 195344, 571, 1, 1, 7813.522, 2376.698, 383.7577, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+17, 195346, 571, 1, 1, 7813.522, 2376.698, 383.7577, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+18, 195344, 571, 1, 1, 7912.719, 2361.585, 403.3483, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+19, 195346, 571, 1, 1, 7912.719, 2361.585, 403.3483, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+20, 195344, 571, 1, 1, 7887.583, 2323.535, 389.2969, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+21, 195346, 571, 1, 1, 7887.583, 2323.535, 389.2969, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+22, 195344, 571, 1, 1, 7779.922, 2417.377, 384.4348, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+23, 195346, 571, 1, 1, 7779.922, 2417.377, 384.4348, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+24, 195344, 571, 1, 1, 7912.483, 2277.05, 387.8716, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+25, 195346, 571, 1, 1, 7912.483, 2277.05, 387.8716, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+26, 195344, 571, 1, 1, 7843.852, 2334.658, 382.3897, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+27, 195346, 571, 1, 1, 7843.852, 2334.658, 382.3897, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+28, 195344, 571, 1, 1, 7863.498, 2231.648, 375.1721, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+29, 195346, 571, 1, 1, 7863.498, 2231.648, 375.1721, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+30, 195344, 571, 1, 1, 7829.741, 2296.035, 378.0592, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+31, 195346, 571, 1, 1, 7829.741, 2296.035, 378.0592, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+32, 195344, 571, 1, 1, 7746.049, 2372.997, 376.3941, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+33, 195346, 571, 1, 1, 7746.049, 2372.997, 376.3941, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+34, 195344, 571, 1, 1, 7760.765, 2331.149, 374.8048, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+35, 195346, 571, 1, 1, 7760.765, 2331.149, 374.8048, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+36, 195344, 571, 1, 1, 7788.99, 2255.302, 371.7061, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+37, 195346, 571, 1, 1, 7788.99, 2255.302, 371.7061, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+38, 195344, 571, 1, 1, 7820.729, 2238.01, 372.7758, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+39, 195346, 571, 1, 1, 7820.729, 2238.01, 372.7758, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+40, 193984, 571, 1, 1, 7647.473, 2055.554, 599.3989, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- Alliance Banner (Area: The Valley of Fallen Heroes) +(@OGUID+41, 195344, 571, 1, 1, 7745.684, 2289.906, 371.991, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+42, 195346, 571, 1, 1, 7745.684, 2289.906, 371.991, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+43, 195344, 571, 1, 1, 7696.855, 2372.087, 374.5795, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+44, 195346, 571, 1, 1, 7696.855, 2372.087, 374.5795, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+45, 195344, 571, 1, 1, 7710.979, 2338.505, 373.0223, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+46, 195346, 571, 1, 1, 7710.979, 2338.505, 373.0223, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+47, 195344, 571, 1, 1, 7750.775, 2420.458, 380.734, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+48, 195346, 571, 1, 1, 7750.775, 2420.458, 380.734, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+49, 195344, 571, 1, 1, 7651.209, 2394.108, 374.7194, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+50, 195346, 571, 1, 1, 7651.209, 2394.108, 374.7194, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+51, 195344, 571, 1, 1, 7694.101, 2306.049, 370.4156, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+52, 195346, 571, 1, 1, 7694.101, 2306.049, 370.4156, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+53, 195344, 571, 1, 1, 7603.735, 2402.665, 377.1989, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+54, 195346, 571, 1, 1, 7603.735, 2402.665, 377.1989, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+55, 195344, 571, 1, 1, 7632.563, 2369.054, 376.1918, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+56, 195346, 571, 1, 1, 7632.563, 2369.054, 376.1918, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+57, 195346, 571, 1, 1, 7568.995, 2373.521, 377.0721, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+58, 195344, 571, 1, 1, 7568.995, 2373.521, 377.0721, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+59, 195344, 571, 1, 1, 7628.762, 2434.55, 377.8682, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+60, 195346, 571, 1, 1, 7628.762, 2434.55, 377.8682, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+61, 195346, 571, 1, 1, 7569.211, 2434.028, 382.9506, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+62, 195344, 571, 1, 1, 7569.211, 2434.028, 382.9506, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+63, 195344, 571, 1, 1, 7590.309, 2308.01, 376.7488, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+64, 195346, 571, 1, 1, 7590.309, 2308.01, 376.7488, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+65, 195344, 571, 1, 1, 7542.194, 2323.882, 378.2228, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+66, 195346, 571, 1, 1, 7542.194, 2323.882, 378.2228, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+67, 195344, 571, 1, 1, 7505.332, 2363.399, 378.0511, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+68, 195346, 571, 1, 1, 7505.332, 2363.399, 378.0511, 0, 0, 0, 0, 1, 120, 255, 1), -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) +(@OGUID+69, 195344, 571, 1, 1, 7453.913, 2355.877, 380.0355, 0, 0, 0, 0, 1, 120, 255, 1), -- Discarded Soul Crystal (Area: The Valley of Fallen Heroes) +(@OGUID+70, 195346, 571, 1, 1, 7453.913, 2355.877, 380.0355, 0, 0, 0, 0, 1, 120, 255, 1); -- Aura Trap Blue Short (Area: The Valley of Fallen Heroes) diff --git a/sql/updates/world/2013_07_28_01_world_sai.sql b/sql/updates/world/2013_07_28_01_world_sai.sql new file mode 100644 index 00000000000..067200e9c51 --- /dev/null +++ b/sql/updates/world/2013_07_28_01_world_sai.sql @@ -0,0 +1,24 @@ +-- Fix quest 14107: The Fate Of The Fallen +-- Add SmartAI for Fallen Hero's Spirit + +SET @ENTRY := 32149; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE creature_id = @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 0, 0, 8, 0, 100, 1, 66719, 0, 0, 0, 80, @ENTRY*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fallen Hero''s Spirit - On Spellhit Blessing of Peace - Run script'), +(@ENTRY*100, 9, 0, 0, 0, 0, 100, 0, 100, 100, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Fallen Hero''s Spirit - Script - Turn to Invoker'), +(@ENTRY*100, 9, 1, 0, 0, 0, 100, 0, 100, 100, 0, 0, 33, 35055, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 'Fallen Hero''s Spirit - Script - Give Quest Credit'), +(@ENTRY*100, 9, 2, 0, 0, 0, 100, 0, 100, 100, 0, 0, 2, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fallen Hero''s Spirit - Script - Set Faction'), +(@ENTRY*100, 9, 3, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fallen Hero''s Spirit - Script - Say 0'), +(@ENTRY*100, 9, 4, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fallen Hero''s Spirit - Script - Despawn'); + +-- Creature text for Fallen Hero's Spirit +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY, 0, 0, 'It was awful... I dreamt I was fighting against my friends.', 12, 0, 100, 1, 0, 0, 'Fallen Hero''s Spirit'), +(@ENTRY, 0, 1, 'I''m so tired. Just let me rest for a moment.', 12, 0, 100, 1, 0, 0, 'Fallen Hero''s Spirit'), +(@ENTRY, 0, 2, 'I can''t hear the screams anymore. Is this the end?', 12, 0, 100, 1, 0, 0, 'Fallen Hero''s Spirit'), +(@ENTRY, 0, 3, 'At last... now I can rest.', 12, 0, 100, 1, 0, 0, 'Fallen Hero''s Spirit'), +(@ENTRY, 0, 4, 'My nightmare, is it finally over?', 12, 0, 100, 1, 0, 0, 'Fallen Hero''s Spirit'); diff --git a/sql/updates/world/2013_07_29_00_world_drak_tharon_keep.sql b/sql/updates/world/2013_07_29_00_world_drak_tharon_keep.sql new file mode 100644 index 00000000000..bfcc29c1080 --- /dev/null +++ b/sql/updates/world/2013_07_29_00_world_drak_tharon_keep.sql @@ -0,0 +1,2 @@ +UPDATE `instance_template` SET `script`="instance_drak_tharon_keep" WHERE `map`=600; +UPDATE `creature_template` SET `ScriptName`="boss_king_dred" WHERE `entry`=27483; diff --git a/sql/updates/world/2013_07_29_01_world_spelldifficulty_dbc.sql b/sql/updates/world/2013_07_29_01_world_spelldifficulty_dbc.sql new file mode 100644 index 00000000000..56764385765 --- /dev/null +++ b/sql/updates/world/2013_07_29_01_world_spelldifficulty_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spelldifficulty_dbc` WHERE `id` = 48849; +INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`) VALUES +(48849, 48849, 59422); diff --git a/sql/updates/world/2013_07_31_00_world_spell_script_names.sql b/sql/updates/world/2013_07_31_00_world_spell_script_names.sql new file mode 100644 index 00000000000..27779d0da45 --- /dev/null +++ b/sql/updates/world/2013_07_31_00_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (50341,50344); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(50341, 'spell_oculus_touch_the_nightmare'), +(50344, 'spell_oculus_dream_funnel'); diff --git a/sql/updates/world/2013_08_03_00_world_misc.sql b/sql/updates/world/2013_08_03_00_world_misc.sql new file mode 100644 index 00000000000..e6690c13033 --- /dev/null +++ b/sql/updates/world/2013_08_03_00_world_misc.sql @@ -0,0 +1,22 @@ +-- Sergeant Kregga, Captain Kendall, Opportunity and Exploiting an Opening fix by nelegalno +-- http://www.wowhead.com/zone=210#comments:id=838363 +-- http://www.wowhead.com/zone=210#comments:id=838364 +SET @GUID=18; -- Set by TDB team +SET @ASPELL=59073; +SET @HSPELL=59087; +SET @AREA=4522; + +-- Sergeant Kregga (31440) +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`exp`=2 WHERE `entry`=31440; +DELETE FROM `creature` WHERE `guid`=@GUID AND `id`=31440; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID,31440,571,1,8,0,0,5874.2,1948.5,516.1,2.8,300,0,0,32000,0,0,0,0,0); + +-- Captain Kendall (31444) +UPDATE `creature` SET `phaseMask`=2 WHERE `id`=31444; + +DELETE FROM `spell_area` WHERE `spell`=@HSPELL AND `area`=@AREA; +DELETE FROM `spell_area` WHERE `spell`=@ASPELL AND `area`=@AREA; +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`,`quest_start_status`,`quest_end_status`) VALUES +(@HSPELL,@AREA,12899,0,0, 690,2,1,64,43), -- Horde version +(@ASPELL,@AREA,12898,0,0,1101,2,1,64,43); -- Alliance version diff --git a/sql/updates/world/2013_08_04_00_world_quests.sql b/sql/updates/world/2013_08_04_00_world_quests.sql new file mode 100644 index 00000000000..00f71824236 --- /dev/null +++ b/sql/updates/world/2013_08_04_00_world_quests.sql @@ -0,0 +1,390 @@ +-- The Nightmare Manifests/Hope Within the Emerald Nightmare/The Boon of Remulos/Walking Legend +SET @TYRANDE := 15633; +SET @ERANIKUS := 15491; +SET @REMULOS := 11832; +SET @MALFURION := 17949; +SET @PHANTASM := 15629; +SET @E_REDEEM := 15628; + +DELETE FROM `creature_ai_scripts` WHERE creature_id=@ERANIKUS; +-- Tyrande +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='', `flags_extra`=0, `type_flags`=0, `unit_flags`=32768, `faction_H`=1254, `faction_A`=1254 WHERE `entry`=@TYRANDE; +-- Eranikus, Tyrant of the Dream +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='', `InhabitType`=7, `faction_A`=35, `faction_H`=35, `unit_flags`=0, `flags_extra`=2097152, `type_flags`=8, `dynamicflags`=128, `speed_walk`=2 WHERE `entry`=@ERANIKUS; +-- Keeper Remulos +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='', `speed_walk`=2.5, `speed_run`=3.75, `type_flags`=0, `unit_flags`=32768, `faction_H`=1254, `faction_A`=1254 WHERE `entry`=@REMULOS; +-- Malfurion +UPDATE `creature_template` SET `InhabitType`=4,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@MALFURION; +-- Not sure if these are set on stock DB, but I'll still add them just in case. +UPDATE `creature_template` SET `IconName`='Interact', `npcflag`=16777216 WHERE `entry` IN (32788,32790); +-- Wrong gameobject, no idea who spawned it there. +DELETE FROM `gameobject` WHERE `guid`=99849; + +-- NPC texts +DELETE FROM `creature_text` WHERE entry IN (@REMULOS,@ERANIKUS,@PHANTASM,@TYRANDE,@E_REDEEM,@MALFURION); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@REMULOS,0,0,'We will locate the origin of the Nightmare through the fragments you collected, $n. From there, we will pull Eranikus through a rift in the Dream. Steel yourself, $c. We are inviting the embodiment of the Nightmare into our world.',12,0,100,0,0,0,'Keeper Remulos Say 0'), +(@REMULOS,1,1,'The rift will be opened there, above the Lake Elun''ara. Prepare yourself, $n. Eranikus''s entry into our world will be wrought with chaos and strife.',12,0,100,0,0,0,'Keeper Remulos Say 1'), +(@REMULOS,2,2,'He will stop at nothing to get to Malfurion''s physical manifistation. That must not happen... We must keep the beast occupied long enough for Tyrande to arrive.',12,0,100,0,0,0,'Keeper Remulos Say 2'), +(@REMULOS,3,3,'Defend Nighthaven, hero...',12,0,100,0,0,0,'Keeper Remulos Say 3'), +(@REMULOS,4,4,'Fiend! Face the might of Cenarius!',14,0,100,0,0,0,'Keeper Remulos Say 4'), +(@REMULOS,5,5,'Who is the predictable one, beast? Surely you did not think that we would summon you on top of Malfurion? Your redemption comes, Eranikus. You will be cleansed of this madness - this corruption.',14,0,100,0,0,0,'Keeper Remulos Say 4'), +(@REMULOS,6,6,'Hurry, $N! We must find protective cover!',12,0,100,0,0,0,'Keeper Remulos Say 6'), +(@REMULOS,7,7,'Please, champion, protect our people.',12,0,100,0,0,0,'Keeper Remulos Say 7'), +(@REMULOS,8,8,'It will be done, Eranikus. Be well, ancient one.',12,0,100,0,0,0,'Keeper Remulos Say 8'), +(@REMULOS,9,9,'Let us leave Nighthaven, hero Seek me out at the grove.',12,0,100,0,0,0,'Keeper Remulos Say 9'), +-- +(@REMULOS,10,10,'Come, $N. The lake is around the bend.',12,0,100,1,0,0,'Keeper Remulos - say Text 0'), +(@REMULOS,11,11,'Stand near me, $N. I will protect you should anything go wrong.',12,0,100,1,0,0,'Keeper Remulos - say Text 1'), +(@REMULOS,12,12,'Malfurion!',12,0,100,5,0,0,'Keeper Remulos - say Text 2'), +(@REMULOS,13,13,'It was shrouded in nightmares, Malfurion. What is happening in the Dream? What could cause such atrocities?',12,0,100,6,0,0,'Keeper Remulos - say Text 3'), +(@REMULOS,14,14,'I sensed as much, Malfurion. Dark days loom ahead.',12,0,100,1,0,0,'Keeper Remulos - say Text 4'), +(@REMULOS,15,15,'You have been gone too long, Malfurion. Peace between the Children of Azeroth has become tenuous at best. What of my father? Of your brother? Have you any news?',12,0,100,6,0,0,'Keeper Remulos - say Text 5'), +(@REMULOS,16,16,'Farewell, old friend... Farewell...',12,0,100,1,0,0,'Keeper Remulos - say Text 6'), +(@REMULOS,17,17,'Let us return to the grove, mortal.',12,0,100,1,0,0,'Keeper Remulos - say Text 7'), +-- +(@ERANIKUS,0,0,'Pitful predictable mortals... You know not what you have done! The master''s will fulfilled. The Moonglade shall be destroyed and Malfurion along with it!',14,0,100,0,0,0,'Eranikus Say 0'), +(@ERANIKUS,1,1,'Eranikus, Tyrant of the Dream lets loose a sinister laugh.',16,0,100,0,0,0,'Eranikus Say 1'), +(@ERANIKUS,2,2,'You are certanly not your father, insect. Should it interest me, I would crush you with but a swipe of my claws. Turn Shan''do Stormrage over to me and your pitiful life will be spared along with the lives of your people.',14,0,100,0,0,0,'Eranikus Say 2'), +(@ERANIKUS,3,3,'My redemption? You are bold, little one. My redemption comes by the will of my god.',14,0,100,0,0,0,'Eranikus Say 3'), +(@ERANIKUS,4,4,'Eranikus, Tyrant of the Dream roars furiously',16,0,100,0,0,0,'Eranikus Say 4'), +(@ERANIKUS,5,5,'Rise, servants of the Nightmare! Rise and destroy this world! Let there be no survivors...',14,0,100,0,0,0,'Eranikus Say 5'), +(@ERANIKUS,6,6,'Where is your savior? How long can you hold out against my attacks?',14,0,100,0,0,0,'Eranikus Say 6'), +(@ERANIKUS,7,7,'Remulos, look how easy they fall before me? You can stop this, fool. Turn the druid over to me and it will all be over...',14,0,100,0,0,0,'Eranikus Say 7'), +(@ERANIKUS,8,8,'Defeated my minions? Then face me, mortals!',14,0,100,0,0,0,'Eranikus Say 8'), +(@ERANIKUS,9,9,'IT BURNS! THE PAIN.. SEARING...',14,0,100,0,0,0,'Eranikus Say 9'), +(@ERANIKUS,10,10,'WHY? Why did this happen to... to me? Where were you Tyrande? Where were you when I fell from the grace of Elune?',14,0,100,0,0,0,'Eranikus Say 10'), +(@ERANIKUS,11,11,'I... I feel... I feel the touch of Elune upon my being once more... She smiles upon me... Yes... I...',14,0,100,0,0,0,'Eranikus Say 11'), +(@ERANIKUS,12,12,'Tyrande falls to one knee.',16,0,100,0,0,0,'Eranikus Say 12'), +-- +(@TYRANDE,0,0,'Seek absolution, Eranikus. All will be forgiven..',14,0,100,0,0,0,'Tyrande Say 0'), +(@TYRANDE,1,1,'You will be forgiven, Eranikus. Elune will always love you. Break free of the bonds that command you!',14,0,100,0,0,0,'Tyrande Say 0'), +(@TYRANDE,2,2,'The grasp of the Old Gods is unmoving. He is consumed by their dark thoughts... I... I... I cannot... cannot channel much longer... Elune aide me.',12,0,100,0,0,0,'Tyrande Say 0'), +-- +(@E_REDEEM,0,0,'For so long, I was lost... The Nightmare''s corruption had consumed me... And now, you... all of you.. you have saved me. Released me from its grasp.',12,0,100,0,0,0,'Eranikus the Redeemed Say 0'), +(@E_REDEEM,1,1,'But... Malfurion, Cenarius, Ysera... They still fight. They need me. I must return to the Dream at once.',12,0,100,0,0,0,'Eranikus the Redeemed Say 0'), +(@E_REDEEM,2,2,'My lady, I am unworthy of your prayer. Truly, you are an angel of light. Please, assist me in returning to the barrow den so that I may return to the Dream. I like Malfurion, also have a love awaiting me... I must return to her... to protect her...',12,0,100,0,0,0,'Eranikus the Redeemed Say 0'), +(@E_REDEEM,3,3,'And heroes... I hold that which you seek. May it once more see the evil dissolved. Remulos, see to it that our champion receives the shard of the Green Flight.',12,0,100,0,0,0,'Eranikus the Redeemed Say 0'), +-- +(@PHANTASM,0,0,'Nightmare Phantasm drinks in the suffering of the fallen.',16,0,100,0,0,0,'Nightmare Phantasm Say 0'), +-- +(@MALFURION,0,0,'Remulos, old friend. It is good to see you once more. I knew the message would find its way to you; one way or another.',12,0,100,1,0,0,'Malfurion Stormrage - say Text 0'), +(@MALFURION,1,0,'I fear for the worst, old friend. Within the Dream we fight a new foe, born of an ancient evil. Ysera''s noble brood has fallen victim to the old whisperings. It seems as if the Nightmare has broken through the realm to find a new host on Azeroth.',12,0,100,1,0,0,'Malfurion Stormrage - say Text 1'), +(@MALFURION,2,0,'Aye Remulos, prepare the mortal races.',12,0,100,1,0,0,'Malfurion Stormrage - say Text 2'), +(@MALFURION,3,0,'Cenarius fights at my side. Illidan sits atop his throne in Outland; brooding. I''m afraid that the loss to Arthas proved to be his breaking point. Madness has embraced him, Remulos. He replays the events in his mind a thousand times per day, but in his mind, he is the victor and Arthas is utterly defeated. He is too far gone, old friend. I fear that the time may soon come that our bond is tested and it will not be as it was at the Well in Zin-Azshari.',12,0,100,1,0,0,'Malfurion Stormrage - say Text 3'), +(@MALFURION,4,0,'Remulos, I am being drawn back... Tyrande... send her my love... Tell her I am safe... Tell her... Tell her I will return... Farewell...',12,0,100,1,0,0,'Malfurion Stormrage - say Text 4'); + + +-- Remulos SAI +DELETE FROM `smart_scripts` WHERE `source_type`IN (0,9) AND `entryorguid` IN (@REMULOS,@REMULOS*100,@REMULOS*100+1,@REMULOS*100+2); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` = @MALFURION; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +-- Quests: Hope Within the Emerald Nightmare & The Boon of Remulos +(@REMULOS,0,0,0,62,0,100,0,10215,0,0,0,11,57413,1,0,0,0,0,7,0,0,0,0,0,0,0,'Keeper Remulos - On gossip option select - cast spell'), +(@REMULOS,0,1,2,62,0,100,0,10215,1,0,0,11,57670,1,0,0,0,0,7,0,0,0,0,0,0,0,'Keeper Remulos - On gossip option select - cast spell'), +(@REMULOS,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Keeper Remulos - On gossip option select - Close gossip'), +(@REMULOS,0,3,0,19,0,100,0,13074,0,0,0,11,57413,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Keeper Remulos - On Quest Accept - Cast Fitful Dream'), +-- The Nightmare Manifests +(@REMULOS,0,4,0,19,0,100,1,8736,0,0,0,1,0,15000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Quest Accept - Say 0'), +(@REMULOS,0,5,0,52,0,100,0,0,@REMULOS,0,0,53,0,@REMULOS,0,8736,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 0 - Start WayPoint'), +(@REMULOS,0,6,0,52,0,100,0,0,@REMULOS,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Quest Accept - Remove Npcflag'), +(@REMULOS,0,7,0,40,0,100,0,13,@REMULOS,0,0,54,95000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 13 - Pause WP'), +(@REMULOS,0,8,0,40,0,100,0,13,@REMULOS,0,0,1,1,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 13 - Say 1'), +(@REMULOS,0,9,0,52,0,100,0,1,@REMULOS,0,0,1,2,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 1 - Say 2'), +(@REMULOS,0,10,0,52,0,100,0,2,@REMULOS,0,0,11,25813,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 3 - Cast Conjure Dream Rift'), +(@REMULOS,0,11,0,52,0,100,0,2,@REMULOS,0,0,12,@ERANIKUS,3,3600000,0,0,0,8,0,0,0,7872.5888, -2664.55888, 497.139282,0.63583,'Keeper Remulos - On Say 3 - Summon Eranikus'), +(@REMULOS,0,12,0,52,0,100,0,2,@REMULOS,0,0,1,3,23000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 2 - Say 3'), +(@REMULOS,0,13,0,52,0,100,0,3,@REMULOS,0,0,1,4,31000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 3 - Say 4'), +(@REMULOS,0,14,0,52,0,100,0,4,@REMULOS,0,0,1,5,22000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 4 - Say 5'), +(@REMULOS,0,15,0,52,0,100,0,5,@REMULOS,0,0,1,6,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 5 - Say 6'), +(@REMULOS,0,16,0,40,0,100,0,20,@REMULOS,0,0,54,60000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 20 - Pause WP'), +(@REMULOS,0,17,0,40,0,100,0,20,@REMULOS,0,0,1,7,20000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 20 - Say 7'), +(@REMULOS,0,18,0,52,0,100,0,7,@REMULOS,0,0,12,@PHANTASM,3,3600000,0,0,0,8,0,0,0,7829.066,-2562.347,489.299,5.234,'Keeper Remulos - On Say 7 - Summon Nightmare Phantasm'), +(@REMULOS,0,19,0,52,0,100,0,7,@REMULOS,0,0,12,@PHANTASM,3,3600000,0,0,0,8,0,0,0,7828.889,-2580.694,489.299,0.753,'Keeper Remulos - On Say 7 -Summon Nightmare Phantasm'), +(@REMULOS,0,20,0,52,0,100,0,7,@REMULOS,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Say 7 - Set react state aggresive'), +(@REMULOS,0,21,0,52,0,100,0,7,@REMULOS,0,0,49,0,0,0,0,0,0,19,@PHANTASM,0,0,0,0,0,0,'Keeper Remulos - On Say 7 - Attack'), +(@REMULOS,0,22,0,0,0,100,0,7000,14000,6000,12000,11,20665,0,0,0,0,0,18,20,0,0,0,0,0,0,'Keeper Remulos - In Combat - Cast Regrowth'), +(@REMULOS,0,23,0,0,0,100,0,26000,52000,34000,46000,11,20664,0,0,0,0,0,18,20,0,0,0,0,0,0,'Keeper Remulos - In Combat - Cast Regrowth'), +(@REMULOS,0,24,0,0,0,100,0,25000,25000,25000,50000,11,23381,0,0,0,0,0,18,20,0,0,0,0,0,0,'Keeper Remulos - In Combat - Cast Healing Touch'), +(@REMULOS,0,25,0,0,0,100,0,10000,40000,40000,40000,11,25817,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - In Combat - Cast Tranquility'), +(@REMULOS,0,26,0,0,0,100,0,16000,21000,19000,25000,11,21668,0,0,0,0,0,2,0,0,0,0,0,0,0,'Keeper Remulos - In Combat - Cast Starfall'), +(@REMULOS,0,27,0,38,0,100,0,1,1,0,0,1,8,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Data Set - Say 8'), +(@REMULOS,0,28,0,52,0,100,0,8,@REMULOS,0,0,1,9,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Said 8 8 - Say 9'), +(@REMULOS,0,29,0,40,0,100,1,21,@REMULOS,0,0,49,0,0,0,0,0,0,11,@ERANIKUS,30,0,0,0,0,0,'Keeper Remulos - On Waypoint Reached - Attack Eranikus'), +(@REMULOS,0,30,0,6,0,100,0,0,0,0,0,6,8736,0,0,0,0,0,18,40,0,0,0,0,0,0,'Keeper Remulos - On Death - Fail Quest'), +(@REMULOS,0,31,0,40,0,100,1,23,@REMULOS,0,0,54,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 23 - Pause WP'), +(@REMULOS,0,32,0,40,0,100,1,23,@REMULOS,0,0,66,2.835,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 23 - Set Orientation'), +(@REMULOS,0,33,0,52,0,100,0,9,@REMULOS,0,0,53,1,@REMULOS*100+1,0,8736,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On Said 9 - Go Home'), +(@REMULOS,0,34,0,40,0,100,0,12,@REMULOS*100+1,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 12 - Set Npcflags'), +(@REMULOS,0,35,0,40,0,100,0,12,@REMULOS*100+1,0,0,66,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 12 - Set Orientation'), +(@REMULOS,0,36,0,40,0,100,0,24,@REMULOS,0,0,80,@REMULOS*100+1,0,1,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - On WayPoint 24 - Run Script only when OOC'), +-- Quest: Waking Legends +(@REMULOS,0,37,38,19,0,100,0,8447,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - on Quest Accept - Turn off Quest Giver & Gossip Flag'), +(@REMULOS,0,38,39,61,0,100,0,0,0,0,0,53,0,@REMULOS*100,0,8447,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - on Quest Accept - start WP'), +(@REMULOS,0,39,0,61,0,100,0,0,0,0,0,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - on Quest Accept - say Text 10'), +(@REMULOS,0,40,41,40,0,100,0,5,@REMULOS*100,0,0,54,83000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - reached WP 5 - pause WP'), +(@REMULOS,0,41,42,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.12180,'Keeper Remulos - reached WP5 - set orientation'), +(@REMULOS,0,42,0,61,0,100,0,0,0,0,0,80,@REMULOS*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - reached WP 5 - run Script'), +(@REMULOS,0,43,0,40,0,100,0,10,@REMULOS*100,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - reached WP 10 - Turn on Quest Giver & Gossip Flag'), +(@REMULOS,0,44,0,40,0,100,0,10,@REMULOS*100,0,0,66,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - reached WP 10 - set orientation'), +-- Script +(@REMULOS*100+2,9,0,0,0,0,100,0,2000,2000,0,0,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Say Text 1'), +(@REMULOS*100+2,9,1,0,0,0,100,0,3000,3000,0,0,11,25004,1,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Cast Spell: Throw Nightmare Object to Position'), +(@REMULOS*100+2,9,2,0,0,0,100,0,5000,5000,0,0,12,@MALFURION,8,0,0,0,0,8,0,0,0,7730.5288,-2318.8596,453.8706,6.14985,'Keeper Remulos - Summon Malfurion Stormrage'), +(@REMULOS*100+2,9,3,0,0,0,100,0,2000,2000,0,0,1,12,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Say Text 12'), +(@REMULOS*100+2,9,4,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,9,@MALFURION,0,30,0,0,0,0,'Malfurion Stormrage - Say Text 0'), +(@REMULOS*100+2,9,5,0,0,0,100,0,6000,6000,0,0,1,13,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Say Text 13'), +(@REMULOS*100+2,9,6,0,0,0,100,0,7000,7000,0,0,1,1,0,0,0,0,0,9,@MALFURION,0,30,0,0,0,0,'Malfurion Stormrage - Say Text 1'), +(@REMULOS*100+2,9,7,0,0,0,100,0,11000,11000,0,0,1,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Say Text 14'), +(@REMULOS*100+2,9,8,0,0,0,100,0,3500,3500,0,0,1,2,0,0,0,0,0,9,@MALFURION,0,30,0,0,0,0,'Malfurion Stormrage - Say Text 2'), +(@REMULOS*100+2,9,9,0,0,0,100,0,4000,4000,0,0,1,15,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Say Text 15'), +(@REMULOS*100+2,9,10,0,0,0,100,0,9000,9000,0,0,1,3,0,0,0,0,0,9,@MALFURION,0,30,0,0,0,0,'Malfurion Stormrage - Say Text 3'), +(@REMULOS*100+2,9,11,0,0,0,100,0,19000,19000,0,0,1,4,0,0,0,0,0,9,@MALFURION,0,30,0,0,0,0,'Malfurion Stormrage - Say Text 4'), +(@REMULOS*100+2,9,12,0,0,0,100,0,6000,6000,0,0,1,16,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Say Text 16'), +(@REMULOS*100+2,9,13,0,0,0,100,0,2000,2000,0,0,1,17,0,0,0,0,0,1,0,0,0,0,0,0,0,'Keeper Remulos - Say Text 17'), +(@REMULOS*100+2,9,14,0,0,0,100,0,0,0,0,0,15,8447,0,0,0,0,0,7,0,0,0,0,0,0,0,'Keeper Remulos - Give Quest Credit'), +(@REMULOS*100+2,9,15,0,0,0,100,0,1000,1000,0,0,45,0,1,0,0,0,0,9,@MALFURION,0,30,0,0,0,0,'Keeper Remulos - Set data 0 1 to Malfurion Stormrage'), + -- +(@MALFURION,0,0,0,54,0,100,0,0,0,0,0,11,52096,2,0,0,0,0,1,0,0,0,0,0,0,0,'Malfurion Stormrage - On summon - Cast Cosmetic Teleport Effect on self'), +(@MALFURION,0,1,0,38,0,100,0,0,1,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Malfurion Stormrage - On data set 0 1 - Despawn'), + -- +(@REMULOS*100+1,9,0,0,1,0,100,1,60000,60000,0,0,53,0,@REMULOS*100+1,0,8736,0,0,1,0,0,0,0,0,0,0,'On Script - OOC 1 Mintues - Go Home'); + +-- Eranikus, Tyrant of the Dream SAI +DELETE FROM `smart_scripts` WHERE entryorguid IN(@ERANIKUS,@ERANIKUS*100,@ERANIKUS*100+1); +INSERT INTO `smart_scripts` VALUES +(@ERANIKUS,0,0,0,1,0,100,1,13000,13000,13000,13000,1,0,15000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - OOC 13 Sec - Say 0'), +(@ERANIKUS,0,1,0,52,0,100,0,0,@ERANIKUS,0,0,1,1,6000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 0 - Say 1'), +(@ERANIKUS,0,2,0,52,0,100,0,1,@ERANIKUS,0,0,1,2,34000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 1 - Say 2'), +(@ERANIKUS,0,3,0,52,0,100,0,2,@ERANIKUS,0,0,1,3,3000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 2 - Say 3'), +(@ERANIKUS,0,4,0,52,0,100,0,3,@ERANIKUS,0,0,1,4,3000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 3 - Say 4'), +(@ERANIKUS,0,5,0,52,0,100,0,4,@ERANIKUS,0,0,53,0,@ERANIKUS,0,8736,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 4 - Start WayPoint'), +(@ERANIKUS,0,6,0,40,0,100,0,3,@ERANIKUS,0,0,54,130000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On WayPoint 3 - Pause'), +(@ERANIKUS,0,7,0,40,0,100,0,3,@ERANIKUS,0,0,1,5,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On WayPoint 3 - Say 5'), +(@ERANIKUS,0,8,0,52,0,100,0,5,@ERANIKUS,0,0,80,@ERANIKUS*100,0,2,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 5 - Start Script'), +(@ERANIKUS*100,9,0,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,1,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,2,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,3,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,4,0,0,0,100,0,5000,5000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,5,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,6,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,7,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,8,0,0,0,100,0,5000,5000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,9,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,10,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,11,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,12,0,0,0,100,0,5000,5000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,13,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,14,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,15,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100,9,16,0,0,0,100,0,1000,1000,0,0,1,6,35000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Script - Say 6'), +(@ERANIKUS,0,9,0,52,0,100,0,6,@ERANIKUS,0,0,80,@ERANIKUS*100+1,0,2,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 6 - Start Script'), +(@ERANIKUS*100+1,9,0,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,1,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,2,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,3,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,4,0,0,0,100,0,5000,5000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,5,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,6,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,7,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,8,0,0,0,100,0,5000,5000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,9,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,10,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,11,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,12,0,0,0,100,0,5000,5000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7865.966,-2554.104,486.967,5.492,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,13,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7873.412,-2587.454,486.946,0.924,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,14,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7901.544,-2581.989,487.178,2.059,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,15,0,0,0,100,0,1000,1000,0,0,12,@PHANTASM,3,600000,0,0,0,8,0,0,0,7918.844,-2553.987,486.911,3.772,'Eranikus - On Script - Summon Nightmare Phantasm'), +(@ERANIKUS*100+1,9,16,0,0,0,100,0,1000,1000,0,0,1,7,33000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Script - Say 7'), +(@ERANIKUS,0,10,0,40,0,100,0,4,@ERANIKUS,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - Waypont 4 reached - Set faction enemy'), +(@ERANIKUS,0,38,0,40,0,100,0,4,@ERANIKUS,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - Waypont 4 - Set react state aggresive'), +(@ERANIKUS,0,11,0,2,0,100,0,30,65,12000,35000,12,@PHANTASM,3,600000,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - In Combat - Summon Nightmare Phantasm'), +(@ERANIKUS,0,12,0,4,1,100,0,0,0,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On aggro - Say 8'), +(@ERANIKUS,0,13,0,4,0,100,0,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On aggro - Set react state aggresive'), +(@ERANIKUS,0,14,0,4,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Eranikus - On aggro - Start Attack'), +(@ERANIKUS,0,15,0,0,0,100,0,2000,4000,55000,60000,11,24818,0,0,0,0,0,2,0,0,0,0,0,0,0,'Eranikus - In Combat - Cast Noxious Breath'), +(@ERANIKUS,0,16,0,0,0,100,0,9000,14000,50000,55000,11,24839,0,0,0,0,0,2,0,0,0,0,0,0,0,'Eranikus - In Combat - Cast Acid Spit'), +(@ERANIKUS,0,17,0,0,0,100,0,10000,20000,15000,25000,11,22878,0,0,0,0,0,2,0,0,0,0,0,0,0,'Eranikus - In Combat - Cast Shadow Bolt Volley'), +(@ERANIKUS,0,18,0,2,0,100,1,0,70,0,0,12,@TYRANDE,3,3600000,0,0,0,8,0,0,0,7900.216,-2572.621,488.176,2.330,'Eranikus - At 70% - Summon Tyrande'), +(@ERANIKUS,0,34,0,2,0,100,1,0,69,0,0,1,0,0,0,0,0,0,11,@TYRANDE,30,0,0,0,0,0,'Eranikus - At 69% - Tyrande Say 0'), +(@ERANIKUS,0,35,0,2,0,100,1,0,30,0,0,1,1,0,0,0,0,0,11,@TYRANDE,30,0,0,0,0,0,'Eranikus - At 30% - Tyrande Say 1'), +(@ERANIKUS,0,19,0,2,0,100,1,0,25,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - At 25% - Say 9'), +(@ERANIKUS,0,20,0,2,0,100,1,0,22,0,0,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - At 22% - Say 10'), +(@ERANIKUS,0,21,0,2,0,100,1,0,20,0,0,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - At 20% - Say 11'), +(@ERANIKUS,0,22,0,52,0,100,0,11,@ERANIKUS,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 2 - Set faction friendly'), +(@ERANIKUS,0,23,0,52,0,100,0,11,@ERANIKUS,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 2 - Set react state passive'), +(@ERANIKUS,0,24,0,52,0,100,0,11,@ERANIKUS,0,0,18,33555200,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 2 - Set unit flags'), +(@ERANIKUS,0,25,0,52,0,100,0,11,@ERANIKUS,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Say 2 - Stop AutoAttack'), +(@ERANIKUS,0,26,0,52,0,100,0,11,@ERANIKUS,0,0,1,12,3000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - Say 11 - Say 12'), +(@ERANIKUS,0,27,0,52,0,100,0,12,@ERANIKUS,0,0,12,@E_REDEEM,3,60000,0,0,0,8,0,0,0,7904.248,-2564.867,488.156,5.116,'Eranikus - On Say 12 - Summon Eranikus the Redeemed'), +(@ERANIKUS,0,28,0,52,0,100,0,12,@ERANIKUS,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - Say 12 - Kill'), +(@ERANIKUS,0,31,0,7,0,100,0,0,0,0,0,6,8736,0,0,0,0,0,18,40,0,0,0,0,0,0,'Eranikus - On Evade - Quest Fail'), +(@ERANIKUS,0,32,0,6,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On Death - Set invisibility'), +(@ERANIKUS,0,33,0,40,0,100,0,5,@ERANIKUS,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On WayPoint 5 - Set invisibility'), +(@ERANIKUS,0,36,0,40,0,100,0,5,@ERANIKUS,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus - On WayPoint 5 - Die'), +(@ERANIKUS,0,37,0,40,0,100,0,5,@ERANIKUS,0,0,6,8736,0,0,0,0,0,18,40,0,0,0,0,0,0,'Eranikus - On WayPoint 5 - Quest Fail'); + +-- Tyrande SAI +DELETE FROM `smart_scripts` WHERE entryorguid IN (@TYRANDE); +INSERT INTO `smart_scripts` VALUES +(@TYRANDE,0,0,0,54,0,100,1,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Tyrande - On Summon - Set react state aggresive'), +(@TYRANDE,0,1,0,1,0,100,1,95000,95000,95000,95000,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Tyrande - OOC 60 Sec - Set invisibility'), +(@TYRANDE,0,2,0,1,0,100,1,96000,96000,96000,96000,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Tyrande - OOC 61 Sec - Kill'), +(@TYRANDE,0,3,0,0,0,100,0,1000,2000,2300,2500,11,21668,0,0,0,0,0,11,@ERANIKUS,20,0,0,0,0,0,'Tyrande - In Combat - Cast Starfall'); + +-- Eranikus the Redeemed SAI +UPDATE `creature_template` SET AIName='SmartAI', modelid1=6984 WHERE entry=@E_REDEEM; +DELETE FROM `smart_scripts` WHERE entryorguid IN(@E_REDEEM); +INSERT INTO `smart_scripts` VALUES +(@E_REDEEM,0,0,0,1,0,100,1,7000,7000,7000,7000,1,0,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus the Redeemed - OOC 7 Secs - Say 0'), +(@E_REDEEM,0,1,0,52,0,100,0,0,@E_REDEEM,0,0,1,1,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus the Redeemed - On Say 0 - Say 1'), +(@E_REDEEM,0,2,0,52,0,100,0,1,@E_REDEEM,0,0,1,2,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus the Redeemed - On Say 1 - Say 2'), +(@E_REDEEM,0,3,0,52,0,100,0,2,@E_REDEEM,0,0,1,3,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Eranikus the Redeemed - On Say 2 - Say 3'), +(@E_REDEEM,0,5,0,52,0,100,0,3,@E_REDEEM,0,0,15,8736,0,0,0,0,0,18,30,0,0,0,0,0,0,'Eranikus the Redeemed - On Say 3 - Credit'), +(@E_REDEEM,0,6,0,52,0,100,0,3,@E_REDEEM,0,0,45,1,1,0,0,0,0,11,@REMULOS,40,0,0,0,0,0,'Eranikus the Redeemed - On Say 3 - Set Data'); + +UPDATE `creature_template` SET AIName='SmartAI', Faction_A=14, Faction_H=14 WHERE entry=@PHANTASM; +DELETE FROM `smart_scripts` WHERE entryorguid IN(@PHANTASM); +INSERT INTO `smart_scripts` VALUES +(@PHANTASM,0,0,0,54,0,100,0,0,0,0,0,53,1,@PHANTASM,0,8736,0,0,1,0,0,0,0,0,0,0,'Nightmare Phantasm - Summon - Start WayPoint'), +(@PHANTASM,0,1,0,54,0,100,0,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nightmare Phantasm - Summon - Aggresive'), +(@PHANTASM,0,2,0,54,0,100,0,0,0,0,0,49,0,0,0,0,0,0,18,50,0,0,0,0,0,0,'Nightmare Phantasm - Summon - Attack Player'), +(@PHANTASM,0,3,0,6,0,75,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nightmare Phantasm - Death - Say 0'), +(@PHANTASM,0,4,0,40,0,100,0,4,@PHANTASM,0,0,53,1,@PHANTASM,0,8736,0,0,1,0,0,0,0,0,0,0,'Nightmare Phantasm - WayPoint 20 - Start Again'), +(@PHANTASM,0,5,0,1,0,100,1,60000,60000,60000,60000,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nightmare Phantasm - OOC 60 Secs - Unseen'), +(@PHANTASM,0,6,0,1,0,100,1,63000,63000,63000,63000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nightmare Phantasm - OOC 63 Secs - Despawn'), +(@PHANTASM,0,7,0,1,0,100,1,5000,5000,5000,5000,53,1,@PHANTASM,0,8736,0,0,1,0,0,0,0,0,0,0,'Nightmare Phantasm - OOC 5 Secs - Start WayPoint'); + +DELETE FROM `creature_template_addon` WHERE `entry`=@MALFURION; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@MALFURION,0,0,33554432,0,0,'24999'); -- Malfurion's Shade Aura & Hover Mode + +DELETE FROM `creature_template_addon` WHERE `entry`=@ERANIKUS; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@ERANIKUS,0,0,33554432,0,0,''); + +DELETE FROM `spell_target_position` WHERE `id`=25004; +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(25004,1,7730.5288,-2318.8596,451.34,0); + +-- Waypoints +DELETE FROM `waypoints` WHERE entry=@REMULOS; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@REMULOS,1,7829.66,-2244.87,463.87,'Keeper Remulos'), +(@REMULOS,2,7817.25,-2306.20,456.00,'Keeper Remulos'), +(@REMULOS,3,7866.54,-2312.20,463.32,'Keeper Remulos'), +(@REMULOS,4,7908.488,-2309.086,467.677,'Keeper Remulos'), +(@REMULOS,5,7933.290,-2314.777,473.674,'Keeper Remulos'), +(@REMULOS,6,7942.543457,-2320.170654,476.770355,'Keeper Remulos'), +(@REMULOS,7,7953.036133,-2357.953613,486.379303,'Keeper Remulos'), +(@REMULOS,8,7962.706055,-2411.155518,488.955231,'Keeper Remulos'), +(@REMULOS,9,7976.860352,-2552.697998,490.081390,'Keeper Remulos'), +(@REMULOS,10,7949.307617,-2569.120361,489.716248,'Keeper Remulos'), +(@REMULOS,11,7950.945801,-2597.000000,489.765564,'Keeper Remulos'), +(@REMULOS,12,7948.758301,-2610.823486,492.368988,'Keeper Remulos'), +(@REMULOS,13,7928.785156,-2629.920654,492.524933,'Keeper Remulos'), ## stop +(@REMULOS,14,7948.697754,-2610.551758,492.363983,'Keeper Remulos'), +(@REMULOS,15,7952.019531,-2591.974609,490.081238,'Keeper Remulos'), +(@REMULOS,16,7940.567871,-2577.845703,488.946808,'Keeper Remulos'), +(@REMULOS,17,7908.662109,-2566.450439,488.634644,'Keeper Remulos'), +(@REMULOS,18,7873.132324,-2567.422363,486.946442,'Keeper Remulos'), +(@REMULOS,19,7839.844238,-2570.598877,489.286224,'Keeper Remulos'), +(@REMULOS,20,7830.678597,-2572.878974,489.286224,'Keeper Remulos'), +(@REMULOS,21,7890.504,-2567.259,487.306,'Keeper Remulos'), +(@REMULOS,22,7906.447,-2566.105,488.435,'Keeper Remulos'), +(@REMULOS,23,7925.861,-2573.601,489.642,'Keeper Remulos'), +(@REMULOS,24,7912.283,-2568.500,488.891,'Keeper Remulos'); + +DELETE FROM `waypoints` WHERE `entry`=@REMULOS*100; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@REMULOS*100,1,7828.5752,-2246.8354,463.5159,'Keeper Remulos - WP1'), +(@REMULOS*100,2,7824.6440,-2279.0273,459.3173,'Keeper Remulos - WP2'), +(@REMULOS*100,3,7814.1699,-2302.2565,456.2227,'Keeper Remulos - WP3'), +(@REMULOS*100,4,7787.4604,-2320.9807,454.5470,'Keeper Remulos - WP4'), +(@REMULOS*100,5,7753.7495,-2319.0832,454.7066,'Keeper Remulos - WP5'), +(@REMULOS*100,6,7787.4604,-2320.9807,454.5470,'Keeper Remulos - WP6'), +(@REMULOS*100,7,7814.1699,-2302.2565,456.2227,'Keeper Remulos - WP7'), +(@REMULOS*100,8,7824.6440,-2279.0273,459.3173,'Keeper Remulos - WP8'), +(@REMULOS*100,9,7828.5752,-2246.8354,463.5159,'Keeper Remulos - WP9'), +(@REMULOS*100,10,7848.3,-2216.35,470.888,'Keeper Remulos - WP10 (Home)'); + + +-- Waypoints +DELETE FROM `waypoints` WHERE entry IN(@ERANIKUS); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ERANIKUS,1,7949.812,-2605.4748,513.591,'Eranikus'), +(@ERANIKUS,2,7931.3330,-2575.2097,489.6286,'Eranikus'), +(@ERANIKUS,3,7925.129,-2573.747,493.901,'Eranikus'), +(@ERANIKUS,4,7910.554,-2565.5534,488.616,'Eranikus'), +(@ERANIKUS,5,7867.442,-2567.334,486.946,'Eranikus'); + + +-- Waypoints +DELETE FROM `waypoints` WHERE entry IN(@PHANTASM); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@PHANTASM,1,7891.990,-2566.737,487.385,'Phantasm'), +(@PHANTASM,2,7865.966,-2554.104,486.967,'Phantasm'), +(@PHANTASM,3,7901.544,-2581.989,487.178,'Phantasm'), +(@PHANTASM,4,7918.844,-2553.987,486.911,'Phantasm'), +(@PHANTASM,5,7873.412,-2587.454,486.946,'Phantasm'); + +-- Waypoints +DELETE FROM `waypoints` WHERE entry=@REMULOS*100+1; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@REMULOS*100+1,12,7847.066,-2217.571,470.403,'Keeper Remulos'), +(@REMULOS*100+1,11,7829.66,-2244.87,463.87,'Keeper Remulos'), +(@REMULOS*100+1,10,7817.25,-2306.20,456.00,'Keeper Remulos'), +(@REMULOS*100+1,9,7866.54,-2312.20,463.32,'Keeper Remulos'), +(@REMULOS*100+1,8,7908.488,-2309.086,467.677,'Keeper Remulos'), +(@REMULOS*100+1,7,7933.290,-2314.777,473.674,'Keeper Remulos'), +(@REMULOS*100+1,6,7942.543457,-2320.170654,476.770355,'Keeper Remulos'), +(@REMULOS*100+1,5,7953.036133,-2357.953613,486.379303,'Keeper Remulos'), +(@REMULOS*100+1,4,7962.706055,-2411.155518,488.955231,'Keeper Remulos'), +(@REMULOS*100+1,3,7976.860352,-2552.697998,490.081390,'Keeper Remulos'), +(@REMULOS*100+1,2,7949.307617,-2569.120361,489.716248,'Keeper Remulos'), +(@REMULOS*100+1,1,7940.567871,-2577.845703,488.946808,'Keeper Remulos'); + +-- Arch Druid Lilliandra +DELETE FROM `smart_scripts` WHERE entryorguid = 30630 AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(30630, 0, 0, 1, 62, 0, 100, 0, 9991, 0, 0, 0, 85, 57536, 0, 0, 0, 0, 0, 19, 30630, 0, 0, 0, 0, 0, 0, 'Arch Druid Lilliandra - On gossip option select - Player Cast Forcecast Portal: Moonglade on Arch Druid Lilliandra'); + +-- Icecrown's Moonglade portal +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=32790; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(32790,57654,1,0); + +DELETE FROM `smart_scripts` WHERE entryorguid IN (32790) AND `source_type` IN (0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(32790, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 3, 0, 11686, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moonglade Portal - On Respawn - Morph Into 0'), +(32790, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 61722, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moonglade Portal - On Respawn - Cast Nature Portal State'); + +-- Moonglade's return portal +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=32788; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(32788,57539,1,0); + +DELETE FROM `smart_scripts` WHERE entryorguid IN (32788) AND `source_type` IN (0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(32788, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 3, 0, 11686, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moonglade Return Portal - On Respawn - Morph Into 0'), +(32788, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 61722, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moonglade Return Portal - On Respawn - Cast Nature Portal State'); + +-- Conditions for portals +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry` IN (57654,57539); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(18, 32790, 57654, 0, 0, 28, 0, 13073, 0, 0, 0, 0, 0, '', 'Required quest active for spellclick'), +(18, 32788, 57539, 0, 0, 28, 0, 13075, 0, 0, 0, 0, 0, '', 'Required quest active for spellclick'); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9991,10215); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(9991, 0, 0, 'It''s a pleasure to meet you as well, Arch Druid. I am on a task from Tirion and time is short, might I trouble you for a portal to Moonglade?', 1, 1, 9992, 0, 0, 0, ''), +(10215, 0, 0, 'Please send me into the Emerald Dream to recover the acorns. I know of the danger and I do not fear it.', 1, 1, 0, 0, 0, 0, ''), +(10215, 1, 0, 'I wish to return to Arch Druid Lilliandra. Can you send me back to her?', 1, 1, 0, 0, 0, 0, ''); + +-- Conditions for gossip +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (9991,10215); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 9991, 0, 0, 0, 28, 0, 13073, 0, 0, 0, 0, 0, '', 'Show gossip menu option only if player has quest 13073 complete'), +(15, 10215, 1, 0, 0, 28, 0, 13075, 0, 0, 0, 0, 0, '', 'Show gossip menu option only if player has quest 13075 complete'), +(15, 10215, 0, 0, 0, 9, 0, 13074, 0, 0, 0, 0, 0, '', 'Show gossip menu option only if player has quest 13074 taken'); diff --git a/sql/updates/world/2013_08_04_01_world_sai.sql b/sql/updates/world/2013_08_04_01_world_sai.sql new file mode 100644 index 00000000000..b327d567024 --- /dev/null +++ b/sql/updates/world/2013_08_04_01_world_sai.sql @@ -0,0 +1,21 @@ +SET @NPC := 7271; +DELETE FROM `creature_ai_scripts` WHERE creature_id=@NPC; +UPDATE `creature_template` SET `AIName`='SmartAI', `unit_flags`=32768 WHERE `entry`=@NPC; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@NPC AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC, 0, 0, 1, 10, 0, 100, 1, 0, 10, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - On OOC Los - Say Line 0'), +(@NPC, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - On Link - Remove PC immunity'), +(@NPC, 0, 3, 0, 0, 0, 100, 0, 1000, 3000, 6000, 10000, 11, 12739, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - IC - Cast Shadowbolt '), +(@NPC, 0, 4, 0, 2, 0, 100, 0, 30, 100, 30, 100, 23, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - On mana pct above 30% - Decrement Phase'), +(@NPC, 0, 5, 0, 0, 0, 100, 0, 15, 0, 15, 0, 23, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - On mana pct 15 - Decrement Phase'), +(@NPC, 0, 6, 0, 0, 0, 100, 0, 7000, 13000, 22000, 36000, 11, 15245, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - IC - Cast Shadowbolt Volley'), +(@NPC, 0, 7, 0, 0, 0, 100, 0, 8000, 15000, 26000, 39000, 11, 11086, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - IC - Cast Ward of Zum''rah '), +(@NPC, 0, 8, 0, 0, 0, 100, 0, 4000, 19000, 23000, 30000, 11, 12491, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - IC - Cast Healing Wave'), +(@NPC, 0, 9, 10, 6, 0, 100, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - On Death - Yell'), +(@NPC, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - On Death - Set Phase 0'), +(@NPC, 0, 11, 0, 7, 0, 100, 0, 0, 0, 0, 0, 2, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Zum''rah - On Evade - Set Friendly'); + +DELETE FROM `creature_text` WHERE `entry` =@NPC; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@NPC, 0, 0, 'How dare you enter my sanctum!', 12, 0, 100, 0, 0, 0, 'Witch Doctor Zum''rah'), +(@NPC, 1, 0, 'T''eif godehsi wha!', 14, 14, 100, 0, 0, 0, 'Witch Doctor Zum''rah'); diff --git a/sql/updates/world/2013_08_04_02_world_sai.sql b/sql/updates/world/2013_08_04_02_world_sai.sql new file mode 100644 index 00000000000..3cf828456c0 --- /dev/null +++ b/sql/updates/world/2013_08_04_02_world_sai.sql @@ -0,0 +1,45 @@ +-- Added missing gossip and text for Meridith the Mermaiden.Her gossip should now cast spell=25678 Siren's Song if player has Quest:Love_Song_for_Narain done, which will make players with quest Draconic for Dummies swim faster and not suffer from fatigue loss in waters. + +-- Meridith the Mermaiden NPC id (15526) +-- http://www.youtube.com/watch?v=8lz_LbsEsBQ Video of her giving spell on gossip select + +SET @MERIDITH := 15526; +SET @SPELL := 25678; -- http://www.wowhead.com/spell=25678 +SET @GOSSIP := 6658; +SET @NPCTEXT := 7916; +SET @NPCTEXT1 := 7917; +SET @QUEST := 8599; + +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP WHERE `entry`=@MERIDITH; + +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id` IN (@NPCTEXT,@NPCTEXT1); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@GOSSIP,@NPCTEXT), +(@GOSSIP,@NPCTEXT1); + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(@GOSSIP,0,0,"That would be wonderful! Thank you, Meridith.",1,1,0,0,0,0,''); + +-- SAI for Meridith the Mermaiden +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@MERIDITH; + +DELETE FROM `smart_scripts` WHERE (`entryorguid`=15526 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@MERIDITH,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0,'Meridith the Mermaiden - On gossip select - Spellcast'), +(@MERIDITH,0,1,2,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Meridith the Mermaiden - On gossip select - Close Gossip'), +(@MERIDITH,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Meridith the Mermaiden - On Gossip select - Say'); + +-- Conditions for Spellcast +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14,@GOSSIP,@NPCTEXT,0,0,8,0,@QUEST,0,0,1,0,'','Show text if player doesn''t have quest rewarded' ), +(14,@GOSSIP,@NPCTEXT1,0,0,8,0,@QUEST,0,0,0,0,'','Show text if player has quest rewarded'), +(15,@GOSSIP,0,0,0,8,0,@QUEST,0,0,0,0,'','Show gossip only if player has quest done'); + + +-- Creature text +DELETE FROM `npc_text` WHERE `ID` IN (@NPCTEXT,@NPCTEXT1); +INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`, `text1_0`, `text1_1`, `lang1`, `prob1`, `em1_0`, `em1_1`, `em1_2`, `em1_3`, `em1_4`, `em1_5`, `text2_0`, `text2_1`, `lang2`, `prob2`, `em2_0`, `em2_1`, `em2_2`, `em2_3`, `em2_4`, `em2_5`, `text3_0`, `text3_1`, `lang3`, `prob3`, `em3_0`, `em3_1`, `em3_2`, `em3_3`, `em3_4`, `em3_5`, `text4_0`, `text4_1`, `lang4`, `prob4`, `em4_0`, `em4_1`, `em4_2`, `em4_3`, `em4_4`, `em4_5`, `text5_0`, `text5_1`, `lang5`, `prob5`, `em5_0`, `em5_1`, `em5_2`, `em5_3`, `em5_4`, `em5_5`, `text6_0`, `text6_1`, `lang6`, `prob6`, `em6_0`, `em6_1`, `em6_2`, `em6_3`, `em6_4`, `em6_5`, `text7_0`, `text7_1`, `lang7`, `prob7`, `em7_0`, `em7_1`, `em7_2`, `em7_3`, `em7_4`, `em7_5`, `WDBVerified`) VALUES +(@NPCTEXT, '', 'It''s so lovely to see you again, $N! I really can''t thank you enough for delivering that message to my dear little gnome.$B$BWould you like to hear a song? It will make traveling in the rough seas much easier!', 0, 1, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, 11723), +(@NPCTEXT1, '', 'I find the ocean floor to be very peaceful.', 0, 1, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, 11723); diff --git a/sql/updates/world/2013_08_04_03_world_sai.sql b/sql/updates/world/2013_08_04_03_world_sai.sql new file mode 100644 index 00000000000..bd82b937ed7 --- /dev/null +++ b/sql/updates/world/2013_08_04_03_world_sai.sql @@ -0,0 +1,20 @@ +-- Random comment + +UPDATE `creature_template` SET AIName='SmartAI' WHERE entry IN (26417*100,26417); +DELETE FROM `smart_scripts` WHERE source_type=0 AND entryorguid = 26417; +DELETE FROM `smart_scripts` WHERE (`entryorguid`= 26417*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(26417, 0, 0, 0, 8, 0, 25, 0, 47604, 0, 10000, 10000, 80, 2641700, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - Start Script for Free At Last'), +(2641700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - Change Faction'), +(2641700, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - Stop Attack'), +(2641700, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 33, 26783, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - Quest Credit'), +(2641700, 9, 3, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - Say Lines'), +(2641700, 9, 4, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - Despawn'), +(2641700, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - Reset Faction'); + +DELETE FROM `creature_text` WHERE `entry` =26417; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(26417, 0, 0, 'I thought I was doomed. Thank you for freeing me.', 12, 0, 100, 0, 0, 0, ''), +(26417, 0, 1, 'You have my gratitude.', 12, 0, 100, 0, 0, 0, ''), +(26417, 0, 2, 'I never thought I''d be free from that terrible spell!', 12, 0, 100, 0, 0, 0, ''), +(26417, 0, 3, 'Thank you, small one.', 12, 0, 100, 0, 0, 0, ''); diff --git a/sql/updates/world/2013_08_04_04_world_trinity_string.sql b/sql/updates/world/2013_08_04_04_world_trinity_string.sql new file mode 100644 index 00000000000..cab49ba73f3 --- /dev/null +++ b/sql/updates/world/2013_08_04_04_world_trinity_string.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry`=5037; +INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES +(5037, 'MechanicImmuneMask: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/sql/updates/world/2013_08_05_00_world_sai.sql b/sql/updates/world/2013_08_05_00_world_sai.sql new file mode 100644 index 00000000000..05a675394c2 --- /dev/null +++ b/sql/updates/world/2013_08_05_00_world_sai.sql @@ -0,0 +1,3 @@ +-- Fix Redridge Mystic +DELETE FROM `smart_scripts` WHERE `entryorguid`=430 AND `id`=12; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=430 AND `id`=11; diff --git a/sql/updates/world/2013_08_05_01_world_misc.sql b/sql/updates/world/2013_08_05_01_world_misc.sql new file mode 100644 index 00000000000..a1e9aee50e7 --- /dev/null +++ b/sql/updates/world/2013_08_05_01_world_misc.sql @@ -0,0 +1,2 @@ +UPDATE `smart_scripts` SET `event_type`=2 WHERE `entryorguid`=7271 AND `source_type`=0 AND `id`=5 AND `link`=0; +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='', `InhabitType`=7, `faction_A`=35, `faction_H`=35, `unit_flags`=0, `type_flags`=8, `dynamicflags`=128, `flags_extra`=0, `speed_walk`=2 WHERE `entry`= 15491; diff --git a/sql/updates/world/2013_08_05_01_world_trinity_string.sql b/sql/updates/world/2013_08_05_01_world_trinity_string.sql new file mode 100644 index 00000000000..7e9a465d49a --- /dev/null +++ b/sql/updates/world/2013_08_05_01_world_trinity_string.sql @@ -0,0 +1,8 @@ +DELETE FROM `trinity_string` WHERE `entry`=5038; +INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES +(5038, 'Unit Flags: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +UPDATE `trinity_string` SET `content_default`= +'Unit Flags 2: %u. +Dynamic Flags: %u. +Faction Template: %u.' WHERE `entry`=542; diff --git a/sql/updates/world/2013_08_05_02_world_quest_relation_tables.sql b/sql/updates/world/2013_08_05_02_world_quest_relation_tables.sql new file mode 100644 index 00000000000..a7d2af1725a --- /dev/null +++ b/sql/updates/world/2013_08_05_02_world_quest_relation_tables.sql @@ -0,0 +1,28 @@ +ALTER TABLE `creature_questrelation` RENAME `creature_queststarter`; +ALTER TABLE `creature_involvedrelation` RENAME `creature_questender`; +ALTER TABLE `gameobject_questrelation` RENAME `gameobject_queststarter`; +ALTER TABLE `gameobject_involvedrelation` RENAME `gameobject_questender`; + +UPDATE `command` SET + `name` = 'reload gameobject_queststarter', + `help` = 'Syntax: .reload gameobject_queststarter\nReload gameobject_queststarter table.' +WHERE + `name` = 'reload gameobject_questrelation'; + +UPDATE `command` SET + `name` = 'reload gameobject_questender', + `help` = 'Syntax: .reload gameobject_questender\nReload gameobject_questender table.' +WHERE + `name` = 'reload gameobject_questrelation'; + +UPDATE `command` SET + `name` = 'reload creature_queststarter', + `help` = 'Syntax: .reload creature_queststarter\nReload creature_queststarter table.' +WHERE + `name` = 'reload creature_questrelation'; + +UPDATE `command` SET + `name` = 'reload creature_questender', + `help` = 'Syntax: .reload creature_questender\nReload creature_questender table.' +WHERE + `name` = 'reload creature_involvedrelation'; diff --git a/sql/updates/world/2013_08_06_00_world_item_template.sql b/sql/updates/world/2013_08_06_00_world_item_template.sql new file mode 100644 index 00000000000..15cc7ddfa5a --- /dev/null +++ b/sql/updates/world/2013_08_06_00_world_item_template.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `spellcharges_1`=-1 WHERE `entry`=45008; -- confirmed in 4.x itemsparse diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index ee46e17401b..9a6cc89fdd4 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ + /** * @file main.cpp * @brief Authentication Server main program @@ -22,6 +23,7 @@ * This file contains the main program for the * authentication server */ + #include <ace/Dev_Poll_Reactor.h> #include <ace/TP_Reactor.h> #include <ace/ACE.h> @@ -39,6 +41,12 @@ #include "RealmList.h" #include "RealmAcceptor.h" +#ifdef __linux__ +#include <sched.h> +#include <sys/resource.h> +#define PROCESS_HIGH_PRIORITY -15 // [-20, 19], default is 0 +#endif + #ifndef _TRINITY_REALM_CONFIG # define _TRINITY_REALM_CONFIG "authserver.conf" #endif @@ -48,15 +56,15 @@ void StopDB(); bool stopEvent = false; // Setting it to true stops the server -LoginDatabaseWorkerPool LoginDatabase; // Accessor to the auth server database +LoginDatabaseWorkerPool LoginDatabase; // Accessor to the authserver database /// Handle authserver's termination signals class AuthServerSignalHandler : public Trinity::SignalHandler { public: - virtual void HandleSignal(int SigNum) + virtual void HandleSignal(int sigNum) { - switch (SigNum) + switch (sigNum) { case SIGINT: case SIGTERM: @@ -67,7 +75,7 @@ public: }; /// Print out the usage string for this program on the console. -void usage(const char *prog) +void usage(const char* prog) { TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Usage: \n %s [<options>]\n" " -c config_file use config_file as configuration file\n\r", @@ -75,37 +83,37 @@ void usage(const char *prog) } /// Launch the auth server -extern int main(int argc, char **argv) +extern int main(int argc, char** argv) { // Command line parsing to get the configuration file name - char const* cfg_file = _TRINITY_REALM_CONFIG; - int c = 1; - while (c < argc) + char const* configFile = _TRINITY_REALM_CONFIG; + int count = 1; + while (count < argc) { - if (strcmp(argv[c], "-c") == 0) + if (strcmp(argv[count], "-c") == 0) { - if (++c >= argc) + if (++count >= argc) { printf("Runtime-Error: -c option requires an input argument\n"); usage(argv[0]); return 1; } else - cfg_file = argv[c]; + configFile = argv[count]; } - ++c; + ++count; } - if (!ConfigMgr::Load(cfg_file)) + if (!sConfigMgr->LoadInitial(configFile)) { - printf("Invalid or missing configuration file : %s\n", cfg_file); + printf("Invalid or missing configuration file : %s\n", configFile); printf("Verify that the file exists and has \'[authserver]\' written in the top of the file!\n"); return 1; } TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "%s (authserver)", _FULLVERSION); TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "<Ctrl-C> to stop.\n"); - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using configuration file %s.", cfg_file); + TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using configuration file %s.", configFile); TC_LOG_WARN(LOG_FILTER_AUTHSERVER, "%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); @@ -118,16 +126,16 @@ extern int main(int argc, char **argv) TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Max allowed open files is %d", ACE::max_handles()); // authserver PID file creation - std::string pidfile = ConfigMgr::GetStringDefault("PidFile", ""); - if (!pidfile.empty()) + std::string pidFile = sConfigMgr->GetStringDefault("PidFile", ""); + if (!pidFile.empty()) { - uint32 pid = CreatePIDFile(pidfile); - if (!pid) + if (uint32 pid = CreatePIDFile(pidFile)) + TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Daemon PID: %u\n", pid); + else { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Cannot create PID file %s.\n", pidfile.c_str()); + TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Cannot create PID file %s.\n", pidFile.c_str()); return 1; } - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Daemon PID: %u\n", pid); } // Initialize the database connection @@ -135,7 +143,7 @@ extern int main(int argc, char **argv) return 1; // Get the list of realms for the server - sRealmList->Initialize(ConfigMgr::GetIntDefault("RealmsStateUpdateDelay", 20)); + sRealmList->Initialize(sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 20)); if (sRealmList->size() == 0) { TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "No valid realms specified."); @@ -145,14 +153,14 @@ extern int main(int argc, char **argv) // Launch the listening network socket RealmAcceptor acceptor; - int32 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724); + int32 rmport = sConfigMgr->GetIntDefault("RealmServerPort", 3724); if (rmport < 0 || rmport > 0xFFFF) { TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Specified port out of allowed range (1-65535)"); return 1; } - std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0"); + std::string bind_ip = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0"); ACE_INET_Addr bind_addr(uint16(rmport), bind_ip.c_str()); @@ -162,7 +170,7 @@ extern int main(int argc, char **argv) return 1; } - // Initialise the signal handlers + // Initialize the signal handlers AuthServerSignalHandler SignalINT, SignalTERM; // Register authservers's signal handlers @@ -170,46 +178,73 @@ extern int main(int argc, char **argv) Handler.register_handler(SIGINT, &SignalINT); Handler.register_handler(SIGTERM, &SignalTERM); - ///- Handle affinity for multiple processors and process priority on Windows -#ifdef _WIN32 + ///- Handle affinity for multiple processors and process priority + uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0); + bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false); + +#ifdef _WIN32 // Windows { HANDLE hProcess = GetCurrentProcess(); - uint32 Aff = ConfigMgr::GetIntDefault("UseProcessors", 0); - if (Aff > 0) + if (affinity > 0) { ULONG_PTR appAff; ULONG_PTR sysAff; if (GetProcessAffinityMask(hProcess, &appAff, &sysAff)) { - ULONG_PTR curAff = Aff & appAff; // remove non accessible processors + ULONG_PTR currentAffinity = affinity & appAff; // remove non accessible processors - if (!curAff) - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Processors marked in UseProcessors bitmask (hex) %x not accessible for authserver. Accessible processors bitmask (hex): %x", Aff, appAff); - else if (SetProcessAffinityMask(hProcess, curAff)) - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using processors (bitmask, hex): %x", curAff); + if (!currentAffinity) + TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the authserver. Accessible processors bitmask (hex): %x", affinity, appAff); + else if (SetProcessAffinityMask(hProcess, currentAffinity)) + TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using processors (bitmask, hex): %x", currentAffinity); else - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set used processors (hex): %x", curAff); + TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set used processors (hex): %x", currentAffinity); } - } - bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false); - - if (Prio) + if (highPriority) { if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "The auth server process priority class has been set to HIGH"); + TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "authserver process priority class set to HIGH"); else - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set auth server process priority class."); + TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set authserver process priority class."); + } + } +#elif __linux__ // Linux + if (affinity > 0) + { + cpu_set_t mask; + CPU_ZERO(&mask); + + for (unsigned int i = 0; i < sizeof(affinity) * 8; ++i) + if (affinity & (1 << i)) + CPU_SET(i, &mask); + + if (sched_setaffinity(0, sizeof(mask), &mask)) + TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno)); + else + { + CPU_ZERO(&mask); + sched_getaffinity(0, sizeof(mask), &mask); + TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using processors (bitmask, hex): %x", *(uint32*)(&mask)); } } + + if (highPriority) + { + if (setpriority(PRIO_PROCESS, 0, PROCESS_HIGH_PRIORITY)) + TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set authserver process priority class, error: %s", strerror(errno)); + else + TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "authserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); + } + #endif // maximum counter for next ping - uint32 numLoops = (ConfigMgr::GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000)); + uint32 numLoops = (sConfigMgr->GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000)); uint32 loopCounter = 0; // Wait for termination signal @@ -241,21 +276,21 @@ bool StartDB() { MySQL::Library_Init(); - std::string dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", ""); + std::string dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", ""); if (dbstring.empty()) { TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Database not specified"); return false; } - int32 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1); + int32 worker_threads = sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1); if (worker_threads < 1 || worker_threads > 32) { TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); worker_threads = 1; } - int32 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1); + int32 synch_threads = sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1); if (synch_threads < 1 || synch_threads > 32) { TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 792e1bf2a86..6bfe918643c 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -682,7 +682,7 @@ bool AuthSocket::_HandleLogonProof() TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); - uint32 MaxWrongPassCount = ConfigMgr::GetIntDefault("WrongPass.MaxCount", 0); + uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0); if (MaxWrongPassCount > 0) { //Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP @@ -699,8 +699,8 @@ bool AuthSocket::_HandleLogonProof() if (failed_logins >= MaxWrongPassCount) { - uint32 WrongPassBanTime = ConfigMgr::GetIntDefault("WrongPass.BanTime", 600); - bool WrongPassBanType = ConfigMgr::GetBoolDefault("WrongPass.BanType", false); + uint32 WrongPassBanTime = sConfigMgr->GetIntDefault("WrongPass.BanTime", 600); + bool WrongPassBanType = sConfigMgr->GetBoolDefault("WrongPass.BanType", false); if (WrongPassBanType) { diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index dda19c3b849..3c811eda3b3 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -71,7 +71,9 @@ PidFile = "" # # UseProcessors -# Description: Processors mask for Windows based multi-processor systems. +# Description: Processors mask for Windows and Linux based multi-processor systems. +# Example: A computer with 2 CPUs: +# 1 - 1st CPU only, 2 - 2nd CPU only, 3 - 1st and 2nd CPU, because 1 | 2 is 3 # Default: 0 - (Selected by OS) # 1+ - (Bit mask value of selected processors) @@ -79,11 +81,12 @@ UseProcessors = 0 # # ProcessPriority -# Description: Process priority setting for Windows based systems. -# Default: 1 - (High) -# 0 - (Normal) +# Description: Process priority setting for Windows and Linux based systems. +# Details: On Linux, a nice value of -15 is used. (requires superuser). On Windows, process is set to HIGH class. +# Default: 0 - (Normal) +# 1 - (High) -ProcessPriority = 1 +ProcessPriority = 0 # # RealmsStateUpdateDelay diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 2a13e5c71bf..4d657ec2b2b 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -260,15 +260,15 @@ void PetAI::UpdateAI(uint32 diff) void PetAI::UpdateAllies() { - Unit* owner = me->GetCharmerOrOwner(); - Group* group = NULL; - - m_updateAlliesTimer = 10*IN_MILLISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance + m_updateAlliesTimer = 10 * IN_MILLISECONDS; // update friendly targets every 10 seconds, lesser checks increase performance + Unit* owner = me->GetCharmerOrOwner(); if (!owner) return; - else if (owner->GetTypeId() == TYPEID_PLAYER) - group = owner->ToPlayer()->GetGroup(); + + Group* group = NULL; + if (Player* player = owner->ToPlayer()) + group = player->GetGroup(); //only pet and owner/not in group->ok if (m_AllySet.size() == 2 && !group) @@ -285,7 +285,7 @@ void PetAI::UpdateAllies() for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* Target = itr->GetSource(); - if (!Target || !group->SameSubGroup((Player*)owner, Target)) + if (!Target || !group->SameSubGroup(owner->ToPlayer(), Target)) continue; if (Target->GetGUID() == owner->GetGUID()) diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index d8644c50b35..bc865b8b6aa 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -98,12 +98,14 @@ void TotemAI::UpdateAI(uint32 /*diff*/) void TotemAI::AttackStart(Unit* /*victim*/) { // Sentry totem sends ping on attack - if (me->GetEntry() == SENTRY_TOTEM_ENTRY && me->GetOwner()->GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(MSG_MINIMAP_PING, (8+4+4)); - data << me->GetGUID(); - data << me->GetPositionX(); - data << me->GetPositionY(); - ((Player*)me->GetOwner())->GetSession()->SendPacket(&data); - } + if (me->GetEntry() == SENTRY_TOTEM_ENTRY) + if (Unit* owner = me->GetOwner()) + if (Player* player = owner->ToPlayer()) + { + WorldPacket data(MSG_MINIMAP_PING, (8+4+4)); + data << me->GetGUID(); + data << me->GetPositionX(); + data << me->GetPositionY(); + player->GetSession()->SendPacket(&data); + } } diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 09a6725485a..a494507919a 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -165,8 +165,6 @@ void CreatureAI::EnterEvadeMode() if (me->IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons! me->GetVehicleKit()->Reset(true); - - me->SetLastDamagedTime(0); } /*void CreatureAI::AttackedBy(Unit* attacker) @@ -236,6 +234,7 @@ bool CreatureAI::_EnterEvadeMode() me->LoadCreaturesAddon(); me->SetLootRecipient(NULL); me->ResetPlayerDamageReq(); + me->SetLastDamagedTime(0); if (me->IsInEvadeMode()) return false; diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h index 4a350acab2c..919b24a916c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h @@ -92,7 +92,7 @@ struct npc_escortAI : public ScriptedAI uint64 GetEventStarterGUID() { return m_uiPlayerGUID; } protected: - Player* GetPlayerForEscort() { return (Player*)Unit::GetUnit(*me, m_uiPlayerGUID); } + Player* GetPlayerForEscort() { return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); } private: bool AssistPlayerInCombat(Unit* who); diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index ea6d87b3946..4075ffa4de9 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -439,7 +439,7 @@ void AccountMgr::LoadRBAC() TC_LOG_DEBUG(LOG_FILTER_RBAC, "AccountMgr::LoadRBAC: Loading default groups"); // Load default groups to be added to any RBAC Object. - std::string defaultGroups = ConfigMgr::GetStringDefault("RBAC.DefaultGroups", ""); + std::string defaultGroups = sConfigMgr->GetStringDefault("RBAC.DefaultGroups", ""); Tokenizer tokens(defaultGroups, ','); for (Tokenizer::const_iterator itr = tokens.begin(); itr != tokens.end(); ++itr) if (uint32 groupId = atoi(*itr)) @@ -448,7 +448,7 @@ void AccountMgr::LoadRBAC() void AccountMgr::UpdateAccountAccess(RBACData* rbac, uint32 accountId, uint8 securityLevel, int32 realmId) { - int32 serverRealmId = realmId != -1 ? realmId : ConfigMgr::GetIntDefault("RealmID", 0); + int32 serverRealmId = realmId != -1 ? realmId : sConfigMgr->GetIntDefault("RealmID", 0); bool needDelete = false; if (!rbac) { diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 35024fc4152..b97ea196a0a 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -119,6 +119,8 @@ class RBACObject RBACObject(uint32 id = 0, std::string const& name = ""):
_id(id), _name(name) { }
+ virtual ~RBACObject() { }
+
/// Gets the Name of the Object
std::string const& GetName() const { return _name; }
/// Gets the Id of the Object
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 0b7999fcf57..8bf68cb42fa 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -1630,7 +1630,7 @@ struct WintergraspWorkshopData // Found associate graveyard and update it if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST) - if (m_WG && m_WG->GetGraveyardById(m_Type)) + if (m_WG->GetGraveyardById(m_Type)) m_WG->GetGraveyardById(m_Type)->GiveControlTo(TEAM_ALLIANCE); m_TeamControl = team; @@ -1668,7 +1668,7 @@ struct WintergraspWorkshopData // Update graveyard control if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST) - if (m_WG && m_WG->GetGraveyardById(m_Type)) + if (m_WG->GetGraveyardById(m_Type)) m_WG->GetGraveyardById(m_Type)->GiveControlTo(TEAM_HORDE); m_TeamControl = team; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 4c2fc571ee3..bd8db17b025 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1425,6 +1425,29 @@ void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid) } } +void Battleground::RelocateDeadPlayers(uint64 queueIndex) +{ + // Those who are waiting to resurrect at this node are taken to the closest own node's graveyard + std::vector<uint64>& ghostList = m_ReviveQueue[queueIndex]; + if (!ghostList.empty()) + { + WorldSafeLocsEntry const* closestGrave = NULL; + for (std::vector<uint64>::const_iterator itr = ghostList.begin(); itr != ghostList.end(); ++itr) + { + Player* player = ObjectAccessor::FindPlayer(*itr); + if (!player) + continue; + + if (!closestGrave) + closestGrave = GetClosestGraveYard(player); + + if (closestGrave) + player->TeleportTo(GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation()); + } + ghostList.clear(); + } +} + bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 /*respawnTime*/) { // If the assert is called, means that BgObjects must be resized! diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index dd8fbb6710c..dcca0804977 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -29,6 +29,17 @@ class Group; class Player; class WorldPacket; class BattlegroundMap; +class BattlegroundAV; +class BattlegroundWS; +class BattlegroundAB; +class BattlegroundNA; +class BattlegroundBE; +class BattlegroundEY; +class BattlegroundRL; +class BattlegroundSA; +class BattlegroundDS; +class BattlegroundRV; +class BattlegroundIC; struct PvPDifficultyEntry; struct WorldSafeLocsEntry; @@ -375,6 +386,9 @@ class Battleground void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid); void RemovePlayerFromResurrectQueue(uint64 player_guid); + /// Relocate all players in ReviveQueue to the closest graveyard + void RelocateDeadPlayers(uint64 queueIndex); + void StartBattleground(); GameObject* GetBGObject(uint32 type); @@ -531,6 +545,39 @@ class Battleground virtual uint32 GetPrematureWinner(); + BattlegroundAV* ToBattlegroundAV() { if (GetTypeID() == BATTLEGROUND_AV) return reinterpret_cast<BattlegroundAV*>(this); else return NULL; } + BattlegroundAV const* ToBattlegroundAV() const { if (GetTypeID() == BATTLEGROUND_AV) return reinterpret_cast<const BattlegroundAV*>(this); else return NULL; } + + BattlegroundWS* ToBattlegroundWS() { if (GetTypeID() == BATTLEGROUND_WS) return reinterpret_cast<BattlegroundWS*>(this); else return NULL; } + BattlegroundWS const* ToBattlegroundWS() const { if (GetTypeID() == BATTLEGROUND_WS) return reinterpret_cast<const BattlegroundWS*>(this); else return NULL; } + + BattlegroundAB* ToBattlegroundAB() { if (GetTypeID() == BATTLEGROUND_AB) return reinterpret_cast<BattlegroundAB*>(this); else return NULL; } + BattlegroundAB const* ToBattlegroundAB() const { if (GetTypeID() == BATTLEGROUND_AB) return reinterpret_cast<const BattlegroundAB*>(this); else return NULL; } + + BattlegroundNA* ToBattlegroundNA() { if (GetTypeID() == BATTLEGROUND_NA) return reinterpret_cast<BattlegroundNA*>(this); else return NULL; } + BattlegroundNA const* ToBattlegroundNA() const { if (GetTypeID() == BATTLEGROUND_NA) return reinterpret_cast<const BattlegroundNA*>(this); else return NULL; } + + BattlegroundBE* ToBattlegroundBE() { if (GetTypeID() == BATTLEGROUND_BE) return reinterpret_cast<BattlegroundBE*>(this); else return NULL; } + BattlegroundBE const* ToBattlegroundBE() const { if (GetTypeID() == BATTLEGROUND_BE) return reinterpret_cast<const BattlegroundBE*>(this); else return NULL; } + + BattlegroundEY* ToBattlegroundEY() { if (GetTypeID() == BATTLEGROUND_EY) return reinterpret_cast<BattlegroundEY*>(this); else return NULL; } + BattlegroundEY const* ToBattlegroundEY() const { if (GetTypeID() == BATTLEGROUND_EY) return reinterpret_cast<const BattlegroundEY*>(this); else return NULL; } + + BattlegroundRL* ToBattlegroundRL() { if (GetTypeID() == BATTLEGROUND_RL) return reinterpret_cast<BattlegroundRL*>(this); else return NULL; } + BattlegroundRL const* ToBattlegroundRL() const { if (GetTypeID() == BATTLEGROUND_RL) return reinterpret_cast<const BattlegroundRL*>(this); else return NULL; } + + BattlegroundSA* ToBattlegroundSA() { if (GetTypeID() == BATTLEGROUND_SA) return reinterpret_cast<BattlegroundSA*>(this); else return NULL; } + BattlegroundSA const* ToBattlegroundSA() const { if (GetTypeID() == BATTLEGROUND_SA) return reinterpret_cast<const BattlegroundSA*>(this); else return NULL; } + + BattlegroundDS* ToBattlegroundDS() { if (GetTypeID() == BATTLEGROUND_DS) return reinterpret_cast<BattlegroundDS*>(this); else return NULL; } + BattlegroundDS const* ToBattlegroundDS() const { if (GetTypeID() == BATTLEGROUND_DS) return reinterpret_cast<const BattlegroundDS*>(this); else return NULL; } + + BattlegroundRV* ToBattlegroundRV() { if (GetTypeID() == BATTLEGROUND_RV) return reinterpret_cast<BattlegroundRV*>(this); else return NULL; } + BattlegroundRV const* ToBattlegroundRV() const { if (GetTypeID() == BATTLEGROUND_RV) return reinterpret_cast<const BattlegroundRV*>(this); else return NULL; } + + BattlegroundIC* ToBattlegroundIC() { if (GetTypeID() == BATTLEGROUND_IC) return reinterpret_cast<BattlegroundIC*>(this); else return NULL; } + BattlegroundIC const* ToBattlegroundIC() const { if (GetTypeID() == BATTLEGROUND_IC) return reinterpret_cast<const BattlegroundIC*>(this); else return NULL; } + protected: // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground void EndNow(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index f986a52e3c9..2114fc4ef66 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -359,21 +359,19 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team) if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team)) TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Failed to spawn spirit guide! point: %u, team: %u, ", node, team); + if (node >= BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points + return; + uint8 capturedNodes = 0; for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) - { - if (m_Nodes[node] == GetTeamIndexByTeamId(team) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i]) + if (m_Nodes[i] == GetTeamIndexByTeamId(team) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i]) ++capturedNodes; - } if (capturedNodes >= 5) CastSpellOnTeam(SPELL_AB_QUEST_REWARD_5_BASES, team); if (capturedNodes >= 4) CastSpellOnTeam(SPELL_AB_QUEST_REWARD_4_BASES, team); - if (node >= BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points - return; - Creature* trigger = BgCreatures[node+7] ? GetBGCreature(node+7) : NULL;//0-6 spirit guides if (!trigger) trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]); @@ -397,24 +395,7 @@ void BattlegroundAB::_NodeDeOccupied(uint8 node) if (node < BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points DelCreature(node+7);//NULL checks are in DelCreature! 0-6 spirit guides - // Those who are waiting to resurrect at this node are taken to the closest own node's graveyard - std::vector<uint64> ghost_list = m_ReviveQueue[BgCreatures[node]]; - if (!ghost_list.empty()) - { - WorldSafeLocsEntry const* ClosestGrave = NULL; - for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr) - { - Player* player = ObjectAccessor::FindPlayer(*itr); - if (!player) - continue; - - if (!ClosestGrave) // cache - ClosestGrave = GetClosestGraveYard(player); - - if (ClosestGrave) - player->TeleportTo(GetMapId(), ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, player->GetOrientation()); - } - } + RelocateDeadPlayers(BgCreatures[node]); if (BgCreatures[node]) DelCreature(node); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 5dc20ab8f07..a72b1eb4eb1 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1049,25 +1049,8 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) //spawning/despawning of aura SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_IMMEDIATELY); //neutral aura spawn SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node, RESPAWN_ONE_DAY); //teeamaura despawn - // Those who are waiting to resurrect at this object are taken to the closest own object's graveyard - std::vector<uint64> ghost_list = m_ReviveQueue[BgCreatures[node]]; - if (!ghost_list.empty()) - { - Player* waitingPlayer; // player waiting at graveyard for resurrection - WorldSafeLocsEntry const* closestGrave = NULL; - for (std::vector<uint64>::iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr) - { - waitingPlayer = ObjectAccessor::FindPlayer(*ghost_list.begin()); - if (!waitingPlayer) - continue; - - if (!closestGrave) - closestGrave = GetClosestGraveYard(waitingPlayer); - else - waitingPlayer->TeleportTo(GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation()); - } - m_ReviveQueue[BgCreatures[node]].clear(); - } + + RelocateDeadPlayers(BgCreatures[node]); } DePopulateNode(node); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 983c690523e..cf63b0505d7 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -326,11 +326,27 @@ void BattlegroundIC::RemovePlayer(Player* player, uint64 /*guid*/, uint32 /*team } } -void BattlegroundIC::HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) +void BattlegroundIC::HandleAreaTrigger(Player* player, uint32 trigger) { // this is wrong way to implement these things. On official it done by gameobject spell cast. if (GetStatus() != STATUS_IN_PROGRESS) return; + + /// @hack: this spell should be cast by npc 22515 (World Trigger) and not by the player + if (trigger == 5555 && player->GetTeamId() == TEAM_HORDE) + { + if (GateStatus[BG_IC_A_FRONT] != BG_IC_GATE_DESTROYED + && GateStatus[BG_IC_A_WEST] != BG_IC_GATE_DESTROYED + && GateStatus[BG_IC_A_EAST] != BG_IC_GATE_DESTROYED) + player->CastSpell(player, SPELL_BACK_DOOR_JOB_ACHIEVEMENT, true); + } + else if (trigger == 5535 && player->GetTeamId() == TEAM_ALLIANCE) + { + if (GateStatus[BG_IC_H_FRONT] != BG_IC_GATE_DESTROYED + && GateStatus[BG_IC_H_WEST] != BG_IC_GATE_DESTROYED + && GateStatus[BG_IC_H_EAST] != BG_IC_GATE_DESTROYED) + player->CastSpell(player, SPELL_BACK_DOOR_JOB_ACHIEVEMENT, true); + } } void BattlegroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor) @@ -481,28 +497,6 @@ void BattlegroundIC::EndBattleground(uint32 winner) Battleground::EndBattleground(winner); } -void BattlegroundIC::RealocatePlayers(ICNodePointType nodeType) -{ - // Those who are waiting to resurrect at this node are taken to the closest own node's graveyard - std::vector<uint64> ghost_list = m_ReviveQueue[BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1+nodeType-2]]; - if (!ghost_list.empty()) - { - WorldSafeLocsEntry const* ClosestGrave = NULL; - for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr) - { - Player* player = ObjectAccessor::FindPlayer(*itr); - if (!player) - continue; - - if (!ClosestGrave) // cache - ClosestGrave = GetClosestGraveYard(player); - - if (ClosestGrave) - player->TeleportTo(GetMapId(), ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, player->GetOrientation()); - } - } -} - void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target_obj) { if (GetStatus() != STATUS_IN_PROGRESS) @@ -531,7 +525,7 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target nodePoint[i].timer = BANNER_STATE_CHANGE_TIME; // 1 minute for last change (real faction banner) nodePoint[i].needChange = true; - RealocatePlayers(nodePoint[i].nodeType); + RelocateDeadPlayers(BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1 + nodePoint[i].nodeType - 2]); // if we are here means that the point has been lost, or it is the first capture diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index 7845c002155..e8249dc777a 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -661,6 +661,7 @@ enum Spells SPELL_PARACHUTE = 66656, SPELL_SLOW_FALL = 12438, SPELL_DESTROYED_VEHICLE_ACHIEVEMENT = 68357, + SPELL_BACK_DOOR_JOB_ACHIEVEMENT = 68502, SPELL_DRIVING_CREDIT_DEMOLISHER = 68365, SPELL_DRIVING_CREDIT_GLAIVE = 68363, SPELL_DRIVING_CREDIT_SIEGE = 68364, @@ -950,7 +951,6 @@ class BattlegroundIC : public Battleground return uws; } - void RealocatePlayers(ICNodePointType nodeType); void UpdateNodeWorldState(ICNodePoint* nodePoint); void HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture); void HandleContestedNodes(ICNodePoint* nodePoint); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 5218c9c9e55..0b18a04c5ca 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -80,8 +80,8 @@ ChatCommand* ChatHandler::getCommandTable() // cache top-level commands size_t added = 0; commandTableCache = (ChatCommand*)malloc(sizeof(ChatCommand) * total); + ASSERT(commandTableCache); memset(commandTableCache, 0, sizeof(ChatCommand) * total); - ACE_ASSERT(commandTableCache); for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it) added += appendCommandTable(commandTableCache + added, *it); } diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index dd3804cd9db..ada7909e9ff 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -317,6 +317,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) condMeets = unit->HasUnitState(ConditionValue1); break; } + case CONDITION_CREATURE_TYPE: + { + if (Creature* creature = object->ToCreature()) + condMeets = creature->GetCreatureTemplate()->type == ConditionValue1; + break; + } default: condMeets = false; break; @@ -478,6 +484,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_UNIT_STATE: mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; break; + case CONDITION_CREATURE_TYPE: + mask |= GRID_MAP_TYPE_MASK_CREATURE; + break; default: ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; @@ -1624,7 +1633,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) if (cond->ConditionValue2 < 1 || cond->ConditionValue2 > sWorld->GetConfigMaxSkillValue()) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Skill condition specifies invalid skill value (%u), skipped", cond->ConditionValue2); + TC_LOG_ERROR(LOG_FILTER_SQL, "Skill condition specifies skill (%u) with invalid value (%u), skipped", cond->ConditionValue1, cond->ConditionValue2); return false; } if (cond->ConditionValue3) @@ -1989,9 +1998,15 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } break; } - case CONDITION_UNUSED_24: - TC_LOG_ERROR(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring"); - return false; + case CONDITION_CREATURE_TYPE: + { + if (!cond->ConditionValue1 || cond->ConditionValue1 > CREATURE_TYPE_GAS_CLOUD) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureType condition has non existing CreatureType in value1 (%u), skipped", cond->ConditionValue1); + return false; + } + break; + } default: break; } diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index b49626747a6..8ef085d2d3c 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -57,7 +57,7 @@ enum ConditionTypes CONDITION_UNIT_STATE = 21, // unitState 0 0 true if unit has unitState CONDITION_MAPID = 22, // map_id 0 0 true if in map_id CONDITION_AREAID = 23, // area_id 0 0 true if in area_id - CONDITION_UNUSED_24 = 24, // + CONDITION_CREATURE_TYPE = 24, // cinfo.type 0 0 true if creature_template.type = value1 CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement) diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index c38082bb542..ccceec7185b 100644 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -122,7 +122,7 @@ void Corpse::SaveToDB() stmt->setUInt32(index++, uint32(m_time)); // time stmt->setUInt8 (index++, GetType()); // corpseType stmt->setUInt32(index++, GetInstanceId()); // instanceId - stmt->setUInt16(index++, GetPhaseMask()); // phaseMask + stmt->setUInt32(index++, GetPhaseMask()); // phaseMask trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); @@ -186,7 +186,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields) m_time = time_t(fields[12].GetUInt32()); uint32 instanceId = fields[14].GetUInt32(); - uint32 phaseMask = fields[15].GetUInt16(); + uint32 phaseMask = fields[15].GetUInt32(); // place SetLocationInstanceId(instanceId); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 3900f532d5c..b46ee4703db 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -999,7 +999,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) stmt->setUInt32(index++, GetEntry()); stmt->setUInt16(index++, uint16(mapid)); stmt->setUInt8(index++, spawnMask); - stmt->setUInt16(index++, uint16(GetPhaseMask())); + stmt->setUInt32(index++, GetPhaseMask()); stmt->setUInt32(index++, displayId); stmt->setInt32(index++, int32(GetCurrentEquipmentId())); stmt->setFloat(index++, GetPositionX()); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 216e9246c0f..34084dd662b 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -249,7 +249,7 @@ struct CreatureData CreatureData() : dbData(true) {} uint32 id; // entry in creature_template uint16 mapid; - uint16 phaseMask; + uint32 phaseMask; uint32 displayid; int8 equipmentId; float posX; diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index d59015fd359..e86935f49f8 100644 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -378,7 +378,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size data << uint64(npcGUID); - data << uint64(0); // wotlk, something todo with quest sharing? + data << uint64(_session->GetPlayer()->GetDivider()); data << uint32(quest->GetQuestId()); data << questTitle; data << questDetails; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index f6fd332e6a4..31e625ae3e1 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -712,7 +712,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) stmt->setUInt32(index++, GetEntry()); stmt->setUInt16(index++, uint16(mapid)); stmt->setUInt8(index++, spawnMask); - stmt->setUInt16(index++, uint16(GetPhaseMask())); + stmt->setUInt32(index++, GetPhaseMask()); stmt->setFloat(index++, GetPositionX()); stmt->setFloat(index++, GetPositionY()); stmt->setFloat(index++, GetPositionZ()); @@ -952,7 +952,7 @@ bool GameObject::ActivateToQuest(Player* target) const //look for battlegroundAV for some objects which are only activated after mine gots captured by own team if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S) if (Battleground* bg = target->GetBattleground()) - if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), target->GetTeam()))) + if (bg->GetTypeID(true) == BATTLEGROUND_AV && !bg->ToBattlegroundAV()->PlayerCanDoMineQuest(GetEntry(), target->GetTeam())) return false; return true; } diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index cf916afd6dc..3bddac81ee9 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -582,7 +582,7 @@ struct GameObjectData explicit GameObjectData() : dbData(true) {} uint32 id; // entry in gamobject_template uint16 mapid; - uint16 phaseMask; + uint32 phaseMask; float posX; float posY; float posZ; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index d87e1e8fbbc..ed4341dea8a 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1278,7 +1278,7 @@ void Item::ItemContainerSaveLootToDB() stmt_items->setBool(6, _li->is_counted); stmt_items->setBool(7, _li->is_underthreshold); stmt_items->setBool(8, _li->needs_quest); - stmt_items->setUInt32(9, _li->randomPropertyId); + stmt_items->setInt32(9, _li->randomPropertyId); stmt_items->setUInt32(10, _li->randomSuffix); trans->Append(stmt_items); } @@ -1339,7 +1339,7 @@ bool Item::ItemContainerLoadLootFromDB() loot_item.canSave = true; loot_item.is_underthreshold = fields[6].GetBool(); loot_item.needs_quest = fields[7].GetBool(); - loot_item.randomPropertyId = fields[8].GetUInt32(); + loot_item.randomPropertyId = fields[8].GetInt32(); loot_item.randomSuffix = fields[9].GetUInt32(); // Copy the extra loot conditions from the item in the loot template diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 729a5466fe3..4c8d48222e5 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -372,7 +372,7 @@ void Pet::SavePetToDB(PetSaveMode mode) if (!IS_PLAYER_GUID(GetOwnerGUID())) return; - Player* owner = (Player*)GetOwner(); + Player* owner = GetOwner(); if (!owner) return; @@ -1142,7 +1142,7 @@ void Pet::_LoadSpellCooldowns() while (result->NextRow()); if (!m_CreatureSpellCooldowns.empty() && GetOwner()) - ((Player*)GetOwner())->GetSession()->SendPacket(&data); + GetOwner()->GetSession()->SendPacket(&data); } } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 419f1e1c884..6544d9350a8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2130,7 +2130,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati ExitVehicle(); // reset movement flags at teleport, because player will continue move with these flags after teleport - SetUnitMovementFlags(0); + SetUnitMovementFlags(GetUnitMovementFlags() & MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE); DisableSpline(); if (m_transport) @@ -8773,13 +8773,19 @@ void Player::SendLoot(uint64 guid, LootType loot_type) /// @todo fix this big hack if ((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S)) + { if (Battleground* bg = GetBattleground()) + { if (bg->GetTypeID(true) == BATTLEGROUND_AV) - if (!(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(go->GetEntry(), GetTeam()))) + { + if (!bg->ToBattlegroundAV()->PlayerCanDoMineQuest(go->GetEntry(), GetTeam())) { SendLootRelease(guid); return; } + } + } + } if (lootid) { @@ -16653,11 +16659,11 @@ void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver) } } -void Player::SendPushToPartyResponse(Player* player, uint32 msg) +void Player::SendPushToPartyResponse(Player* player, uint8 msg) { if (player) { - WorldPacket data(MSG_QUEST_PUSH_RESULT, (8+1)); + WorldPacket data(MSG_QUEST_PUSH_RESULT, 8 + 1); data << uint64(player->GetGUID()); data << uint8(msg); // valid values: 0-8 GetSession()->SendPacket(&data); @@ -18787,7 +18793,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report bool Player::CheckInstanceLoginValid() { - if (!GetMap()) + if (!FindMap()) return false; if (!GetMap()->IsDungeon() || IsGameMaster()) @@ -22106,10 +22112,10 @@ bool Player::IsAlwaysDetectableFor(WorldObject const* seer) const if (const Player* seerPlayer = seer->ToPlayer()) if (IsGroupVisibleFor(seerPlayer)) - return true; + return !(seerPlayer->duel && seerPlayer->duel->startTime != 0 && seerPlayer->duel->opponent == this); - return false; - } + return false; +} bool Player::IsVisibleGloballyFor(Player const* u) const { @@ -22678,6 +22684,11 @@ void Player::ApplyEquipCooldown(Item* pItem) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) continue; + //! Don't replace longer cooldowns by equip cooldown if we have any. + SpellCooldowns::iterator itr = m_spellCooldowns.find(spellData.SpellId); + if (itr != m_spellCooldowns.end() && itr->second.itemid == pItem->GetEntry() && itr->second.end > time(NULL) + 30) + break; + AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30); WorldPacket data(SMSG_ITEM_COOLDOWN, 12); @@ -22725,8 +22736,8 @@ void Player::resetSpells(bool myClassOnly) continue; // skip spells with first rank learned as talent (and all talents then also) - uint32 first_rank = sSpellMgr->GetFirstSpellInChain(spellInfo->Id); - if (GetTalentSpellCost(first_rank) > 0) + uint32 firstRank = spellInfo->GetFirstRankSpell()->Id; + if (GetTalentSpellCost(firstRank) > 0) continue; // skip broken spells @@ -22796,15 +22807,14 @@ void Player::learnQuestRewardedSpells(Quest const* quest) uint32 learned_0 = spellInfo->Effects[0].TriggerSpell; if (sSpellMgr->GetSpellRank(learned_0) > 1 && !HasSpell(learned_0)) { - // not have first rank learned (unlearned prof?) - uint32 first_spell = sSpellMgr->GetFirstSpellInChain(learned_0); - if (!HasSpell(first_spell)) - return; - SpellInfo const* learnedInfo = sSpellMgr->GetSpellInfo(learned_0); if (!learnedInfo) return; + // not have first rank learned (unlearned prof?) + if (!HasSpell(learnedInfo->GetFirstRankSpell()->Id)) + return; + SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(learned_0); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second; ++itr2) { @@ -26262,6 +26272,31 @@ float Player::GetCollisionHeight(bool mounted) const } } +std::string Player::GetMapAreaAndZoneString() +{ + uint32 areaId = GetAreaId(); + std::string areaName = "Unknown"; + std::string zoneName = "Unknown"; + if (AreaTableEntry const* area = GetAreaEntryByAreaID(areaId)) + { + int locale = GetSession()->GetSessionDbcLocale(); + areaName = area->area_name[locale]; + if (AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone)) + zoneName = zone->area_name[locale]; + } + + std::ostringstream str; + str << "Map: " << GetMapId() << " (" << (FindMap() ? FindMap()->GetMapName() : "Unknown") << ") Area: " << areaId << " (" << areaName.c_str() << ") Zone: " << zoneName.c_str(); + return str.str(); +} + +std::string Player::GetCoordsMapAreaAndZoneString() +{ + std::ostringstream str; + str << Position::ToString() << " " << GetMapAreaAndZoneString(); + return str.str(); +} + Guild* Player::GetGuild() { uint32 guildId = GetGuildId(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index e4e38115dc1..c26d2d80336 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1431,7 +1431,7 @@ class Player : public Unit, public GridObject<Player> void SendQuestTimerFailed(uint32 quest_id); void SendCanTakeQuestResponse(uint32 msg) const; void SendQuestConfirmAccept(Quest const* quest, Player* pReceiver); - void SendPushToPartyResponse(Player* player, uint32 msg); + void SendPushToPartyResponse(Player* player, uint8 msg); void SendQuestUpdateAddItem(Quest const* quest, uint32 item_idx, uint16 count); void SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count); void SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint16 add_count); @@ -2291,6 +2291,9 @@ class Player : public Unit, public GridObject<Player> //! Return collision height sent to client float GetCollisionHeight(bool mounted) const; + std::string GetMapAreaAndZoneString(); + std::string GetCoordsMapAreaAndZoneString(); + protected: // Gamemaster whisper whitelist WhisperListContainer WhisperList; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 021b86d4b51..327c4b96c34 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -738,10 +738,14 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (victim->GetTypeId() == TYPEID_PLAYER) victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage); - victim->ModifyHealth(- (int32)damage); + victim->ModifyHealth(-(int32)damage); if (damagetype == DIRECT_DAMAGE || damagetype == SPELL_DIRECT_DAMAGE) + { victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0); + if (victim->GetTypeId() == TYPEID_UNIT && !victim->IsPet()) + victim->SetLastDamagedTime(time(NULL)); + } if (victim->GetTypeId() != TYPEID_PLAYER) victim->AddThreat(this, float(damage), damageSchoolMask, spellProto); @@ -5733,12 +5737,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } switch (dummySpell->Id) { - // Glyph of Shadowflame - case 63310: - { - triggered_spell_id = 63311; - break; - } // Nightfall case 18094: case 18095: @@ -7712,12 +7710,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case SPELLFAMILY_GENERIC: switch (auraSpellInfo->Id) { - case 23780: // Aegis of Preservation (Aegis of Preservation trinket) - trigger_spell_id = 23781; - break; - case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) - trigger_spell_id = 33898; - break; case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) // Pct value stored in dummy basepoints0 = victim->GetCreateHealth() * auraSpellInfo->Effects[1].CalcValue() / 100; @@ -7800,14 +7792,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } } break; - case SPELLFAMILY_WARRIOR: - if (auraSpellInfo->Id == 50421) // Scent of Blood - { - CastSpell(this, 50422, true); - RemoveAuraFromStack(auraSpellInfo->Id); - return false; - } - break; case SPELLFAMILY_WARLOCK: { // Drain Soul @@ -7853,11 +7837,8 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } case SPELLFAMILY_PRIEST: { - // Greater Heal Refund - if (auraSpellInfo->Id == 37594) - trigger_spell_id = 37595; // Blessed Recovery - else if (auraSpellInfo->SpellIconID == 1875) + if (auraSpellInfo->SpellIconID == 1875) { switch (auraSpellInfo->Id) { @@ -7949,13 +7930,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg { switch (auraSpellInfo->Id) { - // Healing Discount - case 37705: - { - trigger_spell_id = 37706; - target = this; - break; - } // Soul Preserver case 60510: { @@ -8062,29 +8036,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg { switch (auraSpellInfo->Id) { - // Lightning Shield (The Ten Storms set) - case 23551: - { - trigger_spell_id = 23552; - target = victim; - break; - } - // Damage from Lightning Shield (The Ten Storms set) - case 23552: - { - trigger_spell_id = 27635; - break; - } - // Mana Surge (The Earthfury set) - case 23572: - { - if (!procSpell) - return false; - basepoints0 = int32(CalculatePct(procSpell->ManaCost, 35)); - trigger_spell_id = 23571; - target = this; - break; - } case 30881: // Nature's Guardian Rank 1 case 30883: // Nature's Guardian Rank 2 case 30884: // Nature's Guardian Rank 3 @@ -9264,16 +9215,17 @@ Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() const if (IS_PLAYER_GUID(guid)) return ObjectAccessor::GetPlayer(*this, guid); - return GetTypeId() == TYPEID_PLAYER ? (Player*)this : NULL; + return const_cast<Unit*>(this)->ToPlayer(); } Player* Unit::GetAffectingPlayer() const { if (!GetCharmerOrOwnerGUID()) - return GetTypeId() == TYPEID_PLAYER ? (Player*)this : NULL; + return const_cast<Unit*>(this)->ToPlayer(); if (Unit* owner = GetCharmerOrOwner()) return owner->GetCharmerOrOwnerPlayerOrPlayerItself(); + return NULL; } @@ -12013,10 +11965,6 @@ int32 Unit::ModifyHealth(int32 dVal) if (dVal == 0) return 0; - // Part of Evade mechanics. Only track health lost, not gained. - if (dVal < 0 && GetTypeId() != TYPEID_PLAYER && !IsPet()) - SetLastDamagedTime(time(NULL)); - int32 curHealth = (int32)GetHealth(); int32 val = dVal + curHealth; @@ -14386,13 +14334,14 @@ uint64 Unit::GetCharmerOrOwnerOrOwnGUID() const Player* Unit::GetSpellModOwner() const { - if (GetTypeId() == TYPEID_PLAYER) - return (Player*)this; + if (Player* player = const_cast<Unit*>(this)->ToPlayer()) + return player; + if (ToCreature()->IsPet() || ToCreature()->IsTotem()) { - Unit* owner = GetOwner(); - if (owner && owner->GetTypeId() == TYPEID_PLAYER) - return (Player*)owner; + if (Unit* owner = GetOwner()) + if (Player* player = owner->ToPlayer()) + return player; } return NULL; } @@ -14904,7 +14853,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id) if (GetTypeId() != TYPEID_PLAYER) return NULL; - Pet* pet = new Pet((Player*)this, HUNTER_PET); + Pet* pet = new Pet(ToPlayer(), HUNTER_PET); if (!pet->CreateBaseAtCreature(creatureTarget)) { @@ -14928,7 +14877,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id) if (!creatureInfo) return NULL; - Pet* pet = new Pet((Player*)this, HUNTER_PET); + Pet* pet = new Pet(ToPlayer(), HUNTER_PET); if (!pet->CreateBaseAtCreatureInfo(creatureInfo, this) || !InitTamedPet(pet, getLevel(), spell_id)) { @@ -15404,8 +15353,8 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) { if (Battleground* bg = player->GetBattleground()) { - if (victim->GetTypeId() == TYPEID_PLAYER) - bg->HandleKillPlayer((Player*)victim, player); + if (Player* playerVictim = victim->ToPlayer()) + bg->HandleKillPlayer(playerVictim, player); else bg->HandleKillUnit(victim->ToCreature(), player); } @@ -16368,14 +16317,15 @@ void Unit::UpdateObjectVisibility(bool forced) void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) { - Player* player = NULL; - if (GetTypeId() == TYPEID_PLAYER) - player = (Player*)this; - else if (Unit* charmer = GetCharmer()) + Player* player = ToPlayer(); + if (!player) { - player = charmer->ToPlayer(); - if (player && player->m_mover != this) - player = NULL; + if (Unit* charmer = GetCharmer()) + { + player = charmer->ToPlayer(); + if (player && player->m_mover != this) + player = NULL; + } } if (!player) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5474e336498..56f4e7142a2 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -628,7 +628,8 @@ enum UnitFlags UNIT_FLAG_UNK_28 = 0x10000000, UNIT_FLAG_UNK_29 = 0x20000000, // used in Feing Death spell UNIT_FLAG_SHEATHE = 0x40000000, - UNIT_FLAG_UNK_31 = 0x80000000 + UNIT_FLAG_UNK_31 = 0x80000000, + MAX_UNIT_FLAGS = 33 }; // Value masks for UNIT_FIELD_FLAGS_2 @@ -735,8 +736,13 @@ enum MovementFlags /// @todo if needed: add more flags to this masks that are exclusive to players MOVEMENTFLAG_MASK_PLAYER_ONLY = - MOVEMENTFLAG_FLYING + MOVEMENTFLAG_FLYING, + + /// Movement flags that have change status opcodes associated for players + MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE = MOVEMENTFLAG_DISABLE_GRAVITY | MOVEMENTFLAG_ROOT | + MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_WATERWALKING | MOVEMENTFLAG_FALLING_SLOW | MOVEMENTFLAG_HOVER }; + enum MovementFlags2 { MOVEMENTFLAG2_NONE = 0x00000000, diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6a4bbcc4388..88a8664e8a4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1561,7 +1561,7 @@ void ObjectMgr::LoadCreatures() data.curmana = fields[13].GetUInt32(); data.movementType = fields[14].GetUInt8(); data.spawnMask = fields[15].GetUInt8(); - data.phaseMask = fields[16].GetUInt16(); + data.phaseMask = fields[16].GetUInt32(); int16 gameEvent = fields[17].GetInt8(); uint32 PoolId = fields[18].GetUInt32(); data.npcflag = fields[19].GetUInt32(); @@ -1913,7 +1913,7 @@ void ObjectMgr::LoadGameobjects() if (data.spawnMask & ~spawnMasks[data.mapid]) TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); - data.phaseMask = fields[15].GetUInt16(); + data.phaseMask = fields[15].GetUInt32(); int16 gameEvent = fields[16].GetInt8(); uint32 PoolId = fields[17].GetUInt32(); @@ -2000,7 +2000,7 @@ uint64 ObjectMgr::GetPlayerGUIDByName(std::string const& name) const return guid; } -bool ObjectMgr::GetPlayerNameByGUID(uint64 guid, std::string &name) const +bool ObjectMgr::GetPlayerNameByGUID(uint64 guid, std::string& name) const { // prevent DB access for online player if (Player* player = ObjectAccessor::FindPlayer(guid)) @@ -2179,7 +2179,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.Name1 = fields[4].GetString(); itemTemplate.DisplayInfoID = fields[5].GetUInt32(); itemTemplate.Quality = uint32(fields[6].GetUInt8()); - itemTemplate.Flags = uint32(fields[7].GetInt64()); + itemTemplate.Flags = fields[7].GetUInt32(); itemTemplate.Flags2 = fields[8].GetUInt32(); itemTemplate.BuyCount = uint32(fields[9].GetUInt8()); itemTemplate.BuyPrice = int32(fields[10].GetInt64()); @@ -4862,10 +4862,10 @@ void ObjectMgr::LoadSpellScriptNames() Field* fields = result->Fetch(); int32 spellId = fields[0].GetInt32(); - const char *scriptName = fields[1].GetCString(); + char const* scriptName = fields[1].GetCString(); bool allRanks = false; - if (spellId <= 0) + if (spellId < 0) { allRanks = true; spellId = -spellId; @@ -4874,25 +4874,35 @@ void ObjectMgr::LoadSpellScriptNames() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32()); + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) does not exist.", scriptName, spellId); continue; } if (allRanks) { - if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId)) + if (!spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) has no ranks of spell.", scriptName, fields[0].GetInt32()); + + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32()); + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is not first rank of spell.", scriptName, fields[0].GetInt32()); continue; } + while (spellInfo) { _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName))); - spellInfo = sSpellMgr->GetSpellInfo(spellInfo->Id)->GetNextRankSpell(); + spellInfo = spellInfo->GetNextRankSpell(); } } else + { + if (spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is ranked spell. Perhaps not all ranks are assigned to this script.", scriptName, spellId); + _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName))); + } + ++count; } while (result->NextRow()); @@ -6967,6 +6977,7 @@ void ObjectMgr::LoadPointsOfInterest() uint32 point_id = fields[0].GetUInt32(); PointOfInterest POI; + POI.entry = point_id; POI.x = fields[1].GetFloat(); POI.y = fields[2].GetFloat(); POI.icon = fields[3].GetUInt32(); @@ -7201,59 +7212,59 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string const& TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime)); } -void ObjectMgr::LoadGameobjectQuestRelations() +void ObjectMgr::LoadGameobjectQuestStarters() { - LoadQuestRelationsHelper(_goQuestRelations, "gameobject_questrelation", true, true); + LoadQuestRelationsHelper(_goQuestRelations, "gameobject_queststarter", true, true); for (QuestRelations::iterator itr = _goQuestRelations.begin(); itr != _goQuestRelations.end(); ++itr) { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_queststarter` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_queststarter` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } -void ObjectMgr::LoadGameobjectInvolvedRelations() +void ObjectMgr::LoadGameobjectQuestEnders() { - LoadQuestRelationsHelper(_goQuestInvolvedRelations, "gameobject_involvedrelation", false, true); + LoadQuestRelationsHelper(_goQuestInvolvedRelations, "gameobject_questender", false, true); for (QuestRelations::iterator itr = _goQuestInvolvedRelations.begin(); itr != _goQuestInvolvedRelations.end(); ++itr) { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questender` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questender` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } -void ObjectMgr::LoadCreatureQuestRelations() +void ObjectMgr::LoadCreatureQuestStarters() { - LoadQuestRelationsHelper(_creatureQuestRelations, "creature_questrelation", true, false); + LoadQuestRelationsHelper(_creatureQuestRelations, "creature_queststarter", true, false); for (QuestRelations::iterator itr = _creatureQuestRelations.begin(); itr != _creatureQuestRelations.end(); ++itr) { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_queststarter` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_queststarter` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } -void ObjectMgr::LoadCreatureInvolvedRelations() +void ObjectMgr::LoadCreatureQuestEnders() { - LoadQuestRelationsHelper(_creatureQuestInvolvedRelations, "creature_involvedrelation", false, false); + LoadQuestRelationsHelper(_creatureQuestInvolvedRelations, "creature_questender", false, false); for (QuestRelations::iterator itr = _creatureQuestInvolvedRelations.begin(); itr != _creatureQuestInvolvedRelations.end(); ++itr) { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questender` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questender` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } @@ -8362,15 +8373,6 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max return false; } - if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS) - { - if (player) - ChatHandler(player->GetSession()).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS); - else - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry); - return false; - } - return true; } diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 266fe8ee35c..aad699fe9c1 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -716,7 +716,21 @@ class ObjectMgr void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const; uint64 GetPlayerGUIDByName(std::string const& name) const; - bool GetPlayerNameByGUID(uint64 guid, std::string &name) const; + + /** + * Retrieves the player name by guid. + * + * If the player is online, the name is retrieved immediately otherwise + * a database query is done. + * + * @remark Use sWorld->GetCharacterNameData because it doesn't require a database query when player is offline + * + * @param guid player full guid + * @param name returned name + * + * @return true if player was found, false otherwise + */ + bool GetPlayerNameByGUID(uint64 guid, std::string& name) const; uint32 GetPlayerTeamByGUID(uint64 guid) const; uint32 GetPlayerAccountIdByGUID(uint64 guid) const; uint32 GetPlayerAccountIdByPlayerName(std::string const& name) const; @@ -837,21 +851,21 @@ class ObjectMgr } void LoadQuests(); - void LoadQuestRelations() + void LoadQuestStartersAndEnders() { TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading GO Start Quest Data..."); - LoadGameobjectQuestRelations(); + LoadGameobjectQuestStarters(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading GO End Quest Data..."); - LoadGameobjectInvolvedRelations(); + LoadGameobjectQuestEnders(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Creature Start Quest Data..."); - LoadCreatureQuestRelations(); + LoadCreatureQuestStarters(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Creature End Quest Data..."); - LoadCreatureInvolvedRelations(); + LoadCreatureQuestEnders(); } - void LoadGameobjectQuestRelations(); - void LoadGameobjectInvolvedRelations(); - void LoadCreatureQuestRelations(); - void LoadCreatureInvolvedRelations(); + void LoadGameobjectQuestStarters(); + void LoadGameobjectQuestEnders(); + void LoadCreatureQuestStarters(); + void LoadCreatureQuestEnders(); QuestRelations* GetGOQuestRelationMap() { diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index e717389e919..b8ab75f213b 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -106,10 +106,10 @@ void VisibleChangesNotifier::Visit(CreatureMapType &m) void VisibleChangesNotifier::Visit(DynamicObjectMapType &m) { for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) - if (IS_PLAYER_GUID(iter->GetSource()->GetCasterGUID())) - if (Player* caster = (Player*)iter->GetSource()->GetCaster()) - if (caster->m_seer == iter->GetSource()) - caster->UpdateVisibilityOf(&i_object); + if (Unit* caster = iter->GetSource()->GetCaster()) + if (Player* player = caster->ToPlayer()) + if (player->m_seer == iter->GetSource()) + player->UpdateVisibilityOf(&i_object); } inline void CreatureUnitRelocationWorker(Creature* c, Unit* u) @@ -299,12 +299,12 @@ void MessageDistDeliverer::Visit(DynamicObjectMapType &m) if (target->GetExactDist2dSq(i_source) > i_distSq) continue; - if (IS_PLAYER_GUID(target->GetCasterGUID())) + if (Unit* caster = target->GetCaster()) { // Send packet back to the caster if the caster has vision of dynamic object - Player* caster = (Player*)target->GetCaster(); - if (caster && caster->m_seer == target) - SendPacket(caster); + Player* player = caster->ToPlayer(); + if (player && player->m_seer == target) + SendPacket(player); } } } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index f9d179795bc..0addcfc087c 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -130,10 +130,14 @@ namespace Trinity Player const* skipped_receiver; MessageDistDeliverer(WorldObject* src, WorldPacket* msg, float dist, bool own_team_only = false, Player const* skipped = NULL) : i_source(src), i_message(msg), i_phaseMask(src->GetPhaseMask()), i_distSq(dist * dist) - , team((own_team_only && src->GetTypeId() == TYPEID_PLAYER) ? ((Player*)src)->GetTeam() : 0) + , team(0) , skipped_receiver(skipped) { + if (own_team_only) + if (Player* player = src->ToPlayer()) + team = player->GetTeam(); } + void Visit(PlayerMapType &m); void Visit(CreatureMapType &m); void Visit(DynamicObjectMapType &m); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 0369615da53..d31b4b74b2e 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2123,7 +2123,7 @@ bool Guild::Validate() _SetLeaderGUID(pLeader); // Check config if multiple guildmasters are allowed - if (!ConfigMgr::GetBoolDefault("Guild.AllowMultipleGuildMaster", 0)) + if (!sConfigMgr->GetBoolDefault("Guild.AllowMultipleGuildMaster", 0)) for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) if (itr->second->GetRankId() == GR_GUILDMASTER && !itr->second->IsSamePlayer(m_leaderGuid)) itr->second->ChangeRank(GR_OFFICER); diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 583cfa11be9..3fc4e839651 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -199,7 +199,7 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild members in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index ff4387a3a70..27ef4960f79 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -729,33 +729,28 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (mask & GROUP_UPDATE_FLAG_STATUS) { - if (player) - { - uint16 playerStatus = MEMBER_STATUS_ONLINE; - if (player->IsPvP()) - playerStatus |= MEMBER_STATUS_PVP; + uint16 playerStatus = MEMBER_STATUS_ONLINE; + if (player->IsPvP()) + playerStatus |= MEMBER_STATUS_PVP; - if (!player->IsAlive()) - { - if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) - playerStatus |= MEMBER_STATUS_GHOST; - else - playerStatus |= MEMBER_STATUS_DEAD; - } + if (!player->IsAlive()) + { + if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) + playerStatus |= MEMBER_STATUS_GHOST; + else + playerStatus |= MEMBER_STATUS_DEAD; + } - if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) - playerStatus |= MEMBER_STATUS_PVP_FFA; + if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) + playerStatus |= MEMBER_STATUS_PVP_FFA; - if (player->isAFK()) - playerStatus |= MEMBER_STATUS_AFK; + if (player->isAFK()) + playerStatus |= MEMBER_STATUS_AFK; - if (player->isDND()) - playerStatus |= MEMBER_STATUS_DND; + if (player->isDND()) + playerStatus |= MEMBER_STATUS_DND; - *data << uint16(playerStatus); - } - else - *data << uint16(MEMBER_STATUS_OFFLINE); + *data << uint16(playerStatus); } if (mask & GROUP_UPDATE_FLAG_CUR_HP) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 90c1bc4599f..5f458edbb07 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -784,8 +784,6 @@ void WorldSession::SendListInventory(uint64 vendorGuid) continue; } - ++count; - // reputation discount int32 price = item->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; @@ -797,6 +795,9 @@ void WorldSession::SendListInventory(uint64 vendorGuid) data << uint32(itemTemplate->MaxDurability); data << uint32(itemTemplate->BuyCount); data << uint32(item->ExtendedCost); + + if (++count >= MAX_VENDOR_ITEMS) + break; } } } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 9d210201730..84bdaf4104f 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -329,19 +329,19 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid if (unit_target) { pet->SetInFront(unit_target); - if (unit_target->GetTypeId() == TYPEID_PLAYER) - pet->SendUpdateToPlayer((Player*)unit_target); + if (Player* player = unit_target->ToPlayer()) + pet->SendUpdateToPlayer(player); } else if (Unit* unit_target2 = spell->m_targets.GetUnitTarget()) { pet->SetInFront(unit_target2); - if (unit_target2->GetTypeId() == TYPEID_PLAYER) - pet->SendUpdateToPlayer((Player*)unit_target2); + if (Player* player = unit_target2->ToPlayer()) + pet->SendUpdateToPlayer(player); } if (Unit* powner = pet->GetCharmerOrOwner()) - if (powner->GetTypeId() == TYPEID_PLAYER) - pet->SendUpdateToPlayer(powner->ToPlayer()); + if (Player* player = powner->ToPlayer()) + pet->SendUpdateToPlayer(player); result = SPELL_CAST_OK; } @@ -620,9 +620,9 @@ void WorldSession::HandlePetRename(WorldPacket& recvData) pet->SetName(name); - Unit* owner = pet->GetOwner(); - if (owner && (owner->GetTypeId() == TYPEID_PLAYER) && owner->ToPlayer()->GetGroup()) - owner->ToPlayer()->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME); + Player* owner = pet->GetOwner(); + if (owner && owner->GetGroup()) + owner->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME); pet->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED); diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index ee130728106..cee5b3d1164 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -120,15 +120,37 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData) Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); +#define CLOSE_GOSSIP_CLEAR_DIVIDER() \ + do { \ + _player->PlayerTalkClass->SendCloseGossip(); \ + _player->SetDivider(0); \ + } while (0) + // no or incorrect quest giver - if (!object || (object->GetTypeId() != TYPEID_PLAYER && !object->hasQuest(questId)) || - (object->GetTypeId() == TYPEID_PLAYER && object != _player && !object->ToPlayer()->CanShareQuest(questId))) + if (!object) { - _player->PlayerTalkClass->SendCloseGossip(); - _player->SetDivider(0); + CLOSE_GOSSIP_CLEAR_DIVIDER(); return; } + if (Player* playerQuestObject = object->ToPlayer()) + { + if ((_player->GetDivider() && _player->GetDivider() != guid) || + ((object != _player && !playerQuestObject->CanShareQuest(questId)))) + { + CLOSE_GOSSIP_CLEAR_DIVIDER(); + return; + } + } + else + { + if (!object->hasQuest(questId)) + { + CLOSE_GOSSIP_CLEAR_DIVIDER(); + return; + } + } + // some kind of WPE protection if (!_player->CanInteractWithQuestGiver(object)) return; @@ -138,8 +160,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData) // prevent cheating if (!GetPlayer()->CanTakeQuest(quest, true)) { - _player->PlayerTalkClass->SendCloseGossip(); - _player->SetDivider(0); + CLOSE_GOSSIP_CLEAR_DIVIDER(); return; } @@ -188,18 +209,19 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData) { case TYPEID_UNIT: sScriptMgr->OnQuestAccept(_player, (object->ToCreature()), quest); - (object->ToCreature())->AI()->sQuestAccept(_player, quest); + object->ToCreature()->AI()->sQuestAccept(_player, quest); break; case TYPEID_ITEM: case TYPEID_CONTAINER: { - sScriptMgr->OnQuestAccept(_player, ((Item*)object), quest); + Item* item = (Item*)object; + sScriptMgr->OnQuestAccept(_player, item, quest); // destroy not required for quest finish quest starting item bool destroyItem = true; for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if ((quest->RequiredItemId[i] == ((Item*)object)->GetEntry()) && (((Item*)object)->GetTemplate()->MaxCount > 0)) + if (quest->RequiredItemId[i] == item->GetEntry() && item->GetTemplate()->MaxCount > 0) { destroyItem = false; break; @@ -207,13 +229,13 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData) } if (destroyItem) - _player->DestroyItem(((Item*)object)->GetBagSlot(), ((Item*)object)->GetSlot(), true); + _player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); break; } case TYPEID_GAMEOBJECT: - sScriptMgr->OnQuestAccept(_player, ((GameObject*)object), quest); - (object->ToGameObject())->AI()->QuestAccept(_player, quest); + sScriptMgr->OnQuestAccept(_player, object->ToGameObject(), quest); + object->ToGameObject()->AI()->QuestAccept(_player, quest); break; default: break; @@ -228,6 +250,8 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData) } _player->PlayerTalkClass->SendCloseGossip(); + +#undef CLOSE_GOSSIP_CLEAR_DIVIDER } void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket& recvData) @@ -506,7 +530,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) if (_player->InBattleground()) if (Battleground* bg = _player->GetBattleground()) if (bg->GetTypeID() == BATTLEGROUND_AV) - ((BattlegroundAV*)bg)->HandleQuestComplete(questId, _player); + bg->ToBattlegroundAV()->HandleQuestComplete(questId, _player); if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE) { @@ -538,6 +562,9 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) uint32 questId; recvPacket >> questId; + if (!_player->CanShareQuest(questId)) + return; + TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) @@ -551,8 +578,6 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) if (!player || player == _player) // skip self continue; - _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_SHARING_QUEST); - if (!player->SatisfyQuestStatus(quest, false)) { _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_HAVE_QUEST); @@ -583,8 +608,22 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) continue; } - player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true); - player->SetDivider(_player->GetGUID()); + _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_SHARING_QUEST); + + if (quest->IsAutoAccept() && player->CanAddQuest(quest, true) && player->CanTakeQuest(quest, true)) + { + player->AddQuest(quest, _player); + if (player->CanCompleteQuest(questId)) + player->CompleteQuest(questId); + } + + if ((quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) || quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE)) + player->PlayerTalkClass->SendQuestGiverRequestItems(quest, _player->GetGUID(), player->CanCompleteRepeatableQuest(quest), true); + else + { + player->SetDivider(_player->GetGUID()); + player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true); + } } } } @@ -593,18 +632,19 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) { uint64 guid; + uint32 questId; uint8 msg; - recvPacket >> guid >> msg; + recvPacket >> guid >> questId >> msg; TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUEST_PUSH_RESULT"); - if (_player->GetDivider() != 0) + if (_player->GetDivider() && _player->GetDivider() == guid) { Player* player = ObjectAccessor::FindPlayer(_player->GetDivider()); if (player) { - WorldPacket data(MSG_QUEST_PUSH_RESULT, (8+1)); - data << uint64(guid); + WorldPacket data(MSG_QUEST_PUSH_RESULT, 8 + 4 + 1); + data << uint64(_player->GetGUID()); data << uint8(msg); // valid values: 0-8 player->GetSession()->SendPacket(&data); _player->SetDivider(0); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index d04a7efa2a8..33c21163a4a 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -417,7 +417,7 @@ void Loot::AddItem(LootStoreItem const& item) return; uint32 count = urand(item.mincountOrRef, item.maxcount); - uint32 stacks = count / proto->GetMaxStackSize() + (count % proto->GetMaxStackSize() ? 1 : 0); + uint32 stacks = count / proto->GetMaxStackSize() + ((count % proto->GetMaxStackSize()) ? 1 : 0); std::vector<LootItem>& lootItems = item.needs_quest ? quest_items : items; uint32 limit = item.needs_quest ? MAX_NR_QUEST_ITEMS : MAX_NR_LOOT_ITEMS; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 0da63a61b43..772d5bcfb75 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1083,7 +1083,9 @@ enum TrinityStrings LANG_COMMAND_NO_OUTDOOR_PVP_FORUND = 5034, LANG_CALL_FOR_HELP = 5035, LANG_NPCINFO_EQUIPMENT = 5036, - // Room for more Trinity strings 5037-9999 + LANG_NPCINFO_MECHANIC_IMMUNE = 5037, + LANG_NPCINFO_UNIT_FIELD_FLAGS = 5038, + // Room for more Trinity strings 5039-9999 // Level requirement notifications LANG_SAY_REQ = 6604, diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 4d5245cffb1..e561d37ed36 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1233,7 +1233,8 @@ enum Mechanics MECHANIC_DISCOVERY = 28, MECHANIC_IMMUNE_SHIELD = 29, // Divine (Blessing) Shield/Protection and Ice Block MECHANIC_SAPPED = 30, - MECHANIC_ENRAGED = 31 + MECHANIC_ENRAGED = 31, + MAX_MECHANIC = 32 }; // Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6) diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 30308c12630..73b5399fa89 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -453,18 +453,14 @@ void OutdoorPvP::HandleKill(Player* killer, Unit* killed) // creature kills must be notified, even if not inside objective / not outdoor pvp active // player kills only count if active and inside objective if ((groupGuy->IsOutdoorPvPActive() && IsInsideObjective(groupGuy)) || killed->GetTypeId() == TYPEID_UNIT) - { HandleKillImpl(groupGuy, killed); - } } } else { // creature kills must be notified, even if not inside objective / not outdoor pvp active - if (killer && ((killer->IsOutdoorPvPActive() && IsInsideObjective(killer)) || killed->GetTypeId() == TYPEID_UNIT)) - { + if ((killer->IsOutdoorPvPActive() && IsInsideObjective(killer)) || killed->GetTypeId() == TYPEID_UNIT) HandleKillImpl(killer, killed); - } } } diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index ea23d439eb2..c67a0aec4be 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -468,9 +468,9 @@ void AddSC_boss_toravon(); void AddSC_instance_archavon(); void AddSC_boss_trollgore(); //Drak'Tharon Keep void AddSC_boss_novos(); -void AddSC_boss_dred(); +void AddSC_boss_king_dred(); void AddSC_boss_tharon_ja(); -void AddSC_instance_drak_tharon(); +void AddSC_instance_drak_tharon_keep(); void AddSC_boss_cyanigosa(); //Violet Hold void AddSC_boss_erekem(); void AddSC_boss_ichoron(); @@ -1211,9 +1211,9 @@ void AddNorthrendScripts() AddSC_instance_archavon(); AddSC_boss_trollgore(); //Drak'Tharon Keep AddSC_boss_novos(); - AddSC_boss_dred(); + AddSC_boss_king_dred(); AddSC_boss_tharon_ja(); - AddSC_instance_drak_tharon(); + AddSC_instance_drak_tharon_keep(); AddSC_boss_cyanigosa(); //Violet Hold AddSC_boss_erekem(); AddSC_boss_ichoron(); diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp index fe8b6804020..aeeb0a285a4 100644 --- a/src/server/game/Server/Protocol/PacketLog.cpp +++ b/src/server/game/Server/Protocol/PacketLog.cpp @@ -35,13 +35,13 @@ PacketLog::~PacketLog() void PacketLog::Initialize() { - std::string logsDir = ConfigMgr::GetStringDefault("LogsDir", ""); + std::string logsDir = sConfigMgr->GetStringDefault("LogsDir", ""); if (!logsDir.empty()) if ((logsDir.at(logsDir.length()-1) != '/') && (logsDir.at(logsDir.length()-1) != '\\')) logsDir.push_back('/'); - std::string logname = ConfigMgr::GetStringDefault("PacketLogFile", ""); + std::string logname = sConfigMgr->GetStringDefault("PacketLogFile", ""); if (!logname.empty()) _file = fopen((logsDir + logname).c_str(), "wb"); } diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index ce89243c005..57a77773d52 100644 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -230,9 +230,9 @@ WorldSocketMgr::~WorldSocketMgr() int WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) { - m_UseNoDelay = ConfigMgr::GetBoolDefault ("Network.TcpNodelay", true); + m_UseNoDelay = sConfigMgr->GetBoolDefault ("Network.TcpNodelay", true); - int num_threads = ConfigMgr::GetIntDefault ("Network.Threads", 1); + int num_threads = sConfigMgr->GetIntDefault ("Network.Threads", 1); if (num_threads <= 0) { @@ -247,9 +247,9 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) TC_LOG_DEBUG(LOG_FILTER_GENERAL, "Max allowed socket connections %d", ACE::max_handles()); // -1 means use default - m_SockOutKBuff = ConfigMgr::GetIntDefault ("Network.OutKBuff", -1); + m_SockOutKBuff = sConfigMgr->GetIntDefault ("Network.OutKBuff", -1); - m_SockOutUBuff = ConfigMgr::GetIntDefault ("Network.OutUBuff", 65536); + m_SockOutUBuff = sConfigMgr->GetIntDefault ("Network.OutUBuff", 65536); if (m_SockOutUBuff <= 0) { diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a361d54bbc8..20b6e67c5db 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4999,20 +4999,19 @@ void AuraEffect::HandleForceReaction(AuraApplication const* aurApp, uint8 mode, Unit* target = aurApp->GetTarget(); - if (target->GetTypeId() != TYPEID_PLAYER) + Player* player = target->ToPlayer(); + if (!player) return; - Player* player = (Player*)target; - - uint32 faction_id = GetMiscValue(); - ReputationRank faction_rank = ReputationRank(m_amount); + uint32 factionId = GetMiscValue(); + ReputationRank factionRank = ReputationRank(m_amount); - player->GetReputationMgr().ApplyForceReaction(faction_id, faction_rank, apply); + player->GetReputationMgr().ApplyForceReaction(factionId, factionRank, apply); player->GetReputationMgr().SendForceReactions(); // stop fighting if at apply forced rank friendly or at remove real rank friendly - if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY)) - player->StopAttackFaction(faction_id); + if ((apply && factionRank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(factionId) >= REP_FRIENDLY)) + player->StopAttackFaction(factionId); } void AuraEffect::HandleAuraEmpathy(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -5078,11 +5077,10 @@ void AuraEffect::HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode Unit* target = aurApp->GetTarget(); - if (target->GetTypeId() != TYPEID_PLAYER) + Player* player = target->ToPlayer(); + if (!player) return; - Player* player = (Player*)target; - if (player->getClass() != CLASS_DEATH_KNIGHT) return; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 32ccaf028ad..2846137ad95 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -347,6 +347,14 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false) // m_casterLevel = cast item level/caster level, caster level should be saved to db, confirmed with sniffs } +AuraScript* Aura::GetScriptByName(std::string const& scriptName) const +{ + for (std::list<AuraScript*>::const_iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) + if ((*itr)->_GetScriptName()->compare(scriptName) == 0) + return *itr; + return NULL; +} + void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount) { // shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism @@ -1071,7 +1079,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) { // some auras remove at aura remove - if (!itr->second->IsFitToRequirements((Player*)target, zone, area)) + if (!itr->second->IsFitToRequirements(target->ToPlayer(), zone, area)) target->RemoveAurasDueToSpell(itr->second->spellId); // some auras applied at aura apply else if (itr->second->autocast) @@ -1624,36 +1632,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_PALADIN: switch (GetId()) { - case 19746: - if (!caster) - break; - - // Improved concentration aura - linked aura - if (caster->HasAura(20254) || caster->HasAura(20255) || caster->HasAura(20256)) - { - if (apply) - target->CastSpell(target, 63510, true); - else - target->RemoveAura(63510); - } - break; - case 31821: - // Aura Mastery Triggered Spell Handler - // If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity - // If remove Concentration Aura -> trigger -> remove Aura Mastery Immunity - // If remove Aura Mastery -> trigger -> remove Aura Mastery Immunity - // Do effects only on aura owner - if (GetCasterGUID() != target->GetGUID()) - break; - - if (apply) - { - if ((GetSpellInfo()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellInfo()->Id == 19746 && target->HasAura(31821))) - target->CastSpell(target, 64364, true); - } - else - target->RemoveAurasDueToSpell(64364, GetCasterGUID()); - break; case 31842: // Divine Illumination // Item - Paladin T10 Holy 2P Bonus if (target->HasAura(70755)) @@ -1665,118 +1643,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } break; } - if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA) - { - if (!caster) - break; - - // Improved devotion aura - if (caster->HasAura(20140) || caster->HasAura(20138) || caster->HasAura(20139)) - { - if (apply) - caster->CastSpell(target, 63514, true); - else - target->RemoveAura(63514); - } - // 63531 - linked aura for both Sanctified Retribution and Swift Retribution talents - // Not allow for Retribution Aura (prevent stacking) - if ((GetSpellInfo()->SpellIconID != 555) && (caster->HasAura(53648) || caster->HasAura(53484) || caster->HasAura(53379) || caster->HasAura(31869))) - { - if (apply) - caster->CastSpell(target, 63531, true); - else - target->RemoveAura(63531); - } - } - break; - case SPELLFAMILY_DEATHKNIGHT: - if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_PRESENCE) - { - AuraEffect* bloodPresenceAura=0; // healing by damage done - AuraEffect* frostPresenceAura=0; // increased health - AuraEffect* unholyPresenceAura=0; // increased movement speed, faster rune recovery - - // Improved Presences - Unit::AuraEffectList const& vDummyAuras = target->GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (Unit::AuraEffectList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr) - { - switch ((*itr)->GetId()) - { - // Improved Blood Presence - case 50365: - case 50371: - { - bloodPresenceAura = (*itr); - break; - } - // Improved Frost Presence - case 50384: - case 50385: - { - frostPresenceAura = (*itr); - break; - } - // Improved Unholy Presence - case 50391: - case 50392: - { - unholyPresenceAura = (*itr); - break; - } - } - } - - uint32 presence = GetId(); - if (apply) - { - // Blood Presence bonus - if (presence == 48266) - target->CastSpell(target, 63611, true); - else if (bloodPresenceAura) - { - int32 basePoints1 = bloodPresenceAura->GetAmount(); - target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, bloodPresenceAura); - } - // Frost Presence bonus - if (presence == 48263) - target->CastSpell(target, 61261, true); - else if (frostPresenceAura) - { - int32 basePoints0 = frostPresenceAura->GetAmount(); - target->CastCustomSpell(target, 61261, &basePoints0, NULL, NULL, true, 0, frostPresenceAura); - } - // Unholy Presence bonus - if (presence == 48265) - { - if (unholyPresenceAura) - { - // Not listed as any effect, only base points set - int32 basePoints0 = unholyPresenceAura->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - target->CastCustomSpell(target, 63622, &basePoints0, &basePoints0, &basePoints0, true, 0, unholyPresenceAura); - } - target->CastSpell(target, 49772, true); - } - else if (unholyPresenceAura) - { - int32 basePoints0 = unholyPresenceAura->GetAmount(); - target->CastCustomSpell(target, 49772, &basePoints0, NULL, NULL, true, 0, unholyPresenceAura); - } - } - else - { - // Remove passive auras - if (presence == 48266 || bloodPresenceAura) - target->RemoveAurasDueToSpell(63611); - if (presence == 48263 || frostPresenceAura) - target->RemoveAurasDueToSpell(61261); - if (presence == 48265 || unholyPresenceAura) - { - if (presence == 48265 && unholyPresenceAura) - target->RemoveAurasDueToSpell(63622); - target->RemoveAurasDueToSpell(49772); - } - } - } break; case SPELLFAMILY_WARLOCK: // Drain Soul - If the target is at or below 25% health, Drain Soul causes four times the normal damage diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 56927a09ae6..e865d415438 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -234,6 +234,8 @@ class Aura bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo); void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo); + AuraScript* GetScriptByName(std::string const& scriptName) const; + std::list<AuraScript*> m_loadedScripts; private: void _DeleteRemovedApplications(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a26c0356907..13a6cffeb12 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -820,7 +820,8 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar for (uint32 j = effIndex + 1; j < MAX_SPELL_EFFECTS; ++j) { SpellEffectInfo const* effects = GetSpellInfo()->Effects; - if (effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget() && + if (effects[j].IsEffect() && + effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget() && effects[effIndex].TargetB.GetTarget() == effects[j].TargetB.GetTarget() && effects[effIndex].ImplicitTargetConditions == effects[j].ImplicitTargetConditions && effects[effIndex].CalcRadius(m_caster) == effects[j].CalcRadius(m_caster) && @@ -2154,7 +2155,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= ihit->scaleAura = false; if (m_auraScaleMask && ihit->effectMask == m_auraScaleMask && m_caster != target) { - SpellInfo const* auraSpell = sSpellMgr->GetSpellInfo(sSpellMgr->GetFirstSpellInChain(m_spellInfo->Id)); + SpellInfo const* auraSpell = m_spellInfo->GetFirstRankSpell(); if (uint32(target->getLevel() + 10) >= auraSpell->SpellLevel) ihit->scaleAura = true; } @@ -2175,7 +2176,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= targetInfo.scaleAura = false; if (m_auraScaleMask && targetInfo.effectMask == m_auraScaleMask && m_caster != target) { - SpellInfo const* auraSpell = sSpellMgr->GetSpellInfo(sSpellMgr->GetFirstSpellInChain(m_spellInfo->Id)); + SpellInfo const* auraSpell = m_spellInfo->GetFirstRankSpell(); if (uint32(target->getLevel() + 10) >= auraSpell->SpellLevel) targetInfo.scaleAura = true; } @@ -3119,6 +3120,7 @@ void Spell::cancel() CancelGlobalCooldown(); if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->RestoreSpellMods(this); + // no break case SPELL_STATE_DELAYED: SendInterrupted(0); SendCastResult(SPELL_FAILED_INTERRUPTED); @@ -3542,11 +3544,10 @@ void Spell::_handle_finish_phase() void Spell::SendSpellCooldown() { - if (m_caster->GetTypeId() != TYPEID_PLAYER) + Player* _player = m_caster->ToPlayer(); + if (!_player) return; - Player* _player = (Player*)m_caster; - // mana/health/etc potions, disabled by client (until combat out as declarate) if (m_CastItem && m_CastItem->IsPotion()) { @@ -4343,7 +4344,11 @@ void Spell::SendResurrectRequest(Player* target) void Spell::TakeCastItem() { - if (!m_CastItem || m_caster->GetTypeId() != TYPEID_PLAYER) + if (!m_CastItem) + return; + + Player* player = m_caster->ToPlayer(); + if (!player) return; // not remove cast item at triggered spell (equipping, weapon damage, etc) @@ -4381,7 +4386,7 @@ void Spell::TakeCastItem() (charges > 0) ? --charges : ++charges; // abs(charges) less at 1 after use if (proto->Stackable == 1) m_CastItem->SetSpellCharges(i, charges); - m_CastItem->SetState(ITEM_CHANGED, (Player*)m_caster); + m_CastItem->SetState(ITEM_CHANGED, player); } // all charges used @@ -4501,16 +4506,14 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) if (m_spellInfo->PowerType != POWER_RUNE || !runeCostID) return SPELL_CAST_OK; - if (m_caster->GetTypeId() != TYPEID_PLAYER) + Player* player = m_caster->ToPlayer(); + if (!player) return SPELL_CAST_OK; - Player* player = (Player*)m_caster; - if (player->getClass() != CLASS_DEATH_KNIGHT) return SPELL_CAST_OK; SpellRuneCostEntry const* src = sSpellRuneCostStore.LookupEntry(runeCostID); - if (!src) return SPELL_CAST_OK; @@ -5851,11 +5854,10 @@ SpellCastResult Spell::CheckPower() SpellCastResult Spell::CheckItems() { - if (m_caster->GetTypeId() != TYPEID_PLAYER) + Player* player = m_caster->ToPlayer(); + if (!player) return SPELL_CAST_OK; - Player* p_caster = (Player*)m_caster; - if (!m_CastItem) { if (m_castItemGUID) @@ -5864,14 +5866,14 @@ SpellCastResult Spell::CheckItems() else { uint32 itemid = m_CastItem->GetEntry(); - if (!p_caster->HasItemCount(itemid)) + if (!player->HasItemCount(itemid)) return SPELL_FAILED_ITEM_NOT_READY; ItemTemplate const* proto = m_CastItem->GetTemplate(); if (!proto) return SPELL_FAILED_ITEM_NOT_READY; - for (int i = 0; i < MAX_ITEM_SPELLS; ++i) + for (uint8 i = 0; i < MAX_ITEM_SPELLS; ++i) if (proto->Spells[i].SpellCharges) if (m_CastItem->GetSpellCharges(i) == 0) return SPELL_FAILED_NO_CHARGES_REMAIN; @@ -5881,10 +5883,10 @@ SpellCastResult Spell::CheckItems() { // such items should only fail if there is no suitable effect at all - see Rejuvenation Potions for example SpellCastResult failReason = SPELL_CAST_OK; - for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - // skip check, pet not required like checks, and for TARGET_UNIT_PET m_targets.GetUnitTarget() is not the real target but the caster - if (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_UNIT_PET) + // skip check, pet not required like checks, and for TARGET_UNIT_PET m_targets.GetUnitTarget() is not the real target but the caster + if (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_UNIT_PET) continue; if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_HEAL) @@ -5931,9 +5933,6 @@ SpellCastResult Spell::CheckItems() // check target item if (m_targets.GetItemTargetGUID()) { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return SPELL_FAILED_BAD_TARGETS; - if (!m_targets.GetItemTarget()) return SPELL_FAILED_ITEM_GONE; @@ -5944,7 +5943,7 @@ SpellCastResult Spell::CheckItems() else { if (!(_triggeredCastFlags & TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT)) - if (m_caster->GetTypeId() == TYPEID_PLAYER && !m_caster->ToPlayer()->HasItemFitToSpellRequirements(m_spellInfo)) + if (!player->HasItemFitToSpellRequirements(m_spellInfo)) return SPELL_FAILED_EQUIPPED_ITEM_CLASS; } @@ -5971,7 +5970,7 @@ SpellCastResult Spell::CheckItems() // do not take reagents for these item casts if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)) { - bool checkReagents = !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST) && !p_caster->CanNoReagentCast(m_spellInfo); + bool checkReagents = !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST) && !player->CanNoReagentCast(m_spellInfo); // Not own traded item (in trader trade slot) requires reagents even if triggered spell if (!checkReagents) if (Item* targetItem = m_targets.GetItemTarget()) @@ -5995,7 +5994,7 @@ SpellCastResult Spell::CheckItems() ItemTemplate const* proto = m_CastItem->GetTemplate(); if (!proto) return SPELL_FAILED_ITEM_NOT_READY; - for (int s=0; s < MAX_ITEM_PROTO_SPELLS; ++s) + for (uint8 s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s) { // CastItem will be used up and does not count as reagent int32 charges = m_CastItem->GetSpellCharges(s); @@ -6006,35 +6005,36 @@ SpellCastResult Spell::CheckItems() } } } - if (!p_caster->HasItemCount(itemid, itemcount)) + if (!player->HasItemCount(itemid, itemcount)) return SPELL_FAILED_REAGENTS; } } // check totem-item requirements (items presence in inventory) uint32 totems = 2; - for (int i = 0; i < 2; ++i) + for (uint8 i = 0; i < 2; ++i) { if (m_spellInfo->Totem[i] != 0) { - if (p_caster->HasItemCount(m_spellInfo->Totem[i])) + if (player->HasItemCount(m_spellInfo->Totem[i])) { totems -= 1; continue; } - }else - totems -= 1; + } + else + totems -= 1; } if (totems != 0) return SPELL_FAILED_TOTEMS; //0x7C // Check items for TotemCategory (items presence in inventory) uint32 TotemCategory = 2; - for (int i= 0; i < 2; ++i) + for (uint8 i = 0; i < 2; ++i) { if (m_spellInfo->TotemCategory[i] != 0) { - if (p_caster->HasItemTotemCategory(m_spellInfo->TotemCategory[i])) + if (player->HasItemTotemCategory(m_spellInfo->TotemCategory[i])) { TotemCategory -= 1; continue; @@ -6048,7 +6048,7 @@ SpellCastResult Spell::CheckItems() } // special checks for spell effects - for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { switch (m_spellInfo->Effects[i].Effect) { @@ -6058,24 +6058,24 @@ SpellCastResult Spell::CheckItems() if (!IsTriggered() && m_spellInfo->Effects[i].ItemType) { ItemPosCountVec dest; - InventoryResult msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1); + InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1); if (msg != EQUIP_ERR_OK) { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(m_spellInfo->Effects[i].ItemType); /// @todo Needs review if (pProto && !(pProto->ItemLimitCategory)) { - p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType); + player->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType); return SPELL_FAILED_DONT_REPORT; } else { if (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellInfo->SpellFamilyFlags[0] & 0x40000000))) return SPELL_FAILED_TOO_MANY_OF_ITEM; - else if (!(p_caster->HasItemCount(m_spellInfo->Effects[i].ItemType))) + else if (!(player->HasItemCount(m_spellInfo->Effects[i].ItemType))) return SPELL_FAILED_TOO_MANY_OF_ITEM; else - p_caster->CastSpell(m_caster, m_spellInfo->Effects[EFFECT_1].CalcValue(), false); // move this to anywhere + player->CastSpell(m_caster, m_spellInfo->Effects[EFFECT_1].CalcValue(), false); // move this to anywhere return SPELL_FAILED_DONT_REPORT; } } @@ -6093,10 +6093,10 @@ SpellCastResult Spell::CheckItems() if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST) return SPELL_FAILED_TOTEM_CATEGORY; ItemPosCountVec dest; - InventoryResult msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1); + InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1); if (msg != EQUIP_ERR_OK) { - p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType); + player->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType); return SPELL_FAILED_DONT_REPORT; } } @@ -6177,7 +6177,7 @@ SpellCastResult Spell::CheckItems() uint32 item_disenchantskilllevel = itemProto->RequiredDisenchantSkill; if (item_disenchantskilllevel == uint32(-1)) return SPELL_FAILED_CANT_BE_DISENCHANTED; - if (item_disenchantskilllevel > p_caster->GetSkillValue(SKILL_ENCHANTING)) + if (item_disenchantskilllevel > player->GetSkillValue(SKILL_ENCHANTING)) return SPELL_FAILED_LOW_CASTLEVEL; if (item_quality > 4 || item_quality < 2) return SPELL_FAILED_CANT_BE_DISENCHANTED; @@ -6199,7 +6199,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_CANT_BE_PROSPECTED; //Check for enough skill in jewelcrafting uint32 item_prospectingskilllevel = m_targets.GetItemTarget()->GetTemplate()->RequiredSkillRank; - if (item_prospectingskilllevel >p_caster->GetSkillValue(SKILL_JEWELCRAFTING)) + if (item_prospectingskilllevel >player->GetSkillValue(SKILL_JEWELCRAFTING)) return SPELL_FAILED_LOW_CASTLEVEL; //make sure the player has the required ores in inventory if (m_targets.GetItemTarget()->GetCount() < 5) @@ -6222,7 +6222,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_CANT_BE_MILLED; //Check for enough skill in inscription uint32 item_millingskilllevel = m_targets.GetItemTarget()->GetTemplate()->RequiredSkillRank; - if (item_millingskilllevel >p_caster->GetSkillValue(SKILL_INSCRIPTION)) + if (item_millingskilllevel > player->GetSkillValue(SKILL_INSCRIPTION)) return SPELL_FAILED_LOW_CASTLEVEL; //make sure the player has the required herbs in inventory if (m_targets.GetItemTarget()->GetCount() < 5) @@ -6236,13 +6236,10 @@ SpellCastResult Spell::CheckItems() case SPELL_EFFECT_WEAPON_DAMAGE: case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL: { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return SPELL_FAILED_TARGET_NOT_PLAYER; - if (m_attackType != RANGED_ATTACK) break; - Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); + Item* pItem = player->GetWeaponForAttack(m_attackType); if (!pItem || pItem->IsBroken()) return SPELL_FAILED_EQUIPPED_ITEM; @@ -6251,15 +6248,15 @@ SpellCastResult Spell::CheckItems() case ITEM_SUBCLASS_WEAPON_THROWN: { uint32 ammo = pItem->GetEntry(); - if (!m_caster->ToPlayer()->HasItemCount(ammo)) + if (!player->HasItemCount(ammo)) return SPELL_FAILED_NO_AMMO; - }; - break; + break; + } case ITEM_SUBCLASS_WEAPON_GUN: case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: { - uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); + uint32 ammo = player->GetUInt32Value(PLAYER_AMMO_ID); if (!ammo) { // Requires No Ammo @@ -6292,12 +6289,13 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; } - if (!m_caster->ToPlayer()->HasItemCount(ammo)) + if (!player->HasItemCount(ammo)) { - m_caster->ToPlayer()->SetUInt32Value(PLAYER_AMMO_ID, 0); + player->SetUInt32Value(PLAYER_AMMO_ID, 0); return SPELL_FAILED_NO_AMMO; } - }; break; + break; + } case ITEM_SUBCLASS_WEAPON_WAND: break; default: @@ -6313,7 +6311,7 @@ SpellCastResult Spell::CheckItems() if (!pProto) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; - if (Item* pitem = p_caster->GetItemByEntry(item_id)) + if (Item* pitem = player->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) if (pProto->Spells[x].SpellCharges != 0 && pitem->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 22940c3f930..e054c91ccc9 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -562,9 +562,9 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // Eviscerate else if (m_spellInfo->SpellFamilyFlags[0] & 0x00020000) { - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (Player* player = m_caster->ToPlayer()) { - if (uint32 combo = ((Player*)m_caster)->GetComboPoints()) + if (uint32 combo = player->GetComboPoints()) { float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f)); @@ -2722,30 +2722,30 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; if (!itemTarget) return; - Player* p_caster = (Player*)m_caster; + Player* player = m_caster->ToPlayer(); + if (!player) + return; // Handle vellums if (itemTarget->IsWeaponVellum() || itemTarget->IsArmorVellum()) { // destroy one vellum from stack uint32 count = 1; - p_caster->DestroyItemCount(itemTarget, count, true); - unitTarget=p_caster; + player->DestroyItemCount(itemTarget, count, true); + unitTarget = player; // and add a scroll DoCreateItem(effIndex, m_spellInfo->Effects[effIndex].ItemType); - itemTarget=NULL; + itemTarget = NULL; m_targets.SetItemTarget(NULL); } else { // do not increase skill if vellum used if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)) - p_caster->UpdateCraftSkill(m_spellInfo->Id); + player->UpdateCraftSkill(m_spellInfo->Id); uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue; if (!enchant_id) @@ -2760,10 +2760,10 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) + if (item_owner != player && player->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { - sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", - p_caster->GetName().c_str(), p_caster->GetSession()->GetAccountId(), + sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", + player->GetName().c_str(), player->GetSession()->GetAccountId(), itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(), item_owner->GetName().c_str(), item_owner->GetSession()->GetAccountId()); } @@ -2786,19 +2786,19 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; if (!itemTarget) return; - Player* p_caster = (Player*)m_caster; + Player* player = m_caster->ToPlayer(); + if (!player) + return; - uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue; - if (!enchant_id) + uint32 enchantId = m_spellInfo->Effects[effIndex].MiscValue; + if (!enchantId) return; - SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if (!pEnchant) + SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId); + if (!enchant) return; // support only enchantings with add socket in this slot @@ -2806,7 +2806,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) bool add_socket = false; for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i) { - if (pEnchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) + if (enchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) { add_socket = true; break; @@ -2825,10 +2825,10 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) + if (item_owner != player && player->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { - sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", - p_caster->GetName().c_str(), p_caster->GetSession()->GetAccountId(), + sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", + player->GetName().c_str(), player->GetSession()->GetAccountId(), itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(), item_owner->GetName().c_str(), item_owner->GetSession()->GetAccountId()); } @@ -2836,7 +2836,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) // remove old enchanting before applying new if equipped item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, false); - itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID()); + itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchantId, 0, 0, m_caster->GetGUID()); // add new enchanting if equipped item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, true); @@ -2850,11 +2850,10 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER) + Player* player = m_caster->ToPlayer(); + if (!player) return; - Player* p_caster = (Player*)m_caster; - // Rockbiter Weapon apply to both weapon if (!itemTarget) return; @@ -2894,7 +2893,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) for (int j = BASE_ATTACK; j <= OFF_ATTACK; ++j) { - if (Item* item = p_caster->GetWeaponForAttack(WeaponAttackType(j))) + if (Item* item = player->GetWeaponForAttack(WeaponAttackType(j))) { if (item->IsFitToSpellRequirements(m_spellInfo)) { @@ -2959,10 +2958,10 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) + if (item_owner != player && player->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { - sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", - p_caster->GetName().c_str(), p_caster->GetSession()->GetAccountId(), + sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", + player->GetName().c_str(), player->GetSession()->GetAccountId(), itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(), item_owner->GetName().c_str(), item_owner->GetSession()->GetAccountId()); } @@ -4215,6 +4214,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) m_caster->CastSpell(unitTarget, spellId2, true); return; } + break; } case SPELLFAMILY_DEATHKNIGHT: { @@ -4387,21 +4387,20 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - if (!m_caster || m_caster->GetTypeId() != TYPEID_PLAYER) - return; - if (!sWorld->getBoolConfig(CONFIG_CAST_UNSTUCK)) return; - Player* target = (Player*)m_caster; + Player* player = m_caster->ToPlayer(); + if (!player) + return; TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck"); - TC_LOG_INFO(LOG_FILTER_SPELLS_AURAS, "Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName().c_str(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + TC_LOG_INFO(LOG_FILTER_SPELLS_AURAS, "Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", player->GetName().c_str(), player->GetGUIDLow(), player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); - if (target->IsInFlight()) + if (player->IsInFlight()) return; - target->TeleportTo(target->GetStartPosition(), TELE_TO_SPELL); + player->TeleportTo(player->GetStartPosition(), TELE_TO_SPELL); // homebind location is loaded always // target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation(), (m_caster == m_caster ? TELE_TO_SPELL : 0)); @@ -4409,7 +4408,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(8690); if (!spellInfo) return; - Spell spell(target, spellInfo, TRIGGERED_FULL_MASK); + Spell spell(player, spellInfo, TRIGGERED_FULL_MASK); spell.SendSpellCooldown(); } @@ -4459,10 +4458,12 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER || m_glyphIndex >= MAX_GLYPH_SLOT_INDEX) + if (m_glyphIndex >= MAX_GLYPH_SLOT_INDEX) return; - Player* player = (Player*)m_caster; + Player* player = m_caster->ToPlayer(); + if (!player) + return; // glyph sockets level requirement uint8 minLevel = 0; @@ -4650,25 +4651,11 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) return; uint32 go_id = m_spellInfo->Effects[effIndex].MiscValue; + uint8 slot = m_spellInfo->Effects[effIndex].Effect - SPELL_EFFECT_SUMMON_OBJECT_SLOT1; - uint8 slot = 0; - switch (m_spellInfo->Effects[effIndex].Effect) + if (uint64 guid = m_caster->m_ObjectSlot[slot]) { - case SPELL_EFFECT_SUMMON_OBJECT_SLOT1: slot = 0; break; - case SPELL_EFFECT_SUMMON_OBJECT_SLOT2: slot = 1; break; - case SPELL_EFFECT_SUMMON_OBJECT_SLOT3: slot = 2; break; - case SPELL_EFFECT_SUMMON_OBJECT_SLOT4: slot = 3; break; - default: return; - } - - uint64 guid = m_caster->m_ObjectSlot[slot]; - if (guid != 0) - { - GameObject* obj = NULL; - if (m_caster) - obj = m_caster->GetMap()->GetGameObject(guid); - - if (obj) + if (GameObject* obj = m_caster->GetMap()->GetGameObject(guid)) { // Recast case - null spell id to make auras not be removed on object remove from world if (m_spellInfo->Id == obj->GetSpellId()) @@ -4678,7 +4665,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) m_caster->m_ObjectSlot[slot] = 0; } - GameObject* pGameObj = new GameObject; + GameObject* go = new GameObject(); float x, y, z; // If dest location if present @@ -4689,24 +4676,24 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); Map* map = m_caster->GetMap(); - if (!pGameObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) { - delete pGameObj; + delete go; return; } //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); int32 duration = m_spellInfo->GetDuration(); - pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); - pGameObj->SetSpellId(m_spellInfo->Id); - m_caster->AddGameObject(pGameObj); + go->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); + go->SetSpellId(m_spellInfo->Id); + m_caster->AddGameObject(go); - ExecuteLogEffectSummonObject(effIndex, pGameObj); + ExecuteLogEffectSummonObject(effIndex, go); - map->AddToMap(pGameObj); + map->AddToMap(go); - m_caster->m_ObjectSlot[slot] = pGameObj->GetGUID(); + m_caster->m_ObjectSlot[slot] = go->GetGUID(); } void Spell::EffectResurrect(SpellEffIndex effIndex) @@ -5388,10 +5375,10 @@ void Spell::EffectProspecting(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER) + Player* player = m_caster->ToPlayer(); + if (!player) return; - Player* p_caster = (Player*)m_caster; if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE)) return; @@ -5400,12 +5387,12 @@ void Spell::EffectProspecting(SpellEffIndex /*effIndex*/) if (sWorld->getBoolConfig(CONFIG_SKILL_PROSPECTING)) { - uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_JEWELCRAFTING); + uint32 SkillValue = player->GetPureSkillValue(SKILL_JEWELCRAFTING); uint32 reqSkillValue = itemTarget->GetTemplate()->RequiredSkillRank; - p_caster->UpdateGatherSkill(SKILL_JEWELCRAFTING, SkillValue, reqSkillValue); + player->UpdateGatherSkill(SKILL_JEWELCRAFTING, SkillValue, reqSkillValue); } - m_caster->ToPlayer()->SendLoot(itemTarget->GetGUID(), LOOT_PROSPECTING); + player->SendLoot(itemTarget->GetGUID(), LOOT_PROSPECTING); } void Spell::EffectMilling(SpellEffIndex /*effIndex*/) @@ -5413,10 +5400,10 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER) + Player* player = m_caster->ToPlayer(); + if (!player) return; - Player* p_caster = (Player*)m_caster; if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_MILLABLE)) return; @@ -5425,12 +5412,12 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/) if (sWorld->getBoolConfig(CONFIG_SKILL_MILLING)) { - uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_INSCRIPTION); + uint32 SkillValue = player->GetPureSkillValue(SKILL_INSCRIPTION); uint32 reqSkillValue = itemTarget->GetTemplate()->RequiredSkillRank; - p_caster->UpdateGatherSkill(SKILL_INSCRIPTION, SkillValue, reqSkillValue); + player->UpdateGatherSkill(SKILL_INSCRIPTION, SkillValue, reqSkillValue); } - m_caster->ToPlayer()->SendLoot(itemTarget->GetGUID(), LOOT_MILLING); + player->SendLoot(itemTarget->GetGUID(), LOOT_MILLING); } void Spell::EffectSkill(SpellEffIndex /*effIndex*/) @@ -5470,10 +5457,13 @@ void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) return; TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "Effect: SkinPlayerCorpse"); - if ((m_caster->GetTypeId() != TYPEID_PLAYER) || (unitTarget->GetTypeId() != TYPEID_PLAYER) || (unitTarget->IsAlive())) + + Player* player = m_caster->ToPlayer(); + Player* target = unitTarget->ToPlayer(); + if (!player || !target || target->IsAlive()) return; - unitTarget->ToPlayer()->RemovedInsignia((Player*)m_caster); + target->RemovedInsignia(player); } void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index c813f9bbd27..a58c2ee19e4 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -816,23 +816,30 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) StackAmount = spellEntry->StackAmount; for (uint8 i = 0; i < 2; ++i) Totem[i] = spellEntry->Totem[i]; + for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) Reagent[i] = spellEntry->Reagent[i]; + for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) ReagentCount[i] = spellEntry->ReagentCount[i]; + EquippedItemClass = spellEntry->EquippedItemClass; EquippedItemSubClassMask = spellEntry->EquippedItemSubClassMask; EquippedItemInventoryTypeMask = spellEntry->EquippedItemInventoryTypeMask; for (uint8 i = 0; i < 2; ++i) TotemCategory[i] = spellEntry->TotemCategory[i]; + for (uint8 i = 0; i < 2; ++i) SpellVisual[i] = spellEntry->SpellVisual[i]; + SpellIconID = spellEntry->SpellIconID; ActiveIconID = spellEntry->activeIconID; for (uint8 i = 0; i < 16; ++i) SpellName[i] = spellEntry->SpellName[i]; + for (uint8 i = 0; i < 16; ++i) Rank[i] = spellEntry->Rank[i]; + MaxTargetLevel = spellEntry->MaxTargetLevel; MaxAffectedTargets = spellEntry->MaxAffectedTargets; SpellFamilyName = spellEntry->SpellFamilyName; @@ -843,7 +850,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) SchoolMask = spellEntry->SchoolMask; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) Effects[i] = SpellEffectInfo(spellEntry, this, i); - ExplicitTargetMask = _GetExplicitTargetMask(); + ChainEntry = NULL; } @@ -2270,15 +2277,14 @@ bool SpellInfo::IsDifferentRankOf(SpellInfo const* spellInfo) const bool SpellInfo::IsHighRankOf(SpellInfo const* spellInfo) const { if (ChainEntry && spellInfo->ChainEntry) - { if (ChainEntry->first == spellInfo->ChainEntry->first) if (ChainEntry->rank > spellInfo->ChainEntry->rank) return true; - } + return false; } -uint32 SpellInfo::_GetExplicitTargetMask() const +void SpellInfo::_InitializeExplicitTargetMask() { bool srcSet = false; bool dstSet = false; @@ -2288,6 +2294,7 @@ uint32 SpellInfo::_GetExplicitTargetMask() const { if (!Effects[i].IsEffect()) continue; + targetMask |= Effects[i].TargetA.GetExplicitTargetMask(srcSet, dstSet); targetMask |= Effects[i].TargetB.GetExplicitTargetMask(srcSet, dstSet); @@ -2301,9 +2308,11 @@ uint32 SpellInfo::_GetExplicitTargetMask() const // don't add explicit object/dest flags when spell has no max range if (GetMaxRange(true) == 0.0f && GetMaxRange(false) == 0.0f) effectTargetMask &= ~(TARGET_FLAG_UNIT_MASK | TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_CORPSE_MASK | TARGET_FLAG_DEST_LOCATION); + targetMask |= effectTargetMask; } - return targetMask; + + ExplicitTargetMask = targetMask; } bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 6d0778087ce..6ed742a3b8e 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -198,7 +198,7 @@ class SpellImplicitTargetInfo private: Targets _target; public: - SpellImplicitTargetInfo() {} + SpellImplicitTargetInfo() : _target(Targets(0)) { } SpellImplicitTargetInfo(uint32 target); bool IsArea() const; @@ -461,7 +461,7 @@ public: bool IsHighRankOf(SpellInfo const* spellInfo) const; // loading helpers - uint32 _GetExplicitTargetMask() const; + void _InitializeExplicitTargetMask(); bool _IsPositiveEffect(uint8 effIndex, bool deep) const; bool _IsPositiveSpell() const; static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9cedfdf922f..db0102f4307 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1136,7 +1136,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 uint8 nodeType = spellId == 68719 ? NODE_TYPE_REFINERY : NODE_TYPE_QUARRY; uint8 nodeState = player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H; - BattlegroundIC* pIC = static_cast<BattlegroundIC*>(player->GetBattleground()); + BattlegroundIC* pIC = player->GetBattleground()->ToBattlegroundIC(); if (pIC->GetNodeState(nodeType) == nodeState) return true; @@ -1187,23 +1187,88 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 return true; } -void SpellMgr::LoadSpellRanks() +void SpellMgr::UnloadSpellInfoChains() { - uint32 oldMSTime = getMSTime(); + for (SpellChainMap::iterator itr = mSpellChains.begin(); itr != mSpellChains.end(); ++itr) + mSpellInfoMap[itr->first]->ChainEntry = NULL; + + mSpellChains.clear(); +} +void SpellMgr::LoadSpellTalentRanks() +{ // cleanup core data before reload - remove reference to ChainNode from SpellInfo - for (SpellChainMap::iterator itr = mSpellChains.begin(); itr != mSpellChains.end(); ++itr) + UnloadSpellInfoChains(); + + for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i) { - mSpellInfoMap[itr->first]->ChainEntry = NULL; + TalentEntry const* talentInfo = sTalentStore.LookupEntry(i); + if (!talentInfo) + continue; + + SpellInfo const* lastSpell = NULL; + for (uint8 rank = MAX_TALENT_RANK - 1; rank > 0; --rank) + { + if (talentInfo->RankID[rank]) + { + lastSpell = GetSpellInfo(talentInfo->RankID[rank]); + break; + } + } + + if (!lastSpell) + continue; + + SpellInfo const* firstSpell = GetSpellInfo(talentInfo->RankID[0]); + if (!firstSpell) + { + TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "SpellMgr::LoadSpellTalentRanks: First Rank Spell %u for TalentEntry %u does not exist.", talentInfo->RankID[0], i); + continue; + } + + SpellInfo const* prevSpell = NULL; + for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank) + { + uint32 spellId = talentInfo->RankID[rank]; + if (!spellId) + break; + + SpellInfo const* currentSpell = GetSpellInfo(spellId); + if (!currentSpell) + { + TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "SpellMgr::LoadSpellTalentRanks: Spell %u (Rank: %u) for TalentEntry %u does not exist.", spellId, rank + 1, i); + break; + } + + SpellChainNode node; + node.first = firstSpell; + node.last = lastSpell; + node.rank = rank + 1; + + node.prev = prevSpell; + node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[rank + 1]) : NULL; + + mSpellChains[spellId] = node; + mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId]; + + prevSpell = currentSpell; + } } - mSpellChains.clear(); +} + +void SpellMgr::LoadSpellRanks() +{ + // cleanup data and load spell ranks for talents from dbc + LoadSpellTalentRanks(); + + uint32 oldMSTime = getMSTime(); + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id, rank"); if (!result) { TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); - return; } @@ -1280,6 +1345,10 @@ void SpellMgr::LoadSpellRanks() { ++count; int32 addedSpell = itr->first; + + if (mSpellInfoMap[addedSpell]->ChainEntry) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u (rank: %u, first: %u) listed in `spell_ranks` has already ChainEntry from dbc.", addedSpell, itr->second, lastSpell); + mSpellChains[addedSpell].first = GetSpellInfo(lastSpell); mSpellChains[addedSpell].last = GetSpellInfo(rankChain.back().first); mSpellChains[addedSpell].rank = itr->second; @@ -1296,10 +1365,10 @@ void SpellMgr::LoadSpellRanks() mSpellChains[addedSpell].next = GetSpellInfo(itr->first); } while (true); - } while (!finished); + } + while (!finished); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void SpellMgr::LoadSpellRequired() @@ -1335,14 +1404,14 @@ void SpellMgr::LoadSpellRequired() continue; } - SpellInfo const* req_spell = GetSpellInfo(spell_req); - if (!req_spell) + SpellInfo const* reqSpell = GetSpellInfo(spell_req); + if (!reqSpell) { TC_LOG_ERROR(LOG_FILTER_SQL, "req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req); continue; } - if (GetFirstSpellInChain(spell_id) == GetFirstSpellInChain(spell_req)) + if (spell->IsRankOf(reqSpell)) { TC_LOG_ERROR(LOG_FILTER_SQL, "req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id); continue; @@ -1741,52 +1810,76 @@ void SpellMgr::LoadSpellProcEvents() } uint32 count = 0; - uint32 customProc = 0; + do { Field* fields = result->Fetch(); - uint32 entry = fields[0].GetUInt32(); + int32 spellId = fields[0].GetInt32(); - SpellInfo const* spell = GetSpellInfo(entry); - if (!spell) + bool allRanks = false; + if (spellId < 0) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` does not exist", entry); + allRanks = true; + spellId = -spellId; + } + + SpellInfo const* spellInfo = GetSpellInfo(spellId); + if (!spellInfo) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` does not exist", spellId); continue; } - SpellProcEventEntry spe; + if (allRanks) + { + if (!spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` with all ranks, but spell has no ranks.", spellId); + + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` is not first rank of spell.", spellId); + continue; + } + } - spe.schoolMask = fields[1].GetInt8(); - spe.spellFamilyName = fields[2].GetUInt16(); - spe.spellFamilyMask[0] = fields[3].GetUInt32(); - spe.spellFamilyMask[1] = fields[4].GetUInt32(); - spe.spellFamilyMask[2] = fields[5].GetUInt32(); - spe.procFlags = fields[6].GetUInt32(); - spe.procEx = fields[7].GetUInt32(); - spe.ppmRate = fields[8].GetFloat(); - spe.customChance = fields[9].GetFloat(); - spe.cooldown = fields[10].GetUInt32(); + SpellProcEventEntry spellProcEvent; - mSpellProcEventMap[entry] = spe; + spellProcEvent.schoolMask = fields[1].GetInt8(); + spellProcEvent.spellFamilyName = fields[2].GetUInt16(); + spellProcEvent.spellFamilyMask[0] = fields[3].GetUInt32(); + spellProcEvent.spellFamilyMask[1] = fields[4].GetUInt32(); + spellProcEvent.spellFamilyMask[2] = fields[5].GetUInt32(); + spellProcEvent.procFlags = fields[6].GetUInt32(); + spellProcEvent.procEx = fields[7].GetUInt32(); + spellProcEvent.ppmRate = fields[8].GetFloat(); + spellProcEvent.customChance = fields[9].GetFloat(); + spellProcEvent.cooldown = fields[10].GetUInt32(); - if (spell->ProcFlags == 0) + while (spellInfo) { - if (spe.procFlags == 0) + if (mSpellProcEventMap.find(spellInfo->Id) != mSpellProcEventMap.end()) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` probally not triggered spell", entry); - continue; + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` already has its first rank in table.", spellInfo->Id); + break; } - customProc++; + + if (!spellInfo->ProcFlags && !spellProcEvent.procFlags) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` probally not triggered spell", spellInfo->Id); + + mSpellProcEventMap[spellInfo->Id] = spellProcEvent; + + if (allRanks) + spellInfo = spellInfo->GetNextRankSpell(); + else + break; } - ++count; - } while (result->NextRow()); - if (customProc) - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime)); - else - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + ++count; + } + while (result->NextRow()); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellProcs() @@ -1826,6 +1919,9 @@ void SpellMgr::LoadSpellProcs() if (allRanks) { + if (!spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` with all ranks, but spell has no ranks.", spellId); + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", spellId); @@ -1855,9 +1951,10 @@ void SpellMgr::LoadSpellProcs() { if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellInfo->Id); + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` already has its first rank in table.", spellInfo->Id); break; } + SpellProcEntry procEntry = SpellProcEntry(baseProcEntry); // take defaults from dbcs @@ -2596,34 +2693,28 @@ void SpellMgr::LoadSpellInfoStore() mSpellInfoMap.resize(sSpellStore.GetNumRows(), NULL); for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) - { if (SpellEntry const* spellEntry = sSpellStore.LookupEntry(i)) mSpellInfoMap[i] = new SpellInfo(spellEntry); - } - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo store in %u ms", GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::UnloadSpellInfoStore() { - for (uint32 i = 0; i < mSpellInfoMap.size(); ++i) - { - if (mSpellInfoMap[i]) - delete mSpellInfoMap[i]; - } + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) + delete mSpellInfoMap[i]; + mSpellInfoMap.clear(); } void SpellMgr::UnloadSpellInfoImplicitTargetConditionLists() { - for (uint32 i = 0; i < mSpellInfoMap.size(); ++i) - { + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) if (mSpellInfoMap[i]) mSpellInfoMap[i]->_UnloadImplicitTargetConditionLists(); - } } -void SpellMgr::LoadSpellCustomAttr() +void SpellMgr::LoadSpellInfoCustomAttributes() { uint32 oldMSTime = getMSTime(); @@ -2705,7 +2796,7 @@ void SpellMgr::LoadSpellCustomAttr() if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellInfo* procInfo = (SpellInfo*)GetSpellInfo(enchant->spellid[s]); + SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]); if (!procInfo) continue; @@ -2913,40 +3004,42 @@ void SpellMgr::LoadSpellCustomAttr() default: break; } + + spellInfo->_InitializeExplicitTargetMask(); } CreatureAI::FillAISpellInfo(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); } -void SpellMgr::LoadDbcDataCorrections() +void SpellMgr::LoadSpellInfoCorrections() { uint32 oldMSTime = getMSTime(); - SpellEntry* spellInfo = NULL; - for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) + SpellInfo* spellInfo = NULL; + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { - spellInfo = (SpellEntry*)sSpellStore.LookupEntry(i); + spellInfo = mSpellInfoMap[i]; if (!spellInfo) continue; for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) { - switch (spellInfo->Effect[j]) + switch (spellInfo->Effects[j].Effect) { case SPELL_EFFECT_CHARGE: case SPELL_EFFECT_CHARGE_DEST: case SPELL_EFFECT_JUMP: case SPELL_EFFECT_JUMP_DEST: case SPELL_EFFECT_LEAP_BACK: - if (!spellInfo->speed && !spellInfo->SpellFamilyName) - spellInfo->speed = SPEED_CHARGE; + if (!spellInfo->Speed && !spellInfo->SpellFamilyName) + spellInfo->Speed = SPEED_CHARGE; break; } } - if (spellInfo->activeIconID == 2158) // flight + if (spellInfo->ActiveIconID == 2158) // flight spellInfo->Attributes |= SPELL_ATTR0_PASSIVE; switch (spellInfo->Id) @@ -2955,28 +3048,28 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->MaxAffectedTargets = 1; break; case 42730: - spellInfo->EffectTriggerSpell[EFFECT_1] = 42739; + spellInfo->Effects[EFFECT_1].TriggerSpell = 42739; break; case 59735: - spellInfo->EffectTriggerSpell[EFFECT_1] = 59736; + spellInfo->Effects[EFFECT_1].TriggerSpell = 59736; break; case 52611: // Summon Skeletons case 52612: // Summon Skeletons - spellInfo->EffectMiscValueB[0] = 64; + spellInfo->Effects[EFFECT_0].MiscValueB = 64; break; case 40244: // Simon Game Visual case 40245: // Simon Game Visual case 40246: // Simon Game Visual case 40247: // Simon Game Visual case 42835: // Spout, remove damage effect, only anim is needed - spellInfo->Effect[0] = 0; + spellInfo->Effects[EFFECT_0].Effect = 0; break; case 30657: // Quake - spellInfo->EffectTriggerSpell[0] = 30571; + spellInfo->Effects[EFFECT_0].TriggerSpell = 30571; break; case 30541: // Blaze (needs conditions entry) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 63665: // Charge (Argent Tournament emote on riders) case 31298: // Sleep (needs target selection script) @@ -2984,18 +3077,18 @@ void SpellMgr::LoadDbcDataCorrections() case 2895: // Wrath of Air Totem rank 1 (Aura) case 68933: // Wrath of Air Totem rank 2 (Aura) case 29200: // Purify Helboar Meat - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 31344: // Howl of Azgalor - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yards instead of 50000?! + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yards instead of 50000?! break; case 42818: // Headless Horseman - Wisp Flight Port case 42821: // Headless Horseman - Wisp Flight Missile - spellInfo->rangeIndex = 6; // 100 yards + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards break; - case 36350: //They Must Burn Bomb Aura (self) - spellInfo->EffectTriggerSpell[0] = 36325; // They Must Burn Bomb Drop (DND) + case 36350: // They Must Burn Bomb Aura (self) + spellInfo->Effects[EFFECT_0].TriggerSpell = 36325; // They Must Burn Bomb Drop (DND) break; case 49838: // Stop Time spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO; @@ -3004,15 +3097,15 @@ void SpellMgr::LoadDbcDataCorrections() case 62136: // Energize Cores case 54069: // Energize Cores case 56251: // Energize Cores - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENTRY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY); break; case 50785: // Energize Cores case 59372: // Energize Cores - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENEMY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY); break; case 8494: // Mana Shield (rank 2) // because of bug in dbc - spellInfo->procChance = 0; + spellInfo->ProcChance = 0; break; case 20335: // Heart of the Crusader case 20336: @@ -3023,8 +3116,8 @@ void SpellMgr::LoadDbcDataCorrections() break; case 59725: // Improved Spell Reflection - aoe aura // Target entry seems to be wrong for this spell :/ - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER_AREA_PARTY; - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_10_YARDS_2; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY); + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS_2); break; case 44978: // Wild Magic case 45001: @@ -3095,7 +3188,7 @@ void SpellMgr::LoadDbcDataCorrections() case 33711: // Murmur's Touch case 38794: spellInfo->MaxAffectedTargets = 1; - spellInfo->EffectTriggerSpell[0] = 33760; + spellInfo->Effects[EFFECT_0].TriggerSpell = 33760; break; case 17941: // Shadow Trance case 22008: // Netherwind Focus @@ -3110,17 +3203,17 @@ void SpellMgr::LoadDbcDataCorrections() case 64823: // Item - Druid T8 Balance 4P Bonus case 34477: // Misdirection case 44401: // Missile Barrage - spellInfo->procCharges = 1; + spellInfo->ProcCharges = 1; break; case 44544: // Fingers of Frost - spellInfo->EffectSpellClassMask[0] = flag96(685904631, 1151048, 0); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0); break; case 74396: // Fingers of Frost visual buff - spellInfo->procCharges = 2; + spellInfo->ProcCharges = 2; spellInfo->StackAmount = 0; break; case 28200: // Ascendance (Talisman of Ascendance trinket) - spellInfo->procCharges = 6; + spellInfo->ProcCharges = 6; break; case 47201: // Everlasting Affliction case 47202: @@ -3128,16 +3221,16 @@ void SpellMgr::LoadDbcDataCorrections() case 47204: case 47205: // add corruption to affected spells - spellInfo->EffectSpellClassMask[1][0] |= 2; + spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 2; break; case 51852: // The Eye of Acherus (no spawn in phase 2 in db) - spellInfo->EffectMiscValue[0] |= 1; + spellInfo->Effects[EFFECT_0].MiscValue |= 1; break; case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster - spellInfo->EffectAmplitude[0] = 3000; + spellInfo->Effects[EFFECT_0].Amplitude = 3000; break; case 29809: // Desecration Arm - 36 instead of 37 - typo? :/ - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_7_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_7_YARDS); break; // Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data // To prevent aura staying on target after talent unlearned @@ -3152,37 +3245,37 @@ void SpellMgr::LoadDbcDataCorrections() break; case 51466: // Elemental Oath (Rank 1) case 51470: // Elemental Oath (Rank 2) - spellInfo->Effect[EFFECT_1] = SPELL_EFFECT_APPLY_AURA; - spellInfo->EffectApplyAuraName[EFFECT_1] = SPELL_AURA_ADD_FLAT_MODIFIER; - spellInfo->EffectMiscValue[EFFECT_1] = SPELLMOD_EFFECT2; - spellInfo->EffectSpellClassMask[EFFECT_1] = flag96(0x00000000, 0x00004000, 0x00000000); + spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2; + spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000); break; case 47569: // Improved Shadowform (Rank 1) // with this spell atrribute aura can be stacked several times spellInfo->Attributes &= ~SPELL_ATTR0_NOT_SHAPESHIFT; break; case 64904: // Hymn of Hope - spellInfo->EffectApplyAuraName[EFFECT_1] = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT; break; case 19465: // Improved Stings (Rank 2) - spellInfo->EffectImplicitTargetA[EFFECT_2] = TARGET_UNIT_CASTER; + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); break; case 30421: // Nether Portal - Perseverence - spellInfo->EffectBasePoints[2] += 30000; + spellInfo->Effects[EFFECT_2].BasePoints += 30000; break; case 16834: // Natural shapeshifter case 16835: - spellInfo->DurationIndex = 21; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); break; case 51735: // Ebon Plague case 51734: case 51726: spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; spellInfo->SpellFamilyFlags[2] = 0x10; - spellInfo->EffectApplyAuraName[1] = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN; break; case 41913: // Parasitic Shadowfiend Passive - spellInfo->EffectApplyAuraName[0] = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends break; case 27892: // To Anchor 1 case 27928: // To Anchor 1 @@ -3190,18 +3283,18 @@ void SpellMgr::LoadDbcDataCorrections() case 27915: // Anchor to Skulls case 27931: // Anchor to Skulls case 27937: // Anchor to Skulls - spellInfo->rangeIndex = 13; + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); break; // target allys instead of enemies, target A is src_caster, spells with effect like that have ally target // this is the only known exception, probably just wrong data case 29214: // Wrath of the Plaguebringer case 54836: // Wrath of the Plaguebringer - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_SRC_AREA_ALLY; - spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_SRC_AREA_ALLY; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); + spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); break; case 57994: // Wind Shear - improper data for EFFECT_1 in 3.3.5 DBC, but is correct in 4.x - spellInfo->Effect[EFFECT_1] = SPELL_EFFECT_MODIFY_THREAT_PERCENT; - spellInfo->EffectBasePoints[EFFECT_1] = -6; // -5% + spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_MODIFY_THREAT_PERCENT; + spellInfo->Effects[EFFECT_1].BasePoints = -6; // -5% break; case 63675: // Improved Devouring Plague spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; @@ -3218,55 +3311,55 @@ void SpellMgr::LoadDbcDataCorrections() case 58651: // Flametongue Totem rank 6 (Aura) case 58654: // Flametongue Totem rank 7 (Aura) case 58655: // Flametongue Totem rank 8 (Aura) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetA[1] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = 0; - spellInfo->EffectImplicitTargetB[1] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); + spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(); break; case 53241: // Marked for Death (Rank 1) case 53243: // Marked for Death (Rank 2) case 53244: // Marked for Death (Rank 3) case 53245: // Marked for Death (Rank 4) case 53246: // Marked for Death (Rank 5) - spellInfo->EffectSpellClassMask[0] = flag96(0x00067801, 0x10820001, 0x00000801); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00067801, 0x10820001, 0x00000801); break; case 70728: // Exploit Weakness (needs target selection script) case 70840: // Devious Minds (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_PET; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_PET); break; case 70893: // Culling The Herd (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_MASTER; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_MASTER); break; case 54800: // Sigil of the Frozen Conscience - change class mask to custom extended flags of Icy Touch // this is done because another spell also uses the same SpellFamilyFlags as Icy Touch // SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a) // this needs research on modifier applying rules, does not seem to be in Attributes fields - spellInfo->EffectSpellClassMask[0] = flag96(0x00000040, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000); break; case 64949: // Idol of the Flourishing Life - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x00000000, 0x02000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 34231: // Libram of the Lightbringer case 60792: // Libram of Tolerance case 64956: // Libram of the Resolute - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x80000000, 0x00000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 28851: // Libram of Light case 28853: // Libram of Divinity case 32403: // Blessed Book of Nagrand - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x40000000, 0x00000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 45602: // Ride Carpet - spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" + spellInfo->Effects[EFFECT_0].BasePoints = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" break; case 64745: // Item - Death Knight T8 Tank 4P Bonus case 64936: // Item - Warrior T8 Protection 4P Bonus - spellInfo->EffectBasePoints[0] = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) + spellInfo->Effects[EFFECT_0].BasePoints = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) break; case 19970: // Entangling Roots (Rank 6) -- Nature's Grasp Proc case 19971: // Entangling Roots (Rank 5) -- Nature's Grasp Proc @@ -3276,7 +3369,7 @@ void SpellMgr::LoadDbcDataCorrections() case 19975: // Entangling Roots (Rank 1) -- Nature's Grasp Proc case 27010: // Entangling Roots (Rank 7) -- Nature's Grasp Proc case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc - spellInfo->CastingTimeIndex = 1; + spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); break; case 59414: // Pulsing Shockwave Aura (Loken) // this flag breaks movement, remove it @@ -3286,7 +3379,7 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; break; case 70650: // Death Knight T10 Tank 2P Bonus - spellInfo->EffectApplyAuraName[0] = SPELL_AURA_ADD_PCT_MODIFIER; + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_PCT_MODIFIER; break; case 71838: // Drain Life - Bryntroll Normal case 71839: // Drain Life - Bryntroll Heroic @@ -3298,7 +3391,7 @@ void SpellMgr::LoadDbcDataCorrections() // ULDUAR SPELLS // case 62374: // Pursued (Flame Leviathan) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 63342: // Focused Eyebeam Summon Trigger (Kologarn) spellInfo->MaxAffectedTargets = 1; @@ -3320,12 +3413,12 @@ void SpellMgr::LoadDbcDataCorrections() // then EFFECT_1, etc - instead of applying each effect on target1, then target2, etc. // The above situation causes the visual for this spell to be bugged, so we remove the instakill // effect and implement a script hack for that. - spellInfo->Effect[EFFECT_1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; case 64386: // Terrifying Screech (Auriaya) case 64389: // Sentinel Blast (Auriaya) case 64678: // Sentinel Blast (Auriaya) - spellInfo->DurationIndex = 28; // 5 seconds, wrong DBC data? + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds, wrong DBC data? break; case 64321: // Potent Pheromones (Freya) // spell should dispel area aura, but doesn't have the attribute @@ -3335,7 +3428,7 @@ void SpellMgr::LoadDbcDataCorrections() break; case 61791: // Ride Vehicle (Yogg-Saron) // TODO: remove this when basepoints of all Ride Vehicle auras are calculated correctly - spellInfo->EffectBasePoints[0] = 1; + spellInfo->Effects[EFFECT_0].BasePoints = 1; break; case 64468: // Empowering Shadows (Yogg-Saron) case 64486: // Empowering Shadows (Yogg-Saron) @@ -3348,11 +3441,11 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->MaxAffectedTargets = 3; break; case 62293: // Cosmic Smash (Algalon the Observer) - spellInfo->EffectImplicitTargetB[0] = TARGET_DEST_CASTER; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_CASTER); break; case 62311: // Cosmic Smash (Algalon the Observer) case 64596: // Cosmic Smash (Algalon the Observer) - spellInfo->rangeIndex = 6; // 100yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd break; case 64014: // Expedition Base Camp Teleport case 64024: // Conservatory Teleport @@ -3363,7 +3456,7 @@ void SpellMgr::LoadDbcDataCorrections() case 64031: // Scrapyard Teleport case 64032: // Formation Grounds Teleport case 65042: // Prison of Yogg-Saron Teleport - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DB; + spellInfo->Effects[0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); break; // ENDOF ULDUAR SPELLS // @@ -3373,7 +3466,7 @@ void SpellMgr::LoadDbcDataCorrections() case 67901: // Infernal Eruption (25N) // increase duration from 15 to 18 seconds because caster is already // unsummoned when spell missile hits the ground so nothing happen in result - spellInfo->DurationIndex = 85; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(85); break; // ENDOF TRIAL OF THE CRUSADER SPELLS // @@ -3389,11 +3482,11 @@ void SpellMgr::LoadDbcDataCorrections() case 70859: // Upper Spire Teleport case 70860: // Frozen Throne Teleport case 70861: // Sindragosa's Lair Teleport - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DB; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); break; case 69055: // Bone Slice (Lord Marrowgar) case 70814: // Bone Slice (Lord Marrowgar) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_8_YARDS; // 5yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); // 5yd break; case 69075: // Bone Storm (Lord Marrowgar) case 70834: // Bone Storm (Lord Marrowgar) @@ -3403,62 +3496,62 @@ void SpellMgr::LoadDbcDataCorrections() case 71160: // Plague Stench (Stinky) case 71161: // Plague Stench (Stinky) case 71123: // Decimate (Stinky & Precious) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd break; case 71169: // Shadow's Fate spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; case 72378: // Blood Nova (Deathbringer Saurfang) case 73058: // Blood Nova (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); break; case 72769: // Scent of Blood (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // no break case 72771: // Scent of Blood (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); break; case 72723: // Resistant Skin (Deathbringer Saurfang adds) // this spell initially granted Shadow damage immunity, however it was removed but the data was left in client - spellInfo->Effect[2] = 0; + spellInfo->Effects[EFFECT_2].Effect = 0; break; case 70460: // Coldflame Jets (Traps after Saurfang) - spellInfo->DurationIndex = 1; // 10 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(1); // 10 seconds break; case 71412: // Green Ooze Summon (Professor Putricide) case 71415: // Orange Ooze Summon (Professor Putricide) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); break; case 71159: // Awaken Plagued Zombies - spellInfo->DurationIndex = 21; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); break; case 70530: // Volatile Ooze Beam Protection (Professor Putricide) - spellInfo->Effect[0] = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID + spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID break; // THIS IS HERE BECAUSE COOLDOWN ON CREATURE PROCS IS NOT IMPLEMENTED case 71604: // Mutated Strength (Professor Putricide) case 72673: // Mutated Strength (Professor Putricide) case 72674: // Mutated Strength (Professor Putricide) case 72675: // Mutated Strength (Professor Putricide) - spellInfo->Effect[1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; case 72454: // Mutated Plague (Professor Putricide) case 72464: // Mutated Plague (Professor Putricide) case 72506: // Mutated Plague (Professor Putricide) case 72507: // Mutated Plague (Professor Putricide) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 70911: // Unbound Plague (Professor Putricide) (needs target selection script) case 72854: // Unbound Plague (Professor Putricide) (needs target selection script) case 72855: // Unbound Plague (Professor Putricide) (needs target selection script) case 72856: // Unbound Plague (Professor Putricide) (needs target selection script) - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ENEMY; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY); break; case 71518: // Unholy Infusion Quest Credit (Professor Putricide) case 72934: // Blood Infusion Quest Credit (Blood-Queen Lana'thel) case 72289: // Frost Infusion Quest Credit (Sindragosa) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // another missing radius + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // another missing radius break; case 71708: // Empowered Flare (Blood Prince Council) case 72785: // Empowered Flare (Blood Prince Council) @@ -3475,98 +3568,98 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; case 70715: // Column of Frost (visual marker) - spellInfo->DurationIndex = 32; // 6 seconds (missing) + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(32); // 6 seconds (missing) break; case 71085: // Mana Void (periodic aura) - spellInfo->DurationIndex = 9; // 30 seconds (missing) + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 seconds (missing) break; case 72015: // Frostbolt Volley (only heroic) case 72016: // Frostbolt Volley (only heroic) - spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_40_YARDS; + spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_40_YARDS); break; case 70936: // Summon Suppressor (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 72706: // Achievement Check (Valithria Dreamwalker) case 71357: // Order Whelp - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 70598: // Sindragosa's Fury - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); break; case 69846: // Frost Bomb - spellInfo->speed = 0.0f; // This spell's summon happens instantly + spellInfo->Speed = 0.0f; // This spell's summon happens instantly break; case 71614: // Ice Lock spellInfo->Mechanic = MECHANIC_STUN; break; case 72762: // Defile - spellInfo->DurationIndex = 559; // 53 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(559); // 53 seconds break; case 72743: // Defile - spellInfo->DurationIndex = 22; // 45 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(22); // 45 seconds break; case 72754: // Defile case 73708: // Defile case 73709: // Defile case 73710: // Defile - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 69030: // Val'kyr Target Search - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 69198: // Raging Spirit Visual - spellInfo->rangeIndex = 13; // 50000yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd break; case 73654: // Harvest Souls case 74295: // Harvest Souls case 74296: // Harvest Souls case 74297: // Harvest Souls - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 73655: // Harvest Soul spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; break; case 73540: // Summon Shadow Trap - spellInfo->DurationIndex = 23; // 90 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(23); // 90 seconds break; case 73530: // Shadow Trap (visual) - spellInfo->DurationIndex = 28; // 5 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds break; case 73529: // Shadow Trap - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_10_YARDS; // 10yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd break; case 74282: // Shadow Trap (searcher) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_3_YARDS; // 3yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd break; case 72595: // Restore Soul case 73650: // Restore Soul - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 74086: // Destroy Soul - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 74302: // Summon Spirit Bomb case 74342: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd spellInfo->MaxAffectedTargets = 1; break; case 74341: // Summon Spirit Bomb case 74343: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd spellInfo->MaxAffectedTargets = 3; break; case 73579: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_25_YARDS; // 25yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd break; case 72350: // Fury of Frostmourne - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 75127: // Kill Frostmourne Players case 72351: // Fury of Frostmourne @@ -3574,18 +3667,18 @@ void SpellMgr::LoadDbcDataCorrections() case 72429: // Mass Resurrection case 73159: // Play Movie case 73582: // Trigger Vile Spirit (Inside, Heroic) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 72376: // Raise Dead spellInfo->MaxAffectedTargets = 3; - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 71809: // Jump - spellInfo->rangeIndex = 3; // 20yd - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_25_YARDS; // 25yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(3); // 20yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd break; case 72405: // Broken Frostmourne - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; // ENDOF ICECROWN CITADEL SPELLS // @@ -3595,7 +3688,7 @@ void SpellMgr::LoadDbcDataCorrections() case 77844: // Twilight Cutter case 77845: // Twilight Cutter case 77846: // Twilight Cutter - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd break; case 75509: // Twilight Mending spellInfo->AttributesEx6 |= SPELL_ATTR6_CAN_TARGET_INVISIBLE; @@ -3632,7 +3725,7 @@ void SpellMgr::LoadDbcDataCorrections() case 49462: // Call Ruby Drake case 49461: // Call Amber Drake case 49345: // Call Emerald Drake - spellInfo->Effect[1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; // ENDOF OCULUS SPELLS // @@ -3643,11 +3736,11 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1; break; case 45524: // Chains of Ice - spellInfo->EffectImplicitTargetA[EFFECT_2] = 0; + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(); break; case 2378: // Minor Fortitude - spellInfo->manaCost = 0; - spellInfo->manaPerSecond = 0; + spellInfo->ManaCost = 0; + spellInfo->ManaPerSecond = 0; break; case 24314: // Threatening Gaze spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_JUMP; @@ -3660,7 +3753,7 @@ void SpellMgr::LoadDbcDataCorrections() case SPELLFAMILY_PALADIN: // Seals of the Pure should affect Seal of Righteousness if (spellInfo->SpellIconID == 25 && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) - spellInfo->EffectSpellClassMask[0][1] |= 0x20000000; + spellInfo->Effects[EFFECT_0].SpellClassMask[1] |= 0x20000000; break; case SPELLFAMILY_DEATHKNIGHT: // Icy Touch - extend FamilyFlags (unused value) for Sigil of the Frozen Conscience to use @@ -3675,5 +3768,5 @@ void SpellMgr::LoadDbcDataCorrections() properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647)); // 52893 properties->Type = SUMMON_TYPE_TOTEM; - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index b7a3294efe3..677a6e2f758 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -692,10 +692,15 @@ class SpellMgr SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; } uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); } + private: + SpellInfo* _GetSpellInfo(uint32 spellId) { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; } + // Modifiers public: // Loading data at server startup + void UnloadSpellInfoChains(); + void LoadSpellTalentRanks(); void LoadSpellRanks(); void LoadSpellRequired(); void LoadSpellLearnSkills(); @@ -718,8 +723,8 @@ class SpellMgr void LoadSpellInfoStore(); void UnloadSpellInfoStore(); void UnloadSpellInfoImplicitTargetConditionLists(); - void LoadSpellCustomAttr(); - void LoadDbcDataCorrections(); + void LoadSpellInfoCustomAttributes(); + void LoadSpellInfoCorrections(); private: SpellDifficultySearcherMap mSpellDifficultySearcherMap; diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 404c62efb53..5fb4d69cd02 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -136,7 +136,7 @@ bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8 return true; if (!spellEntry->Effects[effIndex].ApplyAuraName) return false; - return (effAurName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName); + return (effAurName == SPELL_AURA_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName); } std::string _SpellScript::EffectAuraNameCheck::ToString() diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 645c14b8758..410fbee9931 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -397,123 +397,123 @@ void World::LoadConfigSettings(bool reload) { if (reload) { - if (!ConfigMgr::Load()) + if (!sConfigMgr->Reload()) { - TC_LOG_ERROR(LOG_FILTER_GENERAL, "World settings reload fail: can't read settings from %s.", ConfigMgr::GetFilename().c_str()); + TC_LOG_ERROR(LOG_FILTER_GENERAL, "World settings reload fail: can't read settings from %s.", sConfigMgr->GetFilename().c_str()); return; } sLog->LoadFromConfig(); } ///- Read the player limit and the Message of the day from the config file - SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); - SetMotd(ConfigMgr::GetStringDefault("Motd", "Welcome to a Trinity Core Server.")); + SetPlayerAmountLimit(sConfigMgr->GetIntDefault("PlayerLimit", 100)); + SetMotd(sConfigMgr->GetStringDefault("Motd", "Welcome to a Trinity Core Server.")); ///- Read ticket system setting from the config file - m_bool_configs[CONFIG_ALLOW_TICKETS] = ConfigMgr::GetBoolDefault("AllowTickets", true); + m_bool_configs[CONFIG_ALLOW_TICKETS] = sConfigMgr->GetBoolDefault("AllowTickets", true); ///- Get string for new logins (newly created characters) - SetNewCharString(ConfigMgr::GetStringDefault("PlayerStart.String", "")); + SetNewCharString(sConfigMgr->GetStringDefault("PlayerStart.String", "")); ///- Send server info on login? - m_int_configs[CONFIG_ENABLE_SINFO_LOGIN] = ConfigMgr::GetIntDefault("Server.LoginInfo", 0); + m_int_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfigMgr->GetIntDefault("Server.LoginInfo", 0); ///- Read all rates from the config file - rate_values[RATE_HEALTH] = ConfigMgr::GetFloatDefault("Rate.Health", 1); + rate_values[RATE_HEALTH] = sConfigMgr->GetFloatDefault("Rate.Health", 1); if (rate_values[RATE_HEALTH] < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Rate.Health (%f) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]); rate_values[RATE_HEALTH] = 1; } - rate_values[RATE_POWER_MANA] = ConfigMgr::GetFloatDefault("Rate.Mana", 1); + rate_values[RATE_POWER_MANA] = sConfigMgr->GetFloatDefault("Rate.Mana", 1); if (rate_values[RATE_POWER_MANA] < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Rate.Mana (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]); rate_values[RATE_POWER_MANA] = 1; } - rate_values[RATE_POWER_RAGE_INCOME] = ConfigMgr::GetFloatDefault("Rate.Rage.Income", 1); - rate_values[RATE_POWER_RAGE_LOSS] = ConfigMgr::GetFloatDefault("Rate.Rage.Loss", 1); + rate_values[RATE_POWER_RAGE_INCOME] = sConfigMgr->GetFloatDefault("Rate.Rage.Income", 1); + rate_values[RATE_POWER_RAGE_LOSS] = sConfigMgr->GetFloatDefault("Rate.Rage.Loss", 1); if (rate_values[RATE_POWER_RAGE_LOSS] < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Rate.Rage.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]); rate_values[RATE_POWER_RAGE_LOSS] = 1; } - rate_values[RATE_POWER_RUNICPOWER_INCOME] = ConfigMgr::GetFloatDefault("Rate.RunicPower.Income", 1); - rate_values[RATE_POWER_RUNICPOWER_LOSS] = ConfigMgr::GetFloatDefault("Rate.RunicPower.Loss", 1); + rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfigMgr->GetFloatDefault("Rate.RunicPower.Income", 1); + rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfigMgr->GetFloatDefault("Rate.RunicPower.Loss", 1); if (rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]); rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1; } - rate_values[RATE_POWER_FOCUS] = ConfigMgr::GetFloatDefault("Rate.Focus", 1.0f); - rate_values[RATE_POWER_ENERGY] = ConfigMgr::GetFloatDefault("Rate.Energy", 1.0f); - - rate_values[RATE_SKILL_DISCOVERY] = ConfigMgr::GetFloatDefault("Rate.Skill.Discovery", 1.0f); - - rate_values[RATE_DROP_ITEM_POOR] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Poor", 1.0f); - rate_values[RATE_DROP_ITEM_NORMAL] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Normal", 1.0f); - rate_values[RATE_DROP_ITEM_UNCOMMON] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Uncommon", 1.0f); - rate_values[RATE_DROP_ITEM_RARE] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Rare", 1.0f); - rate_values[RATE_DROP_ITEM_EPIC] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Epic", 1.0f); - rate_values[RATE_DROP_ITEM_LEGENDARY] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Legendary", 1.0f); - rate_values[RATE_DROP_ITEM_ARTIFACT] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Artifact", 1.0f); - rate_values[RATE_DROP_ITEM_REFERENCED] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.Referenced", 1.0f); - rate_values[RATE_DROP_ITEM_REFERENCED_AMOUNT] = ConfigMgr::GetFloatDefault("Rate.Drop.Item.ReferencedAmount", 1.0f); - rate_values[RATE_DROP_MONEY] = ConfigMgr::GetFloatDefault("Rate.Drop.Money", 1.0f); - rate_values[RATE_XP_KILL] = ConfigMgr::GetFloatDefault("Rate.XP.Kill", 1.0f); - rate_values[RATE_XP_QUEST] = ConfigMgr::GetFloatDefault("Rate.XP.Quest", 1.0f); - rate_values[RATE_XP_EXPLORE] = ConfigMgr::GetFloatDefault("Rate.XP.Explore", 1.0f); - rate_values[RATE_REPAIRCOST] = ConfigMgr::GetFloatDefault("Rate.RepairCost", 1.0f); + rate_values[RATE_POWER_FOCUS] = sConfigMgr->GetFloatDefault("Rate.Focus", 1.0f); + rate_values[RATE_POWER_ENERGY] = sConfigMgr->GetFloatDefault("Rate.Energy", 1.0f); + + rate_values[RATE_SKILL_DISCOVERY] = sConfigMgr->GetFloatDefault("Rate.Skill.Discovery", 1.0f); + + rate_values[RATE_DROP_ITEM_POOR] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Poor", 1.0f); + rate_values[RATE_DROP_ITEM_NORMAL] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Normal", 1.0f); + rate_values[RATE_DROP_ITEM_UNCOMMON] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Uncommon", 1.0f); + rate_values[RATE_DROP_ITEM_RARE] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Rare", 1.0f); + rate_values[RATE_DROP_ITEM_EPIC] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Epic", 1.0f); + rate_values[RATE_DROP_ITEM_LEGENDARY] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Legendary", 1.0f); + rate_values[RATE_DROP_ITEM_ARTIFACT] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Artifact", 1.0f); + rate_values[RATE_DROP_ITEM_REFERENCED] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.Referenced", 1.0f); + rate_values[RATE_DROP_ITEM_REFERENCED_AMOUNT] = sConfigMgr->GetFloatDefault("Rate.Drop.Item.ReferencedAmount", 1.0f); + rate_values[RATE_DROP_MONEY] = sConfigMgr->GetFloatDefault("Rate.Drop.Money", 1.0f); + rate_values[RATE_XP_KILL] = sConfigMgr->GetFloatDefault("Rate.XP.Kill", 1.0f); + rate_values[RATE_XP_QUEST] = sConfigMgr->GetFloatDefault("Rate.XP.Quest", 1.0f); + rate_values[RATE_XP_EXPLORE] = sConfigMgr->GetFloatDefault("Rate.XP.Explore", 1.0f); + rate_values[RATE_REPAIRCOST] = sConfigMgr->GetFloatDefault("Rate.RepairCost", 1.0f); if (rate_values[RATE_REPAIRCOST] < 0.0f) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Rate.RepairCost (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_REPAIRCOST]); rate_values[RATE_REPAIRCOST] = 0.0f; } - rate_values[RATE_REPUTATION_GAIN] = ConfigMgr::GetFloatDefault("Rate.Reputation.Gain", 1.0f); - rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = ConfigMgr::GetFloatDefault("Rate.Reputation.LowLevel.Kill", 1.0f); - rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = ConfigMgr::GetFloatDefault("Rate.Reputation.LowLevel.Quest", 1.0f); - rate_values[RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS] = ConfigMgr::GetFloatDefault("Rate.Reputation.RecruitAFriendBonus", 0.1f); - rate_values[RATE_CREATURE_NORMAL_DAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Normal.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.Elite.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.RAREELITE.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_DAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.RARE.Damage", 1.0f); - rate_values[RATE_CREATURE_NORMAL_HP] = ConfigMgr::GetFloatDefault("Rate.Creature.Normal.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_HP] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.Elite.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_HP] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.RAREELITE.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_HP] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_HP] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.RARE.HP", 1.0f); - rate_values[RATE_CREATURE_NORMAL_SPELLDAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Normal.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.Elite.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.RAREELITE.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_SPELLDAMAGE] = ConfigMgr::GetFloatDefault("Rate.Creature.Elite.RARE.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_AGGRO] = ConfigMgr::GetFloatDefault("Rate.Creature.Aggro", 1.0f); - rate_values[RATE_REST_INGAME] = ConfigMgr::GetFloatDefault("Rate.Rest.InGame", 1.0f); - rate_values[RATE_REST_OFFLINE_IN_TAVERN_OR_CITY] = ConfigMgr::GetFloatDefault("Rate.Rest.Offline.InTavernOrCity", 1.0f); - rate_values[RATE_REST_OFFLINE_IN_WILDERNESS] = ConfigMgr::GetFloatDefault("Rate.Rest.Offline.InWilderness", 1.0f); - rate_values[RATE_DAMAGE_FALL] = ConfigMgr::GetFloatDefault("Rate.Damage.Fall", 1.0f); - rate_values[RATE_AUCTION_TIME] = ConfigMgr::GetFloatDefault("Rate.Auction.Time", 1.0f); - rate_values[RATE_AUCTION_DEPOSIT] = ConfigMgr::GetFloatDefault("Rate.Auction.Deposit", 1.0f); - rate_values[RATE_AUCTION_CUT] = ConfigMgr::GetFloatDefault("Rate.Auction.Cut", 1.0f); - rate_values[RATE_HONOR] = ConfigMgr::GetFloatDefault("Rate.Honor", 1.0f); - rate_values[RATE_INSTANCE_RESET_TIME] = ConfigMgr::GetFloatDefault("Rate.InstanceResetTime", 1.0f); - rate_values[RATE_TALENT] = ConfigMgr::GetFloatDefault("Rate.Talent", 1.0f); + rate_values[RATE_REPUTATION_GAIN] = sConfigMgr->GetFloatDefault("Rate.Reputation.Gain", 1.0f); + rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = sConfigMgr->GetFloatDefault("Rate.Reputation.LowLevel.Kill", 1.0f); + rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = sConfigMgr->GetFloatDefault("Rate.Reputation.LowLevel.Quest", 1.0f); + rate_values[RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS] = sConfigMgr->GetFloatDefault("Rate.Reputation.RecruitAFriendBonus", 0.1f); + rate_values[RATE_CREATURE_NORMAL_DAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Normal.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.Elite.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.RAREELITE.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RARE_DAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.RARE.Damage", 1.0f); + rate_values[RATE_CREATURE_NORMAL_HP] = sConfigMgr->GetFloatDefault("Rate.Creature.Normal.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_ELITE_HP] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.Elite.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_RAREELITE_HP] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.RAREELITE.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_WORLDBOSS_HP] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_RARE_HP] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.RARE.HP", 1.0f); + rate_values[RATE_CREATURE_NORMAL_SPELLDAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Normal.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.Elite.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.RAREELITE.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RARE_SPELLDAMAGE] = sConfigMgr->GetFloatDefault("Rate.Creature.Elite.RARE.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_AGGRO] = sConfigMgr->GetFloatDefault("Rate.Creature.Aggro", 1.0f); + rate_values[RATE_REST_INGAME] = sConfigMgr->GetFloatDefault("Rate.Rest.InGame", 1.0f); + rate_values[RATE_REST_OFFLINE_IN_TAVERN_OR_CITY] = sConfigMgr->GetFloatDefault("Rate.Rest.Offline.InTavernOrCity", 1.0f); + rate_values[RATE_REST_OFFLINE_IN_WILDERNESS] = sConfigMgr->GetFloatDefault("Rate.Rest.Offline.InWilderness", 1.0f); + rate_values[RATE_DAMAGE_FALL] = sConfigMgr->GetFloatDefault("Rate.Damage.Fall", 1.0f); + rate_values[RATE_AUCTION_TIME] = sConfigMgr->GetFloatDefault("Rate.Auction.Time", 1.0f); + rate_values[RATE_AUCTION_DEPOSIT] = sConfigMgr->GetFloatDefault("Rate.Auction.Deposit", 1.0f); + rate_values[RATE_AUCTION_CUT] = sConfigMgr->GetFloatDefault("Rate.Auction.Cut", 1.0f); + rate_values[RATE_HONOR] = sConfigMgr->GetFloatDefault("Rate.Honor", 1.0f); + rate_values[RATE_INSTANCE_RESET_TIME] = sConfigMgr->GetFloatDefault("Rate.InstanceResetTime", 1.0f); + rate_values[RATE_TALENT] = sConfigMgr->GetFloatDefault("Rate.Talent", 1.0f); if (rate_values[RATE_TALENT] < 0.0f) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Rate.Talent (%f) must be > 0. Using 1 instead.", rate_values[RATE_TALENT]); rate_values[RATE_TALENT] = 1.0f; } - rate_values[RATE_MOVESPEED] = ConfigMgr::GetFloatDefault("Rate.MoveSpeed", 1.0f); + rate_values[RATE_MOVESPEED] = sConfigMgr->GetFloatDefault("Rate.MoveSpeed", 1.0f); if (rate_values[RATE_MOVESPEED] < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Rate.MoveSpeed (%f) must be > 0. Using 1 instead.", rate_values[RATE_MOVESPEED]); rate_values[RATE_MOVESPEED] = 1.0f; } for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED]; - rate_values[RATE_CORPSE_DECAY_LOOTED] = ConfigMgr::GetFloatDefault("Rate.Corpse.Decay.Looted", 0.5f); + rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfigMgr->GetFloatDefault("Rate.Corpse.Decay.Looted", 0.5f); - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = ConfigMgr::GetFloatDefault("TargetPosRecalculateRange", 1.5f); + rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfigMgr->GetFloatDefault("TargetPosRecalculateRange", 1.5f); if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "TargetPosRecalculateRange (%f) must be >= %f. Using %f instead.", rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE); @@ -526,7 +526,7 @@ void World::LoadConfigSettings(bool reload) rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = NOMINAL_MELEE_RANGE; } - rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = ConfigMgr::GetFloatDefault("DurabilityLoss.OnDeath", 10.0f); + rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfigMgr->GetFloatDefault("DurabilityLoss.OnDeath", 10.0f); if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "DurabilityLoss.OnDeath (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); @@ -539,25 +539,25 @@ void World::LoadConfigSettings(bool reload) } rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = rate_values[RATE_DURABILITY_LOSS_ON_DEATH] / 100.0f; - rate_values[RATE_DURABILITY_LOSS_DAMAGE] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Damage", 0.5f); + rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfigMgr->GetFloatDefault("DurabilityLossChance.Damage", 0.5f); if (rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Damage (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_DAMAGE]); rate_values[RATE_DURABILITY_LOSS_DAMAGE] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_ABSORB] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Absorb", 0.5f); + rate_values[RATE_DURABILITY_LOSS_ABSORB] = sConfigMgr->GetFloatDefault("DurabilityLossChance.Absorb", 0.5f); if (rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Absorb (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ABSORB]); rate_values[RATE_DURABILITY_LOSS_ABSORB] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_PARRY] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Parry", 0.05f); + rate_values[RATE_DURABILITY_LOSS_PARRY] = sConfigMgr->GetFloatDefault("DurabilityLossChance.Parry", 0.05f); if (rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Parry (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_PARRY]); rate_values[RATE_DURABILITY_LOSS_PARRY] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_BLOCK] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Block", 0.05f); + rate_values[RATE_DURABILITY_LOSS_BLOCK] = sConfigMgr->GetFloatDefault("DurabilityLossChance.Block", 0.05f); if (rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]); @@ -565,39 +565,39 @@ void World::LoadConfigSettings(bool reload) } ///- Read other configuration items from the config file - m_bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = ConfigMgr::GetBoolDefault("DurabilityLoss.InPvP", false); + m_bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfigMgr->GetBoolDefault("DurabilityLoss.InPvP", false); - m_int_configs[CONFIG_COMPRESSION] = ConfigMgr::GetIntDefault("Compression", 1); + m_int_configs[CONFIG_COMPRESSION] = sConfigMgr->GetIntDefault("Compression", 1); if (m_int_configs[CONFIG_COMPRESSION] < 1 || m_int_configs[CONFIG_COMPRESSION] > 9) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Compression level (%i) must be in range 1..9. Using default compression level (1).", m_int_configs[CONFIG_COMPRESSION]); m_int_configs[CONFIG_COMPRESSION] = 1; } - m_bool_configs[CONFIG_ADDON_CHANNEL] = ConfigMgr::GetBoolDefault("AddonChannel", true); - m_bool_configs[CONFIG_CLEAN_CHARACTER_DB] = ConfigMgr::GetBoolDefault("CleanCharacterDB", false); - m_int_configs[CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS] = ConfigMgr::GetIntDefault("PersistentCharacterCleanFlags", 0); - m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = ConfigMgr::GetIntDefault("ChatLevelReq.Channel", 1); - m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = ConfigMgr::GetIntDefault("ChatLevelReq.Whisper", 1); - m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = ConfigMgr::GetIntDefault("ChatLevelReq.Say", 1); - m_int_configs[CONFIG_TRADE_LEVEL_REQ] = ConfigMgr::GetIntDefault("LevelReq.Trade", 1); - m_int_configs[CONFIG_TICKET_LEVEL_REQ] = ConfigMgr::GetIntDefault("LevelReq.Ticket", 1); - m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = ConfigMgr::GetIntDefault("LevelReq.Auction", 1); - m_int_configs[CONFIG_MAIL_LEVEL_REQ] = ConfigMgr::GetIntDefault("LevelReq.Mail", 1); - m_bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = ConfigMgr::GetBoolDefault("PreserveCustomChannels", false); - m_int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = ConfigMgr::GetIntDefault("PreserveCustomChannelDuration", 14); - m_bool_configs[CONFIG_GRID_UNLOAD] = ConfigMgr::GetBoolDefault("GridUnload", true); - m_int_configs[CONFIG_INTERVAL_SAVE] = ConfigMgr::GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = ConfigMgr::GetIntDefault("DisconnectToleranceInterval", 0); - m_bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = ConfigMgr::GetBoolDefault("PlayerSave.Stats.SaveOnlyOnLogout", true); - - m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = ConfigMgr::GetIntDefault("PlayerSave.Stats.MinLevel", 0); + m_bool_configs[CONFIG_ADDON_CHANNEL] = sConfigMgr->GetBoolDefault("AddonChannel", true); + m_bool_configs[CONFIG_CLEAN_CHARACTER_DB] = sConfigMgr->GetBoolDefault("CleanCharacterDB", false); + m_int_configs[CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS] = sConfigMgr->GetIntDefault("PersistentCharacterCleanFlags", 0); + m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Channel", 1); + m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Whisper", 1); + m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Say", 1); + m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Trade", 1); + m_int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Ticket", 1); + m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Auction", 1); + m_int_configs[CONFIG_MAIL_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Mail", 1); + m_bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = sConfigMgr->GetBoolDefault("PreserveCustomChannels", false); + m_int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = sConfigMgr->GetIntDefault("PreserveCustomChannelDuration", 14); + m_bool_configs[CONFIG_GRID_UNLOAD] = sConfigMgr->GetBoolDefault("GridUnload", true); + m_int_configs[CONFIG_INTERVAL_SAVE] = sConfigMgr->GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfigMgr->GetIntDefault("DisconnectToleranceInterval", 0); + m_bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfigMgr->GetBoolDefault("PlayerSave.Stats.SaveOnlyOnLogout", true); + + m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = sConfigMgr->GetIntDefault("PlayerSave.Stats.MinLevel", 0); if (m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] > MAX_LEVEL) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "PlayerSave.Stats.MinLevel (%i) must be in range 0..80. Using default, do not save character stats (0).", m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]); m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = 0; } - m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = ConfigMgr::GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfigMgr->GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILLISECONDS); if (m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "GridCleanUpDelay (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_GRIDCLEAN], MIN_GRID_DELAY); @@ -606,7 +606,7 @@ void World::LoadConfigSettings(bool reload) if (reload) sMapMgr->SetGridCleanUpDelay(m_int_configs[CONFIG_INTERVAL_GRIDCLEAN]); - m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = ConfigMgr::GetIntDefault("MapUpdateInterval", 100); + m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfigMgr->GetIntDefault("MapUpdateInterval", 100); if (m_int_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MapUpdateInterval (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY); @@ -615,81 +615,81 @@ void World::LoadConfigSettings(bool reload) if (reload) sMapMgr->SetMapUpdateInterval(m_int_configs[CONFIG_INTERVAL_MAPUPDATE]); - m_int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = ConfigMgr::GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfigMgr->GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); if (reload) { - uint32 val = ConfigMgr::GetIntDefault("WorldServerPort", 8085); + uint32 val = sConfigMgr->GetIntDefault("WorldServerPort", 8085); if (val != m_int_configs[CONFIG_PORT_WORLD]) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_PORT_WORLD]); } else - m_int_configs[CONFIG_PORT_WORLD] = ConfigMgr::GetIntDefault("WorldServerPort", 8085); + m_int_configs[CONFIG_PORT_WORLD] = sConfigMgr->GetIntDefault("WorldServerPort", 8085); - m_int_configs[CONFIG_SOCKET_TIMEOUTTIME] = ConfigMgr::GetIntDefault("SocketTimeOutTime", 900000); - m_int_configs[CONFIG_SESSION_ADD_DELAY] = ConfigMgr::GetIntDefault("SessionAddDelay", 10000); + m_int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfigMgr->GetIntDefault("SocketTimeOutTime", 900000); + m_int_configs[CONFIG_SESSION_ADD_DELAY] = sConfigMgr->GetIntDefault("SessionAddDelay", 10000); - m_float_configs[CONFIG_GROUP_XP_DISTANCE] = ConfigMgr::GetFloatDefault("MaxGroupXPDistance", 74.0f); - m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = ConfigMgr::GetFloatDefault("MaxRecruitAFriendBonusDistance", 100.0f); + m_float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfigMgr->GetFloatDefault("MaxGroupXPDistance", 74.0f); + m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfigMgr->GetFloatDefault("MaxRecruitAFriendBonusDistance", 100.0f); /// @todo Add MonsterSight and GuarderSight (with meaning) in worldserver.conf or put them as define - m_float_configs[CONFIG_SIGHT_MONSTER] = ConfigMgr::GetFloatDefault("MonsterSight", 50); - m_float_configs[CONFIG_SIGHT_GUARDER] = ConfigMgr::GetFloatDefault("GuarderSight", 50); + m_float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetFloatDefault("MonsterSight", 50); + m_float_configs[CONFIG_SIGHT_GUARDER] = sConfigMgr->GetFloatDefault("GuarderSight", 50); if (reload) { - uint32 val = ConfigMgr::GetIntDefault("GameType", 0); + uint32 val = sConfigMgr->GetIntDefault("GameType", 0); if (val != m_int_configs[CONFIG_GAME_TYPE]) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "GameType option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_GAME_TYPE]); } else - m_int_configs[CONFIG_GAME_TYPE] = ConfigMgr::GetIntDefault("GameType", 0); + m_int_configs[CONFIG_GAME_TYPE] = sConfigMgr->GetIntDefault("GameType", 0); if (reload) { - uint32 val = ConfigMgr::GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); + uint32 val = sConfigMgr->GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); if (val != m_int_configs[CONFIG_REALM_ZONE]) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "RealmZone option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_REALM_ZONE]); } else - m_int_configs[CONFIG_REALM_ZONE] = ConfigMgr::GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); - - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR]= ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Calendar", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Channel", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Group", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Guild", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Auction", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = ConfigMgr::GetBoolDefault("AllowTwoSide.trade", false); - m_int_configs[CONFIG_STRICT_PLAYER_NAMES] = ConfigMgr::GetIntDefault ("StrictPlayerNames", 0); - m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = ConfigMgr::GetIntDefault ("StrictCharterNames", 0); - m_int_configs[CONFIG_STRICT_PET_NAMES] = ConfigMgr::GetIntDefault ("StrictPetNames", 0); - - m_int_configs[CONFIG_MIN_PLAYER_NAME] = ConfigMgr::GetIntDefault ("MinPlayerName", 2); + m_int_configs[CONFIG_REALM_ZONE] = sConfigMgr->GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); + + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR]= sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Calendar", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Channel", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Group", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Guild", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Auction", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfigMgr->GetBoolDefault("AllowTwoSide.trade", false); + m_int_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfigMgr->GetIntDefault ("StrictPlayerNames", 0); + m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfigMgr->GetIntDefault ("StrictCharterNames", 0); + m_int_configs[CONFIG_STRICT_PET_NAMES] = sConfigMgr->GetIntDefault ("StrictPetNames", 0); + + m_int_configs[CONFIG_MIN_PLAYER_NAME] = sConfigMgr->GetIntDefault ("MinPlayerName", 2); if (m_int_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_int_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MinPlayerName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME); m_int_configs[CONFIG_MIN_PLAYER_NAME] = 2; } - m_int_configs[CONFIG_MIN_CHARTER_NAME] = ConfigMgr::GetIntDefault ("MinCharterName", 2); + m_int_configs[CONFIG_MIN_CHARTER_NAME] = sConfigMgr->GetIntDefault ("MinCharterName", 2); if (m_int_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_int_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MinCharterName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME); m_int_configs[CONFIG_MIN_CHARTER_NAME] = 2; } - m_int_configs[CONFIG_MIN_PET_NAME] = ConfigMgr::GetIntDefault ("MinPetName", 2); + m_int_configs[CONFIG_MIN_PET_NAME] = sConfigMgr->GetIntDefault ("MinPetName", 2); if (m_int_configs[CONFIG_MIN_PET_NAME] < 1 || m_int_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MinPetName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME); m_int_configs[CONFIG_MIN_PET_NAME] = 2; } - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED] = ConfigMgr::GetIntDefault("CharacterCreating.Disabled", 0); - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK] = ConfigMgr::GetIntDefault("CharacterCreating.Disabled.RaceMask", 0); - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK] = ConfigMgr::GetIntDefault("CharacterCreating.Disabled.ClassMask", 0); + m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED] = sConfigMgr->GetIntDefault("CharacterCreating.Disabled", 0); + m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK] = sConfigMgr->GetIntDefault("CharacterCreating.Disabled.RaceMask", 0); + m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK] = sConfigMgr->GetIntDefault("CharacterCreating.Disabled.ClassMask", 0); - m_int_configs[CONFIG_CHARACTERS_PER_REALM] = ConfigMgr::GetIntDefault("CharactersPerRealm", 10); + m_int_configs[CONFIG_CHARACTERS_PER_REALM] = sConfigMgr->GetIntDefault("CharactersPerRealm", 10); if (m_int_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_int_configs[CONFIG_CHARACTERS_PER_REALM] > 10) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "CharactersPerRealm (%i) must be in range 1..10. Set to 10.", m_int_configs[CONFIG_CHARACTERS_PER_REALM]); @@ -697,23 +697,23 @@ void World::LoadConfigSettings(bool reload) } // must be after CONFIG_CHARACTERS_PER_REALM - m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = ConfigMgr::GetIntDefault("CharactersPerAccount", 50); + m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfigMgr->GetIntDefault("CharactersPerAccount", 50); if (m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_int_configs[CONFIG_CHARACTERS_PER_REALM]) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]); m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = m_int_configs[CONFIG_CHARACTERS_PER_REALM]; } - m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = ConfigMgr::GetIntDefault("HeroicCharactersPerRealm", 1); + m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfigMgr->GetIntDefault("HeroicCharactersPerRealm", 1); if (int32(m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.", m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]); m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1; } - m_int_configs[CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER] = ConfigMgr::GetIntDefault("CharacterCreating.MinLevelForHeroicCharacter", 55); + m_int_configs[CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER] = sConfigMgr->GetIntDefault("CharacterCreating.MinLevelForHeroicCharacter", 55); - m_int_configs[CONFIG_SKIP_CINEMATICS] = ConfigMgr::GetIntDefault("SkipCinematics", 0); + m_int_configs[CONFIG_SKIP_CINEMATICS] = sConfigMgr->GetIntDefault("SkipCinematics", 0); if (int32(m_int_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_int_configs[CONFIG_SKIP_CINEMATICS] > 2) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "SkipCinematics (%i) must be in range 0..2. Set to 0.", m_int_configs[CONFIG_SKIP_CINEMATICS]); @@ -722,12 +722,12 @@ void World::LoadConfigSettings(bool reload) if (reload) { - uint32 val = ConfigMgr::GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); + uint32 val = sConfigMgr->GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); if (val != m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MaxPlayerLevel option can't be changed at config reload, using current value (%u).", m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); } else - m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); + m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); if (m_int_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL) { @@ -735,9 +735,9 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = MAX_LEVEL; } - m_int_configs[CONFIG_MIN_DUALSPEC_LEVEL] = ConfigMgr::GetIntDefault("MinDualSpecLevel", 40); + m_int_configs[CONFIG_MIN_DUALSPEC_LEVEL] = sConfigMgr->GetIntDefault("MinDualSpecLevel", 40); - m_int_configs[CONFIG_START_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("StartPlayerLevel", 1); + m_int_configs[CONFIG_START_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("StartPlayerLevel", 1); if (m_int_configs[CONFIG_START_PLAYER_LEVEL] < 1) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); @@ -749,7 +749,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL]; } - m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("StartHeroicPlayerLevel", 55); + m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("StartHeroicPlayerLevel", 55); if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.", @@ -763,7 +763,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL]; } - m_int_configs[CONFIG_START_PLAYER_MONEY] = ConfigMgr::GetIntDefault("StartPlayerMoney", 0); + m_int_configs[CONFIG_START_PLAYER_MONEY] = sConfigMgr->GetIntDefault("StartPlayerMoney", 0); if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); @@ -776,14 +776,14 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT; } - m_int_configs[CONFIG_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("MaxHonorPoints", 75000); + m_int_configs[CONFIG_MAX_HONOR_POINTS] = sConfigMgr->GetIntDefault("MaxHonorPoints", 75000); if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]); m_int_configs[CONFIG_MAX_HONOR_POINTS] = 0; } - m_int_configs[CONFIG_START_HONOR_POINTS] = ConfigMgr::GetIntDefault("StartHonorPoints", 0); + m_int_configs[CONFIG_START_HONOR_POINTS] = sConfigMgr->GetIntDefault("StartHonorPoints", 0); if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.", @@ -797,14 +797,14 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS]; } - m_int_configs[CONFIG_MAX_ARENA_POINTS] = ConfigMgr::GetIntDefault("MaxArenaPoints", 10000); + m_int_configs[CONFIG_MAX_ARENA_POINTS] = sConfigMgr->GetIntDefault("MaxArenaPoints", 10000); if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MaxArenaPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]); m_int_configs[CONFIG_MAX_ARENA_POINTS] = 0; } - m_int_configs[CONFIG_START_ARENA_POINTS] = ConfigMgr::GetIntDefault("StartArenaPoints", 0); + m_int_configs[CONFIG_START_ARENA_POINTS] = sConfigMgr->GetIntDefault("StartArenaPoints", 0); if (int32(m_int_configs[CONFIG_START_ARENA_POINTS]) < 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.", @@ -818,7 +818,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_ARENA_POINTS] = m_int_configs[CONFIG_MAX_ARENA_POINTS]; } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("RecruitAFriend.MaxLevel", 60); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxLevel", 60); if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.", @@ -826,33 +826,33 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60; } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = ConfigMgr::GetIntDefault("RecruitAFriend.MaxDifference", 4); - m_bool_configs[CONFIG_ALL_TAXI_PATHS] = ConfigMgr::GetBoolDefault("AllFlightPaths", false); - m_bool_configs[CONFIG_INSTANT_TAXI] = ConfigMgr::GetBoolDefault("InstantFlightPaths", false); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxDifference", 4); + m_bool_configs[CONFIG_ALL_TAXI_PATHS] = sConfigMgr->GetBoolDefault("AllFlightPaths", false); + m_bool_configs[CONFIG_INSTANT_TAXI] = sConfigMgr->GetBoolDefault("InstantFlightPaths", false); - m_bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = ConfigMgr::GetBoolDefault("Instance.IgnoreLevel", false); - m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = ConfigMgr::GetBoolDefault("Instance.IgnoreRaid", false); + m_bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfigMgr->GetBoolDefault("Instance.IgnoreLevel", false); + m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfigMgr->GetBoolDefault("Instance.IgnoreRaid", false); - m_bool_configs[CONFIG_CAST_UNSTUCK] = ConfigMgr::GetBoolDefault("CastUnstuck", true); - m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = ConfigMgr::GetIntDefault("Instance.ResetTimeHour", 4); - m_int_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = ConfigMgr::GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS); + m_bool_configs[CONFIG_CAST_UNSTUCK] = sConfigMgr->GetBoolDefault("CastUnstuck", true); + m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetIntDefault("Instance.ResetTimeHour", 4); + m_int_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfigMgr->GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = ConfigMgr::GetIntDefault("MaxPrimaryTradeSkill", 2); - m_int_configs[CONFIG_MIN_PETITION_SIGNS] = ConfigMgr::GetIntDefault("MinPetitionSigns", 9); + m_int_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfigMgr->GetIntDefault("MaxPrimaryTradeSkill", 2); + m_int_configs[CONFIG_MIN_PETITION_SIGNS] = sConfigMgr->GetIntDefault("MinPetitionSigns", 9); if (m_int_configs[CONFIG_MIN_PETITION_SIGNS] > 9) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MinPetitionSigns (%i) must be in range 0..9. Set to 9.", m_int_configs[CONFIG_MIN_PETITION_SIGNS]); m_int_configs[CONFIG_MIN_PETITION_SIGNS] = 9; } - m_int_configs[CONFIG_GM_LOGIN_STATE] = ConfigMgr::GetIntDefault("GM.LoginState", 2); - m_int_configs[CONFIG_GM_VISIBLE_STATE] = ConfigMgr::GetIntDefault("GM.Visible", 2); - m_int_configs[CONFIG_GM_CHAT] = ConfigMgr::GetIntDefault("GM.Chat", 2); - m_int_configs[CONFIG_GM_WHISPERING_TO] = ConfigMgr::GetIntDefault("GM.WhisperingTo", 2); + m_int_configs[CONFIG_GM_LOGIN_STATE] = sConfigMgr->GetIntDefault("GM.LoginState", 2); + m_int_configs[CONFIG_GM_VISIBLE_STATE] = sConfigMgr->GetIntDefault("GM.Visible", 2); + m_int_configs[CONFIG_GM_CHAT] = sConfigMgr->GetIntDefault("GM.Chat", 2); + m_int_configs[CONFIG_GM_WHISPERING_TO] = sConfigMgr->GetIntDefault("GM.WhisperingTo", 2); - m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = ConfigMgr::GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR); - m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = ConfigMgr::GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR); - m_int_configs[CONFIG_START_GM_LEVEL] = ConfigMgr::GetIntDefault("GM.StartLevel", 1); + m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfigMgr->GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR); + m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfigMgr->GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR); + m_int_configs[CONFIG_START_GM_LEVEL] = sConfigMgr->GetIntDefault("GM.StartLevel", 1); if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL]) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.", @@ -864,15 +864,15 @@ void World::LoadConfigSettings(bool reload) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL); m_int_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL; } - m_bool_configs[CONFIG_ALLOW_GM_GROUP] = ConfigMgr::GetBoolDefault("GM.AllowInvite", false); - m_bool_configs[CONFIG_GM_LOWER_SECURITY] = ConfigMgr::GetBoolDefault("GM.LowerSecurity", false); - m_float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = ConfigMgr::GetFloatDefault("GM.TicketSystem.ChanceOfGMSurvey", 50.0f); + m_bool_configs[CONFIG_ALLOW_GM_GROUP] = sConfigMgr->GetBoolDefault("GM.AllowInvite", false); + m_bool_configs[CONFIG_GM_LOWER_SECURITY] = sConfigMgr->GetBoolDefault("GM.LowerSecurity", false); + m_float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = sConfigMgr->GetFloatDefault("GM.TicketSystem.ChanceOfGMSurvey", 50.0f); - m_int_configs[CONFIG_GROUP_VISIBILITY] = ConfigMgr::GetIntDefault("Visibility.GroupMode", 1); + m_int_configs[CONFIG_GROUP_VISIBILITY] = sConfigMgr->GetIntDefault("Visibility.GroupMode", 1); - m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = ConfigMgr::GetIntDefault("MailDeliveryDelay", HOUR); + m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfigMgr->GetIntDefault("MailDeliveryDelay", HOUR); - m_int_configs[CONFIG_UPTIME_UPDATE] = ConfigMgr::GetIntDefault("UpdateUptimeInterval", 10); + m_int_configs[CONFIG_UPTIME_UPDATE] = sConfigMgr->GetIntDefault("UpdateUptimeInterval", 10); if (int32(m_int_configs[CONFIG_UPTIME_UPDATE]) <= 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "UpdateUptimeInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_UPTIME_UPDATE]); @@ -885,7 +885,7 @@ void World::LoadConfigSettings(bool reload) } // log db cleanup interval - m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = ConfigMgr::GetIntDefault("LogDB.Opt.ClearInterval", 10); + m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfigMgr->GetIntDefault("LogDB.Opt.ClearInterval", 10); if (int32(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "LogDB.Opt.ClearInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]); @@ -896,146 +896,146 @@ void World::LoadConfigSettings(bool reload) m_timers[WUPDATE_CLEANDB].SetInterval(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILLISECONDS); m_timers[WUPDATE_CLEANDB].Reset(); } - m_int_configs[CONFIG_LOGDB_CLEARTIME] = ConfigMgr::GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default + m_int_configs[CONFIG_LOGDB_CLEARTIME] = sConfigMgr->GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Will clear `logs` table of entries older than %i seconds every %u minutes.", m_int_configs[CONFIG_LOGDB_CLEARTIME], m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]); - m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = ConfigMgr::GetIntDefault("SkillChance.Orange", 100); - m_int_configs[CONFIG_SKILL_CHANCE_YELLOW] = ConfigMgr::GetIntDefault("SkillChance.Yellow", 75); - m_int_configs[CONFIG_SKILL_CHANCE_GREEN] = ConfigMgr::GetIntDefault("SkillChance.Green", 25); - m_int_configs[CONFIG_SKILL_CHANCE_GREY] = ConfigMgr::GetIntDefault("SkillChance.Grey", 0); + m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfigMgr->GetIntDefault("SkillChance.Orange", 100); + m_int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfigMgr->GetIntDefault("SkillChance.Yellow", 75); + m_int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfigMgr->GetIntDefault("SkillChance.Green", 25); + m_int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfigMgr->GetIntDefault("SkillChance.Grey", 0); - m_int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = ConfigMgr::GetIntDefault("SkillChance.MiningSteps", 75); - m_int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = ConfigMgr::GetIntDefault("SkillChance.SkinningSteps", 75); + m_int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfigMgr->GetIntDefault("SkillChance.MiningSteps", 75); + m_int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfigMgr->GetIntDefault("SkillChance.SkinningSteps", 75); - m_bool_configs[CONFIG_SKILL_PROSPECTING] = ConfigMgr::GetBoolDefault("SkillChance.Prospecting", false); - m_bool_configs[CONFIG_SKILL_MILLING] = ConfigMgr::GetBoolDefault("SkillChance.Milling", false); + m_bool_configs[CONFIG_SKILL_PROSPECTING] = sConfigMgr->GetBoolDefault("SkillChance.Prospecting", false); + m_bool_configs[CONFIG_SKILL_MILLING] = sConfigMgr->GetBoolDefault("SkillChance.Milling", false); - m_int_configs[CONFIG_SKILL_GAIN_CRAFTING] = ConfigMgr::GetIntDefault("SkillGain.Crafting", 1); + m_int_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfigMgr->GetIntDefault("SkillGain.Crafting", 1); - m_int_configs[CONFIG_SKILL_GAIN_DEFENSE] = ConfigMgr::GetIntDefault("SkillGain.Defense", 1); + m_int_configs[CONFIG_SKILL_GAIN_DEFENSE] = sConfigMgr->GetIntDefault("SkillGain.Defense", 1); - m_int_configs[CONFIG_SKILL_GAIN_GATHERING] = ConfigMgr::GetIntDefault("SkillGain.Gathering", 1); + m_int_configs[CONFIG_SKILL_GAIN_GATHERING] = sConfigMgr->GetIntDefault("SkillGain.Gathering", 1); - m_int_configs[CONFIG_SKILL_GAIN_WEAPON] = ConfigMgr::GetIntDefault("SkillGain.Weapon", 1); + m_int_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfigMgr->GetIntDefault("SkillGain.Weapon", 1); - m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = ConfigMgr::GetIntDefault("MaxOverspeedPings", 2); + m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfigMgr->GetIntDefault("MaxOverspeedPings", 2); if (m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]); m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2; } - m_bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = ConfigMgr::GetBoolDefault("SaveRespawnTimeImmediately", true); - m_bool_configs[CONFIG_WEATHER] = ConfigMgr::GetBoolDefault("ActivateWeather", true); + m_bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfigMgr->GetBoolDefault("SaveRespawnTimeImmediately", true); + m_bool_configs[CONFIG_WEATHER] = sConfigMgr->GetBoolDefault("ActivateWeather", true); - m_int_configs[CONFIG_DISABLE_BREATHING] = ConfigMgr::GetIntDefault("DisableWaterBreath", SEC_CONSOLE); + m_int_configs[CONFIG_DISABLE_BREATHING] = sConfigMgr->GetIntDefault("DisableWaterBreath", SEC_CONSOLE); - m_bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = ConfigMgr::GetBoolDefault("AlwaysMaxSkillForLevel", false); + m_bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = sConfigMgr->GetBoolDefault("AlwaysMaxSkillForLevel", false); if (reload) { - uint32 val = ConfigMgr::GetIntDefault("Expansion", 1); + uint32 val = sConfigMgr->GetIntDefault("Expansion", 1); if (val != m_int_configs[CONFIG_EXPANSION]) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]); } else - m_int_configs[CONFIG_EXPANSION] = ConfigMgr::GetIntDefault("Expansion", 1); + m_int_configs[CONFIG_EXPANSION] = sConfigMgr->GetIntDefault("Expansion", 1); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = ConfigMgr::GetIntDefault("ChatFlood.MessageCount", 10); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = ConfigMgr::GetIntDefault("ChatFlood.MessageDelay", 1); - m_int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = ConfigMgr::GetIntDefault("ChatFlood.MuteTime", 10); + m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfigMgr->GetIntDefault("ChatFlood.MessageCount", 10); + m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfigMgr->GetIntDefault("ChatFlood.MessageDelay", 1); + m_int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfigMgr->GetIntDefault("ChatFlood.MuteTime", 10); - m_bool_configs[CONFIG_EVENT_ANNOUNCE] = ConfigMgr::GetIntDefault("Event.Announce", false); + m_bool_configs[CONFIG_EVENT_ANNOUNCE] = sConfigMgr->GetIntDefault("Event.Announce", false); - m_float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = ConfigMgr::GetFloatDefault("CreatureFamilyFleeAssistanceRadius", 30.0f); - m_float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = ConfigMgr::GetFloatDefault("CreatureFamilyAssistanceRadius", 10.0f); - m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = ConfigMgr::GetIntDefault("CreatureFamilyAssistanceDelay", 1500); - m_int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = ConfigMgr::GetIntDefault("CreatureFamilyFleeDelay", 7000); + m_float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfigMgr->GetFloatDefault("CreatureFamilyFleeAssistanceRadius", 30.0f); + m_float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfigMgr->GetFloatDefault("CreatureFamilyAssistanceRadius", 10.0f); + m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfigMgr->GetIntDefault("CreatureFamilyAssistanceDelay", 1500); + m_int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfigMgr->GetIntDefault("CreatureFamilyFleeDelay", 7000); - m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = ConfigMgr::GetIntDefault("WorldBossLevelDiff", 3); + m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfigMgr->GetIntDefault("WorldBossLevelDiff", 3); // note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100) - m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = ConfigMgr::GetIntDefault("Quests.LowLevelHideDiff", 4); + m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfigMgr->GetIntDefault("Quests.LowLevelHideDiff", 4); if (m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL) m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = MAX_LEVEL; - m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = ConfigMgr::GetIntDefault("Quests.HighLevelHideDiff", 7); + m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfigMgr->GetIntDefault("Quests.HighLevelHideDiff", 7); if (m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL) m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = MAX_LEVEL; - m_bool_configs[CONFIG_QUEST_IGNORE_RAID] = ConfigMgr::GetBoolDefault("Quests.IgnoreRaid", false); - m_bool_configs[CONFIG_QUEST_IGNORE_AUTO_ACCEPT] = ConfigMgr::GetBoolDefault("Quests.IgnoreAutoAccept", false); - m_bool_configs[CONFIG_QUEST_IGNORE_AUTO_COMPLETE] = ConfigMgr::GetBoolDefault("Quests.IgnoreAutoComplete", false); + m_bool_configs[CONFIG_QUEST_IGNORE_RAID] = sConfigMgr->GetBoolDefault("Quests.IgnoreRaid", false); + m_bool_configs[CONFIG_QUEST_IGNORE_AUTO_ACCEPT] = sConfigMgr->GetBoolDefault("Quests.IgnoreAutoAccept", false); + m_bool_configs[CONFIG_QUEST_IGNORE_AUTO_COMPLETE] = sConfigMgr->GetBoolDefault("Quests.IgnoreAutoComplete", false); - m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = ConfigMgr::GetIntDefault("Battleground.Random.ResetHour", 6); + m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfigMgr->GetIntDefault("Battleground.Random.ResetHour", 6); if (m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] > 23) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Battleground.Random.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR]); m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = 6; } - m_int_configs[CONFIG_GUILD_RESET_HOUR] = ConfigMgr::GetIntDefault("Guild.ResetHour", 6); + m_int_configs[CONFIG_GUILD_RESET_HOUR] = sConfigMgr->GetIntDefault("Guild.ResetHour", 6); if (m_int_configs[CONFIG_GUILD_RESET_HOUR] > 23) { TC_LOG_ERROR(LOG_FILTER_GENERAL, "Guild.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_GUILD_RESET_HOUR]); m_int_configs[CONFIG_GUILD_RESET_HOUR] = 6; } - m_bool_configs[CONFIG_DETECT_POS_COLLISION] = ConfigMgr::GetBoolDefault("DetectPosCollision", true); + m_bool_configs[CONFIG_DETECT_POS_COLLISION] = sConfigMgr->GetBoolDefault("DetectPosCollision", true); - m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = ConfigMgr::GetBoolDefault("Channel.RestrictedLfg", true); - m_bool_configs[CONFIG_TALENTS_INSPECTING] = ConfigMgr::GetBoolDefault("TalentsInspecting", true); - m_bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = ConfigMgr::GetBoolDefault("ChatFakeMessagePreventing", false); - m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = ConfigMgr::GetIntDefault("ChatStrictLinkChecking.Severity", 0); - m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = ConfigMgr::GetIntDefault("ChatStrictLinkChecking.Kick", 0); + m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfigMgr->GetBoolDefault("Channel.RestrictedLfg", true); + m_bool_configs[CONFIG_TALENTS_INSPECTING] = sConfigMgr->GetBoolDefault("TalentsInspecting", true); + m_bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfigMgr->GetBoolDefault("ChatFakeMessagePreventing", false); + m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfigMgr->GetIntDefault("ChatStrictLinkChecking.Severity", 0); + m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfigMgr->GetIntDefault("ChatStrictLinkChecking.Kick", 0); - m_int_configs[CONFIG_CORPSE_DECAY_NORMAL] = ConfigMgr::GetIntDefault("Corpse.Decay.NORMAL", 60); - m_int_configs[CONFIG_CORPSE_DECAY_RARE] = ConfigMgr::GetIntDefault("Corpse.Decay.RARE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_ELITE] = ConfigMgr::GetIntDefault("Corpse.Decay.ELITE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = ConfigMgr::GetIntDefault("Corpse.Decay.RAREELITE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = ConfigMgr::GetIntDefault("Corpse.Decay.WORLDBOSS", 3600); + m_int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfigMgr->GetIntDefault("Corpse.Decay.NORMAL", 60); + m_int_configs[CONFIG_CORPSE_DECAY_RARE] = sConfigMgr->GetIntDefault("Corpse.Decay.RARE", 300); + m_int_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfigMgr->GetIntDefault("Corpse.Decay.ELITE", 300); + m_int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfigMgr->GetIntDefault("Corpse.Decay.RAREELITE", 300); + m_int_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = sConfigMgr->GetIntDefault("Corpse.Decay.WORLDBOSS", 3600); - m_int_configs[CONFIG_DEATH_SICKNESS_LEVEL] = ConfigMgr::GetIntDefault ("Death.SicknessLevel", 11); - m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = ConfigMgr::GetBoolDefault("Death.CorpseReclaimDelay.PvP", true); - m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = ConfigMgr::GetBoolDefault("Death.CorpseReclaimDelay.PvE", true); - m_bool_configs[CONFIG_DEATH_BONES_WORLD] = ConfigMgr::GetBoolDefault("Death.Bones.World", true); - m_bool_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = ConfigMgr::GetBoolDefault("Death.Bones.BattlegroundOrArena", true); + m_int_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfigMgr->GetIntDefault ("Death.SicknessLevel", 11); + m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfigMgr->GetBoolDefault("Death.CorpseReclaimDelay.PvP", true); + m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfigMgr->GetBoolDefault("Death.CorpseReclaimDelay.PvE", true); + m_bool_configs[CONFIG_DEATH_BONES_WORLD] = sConfigMgr->GetBoolDefault("Death.Bones.World", true); + m_bool_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfigMgr->GetBoolDefault("Death.Bones.BattlegroundOrArena", true); - m_bool_configs[CONFIG_DIE_COMMAND_MODE] = ConfigMgr::GetBoolDefault("Die.Command.Mode", true); + m_bool_configs[CONFIG_DIE_COMMAND_MODE] = sConfigMgr->GetBoolDefault("Die.Command.Mode", true); - m_float_configs[CONFIG_THREAT_RADIUS] = ConfigMgr::GetFloatDefault("ThreatRadius", 60.0f); + m_float_configs[CONFIG_THREAT_RADIUS] = sConfigMgr->GetFloatDefault("ThreatRadius", 60.0f); // always use declined names in the russian client m_bool_configs[CONFIG_DECLINED_NAMES_USED] = - (m_int_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : ConfigMgr::GetBoolDefault("DeclinedNames", false); - - m_float_configs[CONFIG_LISTEN_RANGE_SAY] = ConfigMgr::GetFloatDefault("ListenRange.Say", 25.0f); - m_float_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = ConfigMgr::GetFloatDefault("ListenRange.TextEmote", 25.0f); - m_float_configs[CONFIG_LISTEN_RANGE_YELL] = ConfigMgr::GetFloatDefault("ListenRange.Yell", 300.0f); - - m_bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = ConfigMgr::GetBoolDefault("Battleground.CastDeserter", true); - m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = ConfigMgr::GetBoolDefault("Battleground.QueueAnnouncer.Enable", false); - m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = ConfigMgr::GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false); - m_int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = ConfigMgr::GetIntDefault ("Battleground.InvitationType", 0); - m_int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = ConfigMgr::GetIntDefault ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = ConfigMgr::GetIntDefault ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS); - m_bool_configs[CONFIG_BG_XP_FOR_KILL] = ConfigMgr::GetBoolDefault("Battleground.GiveXPForKills", false); - m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = ConfigMgr::GetIntDefault ("Arena.MaxRatingDifference", 150); - m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_ARENA_RATED_UPDATE_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatedUpdateTimer", 5 * IN_MILLISECONDS); - m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = ConfigMgr::GetBoolDefault("Arena.AutoDistributePoints", false); - m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = ConfigMgr::GetIntDefault ("Arena.AutoDistributeInterval", 7); - m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = ConfigMgr::GetBoolDefault("Arena.QueueAnnouncer.Enable", false); - m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = ConfigMgr::GetBoolDefault("Arena.QueueAnnouncer.PlayerOnly", false); - m_int_configs[CONFIG_ARENA_SEASON_ID] = ConfigMgr::GetIntDefault ("Arena.ArenaSeason.ID", 1); - m_int_configs[CONFIG_ARENA_START_RATING] = ConfigMgr::GetIntDefault ("Arena.ArenaStartRating", 0); - m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = ConfigMgr::GetIntDefault ("Arena.ArenaStartPersonalRating", 1000); - m_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = ConfigMgr::GetIntDefault ("Arena.ArenaStartMatchmakerRating", 1500); - m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = ConfigMgr::GetBoolDefault("Arena.ArenaSeason.InProgress", true); - m_bool_configs[CONFIG_ARENA_LOG_EXTENDED_INFO] = ConfigMgr::GetBoolDefault("ArenaLog.ExtendedInfo", false); - - m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = ConfigMgr::GetBoolDefault("OffhandCheckAtSpellUnlearn", true); - - if (int32 clientCacheId = ConfigMgr::GetIntDefault("ClientCacheVersion", 0)) + (m_int_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfigMgr->GetBoolDefault("DeclinedNames", false); + + m_float_configs[CONFIG_LISTEN_RANGE_SAY] = sConfigMgr->GetFloatDefault("ListenRange.Say", 25.0f); + m_float_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfigMgr->GetFloatDefault("ListenRange.TextEmote", 25.0f); + m_float_configs[CONFIG_LISTEN_RANGE_YELL] = sConfigMgr->GetFloatDefault("ListenRange.Yell", 300.0f); + + m_bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfigMgr->GetBoolDefault("Battleground.CastDeserter", true); + m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetBoolDefault("Battleground.QueueAnnouncer.Enable", false); + m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false); + m_int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfigMgr->GetIntDefault ("Battleground.InvitationType", 0); + m_int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfigMgr->GetIntDefault ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfigMgr->GetIntDefault ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS); + m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetBoolDefault("Battleground.GiveXPForKills", false); + m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfigMgr->GetIntDefault ("Arena.MaxRatingDifference", 150); + m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfigMgr->GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_ARENA_RATED_UPDATE_TIMER] = sConfigMgr->GetIntDefault ("Arena.RatedUpdateTimer", 5 * IN_MILLISECONDS); + m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfigMgr->GetBoolDefault("Arena.AutoDistributePoints", false); + m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfigMgr->GetIntDefault ("Arena.AutoDistributeInterval", 7); + m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetBoolDefault("Arena.QueueAnnouncer.Enable", false); + m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetBoolDefault("Arena.QueueAnnouncer.PlayerOnly", false); + m_int_configs[CONFIG_ARENA_SEASON_ID] = sConfigMgr->GetIntDefault ("Arena.ArenaSeason.ID", 1); + m_int_configs[CONFIG_ARENA_START_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartRating", 0); + m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartPersonalRating", 1000); + m_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartMatchmakerRating", 1500); + m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetBoolDefault("Arena.ArenaSeason.InProgress", true); + m_bool_configs[CONFIG_ARENA_LOG_EXTENDED_INFO] = sConfigMgr->GetBoolDefault("ArenaLog.ExtendedInfo", false); + + m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetBoolDefault("OffhandCheckAtSpellUnlearn", true); + + if (int32 clientCacheId = sConfigMgr->GetIntDefault("ClientCacheVersion", 0)) { // overwrite DB/old value if (clientCacheId > 0) @@ -1047,15 +1047,15 @@ void World::LoadConfigSettings(bool reload) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "ClientCacheVersion can't be negative %d, ignored.", clientCacheId); } - m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = ConfigMgr::GetIntDefault("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); + m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = sConfigMgr->GetIntDefault("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); if (m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] > GUILD_EVENTLOG_MAX_RECORDS) m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = GUILD_EVENTLOG_MAX_RECORDS; - m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = ConfigMgr::GetIntDefault("Guild.BankEventLogRecordsCount", GUILD_BANKLOG_MAX_RECORDS); + m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = sConfigMgr->GetIntDefault("Guild.BankEventLogRecordsCount", GUILD_BANKLOG_MAX_RECORDS); if (m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] > GUILD_BANKLOG_MAX_RECORDS) m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = GUILD_BANKLOG_MAX_RECORDS; //visibility on continents - m_MaxVisibleDistanceOnContinents = ConfigMgr::GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE); + m_MaxVisibleDistanceOnContinents = sConfigMgr->GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE); if (m_MaxVisibleDistanceOnContinents < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); @@ -1068,7 +1068,7 @@ void World::LoadConfigSettings(bool reload) } //visibility in instances - m_MaxVisibleDistanceInInstances = ConfigMgr::GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); + m_MaxVisibleDistanceInInstances = sConfigMgr->GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); if (m_MaxVisibleDistanceInInstances < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); @@ -1081,7 +1081,7 @@ void World::LoadConfigSettings(bool reload) } //visibility in BG/Arenas - m_MaxVisibleDistanceInBGArenas = ConfigMgr::GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS); + m_MaxVisibleDistanceInBGArenas = sConfigMgr->GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS); if (m_MaxVisibleDistanceInBGArenas < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) { TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "Visibility.Distance.BGArenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); @@ -1093,18 +1093,18 @@ void World::LoadConfigSettings(bool reload) m_MaxVisibleDistanceInBGArenas = MAX_VISIBILITY_DISTANCE; } - m_visibility_notify_periodOnContinents = ConfigMgr::GetIntDefault("Visibility.Notify.Period.OnContinents", DEFAULT_VISIBILITY_NOTIFY_PERIOD); - m_visibility_notify_periodInInstances = ConfigMgr::GetIntDefault("Visibility.Notify.Period.InInstances", DEFAULT_VISIBILITY_NOTIFY_PERIOD); - m_visibility_notify_periodInBGArenas = ConfigMgr::GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_visibility_notify_periodOnContinents = sConfigMgr->GetIntDefault("Visibility.Notify.Period.OnContinents", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_visibility_notify_periodInInstances = sConfigMgr->GetIntDefault("Visibility.Notify.Period.InInstances", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_visibility_notify_periodInBGArenas = sConfigMgr->GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD); ///- Load the CharDelete related config options - m_int_configs[CONFIG_CHARDELETE_METHOD] = ConfigMgr::GetIntDefault("CharDelete.Method", 0); - m_int_configs[CONFIG_CHARDELETE_MIN_LEVEL] = ConfigMgr::GetIntDefault("CharDelete.MinLevel", 0); - m_int_configs[CONFIG_CHARDELETE_HEROIC_MIN_LEVEL] = ConfigMgr::GetIntDefault("CharDelete.Heroic.MinLevel", 0); - m_int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = ConfigMgr::GetIntDefault("CharDelete.KeepDays", 30); + m_int_configs[CONFIG_CHARDELETE_METHOD] = sConfigMgr->GetIntDefault("CharDelete.Method", 0); + m_int_configs[CONFIG_CHARDELETE_MIN_LEVEL] = sConfigMgr->GetIntDefault("CharDelete.MinLevel", 0); + m_int_configs[CONFIG_CHARDELETE_HEROIC_MIN_LEVEL] = sConfigMgr->GetIntDefault("CharDelete.Heroic.MinLevel", 0); + m_int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfigMgr->GetIntDefault("CharDelete.KeepDays", 30); ///- Read the "Data" directory from the config file - std::string dataPath = ConfigMgr::GetStringDefault("DataDir", "./"); + std::string dataPath = sConfigMgr->GetStringDefault("DataDir", "./"); if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\') dataPath.push_back('/'); @@ -1128,13 +1128,13 @@ void World::LoadConfigSettings(bool reload) TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Using DataDir %s", m_dataPath.c_str()); } - m_bool_configs[CONFIG_ENABLE_MMAPS] = ConfigMgr::GetBoolDefault("mmap.enablePathFinding", false); + m_bool_configs[CONFIG_ENABLE_MMAPS] = sConfigMgr->GetBoolDefault("mmap.enablePathFinding", false); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "WORLD: MMap data directory is: %smmaps", m_dataPath.c_str()); - m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", 0); - bool enableIndoor = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", true); - bool enableLOS = ConfigMgr::GetBoolDefault("vmap.enableLOS", true); - bool enableHeight = ConfigMgr::GetBoolDefault("vmap.enableHeight", true); + m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfigMgr->GetBoolDefault("vmap.enableIndoorCheck", 0); + bool enableIndoor = sConfigMgr->GetBoolDefault("vmap.enableIndoorCheck", true); + bool enableLOS = sConfigMgr->GetBoolDefault("vmap.enableLOS", true); + bool enableHeight = sConfigMgr->GetBoolDefault("vmap.enableHeight", true); if (!enableHeight) TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support."); @@ -1144,61 +1144,61 @@ void World::LoadConfigSettings(bool reload) TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "VMap support included. LineOfSight: %i, getHeight: %i, indoorCheck: %i", enableLOS, enableHeight, enableIndoor); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "VMap data directory is: %svmaps", m_dataPath.c_str()); - m_int_configs[CONFIG_MAX_WHO] = ConfigMgr::GetIntDefault("MaxWhoListReturns", 49); - m_bool_configs[CONFIG_START_ALL_SPELLS] = ConfigMgr::GetBoolDefault("PlayerStart.AllSpells", false); + m_int_configs[CONFIG_MAX_WHO] = sConfigMgr->GetIntDefault("MaxWhoListReturns", 49); + m_bool_configs[CONFIG_START_ALL_SPELLS] = sConfigMgr->GetBoolDefault("PlayerStart.AllSpells", false); if (m_bool_configs[CONFIG_START_ALL_SPELLS]) TC_LOG_WARN(LOG_FILTER_SERVER_LOADING, "PlayerStart.AllSpells enabled - may not function as intended!"); - m_int_configs[CONFIG_HONOR_AFTER_DUEL] = ConfigMgr::GetIntDefault("HonorPointsAfterDuel", 0); - m_bool_configs[CONFIG_START_ALL_EXPLORED] = ConfigMgr::GetBoolDefault("PlayerStart.MapsExplored", false); - m_bool_configs[CONFIG_START_ALL_REP] = ConfigMgr::GetBoolDefault("PlayerStart.AllReputation", false); - m_bool_configs[CONFIG_ALWAYS_MAXSKILL] = ConfigMgr::GetBoolDefault("AlwaysMaxWeaponSkill", false); - m_bool_configs[CONFIG_PVP_TOKEN_ENABLE] = ConfigMgr::GetBoolDefault("PvPToken.Enable", false); - m_int_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = ConfigMgr::GetIntDefault("PvPToken.MapAllowType", 4); - m_int_configs[CONFIG_PVP_TOKEN_ID] = ConfigMgr::GetIntDefault("PvPToken.ItemID", 29434); - m_int_configs[CONFIG_PVP_TOKEN_COUNT] = ConfigMgr::GetIntDefault("PvPToken.ItemCount", 1); + m_int_configs[CONFIG_HONOR_AFTER_DUEL] = sConfigMgr->GetIntDefault("HonorPointsAfterDuel", 0); + m_bool_configs[CONFIG_START_ALL_EXPLORED] = sConfigMgr->GetBoolDefault("PlayerStart.MapsExplored", false); + m_bool_configs[CONFIG_START_ALL_REP] = sConfigMgr->GetBoolDefault("PlayerStart.AllReputation", false); + m_bool_configs[CONFIG_ALWAYS_MAXSKILL] = sConfigMgr->GetBoolDefault("AlwaysMaxWeaponSkill", false); + m_bool_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfigMgr->GetBoolDefault("PvPToken.Enable", false); + m_int_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfigMgr->GetIntDefault("PvPToken.MapAllowType", 4); + m_int_configs[CONFIG_PVP_TOKEN_ID] = sConfigMgr->GetIntDefault("PvPToken.ItemID", 29434); + m_int_configs[CONFIG_PVP_TOKEN_COUNT] = sConfigMgr->GetIntDefault("PvPToken.ItemCount", 1); if (m_int_configs[CONFIG_PVP_TOKEN_COUNT] < 1) m_int_configs[CONFIG_PVP_TOKEN_COUNT] = 1; - m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = ConfigMgr::GetBoolDefault("NoResetTalentsCost", false); - m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = ConfigMgr::GetBoolDefault("ShowKickInWorld", false); - m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = ConfigMgr::GetIntDefault("RecordUpdateTimeDiffInterval", 60000); - m_int_configs[CONFIG_MIN_LOG_UPDATE] = ConfigMgr::GetIntDefault("MinRecordUpdateTimeDiff", 100); - m_int_configs[CONFIG_NUMTHREADS] = ConfigMgr::GetIntDefault("MapUpdate.Threads", 1); - m_int_configs[CONFIG_MAX_RESULTS_LOOKUP_COMMANDS] = ConfigMgr::GetIntDefault("Command.LookupMaxResults", 0); + m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfigMgr->GetBoolDefault("NoResetTalentsCost", false); + m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfigMgr->GetBoolDefault("ShowKickInWorld", false); + m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfigMgr->GetIntDefault("RecordUpdateTimeDiffInterval", 60000); + m_int_configs[CONFIG_MIN_LOG_UPDATE] = sConfigMgr->GetIntDefault("MinRecordUpdateTimeDiff", 100); + m_int_configs[CONFIG_NUMTHREADS] = sConfigMgr->GetIntDefault("MapUpdate.Threads", 1); + m_int_configs[CONFIG_MAX_RESULTS_LOOKUP_COMMANDS] = sConfigMgr->GetIntDefault("Command.LookupMaxResults", 0); // chat logging - m_bool_configs[CONFIG_CHATLOG_CHANNEL] = ConfigMgr::GetBoolDefault("ChatLogs.Channel", false); - m_bool_configs[CONFIG_CHATLOG_WHISPER] = ConfigMgr::GetBoolDefault("ChatLogs.Whisper", false); - m_bool_configs[CONFIG_CHATLOG_SYSCHAN] = ConfigMgr::GetBoolDefault("ChatLogs.SysChan", false); - m_bool_configs[CONFIG_CHATLOG_PARTY] = ConfigMgr::GetBoolDefault("ChatLogs.Party", false); - m_bool_configs[CONFIG_CHATLOG_RAID] = ConfigMgr::GetBoolDefault("ChatLogs.Raid", false); - m_bool_configs[CONFIG_CHATLOG_GUILD] = ConfigMgr::GetBoolDefault("ChatLogs.Guild", false); - m_bool_configs[CONFIG_CHATLOG_PUBLIC] = ConfigMgr::GetBoolDefault("ChatLogs.Public", false); - m_bool_configs[CONFIG_CHATLOG_ADDON] = ConfigMgr::GetBoolDefault("ChatLogs.Addon", false); - m_bool_configs[CONFIG_CHATLOG_BGROUND] = ConfigMgr::GetBoolDefault("ChatLogs.Battleground", false); + m_bool_configs[CONFIG_CHATLOG_CHANNEL] = sConfigMgr->GetBoolDefault("ChatLogs.Channel", false); + m_bool_configs[CONFIG_CHATLOG_WHISPER] = sConfigMgr->GetBoolDefault("ChatLogs.Whisper", false); + m_bool_configs[CONFIG_CHATLOG_SYSCHAN] = sConfigMgr->GetBoolDefault("ChatLogs.SysChan", false); + m_bool_configs[CONFIG_CHATLOG_PARTY] = sConfigMgr->GetBoolDefault("ChatLogs.Party", false); + m_bool_configs[CONFIG_CHATLOG_RAID] = sConfigMgr->GetBoolDefault("ChatLogs.Raid", false); + m_bool_configs[CONFIG_CHATLOG_GUILD] = sConfigMgr->GetBoolDefault("ChatLogs.Guild", false); + m_bool_configs[CONFIG_CHATLOG_PUBLIC] = sConfigMgr->GetBoolDefault("ChatLogs.Public", false); + m_bool_configs[CONFIG_CHATLOG_ADDON] = sConfigMgr->GetBoolDefault("ChatLogs.Addon", false); + m_bool_configs[CONFIG_CHATLOG_BGROUND] = sConfigMgr->GetBoolDefault("ChatLogs.Battleground", false); // Warden - m_bool_configs[CONFIG_WARDEN_ENABLED] = ConfigMgr::GetBoolDefault("Warden.Enabled", false); - m_int_configs[CONFIG_WARDEN_NUM_MEM_CHECKS] = ConfigMgr::GetIntDefault("Warden.NumMemChecks", 3); - m_int_configs[CONFIG_WARDEN_NUM_OTHER_CHECKS] = ConfigMgr::GetIntDefault("Warden.NumOtherChecks", 7); - m_int_configs[CONFIG_WARDEN_CLIENT_BAN_DURATION] = ConfigMgr::GetIntDefault("Warden.BanDuration", 86400); - m_int_configs[CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF] = ConfigMgr::GetIntDefault("Warden.ClientCheckHoldOff", 30); - m_int_configs[CONFIG_WARDEN_CLIENT_FAIL_ACTION] = ConfigMgr::GetIntDefault("Warden.ClientCheckFailAction", 0); - m_int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = ConfigMgr::GetIntDefault("Warden.ClientResponseDelay", 600); + m_bool_configs[CONFIG_WARDEN_ENABLED] = sConfigMgr->GetBoolDefault("Warden.Enabled", false); + m_int_configs[CONFIG_WARDEN_NUM_MEM_CHECKS] = sConfigMgr->GetIntDefault("Warden.NumMemChecks", 3); + m_int_configs[CONFIG_WARDEN_NUM_OTHER_CHECKS] = sConfigMgr->GetIntDefault("Warden.NumOtherChecks", 7); + m_int_configs[CONFIG_WARDEN_CLIENT_BAN_DURATION] = sConfigMgr->GetIntDefault("Warden.BanDuration", 86400); + m_int_configs[CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF] = sConfigMgr->GetIntDefault("Warden.ClientCheckHoldOff", 30); + m_int_configs[CONFIG_WARDEN_CLIENT_FAIL_ACTION] = sConfigMgr->GetIntDefault("Warden.ClientCheckFailAction", 0); + m_int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = sConfigMgr->GetIntDefault("Warden.ClientResponseDelay", 600); // Dungeon finder - m_int_configs[CONFIG_LFG_OPTIONSMASK] = ConfigMgr::GetIntDefault("DungeonFinder.OptionsMask", 1); + m_int_configs[CONFIG_LFG_OPTIONSMASK] = sConfigMgr->GetIntDefault("DungeonFinder.OptionsMask", 1); // DBC_ItemAttributes - m_bool_configs[CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES] = ConfigMgr::GetBoolDefault("DBC.EnforceItemAttributes", true); + m_bool_configs[CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES] = sConfigMgr->GetBoolDefault("DBC.EnforceItemAttributes", true); // Max instances per hour - m_int_configs[CONFIG_MAX_INSTANCES_PER_HOUR] = ConfigMgr::GetIntDefault("AccountInstancesPerHour", 5); + m_int_configs[CONFIG_MAX_INSTANCES_PER_HOUR] = sConfigMgr->GetIntDefault("AccountInstancesPerHour", 5); // AutoBroadcast - m_bool_configs[CONFIG_AUTOBROADCAST] = ConfigMgr::GetBoolDefault("AutoBroadcast.On", false); - m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = ConfigMgr::GetIntDefault("AutoBroadcast.Center", 0); - m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = ConfigMgr::GetIntDefault("AutoBroadcast.Timer", 60000); + m_bool_configs[CONFIG_AUTOBROADCAST] = sConfigMgr->GetBoolDefault("AutoBroadcast.On", false); + m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = sConfigMgr->GetIntDefault("AutoBroadcast.Center", 0); + m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = sConfigMgr->GetIntDefault("AutoBroadcast.Timer", 60000); if (reload) { m_timers[WUPDATE_AUTOBROADCAST].SetInterval(m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL]); @@ -1206,28 +1206,28 @@ void World::LoadConfigSettings(bool reload) } // MySQL ping time interval - m_int_configs[CONFIG_DB_PING_INTERVAL] = ConfigMgr::GetIntDefault("MaxPingTime", 30); + m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfigMgr->GetIntDefault("MaxPingTime", 30); // misc - m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true); - m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true); - m_bool_configs[CONFIG_UI_QUESTLEVELS_IN_DIALOGS] = ConfigMgr::GetBoolDefault("UI.ShowQuestLevelsInDialogs", false); + m_bool_configs[CONFIG_PDUMP_NO_PATHS] = sConfigMgr->GetBoolDefault("PlayerDump.DisallowPaths", true); + m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = sConfigMgr->GetBoolDefault("PlayerDump.DisallowOverwrite", true); + m_bool_configs[CONFIG_UI_QUESTLEVELS_IN_DIALOGS] = sConfigMgr->GetBoolDefault("UI.ShowQuestLevelsInDialogs", false); // Wintergrasp battlefield - m_bool_configs[CONFIG_WINTERGRASP_ENABLE] = ConfigMgr::GetBoolDefault("Wintergrasp.Enable", false); - m_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMax", 100); - m_int_configs[CONFIG_WINTERGRASP_PLR_MIN] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMin", 0); - m_int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMinLvl", 77); - m_int_configs[CONFIG_WINTERGRASP_BATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.BattleTimer", 30); - m_int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.NoBattleTimer", 150); - m_int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = ConfigMgr::GetIntDefault("Wintergrasp.CrashRestartTimer", 10); + m_bool_configs[CONFIG_WINTERGRASP_ENABLE] = sConfigMgr->GetBoolDefault("Wintergrasp.Enable", false); + m_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetIntDefault("Wintergrasp.PlayerMax", 100); + m_int_configs[CONFIG_WINTERGRASP_PLR_MIN] = sConfigMgr->GetIntDefault("Wintergrasp.PlayerMin", 0); + m_int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetIntDefault("Wintergrasp.PlayerMinLvl", 77); + m_int_configs[CONFIG_WINTERGRASP_BATTLETIME] = sConfigMgr->GetIntDefault("Wintergrasp.BattleTimer", 30); + m_int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = sConfigMgr->GetIntDefault("Wintergrasp.NoBattleTimer", 150); + m_int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = sConfigMgr->GetIntDefault("Wintergrasp.CrashRestartTimer", 10); // Stats limits - m_bool_configs[CONFIG_STATS_LIMITS_ENABLE] = ConfigMgr::GetBoolDefault("Stats.Limits.Enable", false); - m_float_configs[CONFIG_STATS_LIMITS_DODGE] = ConfigMgr::GetFloatDefault("Stats.Limits.Dodge", 95.0f); - m_float_configs[CONFIG_STATS_LIMITS_PARRY] = ConfigMgr::GetFloatDefault("Stats.Limits.Parry", 95.0f); - m_float_configs[CONFIG_STATS_LIMITS_BLOCK] = ConfigMgr::GetFloatDefault("Stats.Limits.Block", 95.0f); - m_float_configs[CONFIG_STATS_LIMITS_CRIT] = ConfigMgr::GetFloatDefault("Stats.Limits.Crit", 95.0f); + m_bool_configs[CONFIG_STATS_LIMITS_ENABLE] = sConfigMgr->GetBoolDefault("Stats.Limits.Enable", false); + m_float_configs[CONFIG_STATS_LIMITS_DODGE] = sConfigMgr->GetFloatDefault("Stats.Limits.Dodge", 95.0f); + m_float_configs[CONFIG_STATS_LIMITS_PARRY] = sConfigMgr->GetFloatDefault("Stats.Limits.Parry", 95.0f); + m_float_configs[CONFIG_STATS_LIMITS_BLOCK] = sConfigMgr->GetFloatDefault("Stats.Limits.Block", 95.0f); + m_float_configs[CONFIG_STATS_LIMITS_CRIT] = sConfigMgr->GetFloatDefault("Stats.Limits.Crit", 95.0f); // call ScriptMgr if we're reloading the configuration if (reload) @@ -1303,17 +1303,17 @@ void World::SetInitialWorldSettings() LoadDBCStores(m_dataPath); DetectDBCLang(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading spell dbc data corrections..."); - sSpellMgr->LoadDbcDataCorrections(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo store..."); sSpellMgr->LoadSpellInfoStore(); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo corrections..."); + sSpellMgr->LoadSpellInfoCorrections(); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SkillLineAbilityMultiMap Data..."); sSpellMgr->LoadSkillLineAbilityMap(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading spell custom attributes..."); - sSpellMgr->LoadSpellCustomAttr(); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo custom attributes..."); + sSpellMgr->LoadSpellInfoCustomAttributes(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading GameObject models..."); LoadGameObjectModelList(); @@ -1460,8 +1460,8 @@ void World::SetInitialWorldSettings() TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Quest POI"); sObjectMgr->LoadQuestPOI(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Quests Relations..."); - sObjectMgr->LoadQuestRelations(); // must be after quest load + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Quests Starters and Enders..."); + sObjectMgr->LoadQuestStartersAndEnders(); // must be after quest load TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Objects Pooling Data..."); sPoolMgr->LoadFromDB(); @@ -1796,13 +1796,13 @@ void World::SetInitialWorldSettings() TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000)); - if (uint32 realmId = ConfigMgr::GetIntDefault("RealmID", 0)) // 0 reserved for auth + if (uint32 realmId = sConfigMgr->GetIntDefault("RealmID", 0)) // 0 reserved for auth sLog->SetRealmId(realmId); } void World::DetectDBCLang() { - uint8 m_lang_confid = ConfigMgr::GetIntDefault("DBC.Locale", 255); + uint8 m_lang_confid = sConfigMgr->GetIntDefault("DBC.Locale", 255); if (m_lang_confid != 255 && m_lang_confid >= TOTAL_LOCALES) { @@ -1876,7 +1876,7 @@ void World::LoadAutobroadcasts() m_Autobroadcasts.clear(); m_AutobroadcastsWeights.clear(); - uint32 realmId = ConfigMgr::GetIntDefault("RealmID", 0); + uint32 realmId = sConfigMgr->GetIntDefault("RealmID", 0); PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_AUTOBROADCAST); stmt->setInt32(0, realmId); PreparedQueryResult result = LoginDatabase.Query(stmt); diff --git a/src/server/scripts/Commands/cs_arena.cpp b/src/server/scripts/Commands/cs_arena.cpp index b631bab0764..4dbdab25747 100644 --- a/src/server/scripts/Commands/cs_arena.cpp +++ b/src/server/scripts/Commands/cs_arena.cpp @@ -70,9 +70,11 @@ public: char* name = handler->extractQuotedArg(tailStr); if (!name) return false; + char* typeStr = strtok(NULL, ""); if (!typeStr) return false; + int8 type = atoi(typeStr); if (sArenaTeamMgr->GetArenaTeamByName(name)) { @@ -90,18 +92,18 @@ public: return false; } - ArenaTeam* Arena = new ArenaTeam(); + ArenaTeam* arena = new ArenaTeam(); - if (!Arena->Create(target->GetGUID(), type, name, 4293102085, 101, 4293253939, 4, 4284049911)) + if (!arena->Create(target->GetGUID(), type, name, 4293102085, 101, 4293253939, 4, 4284049911)) { - delete Arena; + delete arena; handler->SendSysMessage(LANG_BAD_VALUE); handler->SetSentErrorMessage(true); return false; } - sArenaTeamMgr->AddArenaTeam(Arena); - handler->PSendSysMessage(LANG_ARENA_CREATE, Arena->GetName().c_str(), Arena->GetId(), Arena->GetType(), Arena->GetCaptain()); + sArenaTeamMgr->AddArenaTeam(arena); + handler->PSendSysMessage(LANG_ARENA_CREATE, arena->GetName().c_str(), arena->GetId(), arena->GetType(), arena->GetCaptain()); } else { @@ -109,6 +111,7 @@ public: handler->SetSentErrorMessage(true); return false; } + return true; } @@ -121,29 +124,32 @@ public: if (!teamId) return false; - ArenaTeam* Arena = sArenaTeamMgr->GetArenaTeamById(teamId); + ArenaTeam* arena = sArenaTeamMgr->GetArenaTeamById(teamId); - if (!Arena) + if (!arena) { handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_FOUND, teamId); handler->SetSentErrorMessage(true); return false; } - if (Arena->IsFighting()) + if (arena->IsFighting()) { handler->SendSysMessage(LANG_ARENA_ERROR_COMBAT); handler->SetSentErrorMessage(true); return false; } - std::string name = Arena->GetName(); - Arena->Disband(); + + std::string name = arena->GetName(); + arena->Disband(); if (handler->GetSession()) TC_LOG_DEBUG(LOG_FILTER_ARENAS, "GameMaster: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), Arena->GetType(), teamId); + handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), arena->GetType(), teamId); else - TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: disbanded arena team type: %u [Id: %u].", Arena->GetType(), teamId); - delete(Arena); + TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: disbanded arena team type: %u [Id: %u].", arena->GetType(), teamId); + + delete(arena); + handler->PSendSysMessage(LANG_ARENA_DISBAND, name.c_str(), teamId); return true; } @@ -171,8 +177,8 @@ public: return false; } - ArenaTeam* Arena = sArenaTeamMgr->GetArenaTeamByName(oldArenaStr); - if (!Arena) + ArenaTeam* arena = sArenaTeamMgr->GetArenaTeamByName(oldArenaStr); + if (!arena) { handler->PSendSysMessage(LANG_AREAN_ERROR_NAME_NOT_FOUND, oldArenaStr); handler->SetSentErrorMessage(true); @@ -186,25 +192,27 @@ public: return false; } - if (Arena->IsFighting()) + if (arena->IsFighting()) { handler->SendSysMessage(LANG_ARENA_ERROR_COMBAT); handler->SetSentErrorMessage(true); return false; } - if (!Arena->SetName(newArenaStr)) + if (!arena->SetName(newArenaStr)) { handler->SendSysMessage(LANG_BAD_VALUE); handler->SetSentErrorMessage(true); return false; } - handler->PSendSysMessage(LANG_ARENA_RENAME, Arena->GetId(), oldArenaStr, newArenaStr); + + handler->PSendSysMessage(LANG_ARENA_RENAME, arena->GetId(), oldArenaStr, newArenaStr); if (handler->GetSession()) TC_LOG_DEBUG(LOG_FILTER_ARENAS, "GameMaster: %s [GUID: %u] rename arena team \"%s\"[Id: %u] to \"%s\"", - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), oldArenaStr, Arena->GetId(), newArenaStr); + handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), oldArenaStr, arena->GetId(), newArenaStr); else - TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: rename arena team \"%s\"[Id: %u] to \"%s\"", oldArenaStr, Arena->GetId(), newArenaStr); + TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: rename arena team \"%s\"[Id: %u] to \"%s\"", oldArenaStr, arena->GetId(), newArenaStr); + return true; } @@ -228,9 +236,9 @@ public: if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid)) return false; - ArenaTeam* Arena = sArenaTeamMgr->GetArenaTeamById(teamId); + ArenaTeam* arena = sArenaTeamMgr->GetArenaTeamById(teamId); - if (!Arena) + if (!arena) { handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_FOUND, teamId); handler->SetSentErrorMessage(true); @@ -244,36 +252,44 @@ public: return false; } - if (Arena->IsFighting()) + if (arena->IsFighting()) { handler->SendSysMessage(LANG_ARENA_ERROR_COMBAT); handler->SetSentErrorMessage(true); return false; } - if (!Arena->IsMember(targetGuid)) + if (!arena->IsMember(targetGuid)) + { + handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_MEMBER, nameStr, arena->GetName().c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + if (arena->GetCaptain() == targetGuid) { - handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_MEMBER, nameStr, Arena->GetName().c_str()); + handler->PSendSysMessage(LANG_ARENA_ERROR_CAPTAIN, nameStr, arena->GetName().c_str()); handler->SetSentErrorMessage(true); return false; } - if (Arena->GetCaptain() == targetGuid) + arena->SetCaptain(targetGuid); + + CharacterNameData const* oldCaptainNameData = sWorld->GetCharacterNameData(GUID_LOPART(arena->GetCaptain())); + if (!oldCaptainNameData) { - handler->PSendSysMessage(LANG_ARENA_ERROR_CAPTAIN, nameStr, Arena->GetName().c_str()); handler->SetSentErrorMessage(true); return false; } - Player* oldCaptain = sObjectMgr->GetPlayerByLowGUID(Arena->GetCaptain()); - Arena->SetCaptain(targetGuid); - handler->PSendSysMessage(LANG_ARENA_CAPTAIN, Arena->GetName().c_str(), Arena->GetId(), oldCaptain->GetName().c_str(), target->GetName().c_str()); + handler->PSendSysMessage(LANG_ARENA_CAPTAIN, arena->GetName().c_str(), arena->GetId(), oldCaptainNameData->m_name.c_str(), target->GetName().c_str()); if (handler->GetSession()) TC_LOG_DEBUG(LOG_FILTER_ARENAS, "GameMaster: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team \"%s\"[Id: %u]", - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), target->GetName().c_str(), target->GetGUIDLow(), Arena->GetName().c_str(), Arena->GetId()); + handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), target->GetName().c_str(), target->GetGUIDLow(), arena->GetName().c_str(), arena->GetId()); else TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: promoted player: %s [GUID: %u] to leader of arena team \"%s\"[Id: %u]", - target->GetName().c_str(), target->GetGUIDLow(), Arena->GetName().c_str(), Arena->GetId()); + target->GetName().c_str(), target->GetGUIDLow(), arena->GetName().c_str(), arena->GetId()); + return true; } @@ -286,20 +302,19 @@ public: if (!teamId) return false; - ArenaTeam* Arena = sArenaTeamMgr->GetArenaTeamById(teamId); + ArenaTeam* arena = sArenaTeamMgr->GetArenaTeamById(teamId); - if (!Arena) + if (!arena) { handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_FOUND, teamId); handler->SetSentErrorMessage(true); return false; } - handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, Arena->GetName().c_str(), Arena->GetId(), Arena->GetRating(), Arena->GetType(), Arena->GetType()); - for (ArenaTeam::MemberList::iterator itr = Arena->m_membersBegin(); itr != Arena->m_membersEnd(); ++itr) - { - handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr->Name.c_str(), GUID_LOPART(itr->Guid), itr->PersonalRating, (Arena->GetCaptain() == itr->Guid ? "- Captain" : "")); - } + handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, arena->GetName().c_str(), arena->GetId(), arena->GetRating(), arena->GetType(), arena->GetType()); + for (ArenaTeam::MemberList::iterator itr = arena->m_membersBegin(); itr != arena->m_membersEnd(); ++itr) + handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr->Name.c_str(), GUID_LOPART(itr->Guid), itr->PersonalRating, (arena->GetCaptain() == itr->Guid ? "- Captain" : "")); + return true; } @@ -320,17 +335,16 @@ public: ArenaTeamMgr::ArenaTeamContainer::const_iterator i = sArenaTeamMgr->GetArenaTeamMapBegin(); for (; i != sArenaTeamMgr->GetArenaTeamMapEnd(); ++i) { - ArenaTeam* Arena = i->second; + ArenaTeam* arena = i->second; - if (Utf8FitTo(Arena->GetName(), wnamepart)) + if (Utf8FitTo(arena->GetName(), wnamepart)) { if (handler->GetSession()) - handler->PSendSysMessage(LANG_ARENA_LOOKUP, Arena->GetName().c_str(), Arena->GetId(), Arena->GetType(), Arena->GetType()); - - if (!found) - found = true; - - continue; + { + handler->PSendSysMessage(LANG_ARENA_LOOKUP, arena->GetName().c_str(), arena->GetId(), arena->GetType(), arena->GetType()); + found = true; + continue; + } } } diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 8bcf13c2f98..7a49fc2d191 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -281,7 +281,7 @@ public: if (name.empty()) continue; - char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index ? handler->GetTrinityString(LANG_ACTIVE) : ""; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index fc7f1fac352..f6ee0faaa31 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -258,7 +258,7 @@ public: if (!unit || (unit->GetTypeId() != TYPEID_PLAYER)) player = handler->GetSession()->GetPlayer(); else - player = (Player*)unit; + player = unit->ToPlayer(); if (!unit) unit = player; diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 18dee2ea324..8ae2e7b4dfb 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -279,8 +279,8 @@ public: bool found = false; float x, y, z, o; - uint32 guidLow, id; - uint16 mapId, phase; + uint32 guidLow, id, phase; + uint16 mapId; uint32 poolId; do @@ -293,7 +293,7 @@ public: z = fields[4].GetFloat(); o = fields[5].GetFloat(); mapId = fields[6].GetUInt16(); - phase = fields[7].GetUInt16(); + phase = fields[7].GetUInt32(); poolId = sPoolMgr->IsPartOfAPool<GameObject>(guidLow); if (!poolId || sPoolMgr->IsSpawnedObject<GameObject>(guidLow)) found = true; diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp index 9732e2557e9..75c7fcf71e2 100644 --- a/src/server/scripts/Commands/cs_honor.cpp +++ b/src/server/scripts/Commands/cs_honor.cpp @@ -90,8 +90,9 @@ public: } // check online security - if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity((Player*)target, 0)) - return false; + if (Player* player = target->ToPlayer()) + if (handler->HasLowerSecurity(player, 0)) + return false; handler->GetSession()->GetPlayer()->RewardHonor(target, 1); return true; diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 09060e2e01b..baebc3d0bd5 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -116,8 +116,7 @@ public: else targetPlayer->learnSpell(spell, false); - uint32 firstSpell = sSpellMgr->GetFirstSpellInChain(spell); - if (GetTalentSpellCost(firstSpell)) + if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id)) targetPlayer->SendTalentsInfoData(false); return true; @@ -178,8 +177,7 @@ public: continue; // skip spells with first rank learned as talent (and all talents then also) - uint32 firstRank = sSpellMgr->GetFirstSpellInChain(spellInfo->Id); - if (GetTalentSpellCost(firstRank) > 0) + if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id) > 0) continue; // skip broken spells @@ -493,7 +491,7 @@ public: } if (allRanks) - spellId = sSpellMgr->GetFirstSpellInChain (spellId); + spellId = sSpellMgr->GetFirstSpellInChain(spellId); if (target->HasSpell(spellId)) target->removeSpell(spellId, false, !allRanks); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 4e1427dabd2..6c7e8386bdf 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -655,11 +655,9 @@ public: return false; } - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (handler->HasLowerSecurity((Player*)target, 0, false)) + if (Player* player = target->ToPlayer()) + if (handler->HasLowerSecurity(player, 0, false)) return false; - } if (target->IsAlive()) { @@ -1589,6 +1587,7 @@ public: // Guild data print variables defined so that they exist, but are not necessarily used uint32 guildId = 0; + uint8 guildRankId = 0; std::string guildName; std::string guildRank; std::string note; @@ -1755,8 +1754,9 @@ public: guildId = fields[0].GetUInt32(); guildName = fields[1].GetString(); guildRank = fields[2].GetString(); - note = fields[3].GetString(); - officeNote = fields[4].GetString(); + guildRankId = fields[3].GetUInt8(); + note = fields[4].GetString(); + officeNote = fields[5].GetString(); } } } @@ -1765,7 +1765,7 @@ public: // Output I. LANG_PINFO_PLAYER handler->PSendSysMessage(LANG_PINFO_PLAYER, target ? "" : handler->GetTrinityString(LANG_OFFLINE), nameLink.c_str(), lowguid); - // Output II. LANG_PINFO_GM_ACTIVE + // Output II. LANG_PINFO_GM_ACTIVE if character is gamemaster if (target && target->IsGameMaster()) handler->PSendSysMessage(LANG_PINFO_GM_ACTIVE); @@ -1832,7 +1832,7 @@ public: if (!guildName.empty()) { handler->PSendSysMessage(LANG_PINFO_CHR_GUILD, guildName.c_str(), guildId); - handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_RANK, guildRank.c_str()); + handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_RANK, guildRank.c_str(), uint32(guildRankId)); if (!note.empty()) handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_NOTE, note.c_str()); if (!officeNote.empty()) @@ -2227,11 +2227,9 @@ public: return false; } - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (handler->HasLowerSecurity((Player*)target, 0, false)) + if (Player* player = target->ToPlayer()) + if (handler->HasLowerSecurity(player, 0, false)) return false; - } if (!target->IsAlive()) return true; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 939075690c9..f708acc3dee 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -41,7 +41,7 @@ struct NpcFlagText #define NPCFLAG_COUNT 24 -const NpcFlagText npcFlagTexts[NPCFLAG_COUNT] = +NpcFlagText const npcFlagTexts[NPCFLAG_COUNT] = { { UNIT_NPC_FLAG_AUCTIONEER, LANG_NPCINFO_AUCTIONEER }, { UNIT_NPC_FLAG_BANKER, LANG_NPCINFO_BANKER }, @@ -69,6 +69,91 @@ const NpcFlagText npcFlagTexts[NPCFLAG_COUNT] = { UNIT_NPC_FLAG_VENDOR_REAGENT, LANG_NPCINFO_VENDOR_REAGENT } }; +struct MechanicImmune +{ + uint32 flag; + char const* text; +}; + +MechanicImmune const mechanicImmunes[MAX_MECHANIC] = +{ + { MECHANIC_NONE , "MECHANIC_NONE" }, + { MECHANIC_CHARM , "MECHANIC_CHARM" }, + { MECHANIC_DISORIENTED , "MECHANIC_DISORIENTED" }, + { MECHANIC_DISARM , "MECHANIC_DISARM" }, + { MECHANIC_DISTRACT , "MECHANIC_DISTRACT" }, + { MECHANIC_FEAR , "MECHANIC_FEAR" }, + { MECHANIC_GRIP , "MECHANIC_GRIP" }, + { MECHANIC_ROOT , "MECHANIC_ROOT" }, + { MECHANIC_SLOW_ATTACK , "MECHANIC_SLOW_ATTACK" }, + { MECHANIC_SILENCE , "MECHANIC_SILENCE" }, + { MECHANIC_SLEEP , "MECHANIC_SLEEP" }, + { MECHANIC_SNARE , "MECHANIC_SNARE" }, + { MECHANIC_STUN , "MECHANIC_STUN" }, + { MECHANIC_FREEZE , "MECHANIC_FREEZE" }, + { MECHANIC_KNOCKOUT , "MECHANIC_KNOCKOUT" }, + { MECHANIC_BLEED , "MECHANIC_BLEED" }, + { MECHANIC_BANDAGE , "MECHANIC_BANDAGE" }, + { MECHANIC_POLYMORPH , "MECHANIC_POLYMORPH" }, + { MECHANIC_BANISH , "MECHANIC_BANISH" }, + { MECHANIC_SHIELD , "MECHANIC_SHIELD" }, + { MECHANIC_SHACKLE , "MECHANIC_SHACKLE" }, + { MECHANIC_MOUNT , "MECHANIC_MOUNT" }, + { MECHANIC_INFECTED , "MECHANIC_INFECTED" }, + { MECHANIC_TURN , "MECHANIC_TURN" }, + { MECHANIC_HORROR , "MECHANIC_HORROR" }, + { MECHANIC_INVULNERABILITY , "MECHANIC_INVULNERABILITY" }, + { MECHANIC_INTERRUPT , "MECHANIC_INTERRUPT" }, + { MECHANIC_DAZE , "MECHANIC_DAZE" }, + { MECHANIC_DISCOVERY , "MECHANIC_DISCOVERY" }, + { MECHANIC_IMMUNE_SHIELD , "MECHANIC_IMMUNE_SHIELD" }, + { MECHANIC_SAPPED , "MECHANIC_SAPPED" }, + { MECHANIC_ENRAGED , "MECHANIC_ENRAGED" } +}; + + +struct UnitFlag +{ + uint32 flag; + char const* text; +}; + +UnitFlag const unitFlags[MAX_UNIT_FLAGS] = +{ + { UNIT_FLAG_SERVER_CONTROLLED , "UNIT_FLAG_SERVER_CONTROLLED" }, + { UNIT_FLAG_NON_ATTACKABLE , "UNIT_FLAG_NON_ATTACKABLE" }, + { UNIT_FLAG_DISABLE_MOVE , "UNIT_FLAG_DISABLE_MOVE" }, + { UNIT_FLAG_PVP_ATTACKABLE , "UNIT_FLAG_PVP_ATTACKABLE" }, + { UNIT_FLAG_RENAME , "UNIT_FLAG_RENAME" }, + { UNIT_FLAG_PREPARATION , "UNIT_FLAG_PREPARATION" }, + { UNIT_FLAG_UNK_6 , "UNIT_FLAG_UNK_6" }, + { UNIT_FLAG_NOT_ATTACKABLE_1 , "UNIT_FLAG_NOT_ATTACKABLE_1" }, + { UNIT_FLAG_IMMUNE_TO_PC , "UNIT_FLAG_IMMUNE_TO_PC" }, + { UNIT_FLAG_IMMUNE_TO_NPC , "UNIT_FLAG_IMMUNE_TO_NPC" }, + { UNIT_FLAG_LOOTING , "UNIT_FLAG_LOOTING" }, + { UNIT_FLAG_PET_IN_COMBAT , "UNIT_FLAG_PET_IN_COMBAT" }, + { UNIT_FLAG_PVP , "UNIT_FLAG_PVP" }, + { UNIT_FLAG_SILENCED , "UNIT_FLAG_SILENCED" }, + { UNIT_FLAG_UNK_14 , "UNIT_FLAG_UNK_14" }, + { UNIT_FLAG_UNK_15 , "UNIT_FLAG_UNK_15" }, + { UNIT_FLAG_UNK_16 , "UNIT_FLAG_UNK_16" }, + { UNIT_FLAG_PACIFIED , "UNIT_FLAG_PACIFIED" }, + { UNIT_FLAG_STUNNED , "UNIT_FLAG_STUNNED" }, + { UNIT_FLAG_IN_COMBAT , "UNIT_FLAG_IN_COMBAT" }, + { UNIT_FLAG_TAXI_FLIGHT , "UNIT_FLAG_TAXI_FLIGHT" }, + { UNIT_FLAG_DISARMED , "UNIT_FLAG_DISARMED" }, + { UNIT_FLAG_CONFUSED , "UNIT_FLAG_CONFUSED" }, + { UNIT_FLAG_FLEEING , "UNIT_FLAG_FLEEING" }, + { UNIT_FLAG_PLAYER_CONTROLLED , "UNIT_FLAG_PLAYER_CONTROLLED" }, + { UNIT_FLAG_NOT_SELECTABLE , "UNIT_FLAG_NOT_SELECTABLE" }, + { UNIT_FLAG_SKINNABLE , "UNIT_FLAG_SKINNABLE" }, + { UNIT_FLAG_MOUNT , "UNIT_FLAG_MOUNT" }, + { UNIT_FLAG_UNK_28 , "UNIT_FLAG_UNK_28" }, + { UNIT_FLAG_UNK_29 , "UNIT_FLAG_UNK_29" }, + { UNIT_FLAG_SHEATHE , "UNIT_FLAG_SHEATHE" }, + { UNIT_FLAG_UNK_31 , "UNIT_FLAG_UNK_31" } +}; + class npc_commandscript : public CommandScript { public: @@ -630,12 +715,14 @@ public: return false; } + CreatureTemplate const* cInfo = target->GetCreatureTemplate(); + uint32 faction = target->getFaction(); uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS); + uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask; uint32 displayid = target->GetDisplayId(); uint32 nativeid = target->GetNativeDisplayId(); uint32 Entry = target->GetEntry(); - CreatureTemplate const* cInfo = target->GetCreatureTemplate(); int64 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL); if (curRespawnDelay < 0) @@ -647,7 +734,13 @@ public: handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel()); handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId()); handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); - handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_FIELD_FLAGS_2), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction()); + + handler->PSendSysMessage(LANG_NPCINFO_UNIT_FIELD_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS)); + for (uint8 i = 0; i < MAX_UNIT_FLAGS; ++i) + if (target->GetUInt32Value(UNIT_FIELD_FLAGS) & unitFlags[i].flag) + handler->PSendSysMessage(unitFlags[i].text, unitFlags[i].flag); + + handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS_2), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction()); handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str()); handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId); handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId()); @@ -660,6 +753,11 @@ public: if (npcflags & npcFlagTexts[i].flag) handler->PSendSysMessage(npcFlagTexts[i].text, npcFlagTexts[i].flag); + handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask); + for (uint8 i = 0; i < MAX_MECHANIC; ++i) + if ((mechanicImmuneMask << 1) & mechanicImmunes[i].flag) + handler->PSendSysMessage(mechanicImmunes[i].text, mechanicImmunes[i].flag); + return true; } diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 5351f3edda0..829152b7fa7 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -82,11 +82,11 @@ public: { "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL }, { "creature_ai_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventAIScriptsCommand, "", NULL }, { "creature_ai_texts", SEC_ADMINISTRATOR, true, &HandleReloadEventAITextsCommand, "", NULL }, - { "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL }, + { "creature_questender", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestEnderCommand, "", NULL }, { "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL }, { "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, { "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &HandleReloadOnKillReputationCommand, "", NULL }, - { "creature_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestRelationsCommand, "", NULL }, + { "creature_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestStarterCommand, "", NULL }, { "creature_summon_groups", SEC_ADMINISTRATOR, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL }, { "creature_template", SEC_ADMINISTRATOR, true, &HandleReloadCreatureTemplateCommand, "", NULL }, //{ "db_script_string", SEC_ADMINISTRATOR, true, &HandleReloadDbScriptStringCommand, "", NULL }, @@ -96,9 +96,9 @@ public: { "fishing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesFishingCommand, "", NULL }, { "game_graveyard_zone", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardZoneCommand, "", NULL }, { "game_tele", SEC_ADMINISTRATOR, true, &HandleReloadGameTeleCommand, "", NULL }, - { "gameobject_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestInvRelationsCommand, "", NULL }, + { "gameobject_questender", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestEnderCommand, "", NULL }, { "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, - { "gameobject_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestRelationsCommand, "", NULL }, + { "gameobject_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestStarterCommand, "", NULL }, { "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL }, { "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL }, { "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, @@ -249,8 +249,8 @@ public: HandleReloadQuestTemplateCommand(handler, "a"); TC_LOG_INFO(LOG_FILTER_GENERAL, "Re-Loading Quests Relations..."); - sObjectMgr->LoadQuestRelations(); - handler->SendGlobalGMSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded."); + sObjectMgr->LoadQuestStartersAndEnders(); + handler->SendGlobalGMSysMessage("DB tables `*_queststarter` and `*_questender` reloaded."); return true; } @@ -532,11 +532,11 @@ public: return true; } - static bool HandleReloadCreatureQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadCreatureQuestStarterCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_questrelation`)"); - sObjectMgr->LoadCreatureQuestRelations(); - handler->SendGlobalGMSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_queststarter`)"); + sObjectMgr->LoadCreatureQuestStarters(); + handler->SendGlobalGMSysMessage("DB table `creature_queststarter` reloaded."); return true; } @@ -548,11 +548,11 @@ public: return true; } - static bool HandleReloadCreatureQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadCreatureQuestEnderCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_involvedrelation`)"); - sObjectMgr->LoadCreatureInvolvedRelations(); - handler->SendGlobalGMSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_questender`)"); + sObjectMgr->LoadCreatureQuestEnders(); + handler->SendGlobalGMSysMessage("DB table `creature_questender` reloaded."); return true; } @@ -574,19 +574,19 @@ public: return true; } - static bool HandleReloadGOQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadGOQuestStarterCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_questrelation`)"); - sObjectMgr->LoadGameobjectQuestRelations(); - handler->SendGlobalGMSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_queststarter`)"); + sObjectMgr->LoadGameobjectQuestStarters(); + handler->SendGlobalGMSysMessage("DB table `gameobject_queststarter` reloaded."); return true; } - static bool HandleReloadGOQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadGOQuestEnderCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_involvedrelation`)"); - sObjectMgr->LoadGameobjectInvolvedRelations(); - handler->SendGlobalGMSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_questender`)"); + sObjectMgr->LoadGameobjectQuestEnders(); + handler->SendGlobalGMSysMessage("DB table `gameobject_questender` reloaded."); return true; } diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 2d4fa2765cf..ec8771cc2f4 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -153,7 +153,7 @@ public: sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); else if (strncmp(paramStr, "reset", limit) == 0) { - sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); + sWorld->SetPlayerAmountLimit(sConfigMgr->GetIntDefault("PlayerLimit", 100)); sWorld->LoadDBAllowedSecurityLevel(); } else diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index c6cfa3218ec..38c12e75e7e 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -796,7 +796,7 @@ public: if (show == "info") { // Check if the user did specify a visual waypoint - if (target && target->GetEntry() != VISUAL_WAYPOINT) + if (!target || target->GetEntry() != VISUAL_WAYPOINT) { handler->PSendSysMessage(LANG_WAYPOINT_VP_SELECT); handler->SetSentErrorMessage(true); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index c53026de203..e9a6b15dcf8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -354,7 +354,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_phalanxAI (creature); + return new npc_phalanxAI(creature); } struct npc_phalanxAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp index dd251a4fb10..3a4f734429c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp @@ -31,7 +31,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ambassador_flamelashAI (creature); + return new boss_ambassador_flamelashAI(creature); } struct boss_ambassador_flamelashAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp index d48fadd4564..63a94ca616a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp @@ -35,7 +35,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anubshiahAI (creature); + return new boss_anubshiahAI(creature); } struct boss_anubshiahAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index b932b384df4..25f93a2b6b7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -39,7 +39,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_draganthaurissanAI (creature); + return new boss_draganthaurissanAI(creature); } struct boss_draganthaurissanAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp index 9cdbba7f6a9..80bfa651301 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp @@ -33,7 +33,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_general_angerforgeAI (creature); + return new boss_general_angerforgeAI(creature); } struct boss_general_angerforgeAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp index 4c8567ee782..d79c4d191b6 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp @@ -32,7 +32,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gorosh_the_dervishAI (creature); + return new boss_gorosh_the_dervishAI(creature); } struct boss_gorosh_the_dervishAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp index 705382baad1..504fca44c4c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -33,7 +33,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_grizzleAI (creature); + return new boss_grizzleAI(creature); } struct boss_grizzleAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp index 69393e93fc0..7a98cc321dc 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -34,7 +34,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_interrogator_gerstahnAI (creature); + return new boss_high_interrogator_gerstahnAI(creature); } struct boss_high_interrogator_gerstahnAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp index 332bbf09f76..998e7b17897 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp @@ -37,7 +37,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_magmusAI (creature); + return new boss_magmusAI(creature); } struct boss_magmusAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp index 7b5da3db58d..9021649a61e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp @@ -36,7 +36,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_moira_bronzebeardAI (creature); + return new boss_moira_bronzebeardAI(creature); } struct boss_moira_bronzebeardAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index 7c7664249de..55e6862bda7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -140,7 +140,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_doomrelAI (creature); + return new boss_doomrelAI(creature); } struct boss_doomrelAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 458e4c07a40..b84be2feb17 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -401,11 +401,14 @@ public: switch (eventId) { case EVENT_ENCAGED_EMBERSEER: - if(me->GetPositionX() == me->GetHomePosition().GetPositionX()) - if(!me->HasAura(SPELL_ENCAGE_EMBERSEER)) + { + if (me->GetPositionX() == me->GetHomePosition().GetPositionX()) + if (!me->HasAura(SPELL_ENCAGE_EMBERSEER)) if (Creature* Emberseer = me->FindNearestCreature(NPC_PYROGAURD_EMBERSEER, 30.0f, true)) DoCast(Emberseer, SPELL_ENCAGE_EMBERSEER); break; + + } } } return; @@ -429,6 +432,7 @@ public: break; } } + DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index 6e3868807a5..275b3802764 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -176,9 +176,9 @@ public: void EnterCombat(Unit* /*who*/) OVERRIDE { _EnterCombat(); - events.ScheduleEvent(EVENT_WHIRLWIND, urand (13000, 15000)); - events.ScheduleEvent(EVENT_CLEAVE, urand (15000, 17000)); - events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand (17000, 19000)); + events.ScheduleEvent(EVENT_WHIRLWIND, urand(13000, 15000)); + events.ScheduleEvent(EVENT_CLEAVE, urand(15000, 17000)); + events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(17000, 19000)); } void JustDied(Unit* /*killer*/) OVERRIDE diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index b334c5c44b6..f07e426c808 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -553,7 +553,8 @@ public: loadStream >> tmpState; if (tmpState == IN_PROGRESS || tmpState > SPECIAL) tmpState = NOT_STARTED; - SetBossState(i, EncounterState(tmpState)); + + SetBossState(i, EncounterState(tmpState)); } } else diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index 9d25719a52b..c9dc3d8f134 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -116,7 +116,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_broodlordAI (creature); + return new boss_broodlordAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 507786aff20..05effabe557 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -282,7 +282,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_chromaggusAI (creature); + return new boss_chromaggusAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp index 2c35d6ce140..0d79f3faeee 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp @@ -92,7 +92,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ebonrocAI (creature); + return new boss_ebonrocAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp index 2cbcb1d9b58..369e4e02f5a 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -94,7 +94,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_firemawAI (creature); + return new boss_firemawAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp index a1525b46c7c..060bfeb60b3 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp @@ -100,7 +100,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_flamegorAI (creature); + return new boss_flamegorAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 75d1cad0820..d49cca2045f 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -377,7 +377,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_victor_nefariusAI (creature); + return new boss_victor_nefariusAI(creature); } }; @@ -573,7 +573,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nefarianAI (creature); + return new boss_nefarianAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index cd27737fece..be2aeb9e223 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -156,7 +156,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_razorgoreAI (creature); + return new boss_razorgoreAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 6c9d093c58a..c595f3acaff 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -232,7 +232,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_vaelAI (creature); + return new boss_vaelAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 39788067b8a..8a7836b310e 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -45,7 +45,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_mr_smiteAI (creature); + return new boss_mr_smiteAI(creature); } struct boss_mr_smiteAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index e8e388039f8..6599af7c2aa 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -55,7 +55,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_curatorAI (creature); + return new boss_curatorAI(creature); } struct boss_curatorAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp index a348a7026d1..0a9aee6269c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -47,7 +47,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_maiden_of_virtueAI (creature); + return new boss_maiden_of_virtueAI(creature); } struct boss_maiden_of_virtueAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 083af294e18..0b11d425e85 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -55,7 +55,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_attumenAI (creature); + return new boss_attumenAI(creature); } struct boss_attumenAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index b8b3849f8c7..473fe000939 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -100,7 +100,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_moroesAI (creature); + return new boss_moroesAI(creature); } struct boss_moroesAI : public ScriptedAI @@ -401,7 +401,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baroness_dorothea_millstipeAI (creature); + return new boss_baroness_dorothea_millstipeAI(creature); } struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI @@ -464,7 +464,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baron_rafe_dreugerAI (creature); + return new boss_baron_rafe_dreugerAI(creature); } struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI @@ -521,7 +521,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_catriona_von_indiAI (creature); + return new boss_lady_catriona_von_indiAI(creature); } struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI @@ -591,7 +591,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_keira_berrybuckAI (creature); + return new boss_lady_keira_berrybuckAI(creature); } struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI @@ -665,7 +665,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lord_robin_darisAI (creature); + return new boss_lord_robin_darisAI(creature); } struct boss_lord_robin_darisAI : public boss_moroes_guestAI @@ -721,7 +721,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lord_crispin_ferenceAI (creature); + return new boss_lord_crispin_ferenceAI(creature); } struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 74593e5ef56..984ef902f05 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -71,7 +71,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nightbaneAI (creature); + return new boss_nightbaneAI(creature); } struct boss_nightbaneAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 58acf95b1ed..2abfcead826 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -104,7 +104,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new netherspite_infernalAI (creature); + return new netherspite_infernalAI(creature); } struct netherspite_infernalAI : public ScriptedAI @@ -179,7 +179,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_malchezaarAI (creature); + return new boss_malchezaarAI(creature); } struct boss_malchezaarAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index bf3586cd4df..7999524f853 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -86,7 +86,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_aranAI (creature); + return new boss_aranAI(creature); } struct boss_aranAI : public ScriptedAI @@ -515,7 +515,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new water_elementalAI (creature); + return new water_elementalAI(creature); } struct water_elementalAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 3264397d563..f348cf95a82 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -72,7 +72,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_kilrekAI (creature); + return new npc_kilrekAI(creature); } struct npc_kilrekAI : public ScriptedAI @@ -181,7 +181,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_fiendish_portalAI (creature); + return new npc_fiendish_portalAI(creature); } struct npc_fiendish_portalAI : public PassiveAI @@ -215,7 +215,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_fiendish_impAI (creature); + return new npc_fiendish_impAI(creature); } struct npc_fiendish_impAI : public ScriptedAI @@ -257,7 +257,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_terestianAI (creature); + return new boss_terestianAI(creature); } struct boss_terestianAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 506cd3f292b..03c06664edf 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -1304,7 +1304,7 @@ public: //CreatureAI* GetAI(Creature* creature) const OVERRIDE //{ - // return new npc_high_explosive_sheepAI (creature); + // return new npc_high_explosive_sheepAI(creature); //}; }; */ diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index 7f77b8aaad0..668f7ec58f4 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -66,7 +66,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_selin_fireheartAI (creature); + return new boss_selin_fireheartAI(creature); }; struct boss_selin_fireheartAI : public ScriptedAI @@ -327,7 +327,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_fel_crystalAI (creature); + return new npc_fel_crystalAI(creature); }; struct npc_fel_crystalAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index a8c4e4ceaf1..3694fa4a864 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -76,7 +76,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_vexallusAI (creature); + return new boss_vexallusAI(creature); }; struct boss_vexallusAI : public BossAI @@ -212,7 +212,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_pure_energyAI (creature); + return new npc_pure_energyAI(creature); }; struct npc_pure_energyAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp index ea28e548b39..e9ac15147f9 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -115,7 +115,7 @@ class boss_baron_geddon : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baron_geddonAI (creature); + return new boss_baron_geddonAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 0e70a0f0066..44eef7602c8 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -46,7 +46,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_crusade_persuadedAI (creature); + return new npc_crusade_persuadedAI(creature); } struct npc_crusade_persuadedAI : public ScriptedAI @@ -370,7 +370,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_scarlet_courierAI (creature); + return new npc_scarlet_courierAI(creature); } struct npc_scarlet_courierAI : public ScriptedAI @@ -462,7 +462,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_high_inquisitor_valrothAI (creature); + return new npc_high_inquisitor_valrothAI(creature); } struct npc_high_inquisitor_valrothAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 6d0c3eb53c7..382a0002065 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1655,7 +1655,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_the_lich_king_tirion_dawnAI (creature); + return new npc_the_lich_king_tirion_dawnAI(creature); } struct npc_the_lich_king_tirion_dawnAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp index c310bc635cc..aa4be5d2523 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -41,7 +41,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_valkyr_battle_maidenAI (creature); + return new npc_valkyr_battle_maidenAI(creature); } struct npc_valkyr_battle_maidenAI : public PassiveAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index 85f0a9e7cbd..4cf6c069648 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_arcanist_doanAI (creature); + return new boss_arcanist_doanAI(creature); } struct boss_arcanist_doanAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp index 6b799f8c91a..a88ff8b2977 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -40,7 +40,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_azshir_the_sleeplessAI (creature); + return new boss_azshir_the_sleeplessAI(creature); } struct boss_azshir_the_sleeplessAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index b352c5e25c9..f10ac0b5ba2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_bloodmage_thalnosAI (creature); + return new boss_bloodmage_thalnosAI(creature); } struct boss_bloodmage_thalnosAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 81f09e90178..fb2d8374c18 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -148,7 +148,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_wisp_invisAI (creature); + return new npc_wisp_invisAI(creature); } struct npc_wisp_invisAI : public ScriptedAI @@ -228,7 +228,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_headAI (creature); + return new npc_headAI(creature); } struct npc_headAI : public ScriptedAI @@ -377,7 +377,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_headless_horsemanAI (creature); + return new boss_headless_horsemanAI(creature); } struct boss_headless_horsemanAI : public ScriptedAI @@ -787,7 +787,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_pulsing_pumpkinAI (creature); + return new npc_pulsing_pumpkinAI(creature); } struct npc_pulsing_pumpkinAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index 24c2e501d99..38fb663a073 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_inquisitor_fairbanksAI (creature); + return new boss_high_inquisitor_fairbanksAI(creature); } struct boss_high_inquisitor_fairbanksAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp index b8da010773a..10d60eb15cd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -44,7 +44,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_houndmaster_lokseyAI (creature); + return new boss_houndmaster_lokseyAI(creature); } struct boss_houndmaster_lokseyAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 8ce0b430039..a57c237c21a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_interrogator_vishasAI (creature); + return new boss_interrogator_vishasAI(creature); } struct boss_interrogator_vishasAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 3492896dd5d..403416bb202 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -65,7 +65,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_scarlet_commander_mograineAI (creature); + return new boss_scarlet_commander_mograineAI(creature); } struct boss_scarlet_commander_mograineAI : public ScriptedAI @@ -231,7 +231,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_inquisitor_whitemaneAI (creature); + return new boss_high_inquisitor_whitemaneAI(creature); } struct boss_high_inquisitor_whitemaneAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp index 545f5d69bdc..fcd0975fbc0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp @@ -41,7 +41,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_scornAI (creature); + return new boss_scornAI(creature); } struct boss_scornAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 440b91b1d1e..cb6da60bf28 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -128,7 +128,7 @@ class boss_darkmaster_gandling : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_darkmaster_gandlingAI (creature); + return new boss_darkmaster_gandlingAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp index 7f7c0c195b1..8ca8f04f33a 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp @@ -33,7 +33,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_death_knight_darkreaverAI (creature); + return new boss_death_knight_darkreaverAI(creature); } struct boss_death_knight_darkreaverAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index 15bd7c13e36..3dae50ebf44 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -99,7 +99,7 @@ class boss_doctor_theolen_krastinov : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_theolenkrastinovAI (creature); + return new boss_theolenkrastinovAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index 1ee53cc91a5..5da1bf14c7d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -100,7 +100,7 @@ class boss_illucia_barov : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_illuciabarovAI (creature); + return new boss_illuciabarovAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 6b2a38f089d..c3bd97c9a0b 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -137,7 +137,7 @@ class boss_instructor_malicia : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_instructormaliciaAI (creature); + return new boss_instructormaliciaAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 5a339975138..ab259680c07 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -42,7 +42,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_jandicebarovAI (creature); + return new boss_jandicebarovAI(creature); } struct boss_jandicebarovAI : public ScriptedAI @@ -164,7 +164,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_illusionofjandicebarovAI (creature); + return new npc_illusionofjandicebarovAI(creature); } struct npc_illusionofjandicebarovAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index abf54e5e748..0ba0ab4cb92 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -39,7 +39,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kormokAI (creature); + return new boss_kormokAI(creature); } struct boss_kormokAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index d18669e19c2..26028590f5c 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -92,7 +92,7 @@ class boss_lord_alexei_barov : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lordalexeibarovAI (creature); + return new boss_lordalexeibarovAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp index a7b0d7444c8..bc6646be633 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp @@ -100,7 +100,7 @@ class boss_lorekeeper_polkelt : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lorekeeperpolkeltAI (creature); + return new boss_lorekeeperpolkeltAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 9ae301c7720..62922289821 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_rasfrostAI (creature); + return new boss_rasfrostAI(creature); } struct boss_rasfrostAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index 84425e0b664..1e2c38fc487 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -100,7 +100,7 @@ class boss_the_ravenian : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_theravenianAI (creature); + return new boss_theravenianAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index 36788a174f5..e426fb4ec11 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -46,7 +46,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_vectusAI (creature); + return new boss_vectusAI(creature); } struct boss_vectusAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 84cbd9d80e9..16ec442d963 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -68,7 +68,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baron_rivendareAI (creature); + return new boss_baron_rivendareAI(creature); } struct boss_baron_rivendareAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index edca989f2bc..1812e2efd8d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -42,7 +42,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baroness_anastariAI (creature); + return new boss_baroness_anastariAI(creature); } struct boss_baroness_anastariAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp index 5c085d041d4..319afb3deb2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -87,7 +87,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_cannon_master_willeyAI (creature); + return new boss_cannon_master_willeyAI(creature); } struct boss_cannon_master_willeyAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index 0365c0dd5ae..21320ed738f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -76,7 +76,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_dathrohan_balnazzarAI (creature); + return new boss_dathrohan_balnazzarAI(creature); } struct boss_dathrohan_balnazzarAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp index 4416b40724a..1c5f0c72153 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_magistrate_barthilasAI (creature); + return new boss_magistrate_barthilasAI(creature); } struct boss_magistrate_barthilasAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index a9a5ce53257..0f8340891a8 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_maleki_the_pallidAI (creature); + return new boss_maleki_the_pallidAI(creature); } struct boss_maleki_the_pallidAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index b14a60d77cc..2cacf80e27c 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -42,7 +42,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nerubenkanAI (creature); + return new boss_nerubenkanAI(creature); } struct boss_nerubenkanAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index cd1ec45fe20..706c2e7b6fb 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_silver_hand_bossesAI (creature); + return new boss_silver_hand_bossesAI(creature); } struct boss_silver_hand_bossesAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index 9e2c6834439..79b8dd7dfe2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -45,7 +45,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ramstein_the_gorgerAI (creature); + return new boss_ramstein_the_gorgerAI(creature); } struct boss_ramstein_the_gorgerAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp index 931bb3f6b3b..020b14f4823 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_timmy_the_cruelAI (creature); + return new boss_timmy_the_cruelAI(creature); } struct boss_timmy_the_cruelAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 383b9307523..b0d5b0508eb 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -246,23 +246,29 @@ class instance_stratholme : public InstanceMapScript case TYPE_BARONESS: EncounterState[1] = data; if (data == IN_PROGRESS) + { HandleGameObject(ziggurat1GUID, true); - if (data == IN_PROGRESS) //change to DONE when crystals implemented + //change to DONE when crystals implemented StartSlaugtherSquare(); + } break; case TYPE_NERUB: EncounterState[2] = data; if (data == IN_PROGRESS) + { HandleGameObject(ziggurat2GUID, true); - if (data == IN_PROGRESS) //change to DONE when crystals implemented + //change to DONE when crystals implemented StartSlaugtherSquare(); + } break; case TYPE_PALLID: EncounterState[3] = data; if (data == IN_PROGRESS) + { HandleGameObject(ziggurat3GUID, true); - if (data == IN_PROGRESS) //change to DONE when crystals implemented + //change to DONE when crystals implemented StartSlaugtherSquare(); + } break; case TYPE_RAMSTEIN: if (data == IN_PROGRESS) diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index ceff3d583c7..ff2bc1cb15c 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -95,7 +95,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_freed_soulAI (creature); + return new npc_freed_soulAI(creature); } struct npc_freed_soulAI : public ScriptedAI @@ -137,7 +137,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_restless_soulAI (creature); + return new npc_restless_soulAI(creature); } struct npc_restless_soulAI : public ScriptedAI @@ -219,7 +219,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_spectral_ghostly_citizenAI (creature); + return new npc_spectral_ghostly_citizenAI(creature); } struct npc_spectral_ghostly_citizenAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 13be22cd3a1..4460fb99f2b 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -70,7 +70,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_brutallusAI (creature); + return new boss_brutallusAI(creature); } struct boss_brutallusAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index c98443442e3..0e58cb85c4b 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -86,7 +86,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_sacrolashAI (creature); + return new boss_sacrolashAI(creature); }; struct boss_sacrolashAI : public ScriptedAI @@ -342,7 +342,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_alythessAI (creature); + return new boss_alythessAI(creature); }; struct boss_alythessAI : public ScriptedAI @@ -669,7 +669,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shadow_imageAI (creature); + return new npc_shadow_imageAI(creature); }; struct npc_shadow_imageAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 586009271ad..2895e85de71 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -105,7 +105,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kalecgosAI (creature); + return new boss_kalecgosAI(creature); } struct boss_kalecgosAI : public ScriptedAI @@ -444,7 +444,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kalecAI (creature); + return new boss_kalecAI(creature); } struct boss_kalecAI : public ScriptedAI @@ -545,22 +545,27 @@ public: bool OnGossipHello(Player* player, GameObject* go) OVERRIDE { - uint8 SpectralPlayers = 0; Map* map = go->GetMap(); if (!map->IsDungeon()) return true; +#if MAX_PLAYERS_IN_SPECTRAL_REALM > 0 + uint8 SpectralPlayers = 0; Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (i->GetSource() && i->GetSource()->GetPositionZ() < DEMON_REALM_Z + 5) ++SpectralPlayers; } - uint8 MaxSpectralPlayers = MAX_PLAYERS_IN_SPECTRAL_REALM; - if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || (MaxSpectralPlayers && SpectralPlayers >= MaxSpectralPlayers)) + + if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM) + { player->GetSession()->SendNotification(GO_FAILED); - else - player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true); + return true; + } +#endif + + player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true); return true; } }; @@ -572,7 +577,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_sathrovarrAI (creature); + return new boss_sathrovarrAI(creature); } struct boss_sathrovarrAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index daee256d602..855ed46e5cf 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -236,7 +236,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kalecgos_kjAI (creature); + return new boss_kalecgos_kjAI(creature); } struct boss_kalecgos_kjAI : public ScriptedAI @@ -389,7 +389,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_kiljaeden_controllerAI (creature); + return new npc_kiljaeden_controllerAI(creature); } struct npc_kiljaeden_controllerAI : public ScriptedAI @@ -491,7 +491,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kiljaedenAI (creature); + return new boss_kiljaedenAI(creature); } struct boss_kiljaedenAI : public ScriptedAI @@ -710,12 +710,14 @@ public: { SpeechTimer = 0; if (instance) + { if (Creature* speechCreature = Unit::GetCreature(*me, instance->GetData64(Speeches[speechCount].creature))) speechCreature->AI()->Talk(Speeches[speechCount].textid); - if (speechCount == 12) - if (Creature* pAnveena = Unit::GetCreature(*me, instance->GetData64(DATA_ANVEENA))) - pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false); - // ChangeTimers(true, 10000); // Kil should do an emote while screaming without attacking for 10 seconds + if (speechCount == 12) + if (Creature* pAnveena = Unit::GetCreature(*me, instance->GetData64(DATA_ANVEENA))) + pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false); + // ChangeTimers(true, 10000); // Kil should do an emote while screaming without attacking for 10 seconds + } if (speechCount == speechPhaseEnd) TimerIsDeactivated[TIMER_SPEECH]=true; speechCount++; @@ -901,7 +903,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_hand_of_the_deceiverAI (creature); + return new npc_hand_of_the_deceiverAI(creature); } struct npc_hand_of_the_deceiverAI : public ScriptedAI @@ -1001,7 +1003,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_felfire_portalAI (creature); + return new npc_felfire_portalAI(creature); } struct npc_felfire_portalAI : public ScriptedAI @@ -1048,7 +1050,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_volatile_felfire_fiendAI (creature); + return new npc_volatile_felfire_fiendAI(creature); } struct npc_volatile_felfire_fiendAI : public ScriptedAI @@ -1105,7 +1107,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_armageddonAI (creature); + return new npc_armageddonAI(creature); } struct npc_armageddonAI : public ScriptedAI @@ -1162,7 +1164,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shield_orbAI (creature); + return new npc_shield_orbAI(creature); } struct npc_shield_orbAI : public ScriptedAI @@ -1249,7 +1251,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_sinster_reflectionAI (creature); + return new npc_sinster_reflectionAI(creature); } struct npc_sinster_reflectionAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 45f2ae00697..aa53790ee5f 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -111,7 +111,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_entropiusAI (creature); + return new boss_entropiusAI(creature); } struct boss_entropiusAI : public ScriptedAI @@ -210,7 +210,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_muruAI (creature); + return new boss_muruAI(creature); } struct boss_muruAI : public ScriptedAI @@ -375,7 +375,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_muru_portalAI (creature); + return new npc_muru_portalAI(creature); } struct npc_muru_portalAI : public ScriptedAI @@ -459,7 +459,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_dark_fiendAI (creature); + return new npc_dark_fiendAI(creature); } struct npc_dark_fiendAI : public ScriptedAI @@ -520,7 +520,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_void_sentinelAI (creature); + return new npc_void_sentinelAI(creature); } struct npc_void_sentinelAI : public ScriptedAI @@ -575,7 +575,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_blackholeAI (creature); + return new npc_blackholeAI(creature); } struct npc_blackholeAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 92caaa04aec..380293d743c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -174,7 +174,7 @@ class boss_akilzon : public CreatureScript { if (Unit* target = (*i)) { - if (!Cloud->IsWithinDist(target, 6, false)) + if (Cloud && !Cloud->IsWithinDist(target, 6, false)) Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); } } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index de9dd907bc9..bbc8d523cb8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -272,8 +272,7 @@ class npc_harrison_jones : public CreatureScript { public: - npc_harrison_jones() - : CreatureScript("npc_harrison_jones") + npc_harrison_jones() : CreatureScript("npc_harrison_jones") { } @@ -333,6 +332,9 @@ class npc_harrison_jones : public CreatureScript { if (_gongTimer <= diff) { + if (!instance) + return; + switch (_gongEvent) { case GONG_EVENT_1: @@ -362,8 +364,7 @@ class npc_harrison_jones : public CreatureScript // trigger or gong will need to be scripted to set IN_PROGRESS after enough hits. // This is temp workaround. - if (instance) - instance->SetData(DATA_GONGEVENT, IN_PROGRESS); // to be removed. + instance->SetData(DATA_GONGEVENT, IN_PROGRESS); // to be removed. if (instance->GetData(DATA_GONGEVENT) == IN_PROGRESS) { @@ -410,9 +411,11 @@ class npc_harrison_jones : public CreatureScript ptarget->AI()->SetData(0, 1); } else + { ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); ptarget->SetReactState(REACT_PASSIVE); ptarget->AI()->SetData(0, 2); + } } } } @@ -437,16 +440,16 @@ class npc_harrison_jones : public CreatureScript _gongEvent = GONG_EVENT_10; break; case GONG_EVENT_10: - me->SetFacingTo(1.59044f); - _gongEvent = 11; - _gongTimer = 6000; + me->SetFacingTo(1.59044f); + _gongEvent = 11; + _gongTimer = 6000; break; case GONG_EVENT_11: - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - if (instance) - instance->SetData(DATA_GONGEVENT, NOT_STARTED); - _gongEvent = 0; - _gongTimer = 1000; + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + instance->SetData(DATA_GONGEVENT, NOT_STARTED); + _gongEvent = 0; + _gongTimer = 1000; break; } } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 506fbe79508..ac65842fa44 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -353,8 +353,8 @@ class npc_vilebranch_speaker : public CreatureScript void Reset() OVERRIDE { - demoralizing_Shout_Timer = urand (2000, 4000); - cleave_Timer = urand (5000, 8000); + demoralizing_Shout_Timer = urand(2000, 4000); + cleave_Timer = urand(5000, 8000); } void EnterCombat(Unit* /*who*/) OVERRIDE {} diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp index c1e240a0a90..02fce8f3cf2 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -44,7 +44,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kruulAI (creature); + return new boss_kruulAI(creature); } struct boss_kruulAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp index 49a7addaa28..94f227a3de0 100644 --- a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp @@ -125,7 +125,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ragged_johnAI (creature); + return new npc_ragged_johnAI(creature); } struct npc_ragged_johnAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp index ad027726654..23b9d99935b 100644 --- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp @@ -82,7 +82,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_twilight_corrupterAI (creature); + return new boss_twilight_corrupterAI(creature); } struct boss_twilight_corrupterAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp index d9da216d74d..ea8f3cd056a 100644 --- a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ghoul_flayerAI (creature); + return new npc_ghoul_flayerAI(creature); } }; @@ -116,7 +116,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_darrowshire_spiritAI (creature); + return new npc_darrowshire_spiritAI(creature); } struct npc_darrowshire_spiritAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp index 7975272e4e8..d8750a82bc4 100644 --- a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp @@ -61,7 +61,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_apprentice_mirvedaAI (creature); + return new npc_apprentice_mirvedaAI(creature); } struct npc_apprentice_mirvedaAI : public ScriptedAI @@ -159,7 +159,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_infused_crystalAI (creature); + return new npc_infused_crystalAI(creature); } struct npc_infused_crystalAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_ironforge.cpp b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp index 6fefe0de2e9..90271c5658c 100644 --- a/src/server/scripts/EasternKingdoms/zone_ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,84 +15,9 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Ironforge -SD%Complete: 100 -SDComment: Quest support: 3702 -SDCategory: Ironforge -EndScriptData */ - -/* ContentData -npc_royal_historian_archesonus -EndContentData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "Player.h" -/*###### -## npc_royal_historian_archesonus -######*/ - -#define GOSSIP_ITEM_ROYAL "I am ready to listen" -#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" -#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." -#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" -#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" - -class npc_royal_historian_archesonus : public CreatureScript -{ -public: - npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2236, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2237, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2238, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(2239, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3702); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(2235, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -void AddSC_ironforge() -{ - new npc_royal_historian_archesonus(); -} +void AddSC_ironforge() { } diff --git a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp index 519e06eee4a..3ebcd315eaf 100644 --- a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp @@ -52,7 +52,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_converted_sentryAI (creature); + return new npc_converted_sentryAI(creature); } struct npc_converted_sentryAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp index b2a7d34cd25..b5f85d38105 100644 --- a/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp @@ -51,7 +51,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_blood_knight_stillbladeAI (creature); + return new npc_blood_knight_stillbladeAI(creature); } struct npc_blood_knight_stillbladeAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp index acabe63fd1b..5fb8aca22e8 100644 --- a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp @@ -181,7 +181,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new pyrewood_ambushAI (creature); + return new pyrewood_ambushAI(creature); } struct pyrewood_ambushAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index d40a986db47..4dc41e5551c 100644 --- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_yennikuAI (creature); + return new npc_yennikuAI(creature); } struct npc_yennikuAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp index 000fe181793..d84b02d613e 100644 --- a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_calvin_montagueAI (creature); + return new npc_calvin_montagueAI(creature); } struct npc_calvin_montagueAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 75b6265b6d0..33f884408e2 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -94,7 +94,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_lady_sylvanas_windrunnerAI (creature); + return new npc_lady_sylvanas_windrunnerAI(creature); } struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI @@ -226,7 +226,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_highborne_lamenterAI (creature); + return new npc_highborne_lamenterAI(creature); } struct npc_highborne_lamenterAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index fd8fab62821..4057f4070b1 100644 --- a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -167,7 +167,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_the_scourge_cauldronAI (creature); + return new npc_the_scourge_cauldronAI(creature); } struct npc_the_scourge_cauldronAI : public ScriptedAI @@ -253,7 +253,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_andorhal_towerAI (creature); + return new npc_andorhal_towerAI(creature); } struct npc_andorhal_towerAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 7872b42912f..e74ed93bc66 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -31,8 +31,6 @@ enum Spells SPELL_TELEPORT_DARNASSUS = 9268 }; -#define GOSSIP_ITEM_MORRIDUNE "Please port me to Darnassus" - const Position HomePosition = {-815.817f, -145.299f, -25.870f, 0}; class go_blackfathom_altar : public GameObjectScript @@ -75,7 +73,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_blackfathom_deeps_eventAI (creature); + return new npc_blackfathom_deeps_eventAI(creature); } struct npc_blackfathom_deeps_eventAI : public ScriptedAI @@ -201,32 +199,6 @@ class npc_morridune : public CreatureScript public: npc_morridune() : CreatureScript("npc_morridune") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) OVERRIDE - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->TeleportTo(1, 9952.239f, 2284.277f, 1341.394f, 1.595f); - player->CLOSE_GOSSIP_MENU(); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_morriduneAI (creature); - } - struct npc_morriduneAI : public npc_escortAI { npc_morriduneAI(Creature* creature) : npc_escortAI(creature) @@ -248,7 +220,17 @@ public: break; } } + + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE + { + DoCast(player, SPELL_TELEPORT_DARNASSUS); + } }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_morriduneAI(creature); + } }; void AddSC_blackfathom_deeps() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index 7f1909ce4a7..579bb7a8e95 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -92,7 +92,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_aku_maiAI (creature); + return new boss_aku_maiAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index 9816bdc49da..139eed963c1 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -31,7 +31,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gelihastAI (creature); + return new boss_gelihastAI(creature); } struct boss_gelihastAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 4216935a946..8eeedb6e15f 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -36,7 +36,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kelrisAI (creature); + return new boss_kelrisAI(creature); } struct boss_kelrisAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index db74bd37c8d..164de89b017 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -47,7 +47,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anetheronAI (creature); + return new boss_anetheronAI(creature); } struct boss_anetheronAI : public hyjal_trashAI @@ -179,7 +179,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_towering_infernalAI (creature); + return new npc_towering_infernalAI(creature); } struct npc_towering_infernalAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 7450b500b46..3623ad88a0a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -239,7 +239,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_archimondeAI (creature); + return new boss_archimondeAI(creature); } struct boss_archimondeAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index a0aeab0fe84..aaf2bb65ba0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_azgalorAI (creature); + return new boss_azgalorAI(creature); } struct boss_azgalorAI : public hyjal_trashAI @@ -186,7 +186,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_lesser_doomguardAI (creature); + return new npc_lesser_doomguardAI(creature); } struct npc_lesser_doomguardAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index a5fa3f6485f..66e276d25b6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -49,7 +49,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kazrogalAI (creature); + return new boss_kazrogalAI(creature); } struct boss_kazrogalAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 71d832c6970..c163e7c0f1f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -44,7 +44,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_rage_winterchillAI (creature); + return new boss_rage_winterchillAI(creature); } struct boss_rage_winterchillAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h index 0d23d1c700c..1f510ebec73 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h @@ -21,32 +21,73 @@ #define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy." -enum Types +uint32 const EncounterCount = 5; + +enum DataTypes +{ + DATA_ANETHERON = 1, + DATA_ANETHERONEVENT = 2, + DATA_ARCHIMONDE = 3, + DATA_ARCHIMONDEEVENT = 4, + DATA_AZGALOR = 5, + DATA_AZGALOREVENT = 6, + DATA_JAINAPROUDMOORE = 7, + DATA_KAZROGAL = 8, + DATA_KAZROGALEVENT = 9, + DATA_RAGEWINTERCHILL = 10, + DATA_RAGEWINTERCHILLEVENT = 11, + DATA_THRALL = 12, + DATA_TYRANDEWHISPERWIND = 13, + DATA_TRASH = 14, + DATA_RESET_TRASH_COUNT = 15, + DATA_ALLIANCE_RETREAT = 16, + DATA_HORDE_RETREAT = 17, + DATA_RAIDDAMAGE = 18, + DATA_RESET_RAIDDAMAGE = 19, + TYPE_RETREAT = 20 +}; + +enum WorldStateIds { - WORLD_STATE_WAVES = 2842, - WORLD_STATE_ENEMY = 2453, - WORLD_STATE_ENEMYCOUNT = 2454, - - DATA_ANETHERON = 1, - DATA_ANETHERONEVENT = 2, - DATA_ARCHIMONDE = 3, - DATA_ARCHIMONDEEVENT = 4, - DATA_AZGALOR = 5, - DATA_AZGALOREVENT = 6, - DATA_JAINAPROUDMOORE = 7, - DATA_KAZROGAL = 8, - DATA_KAZROGALEVENT = 9, - DATA_RAGEWINTERCHILL = 10, - DATA_RAGEWINTERCHILLEVENT = 11, - DATA_THRALL = 12, - DATA_TYRANDEWHISPERWIND = 13, - DATA_TRASH = 14, - DATA_RESET_TRASH_COUNT = 15, - DATA_ALLIANCE_RETREAT = 16, - DATA_HORDE_RETREAT = 17, - DATA_RAIDDAMAGE = 18, - DATA_RESET_RAIDDAMAGE = 19, - TYPE_RETREAT = 20 + WORLD_STATE_WAVES = 2842, + WORLD_STATE_ENEMY = 2453, + WORLD_STATE_ENEMYCOUNT = 2454 }; + +enum CreaturesIds +{ + // Trash Mobs summoned in waves + NECROMANCER = 17899, + ABOMINATION = 17898, + GHOUL = 17895, + BANSHEE = 17905, + CRYPT_FIEND = 17897, + GARGOYLE = 17906, + FROST_WYRM = 17907, + GIANT_INFERNAL = 17908, + FEL_STALKER = 17916, + + JAINA = 17772, + THRALL = 17852, + TYRANDE = 17948, + + // Bosses summoned after every 8 waves + RAGE_WINTERCHILL = 17767, + ANETHERON = 17808, + KAZROGAL = 17888, + AZGALOR = 17842, + ARCHIMONDE = 17968, + NPC_WORLD_TRIGGER_TINY = 21987 +}; + +enum GameobjectIds +{ + GO_HORDE_ENCAMPMENT_PORTAL = 182060, + GO_NIGHT_ELF_VILLAGE_PORTAL = 182061, + GO_ANCIENT_GEM = 185557, + GO_ANCIENT_VEIN = 185557, + GO_ROARING_FLAME = 182592 +}; + #endif diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 50351aedb5f..fb06a5ccaa5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -661,7 +661,7 @@ void hyjalAI::SpawnVeins() return; for (uint8 i = 0; i<7; ++i) { - GameObject* gem = me->SummonGameObject(ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0); + GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0); if (gem) VeinGUID[i]=gem->GetGUID(); } @@ -671,7 +671,7 @@ void hyjalAI::SpawnVeins() return; for (uint8 i = 7; i<14; ++i) { - GameObject* gem = me->SummonGameObject(ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0); + GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0); if (gem) VeinGUID[i]=gem->GetGUID(); } @@ -731,7 +731,7 @@ void hyjalAI::UpdateAI(uint32 diff) HideNearPos(me->GetPositionX(), me->GetPositionY()); HideNearPos(5037.76f, -1889.71f); for (uint8 i = 0; i < 92; ++i)//summon fires - me->SummonGameObject(FLAMEOBJECT, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0); + me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0); } else me->SetVisible(true); @@ -744,7 +744,7 @@ void hyjalAI::UpdateAI(uint32 diff) HideNearPos(5563, -2763.19f); HideNearPos(5542.2f, -2629.36f); for (uint8 i = 0; i < 65; ++i)//summon fires - me->SummonGameObject(FLAMEOBJECT, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0); + me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0); } else me->SetVisible(true); @@ -1051,7 +1051,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) { case 0://alliance for (uint8 i = 0; i < 92; ++i)//summon fires - me->SummonGameObject(FLAMEOBJECT, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0); + me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0); for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls { @@ -1092,7 +1092,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) break; case 1://horde for (uint8 i = 0; i < 65; ++i)//summon fires - me->SummonGameObject(FLAMEOBJECT, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0); + me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0); for (uint8 i = 0; i < 26; ++i)//summon infernals { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index f40c868a96b..90dd277346a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -24,34 +24,6 @@ #define HYJAL_AI_MAX_SPELLS 3 -enum CreaturesIds -{ - // Trash Mobs summoned in waves - NECROMANCER = 17899, - ABOMINATION = 17898, - GHOUL = 17895, - BANSHEE = 17905, - CRYPT_FIEND = 17897, - GARGOYLE = 17906, - FROST_WYRM = 17907, - GIANT_INFERNAL = 17908, - FEL_STALKER = 17916, - - JAINA = 17772, - THRALL = 17852, - TYRANDE = 17948, - - ANCIENT_VEIN = 185557, - FLAMEOBJECT = 182592, - - // Bosses summoned after every 8 waves - RAGE_WINTERCHILL = 17767, - ANETHERON = 17808, - KAZROGAL = 17888, - AZGALOR = 17842, - ARCHIMONDE = 17968, -}; - enum SpellIds { SPELL_TELEPORT_VISUAL = 41232, @@ -65,7 +37,7 @@ enum SpellIds //Thrall spells SPELL_CHAIN_LIGHTNING = 31330, - SPELL_SUMMON_DIRE_WOLF = 31331, + SPELL_SUMMON_DIRE_WOLF = 31331 }; struct Wave diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 8a96a8fa3fc..65b146e4770 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -31,12 +31,6 @@ EndScriptData */ #include "WorldPacket.h" #include "Opcodes.h" -enum Misc -{ - MAX_ENCOUNTER = 5, - - GO_ANCIENT_GEM = 185557, -}; /* Battle of Mount Hyjal encounters: 0 - Rage Winterchill event 1 - Anetheron event @@ -45,6 +39,9 @@ enum Misc 4 - Archimonde event */ +#define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more." +#define YELL_EFFORTS_NAME "Archimonde" + class instance_hyjal : public InstanceMapScript { public: @@ -59,61 +56,33 @@ public: { instance_mount_hyjal_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - std::list<uint64> m_uiAncientGemGUID; - - uint64 RageWinterchill; - uint64 Anetheron; - uint64 Kazrogal; - uint64 Azgalor; - uint64 Archimonde; - uint64 JainaProudmoore; - uint64 Thrall; - uint64 TyrandeWhisperwind; - uint64 HordeGate; - uint64 ElfGate; - - uint32 Trash; - - uint32 hordeRetreat; - uint32 allianceRetreat; - bool ArchiYell; - - uint32 RaidDamage; - - #define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more." - #define YELL_EFFORTS_NAME "Archimonde" - void Initialize() { memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); m_uiAncientGemGUID.clear(); - RageWinterchill = 0; - Anetheron = 0; - Kazrogal = 0; - Azgalor = 0; - Archimonde = 0; - JainaProudmoore = 0; - Thrall = 0; + RageWinterchill = 0; + Anetheron = 0; + Kazrogal = 0; + Azgalor = 0; + Archimonde = 0; + JainaProudmoore = 0; + Thrall = 0; TyrandeWhisperwind = 0; - HordeGate = 0; - ElfGate = 0; - ArchiYell = false; - RaidDamage = 0; - - Trash = 0; - - hordeRetreat = 0; - allianceRetreat = 0; + HordeGate = 0; + ElfGate = 0; + RaidDamage = 0; + Trash = 0; + hordeRetreat = 0; + allianceRetreat = 0; + + ArchiYell = false; } bool IsEncounterInProgress() const { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + for (uint8 i = 0; i < EncounterCount; ++i) if (m_auiEncounter[i] == IN_PROGRESS) return true; @@ -124,14 +93,14 @@ public: { switch (go->GetEntry()) { - case 182060: + case GO_HORDE_ENCAMPMENT_PORTAL: HordeGate = go->GetGUID(); if (allianceRetreat) HandleGameObject(0, true, go); else HandleGameObject(0, false, go); break; - case 182061: + case GO_NIGHT_ELF_VILLAGE_PORTAL: ElfGate = go->GetGUID(); if (hordeRetreat) HandleGameObject(0, true, go); @@ -148,14 +117,14 @@ public: { switch (creature->GetEntry()) { - case 17767: RageWinterchill = creature->GetGUID(); break; - case 17808: Anetheron = creature->GetGUID(); break; - case 17888: Kazrogal = creature->GetGUID(); break; - case 17842: Azgalor = creature->GetGUID(); break; - case 17968: Archimonde = creature->GetGUID(); break; - case 17772: JainaProudmoore = creature->GetGUID(); break; - case 17852: Thrall = creature->GetGUID(); break; - case 17948: TyrandeWhisperwind = creature->GetGUID(); break; + case RAGE_WINTERCHILL: RageWinterchill = creature->GetGUID(); break; + case ANETHERON: Anetheron = creature->GetGUID(); break; + case KAZROGAL: Kazrogal = creature->GetGUID(); break; + case AZGALOR: Azgalor = creature->GetGUID(); break; + case ARCHIMONDE: Archimonde = creature->GetGUID(); break; + case JAINA: JainaProudmoore = creature->GetGUID(); break; + case THRALL: Thrall = creature->GetGUID(); break; + case TYRANDE: TyrandeWhisperwind = creature->GetGUID(); break; } } @@ -163,13 +132,13 @@ public: { switch (identifier) { - case DATA_RAGEWINTERCHILL: return RageWinterchill; - case DATA_ANETHERON: return Anetheron; - case DATA_KAZROGAL: return Kazrogal; - case DATA_AZGALOR: return Azgalor; - case DATA_ARCHIMONDE: return Archimonde; - case DATA_JAINAPROUDMOORE: return JainaProudmoore; - case DATA_THRALL: return Thrall; + case DATA_RAGEWINTERCHILL: return RageWinterchill; + case DATA_ANETHERON: return Anetheron; + case DATA_KAZROGAL: return Kazrogal; + case DATA_AZGALOR: return Azgalor; + case DATA_ARCHIMONDE: return Archimonde; + case DATA_JAINAPROUDMOORE: return JainaProudmoore; + case DATA_THRALL: return Thrall; case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind; } @@ -202,7 +171,7 @@ public: Creature* creature = instance->GetCreature(Azgalor); if (creature) { - Creature* unit = creature->SummonCreature(21987, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000); + Creature* unit = creature->SummonCreature(NPC_WORLD_TRIGGER_TINY, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000); Map* map = creature->GetMap(); if (map->IsDungeon() && unit) @@ -301,14 +270,14 @@ public: switch (type) { case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0]; - case DATA_ANETHERONEVENT: return m_auiEncounter[1]; - case DATA_KAZROGALEVENT: return m_auiEncounter[2]; - case DATA_AZGALOREVENT: return m_auiEncounter[3]; - case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4]; - case DATA_TRASH: return Trash; - case DATA_ALLIANCE_RETREAT: return allianceRetreat; - case DATA_HORDE_RETREAT: return hordeRetreat; - case DATA_RAIDDAMAGE: return RaidDamage; + case DATA_ANETHERONEVENT: return m_auiEncounter[1]; + case DATA_KAZROGALEVENT: return m_auiEncounter[2]; + case DATA_AZGALOREVENT: return m_auiEncounter[3]; + case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4]; + case DATA_TRASH: return Trash; + case DATA_ALLIANCE_RETREAT: return allianceRetreat; + case DATA_HORDE_RETREAT: return hordeRetreat; + case DATA_RAIDDAMAGE: return RaidDamage; } return 0; } @@ -329,13 +298,32 @@ public: OUT_LOAD_INST_DATA(in); std::istringstream loadStream(in); loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4] >> allianceRetreat >> hordeRetreat >> RaidDamage; - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + for (uint8 i = 0; i < EncounterCount; ++i) if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead. m_auiEncounter[i] = NOT_STARTED; OUT_LOAD_INST_DATA_COMPLETE; } - }; + protected: + uint32 m_auiEncounter[EncounterCount]; + std::string str_data; + std::list<uint64> m_uiAncientGemGUID; + uint64 RageWinterchill; + uint64 Anetheron; + uint64 Kazrogal; + uint64 Azgalor; + uint64 Archimonde; + uint64 JainaProudmoore; + uint64 Thrall; + uint64 TyrandeWhisperwind; + uint64 HordeGate; + uint64 ElfGate; + uint32 Trash; + uint32 hordeRetreat; + uint32 allianceRetreat; + uint32 RaidDamage; + bool ArchiYell; + }; }; void AddSC_instance_mount_hyjal() diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp index b365b09b3c3..c049be0309b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp @@ -52,7 +52,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_epochAI (creature); + return new boss_epochAI(creature); } struct boss_epochAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index bba812989ce..e16ed882171 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -66,7 +66,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_mal_ganisAI (creature); + return new boss_mal_ganisAI(creature); } struct boss_mal_ganisAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index 32499b1bef5..aff076f4763 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -51,7 +51,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_meathookAI (creature); + return new boss_meathookAI(creature); } struct boss_meathookAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp index fd63822fea3..fc5b3c4a8b0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp @@ -56,7 +56,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_salrammAI (creature); + return new boss_salrammAI(creature); } struct boss_salrammAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index 056dc887c68..3b51f6d0f8f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -54,7 +54,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_captain_skarlocAI (creature); + return new boss_captain_skarlocAI(creature); } struct boss_captain_skarlocAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 1e08d4d6bac..3e650bf4fe9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -52,7 +52,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_epoch_hunterAI (creature); + return new boss_epoch_hunterAI(creature); } struct boss_epoch_hunterAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index 337d1f45aba..681ed8e447f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -109,7 +109,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lieutenant_drakeAI (creature); + return new boss_lieutenant_drakeAI(creature); } struct boss_lieutenant_drakeAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp index 1b3311500c9..0d67426d039 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp @@ -140,7 +140,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_aeonusAI (creature); + return new boss_aeonusAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp index f411e24b283..a181c0fe43e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp @@ -145,7 +145,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_chrono_lord_dejaAI (creature); + return new boss_chrono_lord_dejaAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp index eeec1f58a0a..4bd06546a88 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp @@ -143,7 +143,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_temporusAI (creature); + return new boss_temporusAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 6c12dcd5e18..08adcc9ad6d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -70,7 +70,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_medivh_bmAI (creature); + return new npc_medivh_bmAI(creature); } struct npc_medivh_bmAI : public ScriptedAI @@ -264,7 +264,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_time_riftAI (creature); + return new npc_time_riftAI(creature); } struct npc_time_riftAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 687b29353f9..b8c1b4746b2 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -40,7 +40,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new celebras_the_cursedAI (creature); + return new celebras_the_cursedAI(creature); } struct celebras_the_cursedAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index ddfc918f95f..3cf6e3fab33 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -40,7 +40,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_landslideAI (creature); + return new boss_landslideAI(creature); } struct boss_landslideAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index 64751e886e5..d512478a229 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -39,7 +39,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_noxxionAI (creature); + return new boss_noxxionAI(creature); } struct boss_noxxionAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index fbe208df07c..7098d0da3fb 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -42,7 +42,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ptheradrasAI (creature); + return new boss_ptheradrasAI(creature); } struct boss_ptheradrasAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 62c912021a9..79421ffe37e 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -40,7 +40,6 @@ enum Yells SAY_KILL = 1, SAY_PHASE_2_TRANS = 2, SAY_PHASE_3_TRANS = 3, - // Emote EMOTE_BREATH = 4 }; @@ -75,6 +74,20 @@ enum Spells SPELL_BELLOWING_ROAR = 18431 }; +enum Events +{ + EVENT_BELLOWING_ROAR = 1, + EVENT_FLAME_BREATH = 2, + EVENT_TAIL_SWEEP = 3, + EVENT_CLEAVE = 4, + EVENT_WING_BUFFET = 5, + EVENT_DEEP_BREATH = 6, + EVENT_MOVEMENT = 7, + EVENT_FIREBALL = 8, + EVENT_LAIR_GUARD = 9, + EVENT_WHELP_SPAWN = 10 +}; + struct OnyxMove { uint8 LocId; @@ -113,73 +126,28 @@ class boss_onyxia : public CreatureScript public: boss_onyxia() : CreatureScript("boss_onyxia") { } - CreatureAI* GetAI(Creature* creature) const OVERRIDE + struct boss_onyxiaAI : public BossAI { - return new boss_onyxiaAI (creature); - } - - struct boss_onyxiaAI : public ScriptedAI - { - boss_onyxiaAI(Creature* creature) : ScriptedAI(creature), Summons(me) + boss_onyxiaAI(Creature* creature) : BossAI(creature, DATA_ONYXIA), Summons(me) { - instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* instance; - SummonList Summons; - - uint32 Phase; - - uint32 FlameBreathTimer; - uint32 CleaveTimer; - uint32 TailSweepTimer; - uint32 WingBuffetTimer; - - uint8 MovePoint; - uint32 MovementTimer; - OnyxMove* PointData; - - uint32 FireballTimer; - uint32 WhelpTimer; - uint32 LairGuardTimer; - uint32 DeepBreathTimer; - - uint32 BellowingRoarTimer; - - uint8 SummonWhelpCount; - bool IsMoving; - void Reset() OVERRIDE { if (!IsCombatMovementAllowed()) SetCombatMovement(true); Phase = PHASE_START; - - FlameBreathTimer = urand(10000, 20000); - TailSweepTimer = urand(15000, 20000); - CleaveTimer = urand(2000, 5000); - WingBuffetTimer = urand(10000, 20000); - MovePoint = urand(0, 5); - MovementTimer = 14000; PointData = GetMoveData(); - - FireballTimer = 15000; - WhelpTimer = 60000; - LairGuardTimer = 60000; - DeepBreathTimer = 85000; - - BellowingRoarTimer = 30000; - Summons.DespawnAll(); SummonWhelpCount = 0; IsMoving = false; if (instance) { - instance->SetData(DATA_ONYXIA, NOT_STARTED); + instance->SetBossState(DATA_ONYXIA, NOT_STARTED); instance->SetData(DATA_ONYXIA_PHASE, Phase); instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } @@ -190,9 +158,14 @@ public: Talk(SAY_AGGRO); me->SetInCombatWithZone(); + events.ScheduleEvent(EVENT_FLAME_BREATH, urand (10000, 20000)); + events.ScheduleEvent(EVENT_TAIL_SWEEP, urand (15000, 20000)); + events.ScheduleEvent(EVENT_CLEAVE, urand (2000, 5000)); + events.ScheduleEvent(EVENT_WING_BUFFET, urand (10000, 20000)); + if (instance) { - instance->SetData(DATA_ONYXIA, IN_PROGRESS); + instance->SetBossState(DATA_ONYXIA, IN_PROGRESS); instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } @@ -200,7 +173,7 @@ public: void JustDied(Unit* /*killer*/) OVERRIDE { if (instance) - instance->SetData(DATA_ONYXIA, DONE); + instance->SetBossState(DATA_ONYXIA, DONE); Summons.DespawnAll(); } @@ -266,7 +239,7 @@ public: break; case 9: me->GetMotionMaster()->MoveChase(me->GetVictim()); - BellowingRoarTimer = 1000; + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 1000); break; case 10: me->SetCanFly(true); @@ -275,17 +248,15 @@ public: Talk(SAY_PHASE_2_TRANS); if (instance) instance->SetData(DATA_ONYXIA_PHASE, Phase); - WhelpTimer = 5000; - LairGuardTimer = 15000; + events.ScheduleEvent(EVENT_WHELP_SPAWN, 5000); + events.ScheduleEvent(EVENT_LAIR_GUARD, 15000); break; case 11: if (PointData) me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ); me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveIdle(); - break; - default: IsMoving = false; break; @@ -341,7 +312,7 @@ public: MovePoint = iTemp; } - void UpdateAI(uint32 Diff) OVERRIDE + void UpdateAI(uint32 diff) OVERRIDE { if (!UpdateVictim()) return; @@ -356,60 +327,55 @@ public: { SetCombatMovement(false); Phase = PHASE_BREATH; + events.ScheduleEvent(EVENT_DEEP_BREATH, 85000); + events.ScheduleEvent(EVENT_MOVEMENT, 14000); + events.ScheduleEvent(EVENT_FIREBALL, 15000); + events.ScheduleEvent(EVENT_LAIR_GUARD, 60000); + events.ScheduleEvent(EVENT_WHELP_SPAWN, 60000); me->GetMotionMaster()->MovePoint(10, Phase2Location); return; } } - else - { - if (BellowingRoarTimer <= Diff) - { - DoCastVictim(SPELL_BELLOWING_ROAR); - // Eruption - GameObject* Floor = NULL; - Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15); - Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, Floor, check); - me->VisitNearbyGridObject(30, searcher); - if (instance && Floor) - instance->SetData64(DATA_FLOOR_ERUPTION_GUID, Floor->GetGUID()); - BellowingRoarTimer = 30000; - } - else - BellowingRoarTimer -= Diff; - } - - if (FlameBreathTimer <= Diff) - { - DoCastVictim(SPELL_FLAME_BREATH); - FlameBreathTimer = urand(10000, 20000); - } - else - FlameBreathTimer -= Diff; - - if (TailSweepTimer <= Diff) - { - DoCastAOE(SPELL_TAIL_SWEEP); - TailSweepTimer = urand(15000, 20000); - } - else - TailSweepTimer -= Diff; - if (CleaveTimer <= Diff) - { - DoCastVictim(SPELL_CLEAVE); - CleaveTimer = urand(2000, 5000); - } - else - CleaveTimer -= Diff; + events.Update(diff); - if (WingBuffetTimer <= Diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCastVictim(SPELL_WING_BUFFET); - WingBuffetTimer = urand(15000, 30000); + switch (eventId) + { + case EVENT_BELLOWING_ROAR: // Phase PHASE_END + { + DoCastVictim(SPELL_BELLOWING_ROAR); + // Eruption + GameObject* Floor = NULL; + Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15); + Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, Floor, check); + me->VisitNearbyGridObject(30, searcher); + if (instance && Floor) + instance->SetData64(DATA_FLOOR_ERUPTION_GUID, Floor->GetGUID()); + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000); + break; + } + case EVENT_FLAME_BREATH: // Phase PHASE_START and PHASE_END + DoCastVictim(SPELL_FLAME_BREATH); + events.ScheduleEvent(EVENT_FLAME_BREATH, urand (10000, 20000)); + break; + case EVENT_TAIL_SWEEP: // Phase PHASE_START and PHASE_END + DoCastAOE(SPELL_TAIL_SWEEP); + events.ScheduleEvent(EVENT_TAIL_SWEEP, urand (15000, 20000)); + break; + case EVENT_CLEAVE: // Phase PHASE_START and PHASE_END + DoCastVictim(SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, urand (2000, 5000)); + break; + case EVENT_WING_BUFFET: // Phase PHASE_START and PHASE_END + DoCastVictim(SPELL_WING_BUFFET); + events.ScheduleEvent(EVENT_WING_BUFFET, urand (15000, 30000)); + break; + default: + break; + } } - else - WingBuffetTimer -= Diff; - DoMeleeAttackIfReady(); } else @@ -418,88 +384,93 @@ public: { Phase = PHASE_END; if (instance) - instance->SetData(DATA_ONYXIA_PHASE, Phase); + instance->SetData(DATA_ONYXIA_PHASE, PHASE_END); Talk(SAY_PHASE_3_TRANS); SetCombatMovement(true); me->SetCanFly(false); IsMoving = false; me->GetMotionMaster()->MovePoint(9, me->GetHomePosition()); + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000); return; } - if (DeepBreathTimer <= Diff) - { - if (!IsMoving) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); + events.Update(diff); - Talk(EMOTE_BREATH); - DoCast(me, PointData->SpellId); - DeepBreathTimer = 70000; - } - } - else - DeepBreathTimer -= Diff; - - if (MovementTimer <= Diff) + while (uint32 eventId = events.ExecuteEvent()) { - if (!IsMoving) + switch (eventId) { - SetNextRandomPoint(); - PointData = GetMoveData(); - - if (!PointData) - return; - - me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ); - IsMoving = true; - MovementTimer = 25000; + case EVENT_DEEP_BREATH: // Phase PHASE_BREATH + if (!IsMoving) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); + + Talk(EMOTE_BREATH); + if (PointData) /// @todo: In what cases is this null? What should we do? + DoCast(me, PointData->SpellId); + events.ScheduleEvent(EVENT_DEEP_BREATH, 70000); + } + break; + case EVENT_MOVEMENT: // Phase PHASE_BREATH + if (!IsMoving && !(me->HasUnitState(UNIT_STATE_CASTING))) + { + SetNextRandomPoint(); + PointData = GetMoveData(); + + if (!PointData) + return; + + me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ); + IsMoving = true; + events.ScheduleEvent(EVENT_MOVEMENT, 25000); + } + break; + case EVENT_FIREBALL: // Phase PHASE_BREATH + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_FIREBALL); + + events.ScheduleEvent(EVENT_FIREBALL, 8000); + } + break; + case EVENT_LAIR_GUARD: // Phase PHASE_BREATH + me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN); + events.ScheduleEvent(EVENT_LAIR_GUARD, 30000); + break; + case EVENT_WHELP_SPAWN: // Phase PHASE_BREATH + me->SummonCreature(NPC_WHELP, SpawnLocations[0], TEMPSUMMON_CORPSE_DESPAWN); + me->SummonCreature(NPC_WHELP, SpawnLocations[1], TEMPSUMMON_CORPSE_DESPAWN); + if (SummonWhelpCount >= RAID_MODE(20, 40)) + { + SummonWhelpCount = 0; + events.ScheduleEvent(EVENT_WHELP_SPAWN, 90000); + } + else + events.ScheduleEvent(EVENT_WHELP_SPAWN, 500); + break; + default: + break; } } - else - MovementTimer -= Diff; - - if (FireballTimer <= Diff) - { - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_FIREBALL); - - FireballTimer = 8000; - } - } - else - FireballTimer -= Diff; - - if (LairGuardTimer <= Diff) - { - me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN); - LairGuardTimer = 30000; - } - else - LairGuardTimer -= Diff; - - if (WhelpTimer <= Diff) - { - me->SummonCreature(NPC_WHELP, SpawnLocations[0], TEMPSUMMON_CORPSE_DESPAWN); - me->SummonCreature(NPC_WHELP, SpawnLocations[1], TEMPSUMMON_CORPSE_DESPAWN); - if (SummonWhelpCount >= RAID_MODE(20, 40)) - { - SummonWhelpCount = 0; - WhelpTimer = 90000; - } - else - WhelpTimer = 500; - } - else - WhelpTimer -= Diff; } } + + private: + SummonList Summons; + OnyxMove* PointData; + uint8 Phase; + uint8 MovePoint; + uint8 SummonWhelpCount; + bool IsMoving; }; + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new boss_onyxiaAI(creature); + } }; void AddSC_boss_onyxia() diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index 6ae8a2ef709..eed8ab22eb1 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -47,30 +47,18 @@ public: //Eruption is a BFS graph problem //One map to remember all floor, one map to keep floor that still need to erupt and one queue to know what needs to be removed - std::map<uint64, uint32> FloorEruptionGUID[2]; - std::queue<uint64> FloorEruptionGUIDQueue; - - uint64 OnyxiasGUID; - uint32 OnyxiaLiftoffTimer; - uint32 ManyWhelpsCounter; - uint32 EruptTimer; - - uint8 Encounter[MAX_ENCOUNTER]; - - bool AchievManyWhelpsHandleIt; - bool AchievSheDeepBreathMore; void Initialize() { - memset(&Encounter, 0, sizeof(Encounter)); + SetBossNumber(EncounterCount); - OnyxiasGUID = 0; - OnyxiaLiftoffTimer = 0; - ManyWhelpsCounter = 0; - AchievManyWhelpsHandleIt = false; - AchievSheDeepBreathMore = true; + onyxiaGUID = 0; + onyxiaLiftoffTimer = 0; + manyWhelpsCounter = 0; + eruptTimer = 0; - EruptTimer = 0; + achievManyWhelpsHandleIt = false; + achievSheDeepBreathMore = true; } void OnCreatureCreate(Creature* creature) @@ -78,7 +66,7 @@ public: switch (creature->GetEntry()) { case NPC_ONYXIA: - OnyxiasGUID = creature->GetGUID(); + onyxiaGUID = creature->GetGUID(); break; } } @@ -99,7 +87,7 @@ public: if (Creature* temp = go->SummonCreature(NPC_WHELP, goPos, TEMPSUMMON_CORPSE_DESPAWN)) { temp->SetInCombatWithZone(); - ++ManyWhelpsCounter; + ++manyWhelpsCounter; } break; } @@ -116,18 +104,18 @@ public: void FloorEruption(uint64 floorEruptedGUID) { - if (GameObject* pFloorEruption = instance->GetGameObject(floorEruptedGUID)) + if (GameObject* floorEruption = instance->GetGameObject(floorEruptedGUID)) { //THIS GOB IS A TRAP - What shall i do? =( //Cast it spell? Copyed Heigan method - pFloorEruption->SendCustomAnim(pFloorEruption->GetGoAnimProgress()); - pFloorEruption->CastSpell(NULL, Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId + floorEruption->SendCustomAnim(floorEruption->GetGoAnimProgress()); + floorEruption->CastSpell(NULL, Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId //Get all immediatly nearby floors std::list<GameObject*> nearFloorList; - Trinity::GameObjectInRangeCheck check(pFloorEruption->GetPositionX(), pFloorEruption->GetPositionY(), pFloorEruption->GetPositionZ(), 15); - Trinity::GameObjectListSearcher<Trinity::GameObjectInRangeCheck> searcher(pFloorEruption, nearFloorList, check); - pFloorEruption->VisitNearbyGridObject(999, searcher); + Trinity::GameObjectInRangeCheck check(floorEruption->GetPositionX(), floorEruption->GetPositionY(), floorEruption->GetPositionZ(), 15); + Trinity::GameObjectListSearcher<Trinity::GameObjectInRangeCheck> searcher(floorEruption, nearFloorList, check); + floorEruption->VisitNearbyGridObject(999, searcher); //remove all that are not present on FloorEruptionGUID[1] and update treeLen on each GUID for (std::list<GameObject*>::const_iterator itr = nearFloorList.begin(); itr != nearFloorList.end(); ++itr) { @@ -145,88 +133,84 @@ public: FloorEruptionGUID[1].erase(floorEruptedGUID); } - void SetData(uint32 Type, uint32 Data) OVERRIDE + bool SetBossState(uint32 type, EncounterState state) { - switch (Type) + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) { case DATA_ONYXIA: - Encounter[0] = Data; - if (Data == IN_PROGRESS) - SetData(DATA_SHE_DEEP_BREATH_MORE, IN_PROGRESS); + if (state == IN_PROGRESS) + SetBossState(DATA_SHE_DEEP_BREATH_MORE, IN_PROGRESS); break; + } + return true; + } + + void SetData(uint32 type, uint32 data) OVERRIDE + { + switch (type) + { case DATA_ONYXIA_PHASE: - if (Data == PHASE_BREATH) //Used to mark the liftoff phase + if (data == PHASE_BREATH) //Used to mark the liftoff phase { - AchievManyWhelpsHandleIt = false; - ManyWhelpsCounter = 0; - OnyxiaLiftoffTimer = 10*IN_MILLISECONDS; + achievManyWhelpsHandleIt = false; + manyWhelpsCounter = 0; + onyxiaLiftoffTimer = 10000; } break; case DATA_SHE_DEEP_BREATH_MORE: - if (Data == IN_PROGRESS) + if (data == IN_PROGRESS) { - AchievSheDeepBreathMore = true; + achievSheDeepBreathMore = true; } - else if (Data == FAIL) + else if (data == FAIL) { - AchievSheDeepBreathMore = false; + achievSheDeepBreathMore = false; } break; } - - if (Type < MAX_ENCOUNTER && Data == DONE) - SaveToDB(); } - void SetData64(uint32 Type, uint64 Data) OVERRIDE + void SetData64(uint32 type, uint64 data) OVERRIDE { - switch (Type) + switch (type) { case DATA_FLOOR_ERUPTION_GUID: FloorEruptionGUID[1] = FloorEruptionGUID[0]; - FloorEruptionGUIDQueue.push(Data); - EruptTimer = 2500; + FloorEruptionGUIDQueue.push(data); + eruptTimer = 2500; break; } } - uint32 GetData(uint32 Type) const OVERRIDE + uint64 GetData64(uint32 data) const OVERRIDE { - switch (Type) + switch (data) { - case DATA_ONYXIA: - return Encounter[0]; - } - - return 0; - } - - uint64 GetData64(uint32 Data) const OVERRIDE - { - switch (Data) - { - case DATA_ONYXIA_GUID: - return OnyxiasGUID; + case NPC_ONYXIA: + return onyxiaGUID; } return 0; } - void Update(uint32 Diff) + void Update(uint32 diff) { - if (GetData(DATA_ONYXIA) == IN_PROGRESS) + if (GetBossState(DATA_ONYXIA) == IN_PROGRESS) { - if (OnyxiaLiftoffTimer && OnyxiaLiftoffTimer <= Diff) + if (onyxiaLiftoffTimer && onyxiaLiftoffTimer <= diff) { - OnyxiaLiftoffTimer = 0; - if (ManyWhelpsCounter >= 50) - AchievManyWhelpsHandleIt = true; - } else OnyxiaLiftoffTimer -= Diff; + onyxiaLiftoffTimer = 0; + if (manyWhelpsCounter >= 50) + achievManyWhelpsHandleIt = true; + } else onyxiaLiftoffTimer -= diff; } if (!FloorEruptionGUIDQueue.empty()) { - if (EruptTimer <= Diff) + if (eruptTimer <= diff) { uint32 treeHeight = 0; do @@ -235,10 +219,10 @@ public: FloorEruption(FloorEruptionGUIDQueue.front()); FloorEruptionGUIDQueue.pop(); } while (!FloorEruptionGUIDQueue.empty() && (*FloorEruptionGUID[1].find(FloorEruptionGUIDQueue.front())).second == treeHeight); - EruptTimer = 1000; + eruptTimer = 1000; } else - EruptTimer -= Diff; + eruptTimer -= diff; } } @@ -248,15 +232,68 @@ public: { case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER: // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER: // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s - return AchievManyWhelpsHandleIt; + return achievManyWhelpsHandleIt; case ACHIEV_CRITERIA_DEEP_BREATH_10_PLAYER: // Criteria for achievement 4404: She Deep Breaths More (10 player) Everybody evade Deep Breath case ACHIEV_CRITERIA_DEEP_BREATH_25_PLAYER: // Criteria for achievement 4407: She Deep Breaths More (25 player) Everybody evade Deep Breath - return AchievSheDeepBreathMore; + return achievSheDeepBreathMore; } return false; } - }; + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "O L " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* strIn) + { + if (!strIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(strIn); + + char dataHead1, dataHead2; + + std::istringstream loadStream(strIn); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'O' && dataHead2 == 'L') + { + for (uint8 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + protected: + std::map<uint64, uint32> FloorEruptionGUID[2]; + std::queue<uint64> FloorEruptionGUIDQueue; + uint64 onyxiaGUID; + uint32 onyxiaLiftoffTimer; + uint32 manyWhelpsCounter; + uint32 eruptTimer; + bool achievManyWhelpsHandleIt; + bool achievSheDeepBreathMore; + }; }; void AddSC_instance_onyxias_lair() diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h index 91faf6dedb0..bf5010e4658 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h +++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h @@ -18,28 +18,24 @@ #ifndef DEF_ONYXIAS_LAIR_H #define DEF_ONYXIAS_LAIR_H -enum Data64 +uint32 const EncounterCount = 1; + +enum DataTypes { - DATA_ONYXIA_GUID, - DATA_FLOOR_ERUPTION_GUID + DATA_ONYXIA = 0, }; -enum InstanceData +enum Data32 { - DATA_ONYXIA, - MAX_ENCOUNTER, - - DATA_ONYXIA_PHASE, - DATA_SHE_DEEP_BREATH_MORE, - DATA_MANY_WHELPS_COUNT + DATA_ONYXIA_PHASE = 0, + DATA_SHE_DEEP_BREATH_MORE = 1, + DATA_MANY_WHELPS_COUNT = 2 }; -enum Creatures +enum Data64 { - NPC_WHELP = 11262, - NPC_LAIRGUARD = 36561, - - NPC_ONYXIA = 10184 + DATA_ONYXIA_GUID = 0, + DATA_FLOOR_ERUPTION_GUID = 1 }; enum OnyxiaPhases @@ -49,7 +45,14 @@ enum OnyxiaPhases PHASE_END = 3 }; -enum GameObjects +enum CreatureIds +{ + NPC_WHELP = 11262, + NPC_LAIRGUARD = 36561, + NPC_ONYXIA = 10184 +}; + +enum GameObjectIds { GO_WHELP_SPAWNER = 176510, GO_WHELP_EGG = 176511 diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index 7d173ea5955..15b1fa51548 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -47,7 +47,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_amnennar_the_coldbringerAI (creature); + return new boss_amnennar_the_coldbringerAI(creature); } struct boss_amnennar_the_coldbringerAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index a49b4477f20..320c9970077 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -39,54 +39,64 @@ EndContentData */ enum Spells { - SPELL_GOLDTHORN_TEA = 13028, SPELL_TEACHING_GOLDTHORN_TEA = 13029, - SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, - SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, + SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030 }; enum Gossips { - GOSSIP_TEXT_TEA_ANSWER = 2114, - GOSSIP_TEXT_POTION_ANSWER = 2115, + GOSSIP_COOKING_SKILL_HIGH = 1444, + GOSSIP_COOKING_SKILL_LOW = 1501, + GOSSIP_ALCHEMY_SKILL_HIGH = 1442, + GOSSIP_ALCHEMY_SKILL_LOW = 1502 }; -#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" -#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" - class npc_henry_stern : public CreatureScript { public: npc_henry_stern() : CreatureScript("npc_henry_stern") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE + struct npc_henry_sternAI : public ScriptedAI { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - player->CastSpell(player, SPELL_TEACHING_GOLDTHORN_TEA, true); - player->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, creature->GetGUID()); - } + npc_henry_sternAI(Creature* creature) : ScriptedAI(creature) { } - if (action == GOSSIP_ACTION_INFO_DEF + 2) + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) OVERRIDE { - player->CastSpell(player, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); - player->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, creature->GetGUID()); - } + if (action == 0) + { + if (player->GetBaseSkillValue(SKILL_COOKING) >= 175) + { + player->PrepareGossipMenu(me, GOSSIP_COOKING_SKILL_HIGH); + player->SendPreparedGossip(me); + DoCast(player, SPELL_TEACHING_GOLDTHORN_TEA); + } + else + { + player->PrepareGossipMenu(me, GOSSIP_COOKING_SKILL_LOW); + player->SendPreparedGossip(me); + } + } - return true; - } + if (action == 1) + { + if (player->GetBaseSkillValue(SKILL_ALCHEMY) >= 180) + { + player->PrepareGossipMenu(me, GOSSIP_ALCHEMY_SKILL_HIGH); + player->SendPreparedGossip(me); + DoCast(player, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION); + } + else + { + player->PrepareGossipMenu(me, GOSSIP_ALCHEMY_SKILL_LOW); + player->SendPreparedGossip(me); + } + } + } + }; - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE + CreatureAI* GetAI(Creature* creature) const OVERRIDE { - if (player->GetBaseSkillValue(SKILL_COOKING) >= 175 && !player->HasSpell(SPELL_GOLDTHORN_TEA)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !player->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; + return new npc_henry_sternAI(creature); } }; @@ -127,7 +137,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tomb_creatureAI (creature); + return new npc_tomb_creatureAI(creature); } struct npc_tomb_creatureAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index 735ecb0c595..c13ae5aa9c8 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -127,7 +127,7 @@ class boss_kurinnaxx : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kurinnaxxAI (creature); + return new boss_kurinnaxxAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index c19f16e0839..366f74f469e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -273,7 +273,7 @@ class boss_ossirian : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ossirianAI (creature); + return new boss_ossirianAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index 87dbe3b0098..b8d91065d05 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -121,7 +121,7 @@ class boss_rajaxx : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_rajaxxAI (creature); + return new boss_rajaxxAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index fcc6317b15e..53e09c918ea 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kriAI (creature); + return new boss_kriAI(creature); } struct boss_kriAI : public ScriptedAI @@ -145,7 +145,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_vemAI (creature); + return new boss_vemAI(creature); } struct boss_vemAI : public ScriptedAI @@ -238,7 +238,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_yaujAI (creature); + return new boss_yaujAI(creature); } struct boss_yaujAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 1e9e318f3a9..f98494c7c82 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -153,7 +153,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new eye_of_cthunAI (creature); + return new eye_of_cthunAI(creature); } struct eye_of_cthunAI : public ScriptedAI @@ -459,7 +459,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new cthunAI (creature); + return new cthunAI(creature); } struct cthunAI : public ScriptedAI @@ -915,7 +915,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new eye_tentacleAI (creature); + return new eye_tentacleAI(creature); } struct eye_tentacleAI : public ScriptedAI @@ -990,7 +990,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new claw_tentacleAI (creature); + return new claw_tentacleAI(creature); } struct claw_tentacleAI : public ScriptedAI @@ -1100,7 +1100,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new giant_claw_tentacleAI (creature); + return new giant_claw_tentacleAI(creature); } struct giant_claw_tentacleAI : public ScriptedAI @@ -1219,7 +1219,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new giant_eye_tentacleAI (creature); + return new giant_eye_tentacleAI(creature); } struct giant_eye_tentacleAI : public ScriptedAI @@ -1283,7 +1283,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new flesh_tentacleAI (creature); + return new flesh_tentacleAI(creature); } struct flesh_tentacleAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 4b4cb15edbf..59c7565d060 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fankrissAI (creature); + return new boss_fankrissAI(creature); } struct boss_fankrissAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index c74ce8ef68b..54da5a30802 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -46,7 +46,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_huhuranAI (creature); + return new boss_huhuranAI(creature); } struct boss_huhuranAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index f9b78c307c4..36dd93076e7 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ouroAI (creature); + return new boss_ouroAI(creature); } struct boss_ouroAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index 008dfac6a11..a12da4fabd1 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_sarturaAI (creature); + return new boss_sarturaAI(creature); } struct boss_sarturaAI : public ScriptedAI @@ -191,7 +191,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_sartura_royal_guardAI (creature); + return new npc_sartura_royal_guardAI(creature); } struct npc_sartura_royal_guardAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index c20a8b29418..e9cf887f22b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -394,7 +394,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_veknilashAI (creature); + return new boss_veknilashAI(creature); } struct boss_veknilashAI : public boss_twinemperorsAI @@ -480,7 +480,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_veklorAI (creature); + return new boss_veklorAI(creature); } struct boss_veklorAI : public boss_twinemperorsAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 77c72924069..d78f8bd609d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -66,7 +66,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new aqsentinelAI (creature); + return new aqsentinelAI(creature); } struct aqsentinelAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 19d922de2bd..f59dbb785a8 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -97,7 +97,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_sergeant_blyAI (creature); + return new npc_sergeant_blyAI(creature); } struct npc_sergeant_blyAI : public ScriptedAI @@ -296,7 +296,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_weegli_blastfuseAI (creature); + return new npc_weegli_blastfuseAI(creature); } struct npc_weegli_blastfuseAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 229a9035f7c..56d380b7b46 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -49,7 +49,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_azuregosAI (creature); + return new boss_azuregosAI(creature); } struct boss_azuregosAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index 8eb78cbf438..01b8b9c1bcf 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_spitelashesAI (creature); + return new npc_spitelashesAI(creature); } struct npc_spitelashesAI : public ScriptedAI @@ -305,7 +305,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_rizzle_sprysprocketAI (creature); + return new npc_rizzle_sprysprocketAI(creature); } struct npc_rizzle_sprysprocketAI : public ScriptedAI @@ -481,7 +481,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_depth_chargeAI (creature); + return new npc_depth_chargeAI(creature); } struct npc_depth_chargeAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index f5902faa3ff..f5c8c90d921 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_draenei_survivorAI (creature); + return new npc_draenei_survivorAI(creature); } struct npc_draenei_survivorAI : public ScriptedAI @@ -218,7 +218,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_engineer_spark_overgrindAI (creature); + return new npc_engineer_spark_overgrindAI(creature); } struct npc_engineer_spark_overgrindAI : public ScriptedAI @@ -296,7 +296,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_injured_draeneiAI (creature); + return new npc_injured_draeneiAI(creature); } struct npc_injured_draeneiAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index d9989c5035c..ab74a76a440 100644 --- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -47,7 +47,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_webbed_creatureAI (creature); + return new npc_webbed_creatureAI(creature); } struct npc_webbed_creatureAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index 936713a451a..b9d3c6f1cc6 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -128,7 +128,7 @@ class npc_risen_husk_spirit : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_risen_husk_spiritAI (creature); + return new npc_risen_husk_spiritAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index 2b9e89bfbf3..6885e44a245 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -290,7 +290,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_clintar_spiritAI (creature); + return new npc_clintar_spiritAI(creature); } struct npc_clintar_spiritAI : public npc_escortAI diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp index 435238cbc0d..5cd0b9f568b 100644 --- a/src/server/scripts/Kalimdor/zone_mulgore.cpp +++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp @@ -93,7 +93,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_kyle_frenziedAI (creature); + return new npc_kyle_frenziedAI(creature); } struct npc_kyle_frenziedAI : public ScriptedAI @@ -266,7 +266,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_plains_visionAI (creature); + return new npc_plains_visionAI(creature); } struct npc_plains_visionAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp index 9f824f0f1f0..afd320af3ac 100644 --- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp @@ -59,7 +59,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shenthulAI (creature); + return new npc_shenthulAI(creature); } struct npc_shenthulAI : public ScriptedAI @@ -206,7 +206,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_thrall_warchiefAI (creature); + return new npc_thrall_warchiefAI(creature); } struct npc_thrall_warchiefAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index f20266dfb55..154f8b0f80f 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -530,10 +530,10 @@ public: if (!player) return; - Creature* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me); - Creature* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f, me); - Creature* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f, me); - Creature* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f, me); + Creature* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f); + Creature* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f); + Creature* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f); + Creature* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f); if (!Fandral || !Arygos || !Caelestrasz || !Merithra) return; diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 7bb499e0fd4..0b12e6bf48c 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -60,7 +60,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_aquementasAI (creature); + return new npc_aquementasAI(creature); } struct npc_aquementasAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 13b254ac0b2..62867c46f78 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -176,42 +176,6 @@ public: }; /*###### -## npc_sputtervalve -######*/ - -#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?" - -class npc_sputtervalve : public CreatureScript -{ -public: - npc_sputtervalve() : CreatureScript("npc_sputtervalve") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->SEND_GOSSIP_MENU(2013, creature->GetGUID()); - player->AreaExploredOrEventHappens(6981); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - -}; - -/*###### ## npc_taskmaster_fizzule ######*/ @@ -345,7 +309,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_twiggy_flatheadAI (creature); + return new npc_twiggy_flatheadAI(creature); } struct npc_twiggy_flatheadAI : public ScriptedAI @@ -691,7 +655,6 @@ void AddSC_the_barrens() { new npc_beaten_corpse(); new npc_gilthares(); - new npc_sputtervalve(); new npc_taskmaster_fizzule(); new npc_twiggy_flathead(); new npc_wizzlecrank_shredder(); diff --git a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp index 01dd65755f6..7dda6ab027f 100644 --- a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp @@ -74,7 +74,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_cairne_bloodhoofAI (creature); + return new npc_cairne_bloodhoofAI(creature); } struct npc_cairne_bloodhoofAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index 9a96e787f87..481df79c890 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -216,7 +216,7 @@ public: void SummonedCreatureDespawn(Creature* summon) OVERRIDE { - uint32 phase= summon->GetPhaseMask(); + uint32 phase = summon->GetPhaseMask(); uint32 nextPhase = 0; Summons.Despawn(summon); diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 674c35836a2..e04a4c43479 100644 --- a/src/server/scripts/Northrend/CMakeLists.txt +++ b/src/server/scripts/Northrend/CMakeLists.txt @@ -193,7 +193,7 @@ set(scripts_STAT_SRCS Northrend/DraktharonKeep/boss_novos.cpp Northrend/DraktharonKeep/drak_tharon_keep.h Northrend/DraktharonKeep/boss_tharon_ja.cpp - Northrend/DraktharonKeep/boss_dred.cpp + Northrend/DraktharonKeep/boss_king_dred.cpp ) message(" -> Prepared: Northrend") diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index cbb2686bc14..970c53e56ee 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -129,8 +129,8 @@ public: uiDeathArmyCheckTimer = 7000; uiResurrectTimer = 4000; uiGhoulExplodeTimer = 8000; - uiDeathBiteTimer = urand (2000, 4000); - uiMarkedDeathTimer = urand (5000, 7000); + uiDeathBiteTimer = urand(2000, 4000); + uiMarkedDeathTimer = urand(5000, 7000); } void RemoveSummons() @@ -249,7 +249,7 @@ public: if (uiDeathBiteTimer <= uiDiff) { DoCastAOE(SPELL_DEATH_BITE); - uiDeathBiteTimer = urand (2000, 4000); + uiDeathBiteTimer = urand(2000, 4000); } else uiDeathBiteTimer -= uiDiff; if (uiMarkedDeathTimer <= uiDiff) { @@ -258,7 +258,7 @@ public: if (target && target->IsAlive()) DoCast(target, SPELL_MARKED_DEATH); } - uiMarkedDeathTimer = urand (5000, 7000); + uiMarkedDeathTimer = urand(5000, 7000); } else uiMarkedDeathTimer -= uiDiff; break; } @@ -300,7 +300,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_black_knightAI (creature); + return new boss_black_knightAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 4068222f9b7..3dc537b4c23 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -539,7 +539,7 @@ class boss_toc_champion_controller : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_toc_champion_controllerAI (creature); + return new boss_toc_champion_controllerAI(creature); } }; @@ -839,7 +839,7 @@ class npc_toc_druid : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_druidAI (creature); + return new npc_toc_druidAI(creature); } }; @@ -932,7 +932,7 @@ class npc_toc_shaman : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_shamanAI (creature); + return new npc_toc_shamanAI(creature); } }; @@ -1036,7 +1036,7 @@ class npc_toc_paladin : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_paladinAI (creature); + return new npc_toc_paladinAI(creature); } }; @@ -1121,7 +1121,7 @@ class npc_toc_priest : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_priestAI (creature); + return new npc_toc_priestAI(creature); } }; @@ -1219,7 +1219,7 @@ class npc_toc_shadow_priest : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_shadow_priestAI (creature); + return new npc_toc_shadow_priestAI(creature); } }; @@ -1310,7 +1310,7 @@ class npc_toc_warlock : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_warlockAI (creature); + return new npc_toc_warlockAI(creature); } }; @@ -1404,7 +1404,7 @@ class npc_toc_mage : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_mageAI (creature); + return new npc_toc_mageAI(creature); } }; @@ -1506,7 +1506,7 @@ class npc_toc_hunter : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_hunterAI (creature); + return new npc_toc_hunterAI(creature); } }; @@ -1598,7 +1598,7 @@ class npc_toc_boomkin : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_boomkinAI (creature); + return new npc_toc_boomkinAI(creature); } }; @@ -1702,7 +1702,7 @@ class npc_toc_warrior : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_warriorAI (creature); + return new npc_toc_warriorAI(creature); } }; @@ -1798,7 +1798,7 @@ class npc_toc_dk : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_dkAI (creature); + return new npc_toc_dkAI(creature); } }; @@ -1903,7 +1903,7 @@ class npc_toc_rogue : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_rogueAI (creature); + return new npc_toc_rogueAI(creature); } }; @@ -2029,7 +2029,7 @@ class npc_toc_enh_shaman : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_enh_shamanAI (creature); + return new npc_toc_enh_shamanAI(creature); } }; @@ -2135,7 +2135,7 @@ class npc_toc_retro_paladin : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_retro_paladinAI (creature); + return new npc_toc_retro_paladinAI(creature); } }; @@ -2187,7 +2187,7 @@ class npc_toc_pet_warlock : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_pet_warlockAI (creature); + return new npc_toc_pet_warlockAI(creature); } }; @@ -2227,7 +2227,7 @@ class npc_toc_pet_hunter : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_pet_hunterAI (creature); + return new npc_toc_pet_hunterAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 24cbbee76b8..b590b963c34 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -318,7 +318,8 @@ class boss_lich_king_toc : public CreatureScript _instance->SetData(TYPE_EVENT, 5080); break; case 5080: - if (GameObject* go = _instance->instance->GetGameObject(_instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) + { + if (GameObject* go = GameObject::GetGameObject(*me, _instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) { go->SetDisplayId(DISPLAYID_DESTROYED_FLOOR); go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED | GO_FLAG_NODESPAWN); @@ -328,18 +329,17 @@ class boss_lich_king_toc : public CreatureScript me->CastSpell(me, SPELL_CORPSE_TELEPORT, false); me->CastSpell(me, SPELL_DESTROY_FLOOR_KNOCKUP, false); - if (_instance) - { - _instance->SetBossState(BOSS_LICH_KING, DONE); - Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_ANUBARAK)); - if (!temp || !temp->IsAlive()) - temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); + _instance->SetBossState(BOSS_LICH_KING, DONE); + Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_ANUBARAK)); + if (!temp || !temp->IsAlive()) + temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); + + _instance->SetData(TYPE_EVENT, 0); - _instance->SetData(TYPE_EVENT, 0); - } me->DespawnOrUnsummon(); _updateTimer = 20*IN_MILLISECONDS; break; + } default: break; } diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp index 34ced66c8be..f8f0752184e 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp @@ -27,128 +27,54 @@ enum Spells { SPELL_BELLOWING_ROAR = 22686, // fears the group, can be resisted/dispelled SPELL_GRIEVOUS_BITE = 48920, - SPELL_MANGLING_SLASH = 48873, //casted on the current tank, adds debuf + SPELL_MANGLING_SLASH = 48873, // casted on the current tank, adds debuf SPELL_FEARSOME_ROAR = 48849, - H_SPELL_FEARSOME_ROAR = 59422, //Not stacking, debuff - SPELL_PIERCING_SLASH = 48878, //debuff -->Armor reduced by 75% - SPELL_RAPTOR_CALL = 59416, //dummy + SPELL_PIERCING_SLASH = 48878, // debuff --> Armor reduced by 75% + SPELL_RAPTOR_CALL = 59416, // dummy SPELL_GUT_RIP = 49710, SPELL_REND = 13738 }; -enum Creatures +enum Misc { - NPC_RAPTOR_1 = 26641, - NPC_RAPTOR_2 = 26628 + ACTION_RAPTOR_KILLED = 1, + DATA_RAPTORS_KILLED = 2 }; -enum Misc +enum Events { - ACTION_RAPTOR_KILLED = 1, - DATA_KING_DRED = 2 + EVENT_BELLOWING_ROAR = 1, + EVENT_GRIEVOUS_BITE, + EVENT_MANGLING_SLASH, + EVENT_FEARSOME_ROAR, + EVENT_PIERCING_SLASH, + EVENT_RAPTOR_CALL }; -class boss_dred : public CreatureScript +class boss_king_dred : public CreatureScript { public: - boss_dred() : CreatureScript("boss_dred") { } + boss_king_dred() : CreatureScript("boss_king_dred") { } - struct boss_dredAI : public ScriptedAI + struct boss_king_dredAI : public BossAI { - boss_dredAI(Creature* creature) : ScriptedAI(creature) - { - instance = me->GetInstanceScript(); - } - - uint32 uiBellowingRoarTimer; - uint32 uiGrievousBiteTimer; - uint32 uiManglingSlashTimer; - uint32 uiFearsomeRoarTimer; - uint32 uiPiercingSlashTimer; - uint32 uiRaptorCallTimer; - uint8 raptorsKilled; - - InstanceScript* instance; + boss_king_dredAI(Creature* creature) : BossAI(creature, DATA_KING_DRED) { } void Reset() OVERRIDE { - if (instance) - instance->SetData(DATA_DRED_EVENT, NOT_STARTED); - - uiBellowingRoarTimer = 33000; - uiGrievousBiteTimer = 20000; - uiManglingSlashTimer = 18500; - uiFearsomeRoarTimer = urand(10000, 20000); - uiPiercingSlashTimer = 17000; - uiRaptorCallTimer = urand(20000, 25000); + _Reset(); } void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance) - instance->SetData(DATA_DRED_EVENT, IN_PROGRESS); - } - - void UpdateAI(uint32 diff) OVERRIDE - { - if (!UpdateVictim()) - return; - - if (uiBellowingRoarTimer <= diff) - { - DoCastAOE(SPELL_BELLOWING_ROAR, false); - uiBellowingRoarTimer = 40000; - } - else - uiBellowingRoarTimer -=diff; - - if (uiGrievousBiteTimer <= diff) - { - DoCastVictim(SPELL_GRIEVOUS_BITE, false); - uiGrievousBiteTimer = 20000; - } - else - uiGrievousBiteTimer -= diff; - - if (uiManglingSlashTimer <= diff) - { - DoCastVictim(SPELL_MANGLING_SLASH, false); - uiManglingSlashTimer = 20000; - } - else - uiManglingSlashTimer -= diff; - - if (uiFearsomeRoarTimer <= diff) - { - DoCastAOE(SPELL_FEARSOME_ROAR, false); - uiFearsomeRoarTimer = urand(16000, 18000); - } - else - uiFearsomeRoarTimer -= diff; - - if (uiPiercingSlashTimer <= diff) - { - DoCastVictim(SPELL_PIERCING_SLASH, false); - uiPiercingSlashTimer = 20000; - } - else - uiPiercingSlashTimer -= diff; - - if (uiRaptorCallTimer <= diff) - { - DoCastVictim(SPELL_RAPTOR_CALL, false); - - float x, y, z; - - me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 10.0f); - me->SummonCreature(RAND(NPC_RAPTOR_1, NPC_RAPTOR_2), x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000); - - uiRaptorCallTimer = urand(20000, 25000); - } - else - uiRaptorCallTimer -= diff; - - DoMeleeAttackIfReady(); + _EnterCombat(); + + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 33000); + events.ScheduleEvent(EVENT_GRIEVOUS_BITE, 20000); + events.ScheduleEvent(EVENT_MANGLING_SLASH, 18500); + events.ScheduleEvent(EVENT_FEARSOME_ROAR, urand(10000, 20000)); + events.ScheduleEvent(EVENT_PIERCING_SLASH, 17000); + events.ScheduleEvent(EVENT_RAPTOR_CALL, urand(20000, 25000)); } void DoAction(int32 action) OVERRIDE @@ -159,7 +85,7 @@ class boss_dred : public CreatureScript uint32 GetData(uint32 type) const OVERRIDE { - if (type == DATA_KING_DRED) + if (type == DATA_RAPTORS_KILLED) return raptorsKilled; return 0; @@ -167,14 +93,67 @@ class boss_dred : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (instance) - instance->SetData(DATA_DRED_EVENT, DONE); + _JustDied(); } + + 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_BELLOWING_ROAR: + DoCastAOE(SPELL_BELLOWING_ROAR); + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 33000); + break; + case EVENT_GRIEVOUS_BITE: + DoCastVictim(SPELL_GRIEVOUS_BITE); + events.ScheduleEvent(EVENT_GRIEVOUS_BITE, 20000); + break; + case EVENT_MANGLING_SLASH: + DoCastVictim(SPELL_MANGLING_SLASH); + events.ScheduleEvent(EVENT_MANGLING_SLASH, 18500); + break; + case EVENT_FEARSOME_ROAR: + DoCastAOE(SPELL_FEARSOME_ROAR); + events.ScheduleEvent(EVENT_FEARSOME_ROAR, urand(10000, 20000)); + break; + case EVENT_PIERCING_SLASH: + DoCastVictim(SPELL_PIERCING_SLASH); + events.ScheduleEvent(EVENT_PIERCING_SLASH, 17000); + break; + case EVENT_RAPTOR_CALL: + DoCastVictim(SPELL_RAPTOR_CALL); + + float x, y, z; + + me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 10.0f); + me->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000); + events.ScheduleEvent(EVENT_RAPTOR_CALL, urand(20000, 25000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + uint8 raptorsKilled; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_dredAI(creature); + return GetDrakTharonKeepAI<boss_king_dredAI>(creature); } }; @@ -217,14 +196,14 @@ class npc_drakkari_gutripper : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DRED))) + if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_KING_DRED))) Dred->AI()->DoAction(ACTION_RAPTOR_KILLED); } }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_drakkari_gutripperAI(creature); + return GetDrakTharonKeepAI<npc_drakkari_gutripperAI>(creature); } }; @@ -267,14 +246,14 @@ class npc_drakkari_scytheclaw : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DRED))) + if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_KING_DRED))) Dred->AI()->DoAction(ACTION_RAPTOR_KILLED); } }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_drakkari_scytheclawAI(creature); + return GetDrakTharonKeepAI<npc_drakkari_scytheclawAI>(creature); } }; @@ -291,17 +270,17 @@ class achievement_king_dred : public AchievementCriteriaScript return false; if (Creature* Dred = target->ToCreature()) - if (Dred->AI()->GetData(DATA_KING_DRED) >= 6) + if (Dred->AI()->GetData(DATA_RAPTORS_KILLED) >= 6) return true; return false; } }; -void AddSC_boss_dred() +void AddSC_boss_king_dred() { - new boss_dred; - new npc_drakkari_gutripper; - new npc_drakkari_scytheclaw; + new boss_king_dred(); + new npc_drakkari_gutripper(); + new npc_drakkari_scytheclaw(); new achievement_king_dred(); } diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 120d52a3050..785038137d9 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -32,8 +32,7 @@ enum Misc enum Creatures { - NPC_CRYSTAL_CHANNEL_TARGET = 26712, - NPC_FETID_TROLL_CORPSE = 27597, + NPC_FETID_TROLL_CORPSE = 27598, NPC_RISEN_SHADOWCASTER = 27600, NPC_HULKING_CORPSE = 27597 }; @@ -77,13 +76,11 @@ public: struct boss_novosAI : public BossAI { - boss_novosAI(Creature* creature) : BossAI(creature, DATA_NOVOS_EVENT) {} + boss_novosAI(Creature* creature) : BossAI(creature, DATA_NOVOS) { } void Reset() OVERRIDE { - events.Reset(); - summons.DespawnAll(); - instance->SetData(DATA_NOVOS_EVENT, NOT_STARTED); + _Reset(); _ohNovos = true; _crystalHandlerCount = 0; @@ -94,9 +91,7 @@ public: void EnterCombat(Unit* /* victim */) OVERRIDE { - me->setActive(true); - DoZoneInCombat(); - instance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS); + _EnterCombat(); SetCrystalsStatus(true); SetSummonerStatus(true); @@ -148,7 +143,6 @@ public: } void MoveInLineOfSight(Unit* who) OVERRIDE - { BossAI::MoveInLineOfSight(who); @@ -260,7 +254,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_novosAI(creature); + return GetDrakTharonKeepAI<boss_novosAI>(creature); } }; @@ -323,7 +317,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_crystal_channel_targetAI(creature); + return GetDrakTharonKeepAI<npc_crystal_channel_targetAI>(creature); } }; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index 63b23eb594e..e090f3db7c0 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -95,16 +95,13 @@ public: uiShadowVolleyTimer = urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS); Phase = SKELETAL; me->SetDisplayId(me->GetNativeDisplayId()); - if (instance) - instance->SetData(DATA_THARON_JA_EVENT, NOT_STARTED); + instance->SetBossState(DATA_THARON_JA, NOT_STARTED); } void EnterCombat(Unit* /*who*/) OVERRIDE { Talk(SAY_AGGRO); - - if (instance) - instance->SetData(DATA_THARON_JA_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_THARON_JA, IN_PROGRESS); } void UpdateAI(uint32 diff) OVERRIDE @@ -239,14 +236,14 @@ public: DoCast(me, SPELL_ACHIEVEMENT_CHECK); - instance->SetData(DATA_THARON_JA_EVENT, DONE); + instance->SetBossState(DATA_THARON_JA, DONE); } } }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_tharon_jaAI(creature); + return GetDrakTharonKeepAI<boss_tharon_jaAI>(creature); } }; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index f0e72d16f58..d126340ef51 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -99,16 +99,13 @@ public: me->RemoveAura(DUNGEON_MODE(SPELL_CONSUME_AURA, H_SPELL_CONSUME_AURA)); - if (instance) - instance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED); + instance->SetData(DATA_TROLLGORE, NOT_STARTED); } void EnterCombat(Unit* /*who*/) OVERRIDE { Talk(SAY_AGGRO); - - if (instance) - instance->SetData(DATA_TROLLGORE_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_TROLLGORE, IN_PROGRESS); } void UpdateAI(uint32 diff) OVERRIDE @@ -167,8 +164,7 @@ public: lSummons.DespawnAll(); - if (instance) - instance->SetData(DATA_TROLLGORE_EVENT, DONE); + instance->SetBossState(DATA_TROLLGORE, DONE); } uint32 GetData(uint32 type) const OVERRIDE @@ -197,7 +193,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_trollgoreAI(creature); + return GetDrakTharonKeepAI<boss_trollgoreAI>(creature); } }; diff --git a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h index e17cba4bccd..cc0fb9a0090 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h +++ b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h @@ -15,22 +15,26 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef DEF_DRAK_THARON_H -#define DEF_DRAK_THARON_H -enum Data -{ - DATA_TROLLGORE_EVENT, - DATA_NOVOS_EVENT, - DATA_DRED_EVENT, - DATA_THARON_JA_EVENT, - DATA_KING_DRED_ACHIEV -}; -enum Data64 +#ifndef DRAK_THARON_KEEP_H_ +#define DRAK_THARON_KEEP_H_ + +#include "Map.h" +#include "Creature.h" + +#define DrakTharonKeepScriptName "instance_drak_tharon_keep" + +uint32 const EncounterCount = 4; + +enum DataTypes { - DATA_TROLLGORE, - DATA_NOVOS, - DATA_DRED, - DATA_THARON_JA, + // Encounter States/Boss GUIDs + DATA_TROLLGORE = 0, + DATA_NOVOS = 1, + DATA_KING_DRED = 2, + DATA_THARON_JA = 3, + + // Additional data + //DATA_KING_DRED_ACHIEV, DATA_NOVOS_CRYSTAL_1, DATA_NOVOS_CRYSTAL_2, @@ -43,4 +47,39 @@ enum Data64 ACTION_CRYSTAL_HANDLER_DIED }; -#endif + +enum CreatureIds +{ + NPC_TROLLGORE = 26630, + NPC_NOVOS = 26631, + NPC_KING_DRED = 27483, + NPC_THARON_JA = 26632, + + // Novos + NPC_CRYSTAL_CHANNEL_TARGET = 26712, + NPC_CRYSTAL_HANDLER = 26627, + + // King Dred + NPC_DRAKKARI_GUTRIPPER = 26641, + NPC_DRAKKARI_SCYTHECLAW = 26628 +}; + +enum GameObjectIds +{ + GO_NOVOS_CRYSTAL_1 = 189299, + GO_NOVOS_CRYSTAL_2 = 189300, + GO_NOVOS_CRYSTAL_3 = 189301, + GO_NOVOS_CRYSTAL_4 = 189302 +}; + +template<class AI> +AI* GetDrakTharonKeepAI(Creature* creature) +{ + if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(DrakTharonKeepScriptName)) + return new AI(creature); + return NULL; +} + +#endif // DRAK_THARON_KEEP_H_ diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index 61dfced65ed..99a4ce77623 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -20,279 +20,185 @@ #include "InstanceScript.h" #include "drak_tharon_keep.h" -#define MAX_ENCOUNTER 4 - -/* Drak'Tharon Keep encounters: -0 - Trollgore -1 - Novos -2 - King Dred -3 - Tharon Ja -*/ - -enum Creatures -{ - NPC_TROLLGORE = 26630, - NPC_NOVOS = 26631, - NPC_KING_DRED = 27483, - NPC_THARON_JA = 26632, - NPC_CRYSTAL_CHANNEL_TARGET = 26712, - NPC_CRYSTAL_HANDLER = 26627 -}; -enum GameObjects +class instance_drak_tharon_keep : public InstanceMapScript { - GO_NOVOS_CRYSTAL_1 = 189299, - GO_NOVOS_CRYSTAL_2 = 189300, - GO_NOVOS_CRYSTAL_3 = 189301, - GO_NOVOS_CRYSTAL_4 = 189302 -}; -enum Achievements -{ - ACM_CRITERIA_OH_NOVOS = 7361 -}; - -class instance_drak_tharon : public InstanceMapScript -{ -public: - instance_drak_tharon() : InstanceMapScript("instance_drak_tharon", 600) { } - - struct instance_drak_tharon_InstanceScript : public InstanceScript - { - instance_drak_tharon_InstanceScript(Map* map) : InstanceScript(map) {} - - uint8 dredAchievCounter; - - uint64 trollgoreGUID; - uint64 novosGUID; - uint64 dredGUID; - uint64 tharonJaGUID; - - uint64 novosCrystalGUID1; - uint64 novosCrystalGUID2; - uint64 novosCrystalGUID3; - uint64 novosCrystalGUID4; - - uint64 novosSummonerGUID1; - uint64 novosSummonerGUID2; - uint64 novosSummonerGUID3; - uint64 novosSummonerGUID4; - - uint16 m_auiEncounter[MAX_ENCOUNTER]; + public: + instance_drak_tharon_keep() : InstanceMapScript(DrakTharonKeepScriptName, 600) { } - std::string str_data; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - dredAchievCounter = 0; - - trollgoreGUID = 0; - novosGUID = 0; - dredGUID = 0; - tharonJaGUID = 0; - - novosCrystalGUID1 = 0; - novosCrystalGUID2 = 0; - novosCrystalGUID3 = 0; - novosCrystalGUID4 = 0; - - novosSummonerGUID1 = 0; - novosSummonerGUID2 = 0; - novosSummonerGUID3 = 0; - novosSummonerGUID4 = 0; - } - - bool IsEncounterInProgress() const + struct instance_drak_tharon_keep_InstanceScript : public InstanceScript { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; + instance_drak_tharon_keep_InstanceScript(Map* map) : InstanceScript(map) + { + SetBossNumber(EncounterCount); - return false; - } + TrollgoreGUID = 0; + NovosGUID = 0; + KingDredGUID = 0; + TharonJaGUID = 0; - void OnGameObjectCreate(GameObject* go) - { - switch (go->GetEntry()) - { - case GO_NOVOS_CRYSTAL_1: - novosCrystalGUID1 = go->GetGUID(); - go->SetGoState(GO_STATE_READY); - break; - case GO_NOVOS_CRYSTAL_2: - novosCrystalGUID2 = go->GetGUID(); - go->SetGoState(GO_STATE_READY); - break; - case GO_NOVOS_CRYSTAL_3: - novosCrystalGUID3 = go->GetGUID(); - go->SetGoState(GO_STATE_READY); - break; - case GO_NOVOS_CRYSTAL_4: - novosCrystalGUID4 = go->GetGUID(); - go->SetGoState(GO_STATE_READY); - break; + memset(NovosCrystalGUIDs, 0, 4 * sizeof(uint64)); + memset(NovosSummonerGUIDs, 0, 4 * sizeof(uint64)); } - } - void OnCreatureCreate(Creature* creature) - { - switch (creature->GetEntry()) + void OnCreatureCreate(Creature* creature) { - case NPC_TROLLGORE: - trollgoreGUID = creature->GetGUID(); - break; - case NPC_NOVOS: - novosGUID = creature->GetGUID(); - break; - case NPC_KING_DRED: - dredGUID = creature->GetGUID(); - break; - case NPC_THARON_JA: - tharonJaGUID = creature->GetGUID(); - break; - case NPC_CRYSTAL_CHANNEL_TARGET: - InitializeNovosSummoner(creature); - break; + switch (creature->GetEntry()) + { + case NPC_TROLLGORE: + TrollgoreGUID = creature->GetGUID(); + break; + case NPC_NOVOS: + NovosGUID = creature->GetGUID(); + break; + case NPC_KING_DRED: + KingDredGUID = creature->GetGUID(); + break; + case NPC_THARON_JA: + TharonJaGUID = creature->GetGUID(); + break; + case NPC_CRYSTAL_CHANNEL_TARGET: + InitializeNovosSummoner(creature); + break; + default: + break; + } } - } - - void InitializeNovosSummoner(Creature* creature) - { - float x = creature->GetPositionX(); - float y = creature->GetPositionY(); - float z = creature->GetPositionZ(); - - if (x < -374.0f && x > -379.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) - novosSummonerGUID1 = creature->GetGUID(); - else if (x < -379.0f && x > -385.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) - novosSummonerGUID2 = creature->GetGUID(); - else if (x < -374.0f && x > -385.0f && y > -827.0f && y < -820.0f && z < 60.0f && z > 58.0f) - novosSummonerGUID3 = creature->GetGUID(); - else if (x < -338.0f && x > -344.0f && y > -727.0f && y < 721.0f && z < 30.0f && z > 26.0f) - novosSummonerGUID4 = creature->GetGUID(); - } - uint64 GetData64(uint32 identifier) const OVERRIDE - { - switch (identifier) + void OnGameObjectCreate(GameObject* go) { - case DATA_TROLLGORE: return trollgoreGUID; - case DATA_NOVOS: return novosGUID; - case DATA_DRED: return dredGUID; - case DATA_THARON_JA: return tharonJaGUID; - case DATA_NOVOS_CRYSTAL_1: return novosCrystalGUID1; - case DATA_NOVOS_CRYSTAL_2: return novosCrystalGUID2; - case DATA_NOVOS_CRYSTAL_3: return novosCrystalGUID3; - case DATA_NOVOS_CRYSTAL_4: return novosCrystalGUID4; - case DATA_NOVOS_SUMMONER_1: return novosSummonerGUID1; - case DATA_NOVOS_SUMMONER_2: return novosSummonerGUID2; - case DATA_NOVOS_SUMMONER_3: return novosSummonerGUID3; - case DATA_NOVOS_SUMMONER_4: return novosSummonerGUID4; + switch (go->GetEntry()) + { + case GO_NOVOS_CRYSTAL_1: + NovosCrystalGUIDs[0] = go->GetGUID(); + go->SetGoState(GO_STATE_READY); + break; + case GO_NOVOS_CRYSTAL_2: + NovosCrystalGUIDs[1] = go->GetGUID(); + go->SetGoState(GO_STATE_READY); + break; + case GO_NOVOS_CRYSTAL_3: + NovosCrystalGUIDs[2] = go->GetGUID(); + go->SetGoState(GO_STATE_READY); + break; + case GO_NOVOS_CRYSTAL_4: + NovosCrystalGUIDs[3] = go->GetGUID(); + go->SetGoState(GO_STATE_READY); + break; + default: + break; + } } - return 0; - } - - void SetData(uint32 type, uint32 data) OVERRIDE - { - switch (type) + void InitializeNovosSummoner(Creature* creature) { - case DATA_TROLLGORE_EVENT: - m_auiEncounter[0] = data; - break; - case DATA_NOVOS_EVENT: - m_auiEncounter[1] = data; - break; - case DATA_DRED_EVENT: - m_auiEncounter[2] = data; - break; - case DATA_THARON_JA_EVENT: - m_auiEncounter[3] = data; - break; - - case DATA_KING_DRED_ACHIEV: - dredAchievCounter = data; - break; + float x = creature->GetPositionX(); + float y = creature->GetPositionY(); + float z = creature->GetPositionZ(); + + if (x < -374.0f && x > -379.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) + NovosSummonerGUIDs[0] = creature->GetGUID(); + else if (x < -379.0f && x > -385.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) + NovosSummonerGUIDs[1] = creature->GetGUID(); + else if (x < -374.0f && x > -385.0f && y > -827.0f && y < -820.0f && z < 60.0f && z > 58.0f) + NovosSummonerGUIDs[2] = creature->GetGUID(); + else if (x < -338.0f && x > -344.0f && y > -727.0f && y < 721.0f && z < 30.0f && z > 26.0f) + NovosSummonerGUIDs[3] = creature->GetGUID(); } - if (data == DONE) + uint64 GetData64(uint32 type) const OVERRIDE { - SaveToDB(); + switch (type) + { + case DATA_TROLLGORE: + return TrollgoreGUID; + case DATA_NOVOS: + return NovosGUID; + case DATA_KING_DRED: + return KingDredGUID; + case DATA_THARON_JA: + return TharonJaGUID; + case DATA_NOVOS_CRYSTAL_1: + case DATA_NOVOS_CRYSTAL_2: + case DATA_NOVOS_CRYSTAL_3: + case DATA_NOVOS_CRYSTAL_4: + return NovosCrystalGUIDs[type - DATA_NOVOS_CRYSTAL_1]; + case DATA_NOVOS_SUMMONER_1: + case DATA_NOVOS_SUMMONER_2: + case DATA_NOVOS_SUMMONER_3: + case DATA_NOVOS_SUMMONER_4: + return NovosSummonerGUIDs[type - DATA_NOVOS_SUMMONER_1]; + } + + return 0; } - } - uint32 GetData(uint32 type) const OVERRIDE - { - switch (type) + void OnUnitDeath(Unit* unit) { - case DATA_TROLLGORE_EVENT: return m_auiEncounter[0]; - case DATA_NOVOS_EVENT: return m_auiEncounter[1]; - case DATA_DRED_EVENT: return m_auiEncounter[2]; - case DATA_THARON_JA_EVENT: return m_auiEncounter[3]; - case DATA_KING_DRED_ACHIEV: return dredAchievCounter; + if (unit->GetEntry() == NPC_CRYSTAL_HANDLER) + if (Creature* novos = instance->GetCreature(NovosGUID)) + novos->AI()->DoAction(ACTION_CRYSTAL_HANDLER_DIED); } - return 0; - } - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << "D K " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' - << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; - OUT_SAVE_INST_DATA_COMPLETE; - return saveStream.str(); - } + std::ostringstream saveStream; + saveStream << "D K " << GetBossSaveData(); - void OnUnitDeath(Unit* unit) - { - if (unit->GetEntry() == NPC_CRYSTAL_HANDLER) - if (novosGUID) - if (Creature* novos = instance->GetCreature(novosGUID)) - novos->AI()->DoAction(ACTION_CRYSTAL_HANDLER_DIED); - } + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } - void Load(const char* in) - { - if (!in) + void Load(char const* str) { - OUT_LOAD_INST_DATA_FAIL; - return; + if (!str) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'D' && dataHead2 == 'K') + { + for (uint32 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; } - OUT_LOAD_INST_DATA(in); - - char dataHead1, dataHead2; - uint16 data0, data1, data2, data3; + protected: + uint64 TrollgoreGUID; + uint64 NovosGUID; + uint64 KingDredGUID; + uint64 TharonJaGUID; - std::istringstream loadStream(in); - loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3; - - if (dataHead1 == 'D' && dataHead2 == 'K') - { - m_auiEncounter[0] = data0; - m_auiEncounter[1] = data1; - m_auiEncounter[2] = data2; - m_auiEncounter[3] = data3; + uint64 NovosCrystalGUIDs[4]; + uint64 NovosSummonerGUIDs[4]; + }; - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - } else OUT_LOAD_INST_DATA_FAIL; - - OUT_LOAD_INST_DATA_COMPLETE; + InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE + { + return new instance_drak_tharon_keep_InstanceScript(map); } - }; - - InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE - { - return new instance_drak_tharon_InstanceScript(map); - } }; -void AddSC_instance_drak_tharon() +void AddSC_instance_drak_tharon_keep() { - new instance_drak_tharon; + new instance_drak_tharon_keep(); } diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 173abfc2652..b1ecdc5904e 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -17,9 +17,11 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "forge_of_souls.h" #include "Player.h" #include "SpellInfo.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" +#include "forge_of_souls.h" /* * @todo @@ -48,7 +50,10 @@ enum Spells { SPELL_PHANTOM_BLAST = 68982, H_SPELL_PHANTOM_BLAST = 70322, - SPELL_MIRRORED_SOUL = 69051, + SPELL_MIRRORED_SOUL_PROC_AURA = 69023, + SPELL_MIRRORED_SOUL_DAMAGE = 69034, + SPELL_MIRRORED_SOUL_TARGET_SELECTOR = 69048, + SPELL_MIRRORED_SOUL_BUFF = 69051, SPELL_WELL_OF_SOULS = 68820, SPELL_UNLEASHED_SOULS = 68939, SPELL_WAILING_SOULS_STARTING = 68912, // Initial spell cast at begining of wailing souls phase @@ -145,7 +150,6 @@ class boss_devourer_of_souls : public CreatureScript summons.DespawnAll(); threeFaced = true; - mirroredSoulTarget = 0; instance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED); } @@ -165,23 +169,6 @@ class boss_devourer_of_souls : public CreatureScript instance->SetData(DATA_DEVOURER_EVENT, IN_PROGRESS); } - void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage) OVERRIDE - { - if (mirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL)) - { - if (Player* player = Unit::GetPlayer(*me, mirroredSoulTarget)) - { - if (player->GetAura(SPELL_MIRRORED_SOUL)) - { - int32 mirrorDamage = (uiDamage* 45)/100; - me->CastCustomSpell(player, 69034, &mirrorDamage, 0, 0, true); - } - else - mirroredSoulTarget = 0; - } - } - } - void KilledUnit(Unit* victim) OVERRIDE { if (victim->GetTypeId() != TYPEID_PLAYER) @@ -270,12 +257,8 @@ class boss_devourer_of_souls : public CreatureScript events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000); break; case EVENT_MIRRORED_SOUL: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) - { - mirroredSoulTarget = target->GetGUID(); - DoCast(target, SPELL_MIRRORED_SOUL); - Talk(EMOTE_MIRRORED_SOUL); - } + DoCastAOE(SPELL_MIRRORED_SOUL_TARGET_SELECTOR); + Talk(EMOTE_MIRRORED_SOUL); events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000, 30000)); break; case EVENT_WELL_OF_SOULS: @@ -358,8 +341,6 @@ class boss_devourer_of_souls : public CreatureScript float beamAngle; float beamAngleDiff; int8 wailingSoulTick; - - uint64 mirroredSoulTarget; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -368,6 +349,139 @@ class boss_devourer_of_souls : public CreatureScript } }; +// 69051 - Mirrored Soul +class spell_devourer_of_souls_mirrored_soul : public SpellScriptLoader +{ + public: + spell_devourer_of_souls_mirrored_soul() : SpellScriptLoader("spell_devourer_of_souls_mirrored_soul") { } + + class spell_devourer_of_souls_mirrored_soul_SpellScript : public SpellScript + { + PrepareSpellScript(spell_devourer_of_souls_mirrored_soul_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_MIRRORED_SOUL_PROC_AURA)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + target->CastSpell(GetCaster(), SPELL_MIRRORED_SOUL_PROC_AURA, true); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_devourer_of_souls_mirrored_soul_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_devourer_of_souls_mirrored_soul_SpellScript(); + } +}; + +// 69023 - Mirrored Soul (Proc) +class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader +{ + public: + spell_devourer_of_souls_mirrored_soul_proc() : SpellScriptLoader("spell_devourer_of_souls_mirrored_soul_proc") { } + + class spell_devourer_of_souls_mirrored_soul_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_devourer_of_souls_mirrored_soul_proc_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_MIRRORED_SOUL_DAMAGE)) + return false; + return true; + } + + bool Load() OVERRIDE + { + _procTarget = NULL; + return true; + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + _procTarget = GetCaster(); + return _procTarget && _procTarget->IsAlive(); + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45)); + GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, _procTarget, true); + } + + void Register() OVERRIDE + { + DoCheckProc += AuraCheckProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + + private: + Unit* _procTarget; + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_devourer_of_souls_mirrored_soul_proc_AuraScript(); + } +}; + +// 69048 - Mirrored Soul (Target Selector) +class spell_devourer_of_souls_mirrored_soul_target_selector : public SpellScriptLoader +{ + public: + spell_devourer_of_souls_mirrored_soul_target_selector() : SpellScriptLoader("spell_devourer_of_souls_mirrored_soul_target_selector") { } + + class spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript : public SpellScript + { + PrepareSpellScript(spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_MIRRORED_SOUL_BUFF)) + return false; + return true; + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + GetCaster()->CastSpell(target, SPELL_MIRRORED_SOUL_BUFF, false); + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript(); + } +}; + class achievement_three_faced : public AchievementCriteriaScript { public: @@ -391,5 +505,8 @@ class achievement_three_faced : public AchievementCriteriaScript void AddSC_boss_devourer_of_souls() { new boss_devourer_of_souls(); + new spell_devourer_of_souls_mirrored_soul(); + new spell_devourer_of_souls_mirrored_soul_proc(); + new spell_devourer_of_souls_mirrored_soul_target_selector(); new achievement_three_faced(); } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h index 4787a6b9fdc..c5fe115978f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h @@ -138,7 +138,7 @@ struct boss_horAI : ScriptedAI me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC); me->SetReactState(REACT_PASSIVE); - if (instance->GetData(DATA_WAVE_COUNT) != NOT_STARTED) + if (instance && instance->GetData(DATA_WAVE_COUNT) != NOT_STARTED) instance->ProcessEvent(0, EVENT_DO_WIPE); } diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 3e2224208cc..93030492caf 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -392,7 +392,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_living_mojoAI (creature); + return new npc_living_mojoAI(creature); } struct npc_living_mojoAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index 3f1484badbc..c11db7146d1 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -37,7 +37,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_eckAI (creature); + return new boss_eckAI(creature); } struct boss_eckAI : public ScriptedAI @@ -141,7 +141,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ruins_dwellerAI (creature); + return new npc_ruins_dwellerAI(creature); } struct npc_ruins_dwellerAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index c039b45b622..7a5520ab145 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -70,7 +70,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gal_darahAI (creature); + return new boss_gal_darahAI(creature); } struct boss_gal_darahAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 3081c68b58b..afd0e8a4342 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -76,7 +76,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_slad_ranAI (creature); + return new boss_slad_ranAI(creature); } struct boss_slad_ranAI : public ScriptedAI @@ -216,7 +216,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_slad_ran_constrictorAI (creature); + return new npc_slad_ran_constrictorAI(creature); } struct npc_slad_ran_constrictorAI : public ScriptedAI @@ -269,7 +269,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_slad_ran_viperAI (creature); + return new npc_slad_ran_viperAI(creature); } struct npc_slad_ran_viperAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index 9af4de8135d..681ffff46b3 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -242,6 +242,7 @@ public: eckTheFerociousDoorBehindGUID = go->GetGUID(); if (isHeroic && m_auiEncounter[4] == DONE) HandleGameObject(0, true, go); + break; case GO_GALDARAH_DOOR1: galDarahDoor1GUID = go->GetGUID(); if (m_auiEncounter[3] == DONE) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 99ce75cc49b..45e0855bb4f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -62,7 +62,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anubrekhanAI (creature); + return new boss_anubrekhanAI(creature); } struct boss_anubrekhanAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index affddf974b0..9b336a77e26 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -89,7 +89,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_four_horsemenAI (creature); + return new boss_four_horsemenAI(creature); } struct boss_four_horsemenAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index bc879445fcc..8980cd063c0 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gluthAI (creature); + return new boss_gluthAI(creature); } struct boss_gluthAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index 99203ffa0c7..8371a5ad9a0 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -51,7 +51,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_grobbulusAI (creature); + return new boss_grobbulusAI(creature); } struct boss_grobbulusAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index ff0ed31b724..14a7a03bd70 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -61,7 +61,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_heiganAI (creature); + return new boss_heiganAI(creature); } struct boss_heiganAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 28c711511d6..5578d199ec3 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -649,7 +649,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kelthuzadAI (creature); + return new boss_kelthuzadAI(creature); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index f81cbc38b0f..468739894f6 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -65,7 +65,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_maexxnaAI (creature); + return new boss_maexxnaAI(creature); } struct boss_maexxnaAI : public BossAI @@ -156,7 +156,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_webwrapAI (creature); + return new npc_webwrapAI(creature); } struct npc_webwrapAI : public NullCreatureAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index 50fe1b45d7c..e01417574bb 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -75,7 +75,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nothAI (creature); + return new boss_nothAI(creature); } struct boss_nothAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index 342cb9156a4..935d29ff783 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -57,7 +57,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_patchwerkAI (creature); + return new boss_patchwerkAI(creature); } struct boss_patchwerkAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp index 67fa2544d8e..5505b83d411 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_razuviousAI (creature); + return new boss_razuviousAI(creature); } struct boss_razuviousAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 455df2dedff..60620804db8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -403,7 +403,7 @@ class boss_sapphiron : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_sapphironAI (creature); + return new boss_sapphironAI(creature); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index e9eb7556259..3d121887471 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -110,7 +110,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_thaddiusAI (creature); + return new boss_thaddiusAI(creature); } struct boss_thaddiusAI : public BossAI diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 7f2c7a93970..ef3162d892e 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -1543,7 +1543,7 @@ public: } } - void UpdateAI (uint32 /*diff*/) + void UpdateAI(uint32 /*diff*/) { } @@ -1575,7 +1575,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_arcane_overloadAI (creature); + return new npc_arcane_overloadAI(creature); } }; @@ -1640,7 +1640,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_wyrmrest_skytalonAI (creature); + return new npc_wyrmrest_skytalonAI(creature); } }; @@ -1666,7 +1666,7 @@ class npc_static_field : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_static_fieldAI (creature); + return new npc_static_fieldAI(creature); } }; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp index a28c044c583..175816e3ae7 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp @@ -49,7 +49,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_commander_kolurgAI (creature); + return new boss_commander_kolurgAI(creature); } struct boss_commander_kolurgAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp index 33800b92eb4..2f73c85a9cd 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_commander_stoutbeardAI (creature); + return new boss_commander_stoutbeardAI(creature); } struct boss_commander_stoutbeardAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index c0f12347cf1..ef8f5c2d3c4 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -60,7 +60,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_keristraszaAI (creature); + return new boss_keristraszaAI(creature); } struct boss_keristraszaAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index e7c9ecdccfa..8a01c40186e 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -65,7 +65,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_magus_telestraAI (creature); + return new boss_magus_telestraAI(creature); } struct boss_magus_telestraAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index 3da59e614e7..f26e70d6838 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -157,7 +157,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ormorokAI (creature); + return new boss_ormorokAI(creature); } }; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp index e9ba50a3b9d..59652a7d4a1 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp @@ -57,7 +57,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_drakosAI (creature); + return new boss_drakosAI(creature); } struct boss_drakosAI : public BossAI @@ -151,7 +151,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_unstable_sphereAI (creature); + return new npc_unstable_sphereAI(creature); } struct npc_unstable_sphereAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index 2cab18b45e8..abf0d6537c3 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -85,7 +85,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_eregosAI (creature); + return new boss_eregosAI(creature); } struct boss_eregosAI : public BossAI diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 95596f621e0..436a978d15e 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -94,7 +94,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_uromAI (creature); + return new boss_uromAI(creature); } struct boss_uromAI : public BossAI diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 11385a8f95a..fbf39a705ee 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -59,7 +59,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_varosAI (creature); + return new boss_varosAI(creature); } struct boss_varosAI : public BossAI diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp index 4101fb7af33..d1f0105daf1 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp @@ -137,28 +137,36 @@ public: case NPC_BELGARISTRASZ: belgaristraszGUID = creature->GetGUID(); if (GetBossState(DATA_DRAKOS_EVENT) == DONE) + { creature->SetWalk(true), creature->GetMotionMaster()->MovePoint(0, 941.453f, 1044.1f, 359.967f), creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } break; case NPC_ETERNOS: eternosGUID = creature->GetGUID(); if (GetBossState(DATA_DRAKOS_EVENT) == DONE) + { creature->SetWalk(true), creature->GetMotionMaster()->MovePoint(0, 943.202f, 1059.35f, 359.967f), creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } break; case NPC_VERDISA: verdisaGUID = creature->GetGUID(); if (GetBossState(DATA_DRAKOS_EVENT) == DONE) + { creature->SetWalk(true), creature->GetMotionMaster()->MovePoint(0, 949.188f, 1032.91f, 359.967f), creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } break; case NPC_GREATER_WHELP: if (GetBossState(DATA_UROM_EVENT) == DONE) + { creature->SetPhaseMask(1, true); gwhelpList.push_back(creature->GetGUID()); + } break; } } @@ -209,9 +217,13 @@ public: break; case DATA_UROM_EVENT: if (state == DONE) + { if (Creature* eregos = instance->GetCreature(eregosGUID)) + { eregos->SetPhaseMask(1, true); GreaterWhelps(); + } + } break; case DATA_EREGOS_EVENT: if (state == DONE) @@ -288,10 +300,8 @@ public: return; for (std::list<uint64>::const_iterator itr = gwhelpList.begin(); itr != gwhelpList.end(); ++itr) - { if (Creature* gwhelp = instance->GetCreature(*itr)) gwhelp->SetPhaseMask(1, true); - } } std::string GetSaveData() diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 52ffc12f154..fd15cd19b37 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -354,9 +354,7 @@ public: void MovementInform(uint32 type, uint32 id) OVERRIDE { if (type == POINT_MOTION_TYPE && id == 0) - { me->SetDisableGravity(false); // Needed this for proper animation after spawn, the summon in air fall to ground bug leave no other option for now, if this isn't used the drake will only walk on move. - } } void UpdateAI(uint32 diff) OVERRIDE @@ -388,9 +386,7 @@ public: } else WelcomeSequelTimer -= diff; } - } - if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE)) - { + if (instance->GetBossState(DATA_UROM_EVENT) == DONE) { if (!(SpecialOff)) @@ -403,9 +399,7 @@ public: else SpecialTimer -= diff; } } - } - if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE)) - { + if (!(HealthWarningOff)) { if (me->GetHealthPct() <= 40.0f) @@ -414,9 +408,7 @@ public: HealthWarningOff = true; } } - } - if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE)) - { + if (HealthWarningOff) { if (WarningTimer <= diff) @@ -427,6 +419,7 @@ public: else WarningTimer -= diff; } } + if (!(me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))) { if (!(DisableTakeOff)) @@ -527,6 +520,63 @@ public: } }; + +class spell_oculus_touch_the_nightmare : public SpellScriptLoader +{ + public: + spell_oculus_touch_the_nightmare() : SpellScriptLoader("spell_oculus_touch_the_nightmare") { } + + class spell_oculus_touch_the_nightmare_SpellScript : public SpellScript + { + PrepareSpellScript(spell_oculus_touch_the_nightmare_SpellScript); + + void HandleDamageCalc(SpellEffIndex /*effIndex*/) + { + SetHitDamage(int32(GetCaster()->CountPctFromMaxHealth(30))); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_oculus_touch_the_nightmare_SpellScript::HandleDamageCalc, EFFECT_2, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_oculus_touch_the_nightmare_SpellScript(); + } +}; + +class spell_oculus_dream_funnel: public SpellScriptLoader +{ + public: + spell_oculus_dream_funnel() : SpellScriptLoader("spell_oculus_dream_funnel") { } + + class spell_oculus_dream_funnel_AuraScript : public AuraScript + { + PrepareAuraScript(spell_oculus_dream_funnel_AuraScript); + + void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + if (Unit* caster = GetCaster()) + amount = int32(caster->CountPctFromMaxHealth(5)); + + canBeRecalculated = false; + } + + void Register() OVERRIDE + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_oculus_dream_funnel_AuraScript(); + } +}; + void AddSC_oculus() { new npc_verdisa_beglaristrasz_eternos(); @@ -534,4 +584,6 @@ void AddSC_oculus() new npc_ruby_emerald_amber_drake(); new spell_gen_stop_time(); new spell_call_ruby_emerald_amber_drake(); + new spell_oculus_touch_the_nightmare(); + new spell_oculus_dream_funnel(); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index 61251b05ee1..e1c9dec8540 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_krystallusAI (creature); + return new boss_krystallusAI(creature); } struct boss_krystallusAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index ee06304086c..5b34db663d5 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_maiden_of_griefAI (creature); + return new boss_maiden_of_griefAI(creature); } struct boss_maiden_of_griefAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 2ee8d4d70de..185d8e5fd0c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -86,7 +86,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_sjonnirAI (creature); + return new boss_sjonnirAI(creature); } struct boss_sjonnirAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 29a07bac01c..dec27808321 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1154,7 +1154,7 @@ class npc_lorekeeper : public CreatureScript bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE { - player->PlayerTalkClass->ClearMenus(); + player->CLOSE_GOSSIP_MENU(); InstanceScript* instance = creature->GetInstanceScript(); if (!instance) return true; @@ -1162,19 +1162,13 @@ class npc_lorekeeper : public CreatureScript switch (action) { case GOSSIP_ACTION_INFO_DEF+1: - if (player) - { - player->PrepareGossipMenu(creature); - instance->instance->LoadGrid(364, -16); //make sure leviathan is loaded + player->PrepareGossipMenu(creature); + instance->instance->LoadGrid(364, -16); //make sure leviathan is loaded - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - } + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+2: - if (player) - player->CLOSE_GOSSIP_MENU(); - if (Creature* leviathan = instance->instance->GetCreature(instance->GetData64(BOSS_LEVIATHAN))) { leviathan->AI()->DoAction(ACTION_START_HARD_MODE); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index fc5a54ffcfb..13608285b08 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -503,6 +503,7 @@ class instance_ulduar : public InstanceMapScript case GO_MOLE_MACHINE: if (GetBossState(BOSS_RAZORSCALE) == IN_PROGRESS) gameObject->SetGoState(GO_STATE_ACTIVE); + break; case GO_HODIR_DOOR: HodirDoorGUID = gameObject->GetGUID(); break; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index a41f156ec24..3dd84c62890 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -287,7 +287,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_annhylde_the_callerAI (creature); + return new npc_annhylde_the_callerAI(creature); } struct npc_annhylde_the_callerAI : public ScriptedAI @@ -400,7 +400,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ingvar_throw_dummyAI (creature); + return new npc_ingvar_throw_dummyAI(creature); } struct npc_ingvar_throw_dummyAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index 83a10a6e74d..6c7bf6afbe0 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -116,7 +116,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kelesethAI (creature); + return new boss_kelesethAI(creature); } struct boss_kelesethAI : public BossAI @@ -251,7 +251,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_vrykul_skeletonAI (creature); + return new npc_vrykul_skeletonAI(creature); } struct npc_vrykul_skeletonAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 8abe451f572..4ece79b0f7f 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -87,7 +87,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_skarvald_the_constructorAI (creature); + return new boss_skarvald_the_constructorAI(creature); } struct boss_skarvald_the_constructorAI : public ScriptedAI @@ -251,7 +251,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_dalronn_the_controllerAI (creature); + return new boss_dalronn_the_controllerAI(creature); } struct boss_dalronn_the_controllerAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 9974989b9b2..b70bda76d76 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -90,7 +90,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_palehoofAI (creature); + return new boss_palehoofAI(creature); } struct boss_palehoofAI : public ScriptedAI @@ -234,7 +234,9 @@ public: { if (currentPhase == PHASE_NONE) { - instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS); + if (instance) + instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS); + me->SummonCreature(NPC_STASIS_CONTROLLER, moveLocs[5].x, moveLocs[5].y, moveLocs[5].z, 0, TEMPSUMMON_CORPSE_DESPAWN); } Phase move = PHASE_NONE; @@ -279,7 +281,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ravenous_furbolgAI (creature); + return new npc_ravenous_furbolgAI(creature); } struct npc_ravenous_furbolgAI : public ScriptedAI @@ -392,7 +394,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_frenzied_worgenAI (creature); + return new npc_frenzied_worgenAI(creature); } struct npc_frenzied_worgenAI : public ScriptedAI @@ -508,7 +510,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ferocious_rhinoAI (creature); + return new npc_ferocious_rhinoAI(creature); } struct npc_ferocious_rhinoAI : public ScriptedAI @@ -628,7 +630,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_massive_jormungarAI (creature); + return new npc_massive_jormungarAI(creature); } struct npc_massive_jormungarAI : public ScriptedAI @@ -734,7 +736,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_palehoof_orbAI (creature); + return new npc_palehoof_orbAI(creature); } struct npc_palehoof_orbAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 4b035f0b534..08670af939a 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -162,7 +162,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_skadiAI (creature); + return new boss_skadiAI(creature); } struct boss_skadiAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 8b6a695b3a6..b8fa87106a4 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -116,7 +116,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_svalaAI (creature); + return new boss_svalaAI(creature); } struct boss_svalaAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp index f259fbf2b78..ad65fcc83fd 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp @@ -17,6 +17,8 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" #include "vault_of_archavon.h" enum Events @@ -24,14 +26,12 @@ enum Events // Koralon EVENT_BURNING_BREATH = 1, EVENT_BURNING_FURY = 2, - EVENT_FLAME_CINDER_A = 3, - EVENT_METEOR_FISTS_A = 4, - EVENT_METEOR_FISTS_B = 5, + EVENT_FLAME_CINDER = 3, + EVENT_METEOR_FISTS = 4, // Flame Warder - EVENT_FW_LAVA_BIRST = 6, - EVENT_FW_METEOR_FISTS_A = 7, - EVENT_FW_METEOR_FISTS_B = 8, + EVENT_FW_LAVA_BIRST = 5, + EVENT_FW_METEOR_FISTS = 6 }; enum Spells @@ -41,13 +41,13 @@ enum Spells SPELL_BURNING_FURY = 66721, SPELL_FLAME_CINDER_A = 66684, SPELL_FLAME_CINDER_B = 66681, // don't know the real relation to SPELL_FLAME_CINDER_A atm. - SPELL_METEOR_FISTS_A = 66725, - SPELL_METEOR_FISTS_B = 67333, + SPELL_METEOR_FISTS = 66725, + SPELL_METEOR_FISTS_DAMAGE = 66765, // Spells Flame Warder SPELL_FW_LAVA_BIRST = 66813, - SPELL_FW_METEOR_FISTS_A = 66808, - SPELL_FW_METEOR_FISTS_B = 67331, + SPELL_FW_METEOR_FISTS = 66808, + SPELL_FW_METEOR_FISTS_DAMAGE = 66809 }; class boss_koralon : public CreatureScript @@ -67,8 +67,8 @@ class boss_koralon : public CreatureScript events.ScheduleEvent(EVENT_BURNING_FURY, 20000); /// @todo check timer events.ScheduleEvent(EVENT_BURNING_BREATH, 15000); // 1st after 15sec, then every 45sec - events.ScheduleEvent(EVENT_METEOR_FISTS_A, 75000); // 1st after 75sec, then every 45sec - events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000); /// @todo check timer + events.ScheduleEvent(EVENT_METEOR_FISTS, 75000); // 1st after 75sec, then every 45sec + events.ScheduleEvent(EVENT_FLAME_CINDER, 30000); /// @todo check timer _EnterCombat(); } @@ -95,17 +95,13 @@ class boss_koralon : public CreatureScript DoCast(me, SPELL_BURNING_BREATH); events.ScheduleEvent(EVENT_BURNING_BREATH, 45000); break; - case EVENT_METEOR_FISTS_A: - DoCast(me, SPELL_METEOR_FISTS_A); - events.ScheduleEvent(EVENT_METEOR_FISTS_B, 1500); + case EVENT_METEOR_FISTS: + DoCast(me, SPELL_METEOR_FISTS); + events.ScheduleEvent(EVENT_METEOR_FISTS, 45000); break; - case EVENT_METEOR_FISTS_B: - DoCast(me, SPELL_METEOR_FISTS_B); - events.ScheduleEvent(EVENT_METEOR_FISTS_A, 45000); - break; - case EVENT_FLAME_CINDER_A: + case EVENT_FLAME_CINDER: DoCast(me, SPELL_FLAME_CINDER_A); - events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000); + events.ScheduleEvent(EVENT_FLAME_CINDER, 30000); break; default: break; @@ -123,7 +119,7 @@ class boss_koralon : public CreatureScript }; /*###### -## Mob Flame Warder +## Npc Flame Warder ######*/ class npc_flame_warder : public CreatureScript { @@ -146,7 +142,7 @@ class npc_flame_warder : public CreatureScript DoZoneInCombat(); events.ScheduleEvent(EVENT_FW_LAVA_BIRST, 5000); - events.ScheduleEvent(EVENT_FW_METEOR_FISTS_A, 10000); + events.ScheduleEvent(EVENT_FW_METEOR_FISTS, 10000); } void UpdateAI(uint32 diff) OVERRIDE @@ -164,13 +160,9 @@ class npc_flame_warder : public CreatureScript DoCastVictim(SPELL_FW_LAVA_BIRST); events.ScheduleEvent(EVENT_FW_LAVA_BIRST, 15000); break; - case EVENT_FW_METEOR_FISTS_A: - DoCast(me, SPELL_FW_METEOR_FISTS_A); - events.ScheduleEvent(EVENT_FW_METEOR_FISTS_B, 1500); - break; - case EVENT_FW_METEOR_FISTS_B: - DoCast(me, SPELL_FW_METEOR_FISTS_B); - events.ScheduleEvent(EVENT_FW_METEOR_FISTS_A, 20000); + case EVENT_FW_METEOR_FISTS: + DoCast(me, SPELL_FW_METEOR_FISTS); + events.ScheduleEvent(EVENT_FW_METEOR_FISTS, 20000); break; default: break; @@ -190,8 +182,121 @@ class npc_flame_warder : public CreatureScript } }; +class spell_koralon_meteor_fists : public SpellScriptLoader +{ + public: + spell_koralon_meteor_fists() : SpellScriptLoader("spell_koralon_meteor_fists") { } + + class spell_koralon_meteor_fists_AuraScript : public AuraScript + { + PrepareAuraScript(spell_koralon_meteor_fists_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_METEOR_FISTS_DAMAGE)) + return false; + return true; + } + + void TriggerFists(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_METEOR_FISTS_DAMAGE, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_koralon_meteor_fists_AuraScript::TriggerFists, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_koralon_meteor_fists_AuraScript(); + } +}; + +class spell_koralon_meteor_fists_damage : public SpellScriptLoader +{ + public: + spell_koralon_meteor_fists_damage() : SpellScriptLoader("spell_koralon_meteor_fists_damage") { } + + class spell_koralon_meteor_fists_damage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_koralon_meteor_fists_damage_SpellScript); + + bool Load() OVERRIDE + { + _chainTargets = 0; + return true; + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + _chainTargets = targets.size(); + } + + void CalculateSplitDamage() + { + if (_chainTargets) + SetHitDamage(GetHitDamage() / (_chainTargets + 1)); + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_koralon_meteor_fists_damage_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_TARGET_ENEMY); + OnHit += SpellHitFn(spell_koralon_meteor_fists_damage_SpellScript::CalculateSplitDamage); + } + + private: + uint8 _chainTargets; + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_koralon_meteor_fists_damage_SpellScript(); + } +}; + +class spell_flame_warder_meteor_fists : public SpellScriptLoader +{ + public: + spell_flame_warder_meteor_fists() : SpellScriptLoader("spell_flame_warder_meteor_fists") { } + + class spell_flame_warder_meteor_fists_AuraScript : public AuraScript + { + PrepareAuraScript(spell_flame_warder_meteor_fists_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_FW_METEOR_FISTS_DAMAGE)) + return false; + return true; + } + + void TriggerFists(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_FW_METEOR_FISTS_DAMAGE, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_flame_warder_meteor_fists_AuraScript::TriggerFists, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_flame_warder_meteor_fists_AuraScript(); + } +}; + void AddSC_boss_koralon() { new boss_koralon(); new npc_flame_warder(); + new spell_koralon_meteor_fists(); + new spell_koralon_meteor_fists_damage(); + new spell_flame_warder_meteor_fists(); } diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index c8e2155486a..8f44e47dd74 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -50,7 +50,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_cyanigosaAI (creature); + return new boss_cyanigosaAI(creature); } struct boss_cyanigosaAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index f8f67cedfe8..0052d7bc87e 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -49,7 +49,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_erekemAI (creature); + return new boss_erekemAI(creature); } struct boss_erekemAI : public ScriptedAI @@ -266,7 +266,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_erekem_guardAI (creature); + return new npc_erekem_guardAI(creature); } struct npc_erekem_guardAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index abb8c2c8b23..efaa9a8644b 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -78,7 +78,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ichoronAI (creature); + return new boss_ichoronAI(creature); } struct boss_ichoronAI : public ScriptedAI @@ -342,7 +342,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ichor_globuleAI (creature); + return new npc_ichor_globuleAI(creature); } struct npc_ichor_globuleAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index 91b78a5a684..5eaeaab8dc0 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -37,7 +37,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lavanthorAI (creature); + return new boss_lavanthorAI(creature); } struct boss_lavanthorAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index b2309f8f055..2d53fdebde7 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -33,7 +33,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_moraggAI (creature); + return new boss_moraggAI(creature); } struct boss_moraggAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp index 6c483de9acb..20f7e7952fe 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_xevozzAI (creature); + return new boss_xevozzAI(creature); } struct boss_xevozzAI : public ScriptedAI @@ -231,7 +231,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ethereal_sphereAI (creature); + return new npc_ethereal_sphereAI(creature); } struct npc_ethereal_sphereAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index 8021a9c5db4..a3c84e248e7 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_zuramatAI (creature); + return new boss_zuramatAI(creature); } struct boss_zuramatAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 2c65300cd4c..483d243c51d 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -61,12 +61,7 @@ enum AzureSaboteurSpells enum CrystalSpells { - SPELL_ARCANE_LIGHTNING = 57912 -}; - -enum Events -{ - EVENT_ACTIVATE_CRYSTAL = 20001 + SPELL_ARCANE_LIGHTNING = 57930 }; const Position PortalLocation[] = @@ -79,6 +74,7 @@ const Position PortalLocation[] = {1908.31f, 809.657f, 38.7037f, 3.08701f} // WP 6 }; +const Position ArcaneSphere = {1887.060059f, 806.151001f, 61.321602f, 0.0f}; const Position BossStartMove1 = {1894.684448f, 739.390503f, 47.668003f, 0.0f}; const Position BossStartMove2 = {1875.173950f, 860.832703f, 43.333565f, 0.0f}; const Position BossStartMove21 = {1858.854614f, 855.071411f, 43.333565f, 0.0f}; @@ -140,7 +136,7 @@ public: uint64 uiTeleportationPortal; uint64 uiSaboteurPortal; - uint64 uiActivationCrystal[3]; + uint64 uiActivationCrystal[4]; uint32 uiActivationTimer; uint32 uiCyanigosaEventTimer; @@ -308,7 +304,7 @@ public: uiMainDoor = go->GetGUID(); break; case GO_ACTIVATION_CRYSTAL: - if (uiCountActivationCrystals < 3) + if (uiCountActivationCrystals < 4) uiActivationCrystal[uiCountActivationCrystals++] = go->GetGUID(); break; } @@ -397,10 +393,13 @@ public: uiMainEventPhase = data; if (data == IN_PROGRESS) // Start event { - if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) - pMainDoor->SetGoState(GO_STATE_READY); + if (GameObject* mainDoor = instance->GetGameObject(uiMainDoor)) + mainDoor->SetGoState(GO_STATE_READY); uiWaveCount = 1; bActive = true; + for (int i = 0; i < 4; ++i) + if (GameObject* crystal = instance->GetGameObject(uiActivationCrystal[i])) + crystal->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); uiRemoveNpc = 0; // might not have been reset after a wipe on a boss. } break; @@ -700,7 +699,7 @@ public: } // if main event is in progress and players have wiped then reset instance - if ( uiMainEventPhase == IN_PROGRESS && CheckWipe()) + if (uiMainEventPhase == IN_PROGRESS && CheckWipe()) { SetData(DATA_REMOVE_NPC, 1); StartBossEncounter(uiFirstBoss, false); @@ -710,6 +709,10 @@ public: SetData(DATA_WAVE_COUNT, 0); uiMainEventPhase = NOT_STARTED; + for (int i = 0; i < 4; ++i) + if (GameObject* crystal = instance->GetGameObject(uiActivationCrystal[i])) + crystal->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + if (Creature* pSinclari = instance->GetCreature(uiSinclari)) { pSinclari->SetVisible(true); @@ -791,13 +794,29 @@ public: void ActivateCrystal() { + // just to make things easier we'll get the gameobject from the map + GameObject* invoker = instance->GetGameObject(uiActivationCrystal[0]); + if (!invoker) + return; + + SpellInfo const* spellInfoLightning = sSpellMgr->GetSpellInfo(SPELL_ARCANE_LIGHTNING); + if (!spellInfoLightning) + return; + + // the orb + TempSummon* trigger = invoker->SummonCreature(NPC_DEFENSE_SYSTEM, ArcaneSphere, TEMPSUMMON_MANUAL_DESPAWN, 0); + if (!trigger) + return; + + // visuals + trigger->CastSpell(trigger, spellInfoLightning, true, 0, 0, trigger->GetGUID()); + // Kill all mobs registered with SetData64(ADD_TRASH_MOB) - /// @todo All visual, spells etc for (std::set<uint64>::const_iterator itr = trashMobs.begin(); itr != trashMobs.end(); ++itr) { Creature* creature = instance->GetCreature(*itr); if (creature && creature->IsAlive()) - creature->CastSpell(creature, SPELL_ARCANE_LIGHTNING, true); // Who should cast the spell? + trigger->Kill(creature); } } diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 64c327aa919..db382dd9d72 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -21,6 +21,9 @@ #include "ScriptedEscortAI.h" #include "violet_hold.h" #include "Player.h" +#include "SpellAuras.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" #define GOSSIP_START_EVENT "Get your people to safety, we'll keep the Blue Dragonflight's forces at bay." #define GOSSIP_ITEM_1 "Activate the crystals when we get in trouble, right" @@ -108,8 +111,8 @@ enum AzureStalkerSpells enum AzureSaboteurSpells { - SABOTEUR_SHIELD_DISRUPTION = 58291, - SABOTEUR_SHIELD_EFFECT = 45775 + SABOTEUR_SHIELD_DISRUPTION = 58291, + SABOTEUR_SHIELD_EFFECT = 45775 }; enum TrashDoorSpell @@ -119,13 +122,14 @@ enum TrashDoorSpell enum Spells { - SPELL_PORTAL_CHANNEL = 58012, - SPELL_CRYSTALL_ACTIVATION = 57804 + SPELL_PORTAL_CHANNEL = 58012, + SPELL_CRYSTAL_ACTIVATION = 57804, + SPELL_ARCANE_SPHERE_PASSIVE = 44263 }; enum Sinclari { - SAY_SINCLARI_1 = 0 + SAY_SINCLARI_1 = 0 }; float FirstPortalWPs [6][3] = @@ -424,7 +428,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_saboteurAI (creature); + return new npc_azure_saboteurAI(creature); } struct npc_azure_saboteurAI : public npc_escortAI @@ -663,14 +667,14 @@ public: void JustSummoned(Creature* summoned) OVERRIDE { listOfMobs.Summon(summoned); - if (summoned) + if (instance) instance->SetData64(DATA_ADD_TRASH_MOB, summoned->GetGUID()); } - void SummonedMobDied(Creature* summoned) + void SummonedCreatureDies(Creature* summoned, Unit* /*killer*/) OVERRIDE { listOfMobs.Despawn(summoned); - if (summoned) + if (instance) instance->SetData64(DATA_DEL_TRASH_MOB, summoned->GetGUID()); } }; @@ -733,7 +737,7 @@ struct violet_hold_trashAI : public npc_escortAI if (!bHasGotMovingPoints) { bHasGotMovingPoints = true; - switch (portalLocationID) + switch (portalLocationID) { case 0: for (int i=0;i<6;i++) @@ -759,7 +763,7 @@ struct violet_hold_trashAI : public npc_escortAI case 2: for (int i=0;i<8;i++) AddWaypoint(i, ThirdPortalWPs[i][0]+irand(-1, 1), ThirdPortalWPs[i][1]+irand(-1, 1), ThirdPortalWPs[i][2], 0); - me->SetHomePosition(ThirdPortalWPs[7][0], ThirdPortalWPs[7][1], ThirdPortalWPs[7][2], 3.149439f); + me->SetHomePosition(ThirdPortalWPs[7][0], ThirdPortalWPs[7][1], ThirdPortalWPs[7][2], 3.149439f); break; case 3: for (int i=0;i<9;i++) @@ -785,12 +789,7 @@ struct violet_hold_trashAI : public npc_escortAI void JustDied(Unit* /*killer*/) OVERRIDE { if (instance) - { - if (Creature* portal = Unit::GetCreature((*me), instance->GetData64(DATA_TELEPORTATION_PORTAL))) - CAST_AI(npc_teleportation_portal_vh::npc_teleportation_portalAI, portal->AI())->SummonedMobDied(me); - instance->SetData(DATA_NPC_PRESENCE_AT_DOOR_REMOVE, 1); - } } void CreatureStartAttackDoor() @@ -810,7 +809,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_invaderAI (creature); + return new npc_azure_invaderAI(creature); } struct npc_azure_invaderAI : public violet_hold_trashAI @@ -888,7 +887,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_binderAI (creature); + return new npc_azure_binderAI(creature); } struct npc_azure_binderAI : public violet_hold_trashAI @@ -966,7 +965,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_mage_slayerAI (creature); + return new npc_azure_mage_slayerAI(creature); } struct npc_azure_mage_slayerAI : public violet_hold_trashAI @@ -1026,7 +1025,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_raiderAI (creature); + return new npc_azure_raiderAI(creature); } struct npc_azure_raiderAI : public violet_hold_trashAI @@ -1076,26 +1075,18 @@ class npc_azure_stalker : public CreatureScript public: npc_azure_stalker() : CreatureScript("npc_azure_stalker") { } - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_azure_stalkerAI (creature); - } - struct npc_azure_stalkerAI : public violet_hold_trashAI { npc_azure_stalkerAI(Creature* creature) : violet_hold_trashAI(creature) { instance = creature->GetInstanceScript(); } - uint32 uiBackstabTimer; - uint32 uiTacticalBlinkTimer; - bool TacticalBlinkCasted; void Reset() OVERRIDE { - uiBackstabTimer = 1300; - uiTacticalBlinkTimer = 8000; - TacticalBlinkCasted =false; + _backstabTimer = 1300; + _tacticalBlinkTimer = 8000; + _tacticalBlinkCast =false; } void UpdateAI(uint32 diff) OVERRIDE @@ -1106,33 +1097,42 @@ public: if (!UpdateVictim()) return; - if (!TacticalBlinkCasted) + if (!_tacticalBlinkCast) { - if (uiTacticalBlinkTimer <= diff) + if (_tacticalBlinkTimer <= diff) { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true); if (target) DoCast(target, SPELL_TACTICAL_BLINK); - uiTacticalBlinkTimer = 6000; - TacticalBlinkCasted = true; - } else uiTacticalBlinkTimer -= diff; + _tacticalBlinkTimer = 6000; + _tacticalBlinkCast = true; + } else _tacticalBlinkTimer -= diff; } else { - if (uiBackstabTimer <= diff) + if (_backstabTimer <= diff) { Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 10, true); DoCast(target, SPELL_BACKSTAB); - TacticalBlinkCasted = false; - uiBackstabTimer =1300; - } else uiBackstabTimer -= diff; + _tacticalBlinkCast = false; + _backstabTimer =1300; + } else _backstabTimer -= diff; } DoMeleeAttackIfReady(); } + + private: + uint32 _backstabTimer; + uint32 _tacticalBlinkTimer; + bool _tacticalBlinkCast; }; + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_azure_stalkerAI(creature); + } }; class npc_azure_spellbreaker : public CreatureScript @@ -1210,7 +1210,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_spellbreakerAI (creature); + return new npc_azure_spellbreakerAI(creature); } }; @@ -1221,7 +1221,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_captainAI (creature); + return new npc_azure_captainAI(creature); } struct npc_azure_captainAI : public violet_hold_trashAI @@ -1273,7 +1273,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_sorcerorAI (creature); + return new npc_azure_sorcerorAI(creature); } struct npc_azure_sorcerorAI : public violet_hold_trashAI @@ -1320,7 +1320,55 @@ public: DoMeleeAttackIfReady(); } }; +}; + +class npc_violet_hold_arcane_sphere : public CreatureScript +{ +public: + npc_violet_hold_arcane_sphere() : CreatureScript("npc_violet_hold_arcane_sphere") { } + + struct npc_violet_hold_arcane_sphereAI : public ScriptedAI + { + npc_violet_hold_arcane_sphereAI(Creature* creature) : ScriptedAI(creature) { } + + uint32 DespawnTimer; + + void Reset() OVERRIDE + { + DespawnTimer = 3000; + + me->SetDisableGravity(true); + DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); + } + + void EnterCombat(Unit * /*who*/) OVERRIDE {} + + void UpdateAI(uint32 diff) OVERRIDE + { + if (DespawnTimer <= diff) + me->Kill(me); + else + DespawnTimer -= diff; + } + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_violet_hold_arcane_sphereAI(creature); + } +}; + +class go_activation_crystal : public GameObjectScript +{ +public: + go_activation_crystal() : GameObjectScript("go_activation_crystal") { } + + bool OnGossipHello(Player * /*player*/, GameObject* go) OVERRIDE + { + go->EventInform(EVENT_ACTIVATE_CRYSTAL); + return false; + } }; void AddSC_violet_hold() @@ -1336,4 +1384,6 @@ void AddSC_violet_hold() new npc_azure_raider(); new npc_azure_stalker(); new npc_azure_saboteur(); + new npc_violet_hold_arcane_sphere(); + new go_activation_crystal(); } diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.h b/src/server/scripts/Northrend/VioletHold/violet_hold.h index 014d3edff77..f288af43ed2 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.h +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.h @@ -92,7 +92,8 @@ enum CreaturesIds CREATURE_CYANIGOSA = 31134, CREATURE_SINCLARI = 30658, CREATURE_SABOTEOUR = 31079, - NPC_VIOLET_HOLD_GUARD = 30659 + NPC_VIOLET_HOLD_GUARD = 30659, + NPC_DEFENSE_SYSTEM = 30837 }; enum WorldStateIds @@ -102,4 +103,9 @@ enum WorldStateIds WORLD_STATE_VH_WAVE_COUNT = 3810, }; +enum Events +{ + EVENT_ACTIVATE_CRYSTAL = 20001 +}; + #endif diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index c4a93f931d8..6d2a48910fe 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -456,7 +456,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_jennyAI (creature); + return new npc_jennyAI(creature); } }; @@ -1356,7 +1356,7 @@ public: bCheck = false; shadowBoltTimer = urand(5000, 12000); deflectionTimer = urand(20000, 25000); - soulBlastTimer = urand (12000, 18000); + soulBlastTimer = urand(12000, 18000); } void MovementInform(uint32 uiType, uint32 /*uiId*/) OVERRIDE { @@ -1399,7 +1399,7 @@ public: if (soulBlastTimer <= uiDiff) { DoCastVictim(SPELL_SOUL_BLAST); - soulBlastTimer = urand (12000, 18000); + soulBlastTimer = urand(12000, 18000); } else soulBlastTimer -= uiDiff; } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index ef58138c653..24452a5fb5f 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -16,17 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Icecrown -SD%Complete: 100 -SDComment: Quest support: 12807 -SDCategory: Icecrown -EndScriptData */ - -/* ContentData -npc_arete -EndContentData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" @@ -966,6 +955,198 @@ class npc_frostbrood_skytalon : public CreatureScript } }; +/*###### +## The Flesh Giant Champion - Id: 13235 +######*/ +enum FleshGiant +{ + QUEST_FLESH_GIANT_CHAMPION = 13235, + + NPC_MORBIDUS = 30698, + NPC_LICH_KING = 31301, + NPC_OLAKIN = 31428, + NPC_DHAKAR = 31306, + + FACTION_HOSTILE = 14, + FACTION_BASIC = 2102, + + EVENT_INTRO = 1, + EVENT_LK_SAY_1 = 2, + EVENT_LK_SAY_2 = 3, + EVENT_LK_SAY_3 = 4, + EVENT_LK_SAY_4 = 5, + EVENT_LK_SAY_5 = 6, + EVENT_OUTRO = 7, + EVENT_START = 8, + + SPELL_SIMPLE_TELEPORT = 64195, + + SAY_DHAKAR_START = 0, + SAY_LK_1 = 0, + SAY_LK_2 = 1, + SAY_LK_3 = 2, + SAY_LK_4 = 3, + SAY_LK_5 = 4, + SAY_OLAKIN_PAY = 0 +}; + +class npc_margrave_dhakar : public CreatureScript +{ + public: + npc_margrave_dhakar() : CreatureScript("npc_margrave_dhakar") { } + + struct npc_margrave_dhakarAI : public ScriptedAI + { + npc_margrave_dhakarAI(Creature* creature) : ScriptedAI(creature) , _summons(me), _lichKingGuid(0) { } + + void Reset() OVERRIDE + { + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + + _events.Reset(); + _summons.DespawnAll(); + } + + void sGossipSelect(Player* player, uint32 sender, uint32 action) OVERRIDE + { + if (player->GetQuestStatus(QUEST_FLESH_GIANT_CHAMPION) == QUEST_STATUS_INCOMPLETE && !player->IsInCombat()) + { + if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) + { + _events.ScheduleEvent(EVENT_INTRO, 1000); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + } + } + + void UpdateAI(uint32 diff) OVERRIDE + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_INTRO: + { + Talk(SAY_DHAKAR_START); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); + + if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true)) + { + if (Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX() + 10.0f, morbidus->GetPositionY(), morbidus->GetPositionZ())) + { + _lichKingGuid = lichKing->GetGUID(); + lichKing->SetFacingTo(morbidus->GetOrientation()); + lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true); + } + } + + _events.ScheduleEvent(EVENT_LK_SAY_1, 5000); + break; + } + case EVENT_LK_SAY_1: + { + if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid)) + lichKing->AI()->Talk(SAY_LK_1); + _events.ScheduleEvent(EVENT_LK_SAY_2, 5000); + break; + } + case EVENT_LK_SAY_2: + { + if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid)) + lichKing->AI()->Talk(SAY_LK_2); + _events.ScheduleEvent(EVENT_LK_SAY_3, 5000); + break; + } + case EVENT_LK_SAY_3: + { + if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid)) + lichKing->AI()->Talk(SAY_LK_3); + _events.ScheduleEvent(EVENT_LK_SAY_4, 5000); + break; + } + case EVENT_LK_SAY_4: + { + if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid)) + lichKing->AI()->Talk(SAY_LK_4); + _events.ScheduleEvent(EVENT_OUTRO, 12000); + break; + } + case EVENT_LK_SAY_5: + { + if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid)) + lichKing->AI()->Talk(SAY_LK_5); + _events.ScheduleEvent(EVENT_OUTRO, 8000); + break; + } + case EVENT_OUTRO: + { + if (Creature* olakin = me->FindNearestCreature(NPC_OLAKIN, 50.0f, true)) + olakin->AI()->Talk(SAY_OLAKIN_PAY); + + if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid)) + lichKing->DespawnOrUnsummon(0); + + _events.ScheduleEvent(EVENT_START, 5000); + break; + } + case EVENT_START: + { + if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true)) + { + morbidus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_DISABLE_MOVE); + morbidus->setFaction(FACTION_HOSTILE); + } + + break; + } + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap _events; + SummonList _summons; + uint64 _lichKingGuid; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_margrave_dhakarAI(creature); + } +}; + +class npc_morbidus : public CreatureScript +{ + public: + npc_morbidus() : CreatureScript("npc_morbidus") { } + + struct npc_morbidusAI : public ScriptedAI + { + npc_morbidusAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() OVERRIDE + { + if (Creature* dhakar = me->FindNearestCreature(NPC_DHAKAR, 50.0f, true)) + dhakar->AI()->Reset(); + + // this will prevent the event to start without morbidus being alive + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + me->setFaction(FACTION_BASIC); + } + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_morbidusAI(creature); + } +}; + void AddSC_icecrown() { new npc_arete; @@ -976,4 +1157,6 @@ void AddSC_icecrown() new npc_tournament_training_dummy; new npc_blessed_banner(); new npc_frostbrood_skytalon(); + new npc_margrave_dhakar(); + new npc_morbidus(); } diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index e334dbe834a..1fc0cce51b4 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -361,7 +361,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_icefangAI (creature); + return new npc_icefangAI(creature); } }; @@ -409,7 +409,7 @@ class npc_hyldsmeet_protodrake : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_hyldsmeet_protodrakeAI (creature); + return new npc_hyldsmeet_protodrakeAI(creature); } }; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index becf30e1210..9735011ba81 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -56,7 +56,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_stolen_soulAI (creature); + return new npc_stolen_soulAI(creature); } struct npc_stolen_soulAI : public ScriptedAI @@ -158,7 +158,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_exarch_maladaarAI (creature); + return new boss_exarch_maladaarAI(creature); } struct boss_exarch_maladaarAI : public ScriptedAI @@ -309,7 +309,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_avatar_of_martyredAI (creature); + return new npc_avatar_of_martyredAI(creature); } struct npc_avatar_of_martyredAI : public ScriptedAI diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index 86eb9e33a7e..9f7a27ecdef 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -55,7 +55,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_shirrak_the_dead_watcherAI (creature); + return new boss_shirrak_the_dead_watcherAI(creature); } struct boss_shirrak_the_dead_watcherAI : public ScriptedAI @@ -167,7 +167,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_focus_fireAI (creature); + return new npc_focus_fireAI(creature); } struct npc_focus_fireAI : public ScriptedAI diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index ee315d1d42b..6c0d653f213 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -73,7 +73,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nexusprince_shaffarAI (creature); + return new boss_nexusprince_shaffarAI(creature); } struct boss_nexusprince_shaffarAI : public ScriptedAI @@ -234,7 +234,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ethereal_beaconAI (creature); + return new npc_ethereal_beaconAI(creature); } struct npc_ethereal_beaconAI : public ScriptedAI @@ -326,7 +326,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ethereal_apprenticeAI (creature); + return new npc_ethereal_apprenticeAI(creature); } struct npc_ethereal_apprenticeAI : public ScriptedAI diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index aa24e964df9..3a845842934 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -47,7 +47,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_pandemoniusAI (creature); + return new boss_pandemoniusAI(creature); } struct boss_pandemoniusAI : public ScriptedAI diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index 3ba2fd9d19a..7a486876b3f 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_darkweaver_sythAI (creature); + return new boss_darkweaver_sythAI(creature); } struct boss_darkweaver_sythAI : public ScriptedAI @@ -247,7 +247,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_syth_fireAI (creature); + return new npc_syth_fireAI(creature); } }; @@ -258,7 +258,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_syth_arcaneAI (creature); + return new npc_syth_arcaneAI(creature); } struct npc_syth_arcaneAI : public ScriptedAI @@ -312,7 +312,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_syth_frostAI (creature); + return new npc_syth_frostAI(creature); } struct npc_syth_frostAI : public ScriptedAI @@ -367,7 +367,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_syth_shadowAI (creature); + return new npc_syth_shadowAI(creature); } struct npc_syth_shadowAI : public ScriptedAI diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp index 9333f19d41a..4123da48ba6 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -55,7 +55,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_talon_king_ikissAI (creature); + return new boss_talon_king_ikissAI(creature); } struct boss_talon_king_ikissAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index 33a6c42bae7..a44c5f58dc4 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -21,25 +21,41 @@ Complete: 100% Comment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. */ -/* Content -npc_spirit_of_olum -*/ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "black_temple.h" #include "Player.h" -/*### -# npc_spirit_of_olum -####*/ - enum Spells { - SPELL_TELEPORT = 41566 + // Spirit of Olum + SPELL_TELEPORT = 41566, + // Wrathbone Flayer + SPELL_CLEAVE = 15496, + SPELL_IGNORED = 39544, + SPELL_SUMMON_CHANNEL = 40094 }; +enum Creatures +{ + NPC_BLOOD_MAGE = 22945, + NPC_DEATHSHAPER = 22882 +}; + +enum Events +{ + // Wrathbone Flayer + EVENT_GET_CHANNELERS = 1, + EVENT_SET_CHANNELERS = 2, + EVENT_CLEAVE = 3, + EVENT_IGNORED = 4, +}; + +// ######################################################## +// Spirit of Olum +// ######################################################## + class npc_spirit_of_olum : public CreatureScript { public: @@ -62,11 +78,141 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_spirit_of_olumAI (creature); + return new npc_spirit_of_olumAI(creature); + } +}; + +// ######################################################## +// Wrathbone Flayer +// ######################################################## + +class npc_wrathbone_flayer : public CreatureScript +{ +public: + npc_wrathbone_flayer() : CreatureScript("npc_wrathbone_flayer") { } + + struct npc_wrathbone_flayerAI : public ScriptedAI + { + npc_wrathbone_flayerAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } + + void Reset() OVERRIDE + { + events.ScheduleEvent(EVENT_GET_CHANNELERS, 3000); + enteredCombat = false; + } + + void JustDied(Unit* /*killer*/) OVERRIDE { } + + void EnterCombat(Unit* /*who*/) OVERRIDE + { + events.ScheduleEvent(EVENT_CLEAVE, 5000); + events.ScheduleEvent(EVENT_IGNORED, 7000); + enteredCombat = true; + } + + void UpdateAI(uint32 diff) OVERRIDE + { + + if (!enteredCombat) + { + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_GET_CHANNELERS: + { + std::list<Creature*> BloodMageList; + me->GetCreatureListWithEntryInGrid(BloodMageList, NPC_BLOOD_MAGE, 15.0f); + + if (!BloodMageList.empty()) + for (std::list<Creature*>::const_iterator itr = BloodMageList.begin(); itr != BloodMageList.end(); ++itr) + { + bloodmage.push_back((*itr)->GetGUID()); + if ((*itr)->isDead()) + (*itr)->Respawn(); + } + + std::list<Creature*> DeathShaperList; + me->GetCreatureListWithEntryInGrid(DeathShaperList, NPC_DEATHSHAPER, 15.0f); + + if (!DeathShaperList.empty()) + for (std::list<Creature*>::const_iterator itr = DeathShaperList.begin(); itr != DeathShaperList.end(); ++itr) + { + deathshaper.push_back((*itr)->GetGUID()); + if ((*itr)->isDead()) + (*itr)->Respawn(); + } + + events.ScheduleEvent(EVENT_SET_CHANNELERS, 3000); + + break; + } + case EVENT_SET_CHANNELERS: + { + for (std::list<uint64>::const_iterator itr = bloodmage.begin(); itr != bloodmage.end(); ++itr) + if (Creature* bloodmage = (Unit::GetCreature(*me, *itr))) + bloodmage->AI()->DoCast(SPELL_SUMMON_CHANNEL); + + for (std::list<uint64>::const_iterator itr = deathshaper.begin(); itr != deathshaper.end(); ++itr) + if (Creature* deathshaper = (Unit::GetCreature(*me, *itr))) + deathshaper->AI()->DoCast(SPELL_SUMMON_CHANNEL); + + events.ScheduleEvent(EVENT_SET_CHANNELERS, 12000); + + break; + } + default: + break; + } + } + } + + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CLEAVE: + DoCastVictim(SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, urand (1000, 2000)); + break; + case EVENT_IGNORED: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_IGNORED); + events.ScheduleEvent(EVENT_IGNORED, 10000); + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + + private: + InstanceScript* instance; + EventMap events; + std::list<uint64> bloodmage; + std::list<uint64> deathshaper; + bool enteredCombat; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_wrathbone_flayerAI(creature); } }; void AddSC_black_temple() { new npc_spirit_of_olum(); + new npc_wrathbone_flayer(); } diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h index 2d26fe745c2..971cc36d7ba 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.h +++ b/src/server/scripts/Outland/BlackTemple/black_temple.h @@ -19,6 +19,8 @@ #ifndef BLACK_TEMPLE_H_ #define BLACK_TEMPLE_H_ +uint32 const EncounterCount = 9; + enum DataTypes { DATA_AKAMA = 1, @@ -49,4 +51,4 @@ enum DataTypes DATA_BLOOD_ELF_COUNCIL_VOICE = 26 }; -#endif // BLACK_TEMPLE_H_ +#endif diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index d55ca24914a..7a11044476a 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -64,7 +64,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gurtogg_bloodboilAI (creature); + return new boss_gurtogg_bloodboilAI(creature); } struct boss_gurtogg_bloodboilAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 07c6e665e98..2fdfe72a6f9 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -466,7 +466,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new flame_of_azzinothAI (creature); + return new flame_of_azzinothAI(creature); } }; @@ -1129,7 +1129,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_illidan_stormrageAI (creature); + return new boss_illidan_stormrageAI(creature); } }; @@ -1350,7 +1350,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_maievAI (creature); + return new boss_maievAI(creature); } }; @@ -2055,7 +2055,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new cage_trap_triggerAI (creature); + return new cage_trap_triggerAI(creature); } }; @@ -2129,7 +2129,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new shadow_demonAI (creature); + return new shadow_demonAI(creature); } }; @@ -2151,7 +2151,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new blade_of_azzinothAI (creature); + return new blade_of_azzinothAI(creature); } }; @@ -2236,7 +2236,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_parasitic_shadowfiendAI (creature); + return new npc_parasitic_shadowfiendAI(creature); } }; diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 0bf6685bcf4..b9172be49da 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -84,7 +84,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_shahrazAI (creature); + return new boss_shahrazAI(creature); } struct boss_shahrazAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index e43b80d375d..22ea1b70c21 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -106,7 +106,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_enslaved_soulAI (creature); + return new npc_enslaved_soulAI(creature); } struct npc_enslaved_soulAI : public ScriptedAI @@ -134,7 +134,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_reliquary_of_soulsAI (creature); + return new boss_reliquary_of_soulsAI(creature); } struct boss_reliquary_of_soulsAI : public ScriptedAI @@ -390,7 +390,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_essence_of_sufferingAI (creature); + return new boss_essence_of_sufferingAI(creature); } struct boss_essence_of_sufferingAI : public ScriptedAI @@ -515,7 +515,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_essence_of_desireAI (creature); + return new boss_essence_of_desireAI(creature); } struct boss_essence_of_desireAI : public ScriptedAI @@ -618,7 +618,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_essence_of_angerAI (creature); + return new boss_essence_of_angerAI(creature); } struct boss_essence_of_angerAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 04e08a517e7..4a4304bcd24 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,904 +15,1236 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Shade_of_Akama -SD%Complete: 90 -SDComment: Seems to be complete. -SDCategory: Black Temple -EndScriptData */ +/* +Name: Boss_Shade_of_Akama +%Complete: 80 +Comment: WIP A few more adds to script, ending script, and bugs. +Category: Black Temple +*/ +#include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" +#include "GridNotifiers.h" #include "black_temple.h" -#include "Player.h" -enum ShadeOfAkama +enum Says { - SAY_DEATH = 0, - SAY_LOW_HEALTH = 1, - // Ending cinematic text - SAY_FREE = 2, - SAY_BROKEN_FREE_01 = 0, - SAY_BROKEN_FREE_02 = 1 + // Akama Ending cinematic text + SAY_BROKEN_FREE_0 = 0, + SAY_BROKEN_FREE_1 = 1, + SAY_BROKEN_FREE_2 = 2 }; -#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" - -struct Location +enum Spells { - float x, y, o, z; + // Akama + SPELL_STEALTH = 34189, // On Spawn + SPELL_AKAMA_SOUL_CHANNEL = 40447, // Cast on self hits Shade + SPELL_FIXATE = 40607, // Cast on self hits Shade + SPELL_CHAIN_LIGHTNING = 39945, // Combat + SPELL_DESTRUCTIVE_POISON = 40874, // Combat + // Shade + SPELL_THREAT = 41602, // self cast hits Akama + SPELL_SHADE_OF_AKAMA_TRIGGER = 40955, // Cast on death + SPELL_AKAMA_SOUL_EXPEL_CHANNEL = 40927, // must hit shade + SPELL_AKAMA_SOUL_EXPEL = 40902, // the one he cast + // Ashtongue Channeler + SPELL_SHADE_SOUL_CHANNEL = 40401, + SPELL_SHADE_SOUL_CHANNEL_2 = 40520, + SPELL_SHADOWFORM = 40973, // Cast on Shade + // Creature Spawner + SPELL_ASHTONGUE_WAVE_B = 42035, + SPELL_SUMMON_ASHTONGUE_SORCERER = 40476, + SPELL_SUMMON_ASHTONGUE_DEFENDER = 40474, + // Ashtongue Defender + SPELL_DEBILITATING_STRIKE = 41178, + SPELL_HEROIC_STRIKE = 41975, + SPELL_SHIELD_BASH = 41180, + SPELL_WINDFURY = 38229, + // Ashtongue Rogue + SPELL_DEBILITATING_POISON = 41978, + SPELL_EVISCERATE = 41177, + // Ashtongue Elementalist + SPELL_RAIN_OF_FIRE = 42023, + SPELL_LIGHTNING_BOLT = 42024, + // Ashtongue Spiritbinder + SPELL_SPIRIT_MEND = 42025, + SPELL_CHAIN_HEAL = 42027, + SPELL_SPIRITBINDER_SPIRIT_HEAL = 42317 }; -/* Not used -static Location ChannelerLocations[]= +enum Creatures { - {463.161285f, 401.219757f, 3.141592f, 0.0f}, - {457.377625f, 391.227661f, 2.106461f, 0.0f}, - {446.012421f, 391.227661f, 1.071904f, 0.0f}, - {439.533783f, 401.219757f, 0.000000f, 0.0f}, - {446.012421f, 411.211853f, 5.210546f, 0.0f}, - {457.377625f, 411.211853f, 4.177494f, 0.0f} + NPC_ASHTONGUE_CHANNELER = 23421, + NPC_ASHTONGUE_SORCERER = 23215, + NPC_ASHTONGUE_DEFENDER = 23216, + NPC_ASHTONGUE_ELEMENTALIST = 23523, + NPC_ASHTONGUE_ROGUE = 23318, + NPC_ASHTONGUE_SPIRITBINDER = 23524, + NPC_ASHTONGUE_BROKEN = 23319, + NPC_CREATURE_SPAWNER_AKAMA = 23210 }; -*/ -static Location SpawnLocations[]= +enum Factions { - {498.652740f, 461.728119f, 0.0f, 0.0f}, - {498.505003f, 339.619324f, 0.0f, 0.0f} + FACTION_FRIENDLY = 1820, + FACTION_COMBAT = 1868 }; -static Location AkamaWP[]= +enum SetData { - {482.352448f, 401.162720f, 0.0f, 112.783928f}, - {469.597443f, 402.264404f, 0.0f, 118.537910f} + SETDATA_DATA = 1, + SETDATA_RESET = 1, + SETDATA_CHANNELER_DIED = 2, + SETDATA_START_SPAWNING = 3, + SETDATA_STOP_SPAWNING = 4, + SETDATA_DESPAWN_ALL_SPAWNS = 5, + SETDATA_START_ATTACK_AKAMA = 6 }; -static Location BrokenCoords[]= +enum Events { - {541.375916f, 401.439575f, M_PI, 112.783997f}, // The place where Akama channels - {534.130005f, 352.394531f, 2.164150f, 112.783737f}, // Behind a 'pillar' which is behind the east alcove - {499.621185f, 341.534729f, 1.652856f, 112.783730f}, // East Alcove - {499.151093f, 461.036438f, 4.770888f, 112.78370f}, // West Alcove + // Akama + EVENT_SHADE_START = 1, + EVENT_SHADE_CHANNEL = 2, + EVENT_FIXATE = 3, + EVENT_CHAIN_LIGHTNING = 4, + EVENT_DESTRUCTIVE_POISON = 5, + // Shade + EVENT_RESET_ENCOUNTER = 6, + EVENT_FIND_CHANNELERS_SPAWNERS = 7, + EVENT_SET_CHANNELERS_SPAWNERS = 8, + EVENT_START_ATTACK_AKAMA = 9, + EVENT_ADD_THREAT = 10, + // Creature spawner + EVENT_SPAWN_WAVE_B = 11, + EVENT_SUMMON_ASHTONGUE_SORCERER = 12, + EVENT_SUMMON_ASHTONGUE_DEFENDER = 13, + // Channeler + EVENT_GET_SHADE_GUID = 14, + EVENT_CHANNEL = 15, + // Ashtongue Sorcerer + EVENT_SORCERER_CHANNEL = 16, + // Ashtongue Defender + EVENT_DEBILITATING_STRIKE = 17, + EVENT_HEROIC_STRIKE = 18, + EVENT_SHIELD_BASH = 19, + EVENT_WINDFURY = 20, + // Ashtongue Rogue + EVENT_DEBILITATING_POISON = 21, + EVENT_EVISCERATE = 22, + // Ashtongue Elementalist + EVENT_RAIN_OF_FIRE = 23, + EVENT_LIGHTNING_BOLT = 24, + // Ashtongue Spiritbinder + EVENT_SPIRIT_HEAL = 25, }; -static Location BrokenWP[]= +struct Location { - {492.491638f, 400.744690f, 3.122336f, 112.783737f}, - {494.335724f, 382.221771f, 2.676230f, 112.783737f}, - {489.555939f, 373.507202f, 2.416263f, 112.783737f}, - {491.136353f, 427.868774f, 3.519748f, 112.783737f}, + float x, y, z; }; -// Locations -#define Z1 118.543144f -#define Z2 120.783768f -#define Z_SPAWN 113.537949f -#define AGGRO_X 482.793182f -#define AGGRO_Y 401.270172f -#define AGGRO_Z 112.783928f -#define AKAMA_X 514.583984f -#define AKAMA_Y 400.601013f -#define AKAMA_Z 112.783997f - +static Location ShadeWP = { 512.4877f, 400.7993f, 112.7837f }; -enum Spells -{ - SPELL_VERTEX_SHADE_BLACK = 39833, - SPELL_SHADE_SOUL_CHANNEL = 40401, - SPELL_DESTRUCTIVE_POISON = 40874, - SPELL_LIGHTNING_BOLT = 42024, - SPELL_AKAMA_SOUL_CHANNEL = 40447, - SPELL_AKAMA_SOUL_RETRIEVE = 40902, - SPELL_AKAMA_SOUL_EXPEL = 40855, - SPELL_SHADE_SOUL_CHANNEL_2 = 40520 -}; - -enum Creatures +static Location AkamaWP[] = { - NPC_CHANNELER = 23421, - NPC_SORCERER = 23215, - NPC_DEFENDER = 23216, - NPC_BROKEN = 23319 + { 517.4877f, 400.7993f, 112.7837f }, + { 468.4435f, 401.1062f, 118.5379f } }; -const uint32 spawnEntries[4]= { 23523, 23318, 23524 }; +// ######################################################## +// Shade of Akama +// ######################################################## -class npc_ashtongue_channeler : public CreatureScript +class boss_shade_of_akama : public CreatureScript { public: - npc_ashtongue_channeler() : CreatureScript("npc_ashtongue_channeler") { } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_ashtongue_channelerAI (creature); - } + boss_shade_of_akama() : CreatureScript("boss_shade_of_akama") { } - struct npc_ashtongue_channelerAI : public ScriptedAI + struct boss_shade_of_akamaAI : public ScriptedAI { - npc_ashtongue_channelerAI(Creature* creature) : ScriptedAI(creature) + boss_shade_of_akamaAI(Creature* creature) : ScriptedAI(creature), HasKilledAkamaAndReseting(false) { - ShadeGUID = 0; + instance = creature->GetInstanceScript(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - uint64 ShadeGUID; + void Reset() OVERRIDE + { + if (!HasKilledAkamaAndReseting) + { + for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + if (Creature* Channeler = (Unit::GetCreature(*me, *itr))) + Channeler->DespawnOrUnsummon(); - void Reset() OVERRIDE {} - void JustDied(Unit* /*killer*/) OVERRIDE; - void EnterCombat(Unit* /*who*/) OVERRIDE {} - void AttackStart(Unit* /*who*/) OVERRIDE {} - void MoveInLineOfSight(Unit* /*who*/) OVERRIDE {} + for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr) + if (Creature* Spawner = (Unit::GetCreature(*me, *itr))) + Spawner->AI()->SetData(SETDATA_DATA, SETDATA_DESPAWN_ALL_SPAWNS); - void UpdateAI(uint32 /*diff*/) OVERRIDE {} - }; + events.ScheduleEvent(EVENT_FIND_CHANNELERS_SPAWNERS, 3000); + events.ScheduleEvent(EVENT_RESET_ENCOUNTER, 5000); + } -}; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); -class npc_ashtongue_sorcerer : public CreatureScript -{ -public: - npc_ashtongue_sorcerer() : CreatureScript("npc_ashtongue_sorcerer") { } + me->SetWalk(true); + combatStarted = false; + akamaReached = false; + HasKilledAkama = false; + HasKilledAkamaAndReseting = false; + } - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_ashtongue_sorcererAI (creature); - } + void JustDied(Unit* /*killer*/) OVERRIDE + { + if (instance) + instance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); + } - struct npc_ashtongue_sorcererAI : public ScriptedAI - { - npc_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature) + void EnterCombat(Unit* /*who*/) OVERRIDE {} + + void AttackStart(Unit* who) OVERRIDE { - ShadeGUID = 0; + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + if (Creature* Akama = Unit::GetCreature((*me), akamaGUID)) + if (Akama->IsAlive()) + ScriptedAI::AttackStart(Akama); + } + else + ScriptedAI::AttackStart(who); } - uint64 ShadeGUID; - uint32 CheckTimer; - bool StartBanishing; + void SetData(uint32 data, uint32 value) OVERRIDE + { + if (data == SETDATA_DATA && value == SETDATA_CHANNELER_DIED) + me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); - void Reset() OVERRIDE + UpdateSpeed(); + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE { - StartBanishing = false; - CheckTimer = 5000; + if (spell->Id == SPELL_AKAMA_SOUL_CHANNEL) + { + combatStarted = true; + events.ScheduleEvent(EVENT_START_ATTACK_AKAMA, 500); + events.ScheduleEvent(EVENT_SET_CHANNELERS_SPAWNERS, 1000); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + if (Creature* Akama = Unit::GetCreature((*me), akamaGUID)) + me->AddThreat(Akama, 10000000.0f); + } + else if (spell->Id == SPELL_SHADE_SOUL_CHANNEL_2) + UpdateSpeed(); } - void JustDied(Unit* /*killer*/) OVERRIDE; - void EnterCombat(Unit* /*who*/) OVERRIDE {} - void AttackStart(Unit* /*who*/) OVERRIDE {} - void MoveInLineOfSight(Unit* /*who*/) OVERRIDE {} + void UpdateSpeed() + { + float moveSpeed = 0.2f; + + if (me->GetAuraCount(SPELL_SHADE_SOUL_CHANNEL_2) <= 3) + { + moveSpeed = (2.0 - (0.6 * me->GetAuraCount(SPELL_SHADE_SOUL_CHANNEL_2))); + me->SetSpeed(MOVE_WALK, moveSpeed / 2.5); + me->SetSpeed(MOVE_RUN, (moveSpeed * 2) / 7); + me->ClearUnitState(UNIT_STATE_ROOT); + } + else + me->AddUnitState(UNIT_STATE_ROOT); + } void UpdateAI(uint32 diff) OVERRIDE { - if (StartBanishing) + if (HasKilledAkamaAndReseting) return; - if (CheckTimer <= diff) + events.Update(diff); + + if (!combatStarted) { - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && Shade->IsAlive() && me->IsAlive()) + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RESET_ENCOUNTER: + if (Creature* Akama = Unit::GetCreature((*me), akamaGUID)) + if (!Akama->IsAlive()) + Akama->Respawn(); + break; + case EVENT_FIND_CHANNELERS_SPAWNERS: + { + std::list<Creature*> ChannelerList; + me->GetCreatureListWithEntryInGrid(ChannelerList, NPC_ASHTONGUE_CHANNELER, 15.0f); + + if (!ChannelerList.empty()) + for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) + { + Channelers.push_back((*itr)->GetGUID()); + if ((*itr)->isDead()) + (*itr)->Respawn(); + } + + std::list<Creature*> SpawnerList; + me->GetCreatureListWithEntryInGrid(SpawnerList, NPC_CREATURE_SPAWNER_AKAMA, 90.0f); + + if (!SpawnerList.empty()) + for (std::list<Creature*>::const_iterator itr = SpawnerList.begin(); itr != SpawnerList.end(); ++itr) + Spawners.push_back((*itr)->GetGUID()); + + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + akamaGUID = instance->GetData64(DATA_AKAMA_SHADE); + break; + } + default: + break; + } + } + } + else + { + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SET_CHANNELERS_SPAWNERS: + { + for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + { + if (Creature* Channeler = (Unit::GetCreature(*me, *itr))) + Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr) + { + if (Creature* Spawner = (Unit::GetCreature(*me, *itr))) + Spawner->AI()->SetData(SETDATA_DATA, SETDATA_START_SPAWNING); + } + + break; + } + case EVENT_START_ATTACK_AKAMA: + me->GetMotionMaster()->MovePoint(0, ShadeWP.x, ShadeWP.y, ShadeWP.z ,false); + events.ScheduleEvent(EVENT_START_ATTACK_AKAMA, 1000); + break; + case EVENT_ADD_THREAT: + DoCast(SPELL_THREAT); + events.ScheduleEvent(EVENT_ADD_THREAT, 3500); + break; + default: + break; + } + } + + if (HasKilledAkama) { - if (me->IsWithinDist(Shade, 20, false)) + if (!HasKilledAkamaAndReseting) { - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveIdle(); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true); + HasKilledAkamaAndReseting = true; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + instance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); + me->RemoveAllAurasExceptType(SPELL_AURA_DUMMY); + me->DeleteThreatList(); + me->CombatStop(); + me->GetMotionMaster()->MoveTargetedHome(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + combatStarted = false; + + if (Creature* Akama = Unit::GetCreature((*me), akamaGUID)) + Akama->DespawnOrUnsummon(); + + for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + if (Creature* Channeler = (Unit::GetCreature(*me, *itr))) + Channeler->DespawnOrUnsummon(); + + for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr) + if (Creature* Spawner = (Unit::GetCreature(*me, *itr))) + Spawner->AI()->SetData(SETDATA_DATA, SETDATA_DESPAWN_ALL_SPAWNS); - StartBanishing = true; + events.ScheduleEvent(EVENT_FIND_CHANNELERS_SPAWNERS, 10000); + events.ScheduleEvent(EVENT_RESET_ENCOUNTER, 20000); } } - CheckTimer = 2000; - } else CheckTimer -= diff; + + if (!akamaReached) + { + if (Creature* Akama = Unit::GetCreature((*me), akamaGUID)) + { + if (me->IsWithinDist(Akama, 2.0f, false)) + { + akamaReached = true; + me->GetMotionMaster()->Clear(true); + me->GetMotionMaster()->MoveIdle(); + me->SetWalk(false); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + events.CancelEvent(EVENT_START_ATTACK_AKAMA); + events.ScheduleEvent(EVENT_ADD_THREAT, 100); + + for (std::list<uint64>::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr) + if (Creature* Spawner = (Unit::GetCreature(*me, *itr))) + Spawner->AI()->SetData(SETDATA_DATA, SETDATA_STOP_SPAWNING); + } + } + } + else + DoMeleeAttackIfReady(); + } } + + public: + bool HasKilledAkama; + private: + InstanceScript* instance; + EventMap events; + std::list<uint64> Channelers; + std::list<uint64> Spawners; + uint64 akamaGUID; + uint64 ShadeGUID; + bool akamaReached; + bool combatStarted; + bool HasKilledAkamaAndReseting; }; + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new boss_shade_of_akamaAI(creature); + } }; -class boss_shade_of_akama : public CreatureScript +// ######################################################## +// Akama +// ######################################################## + +class npc_akama_shade : public CreatureScript { public: - boss_shade_of_akama() : CreatureScript("boss_shade_of_akama") { } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new boss_shade_of_akamaAI (creature); - } + npc_akama_shade() : CreatureScript("npc_akama_shade") { } - struct boss_shade_of_akamaAI : public ScriptedAI + struct npc_akamaAI : public ScriptedAI { - boss_shade_of_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me) + npc_akamaAI(Creature* creature) : ScriptedAI(creature) { instance = creature->GetInstanceScript(); - AkamaGUID = instance ? instance->GetData64(DATA_AKAMA_SHADE) : 0; - me->setActive(true);//if view distance is too low - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); } - InstanceScript* instance; - - std::list<uint64> Channelers; - std::list<uint64> Sorcerers; - uint64 AkamaGUID; + void Reset() OVERRIDE + { + me->setFaction(FACTION_FRIENDLY); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + DoCast(me, SPELL_STEALTH); + StartChannel = false; + StartCombat = false; + HasYelledOnce = false; + ShadeHasDied = false; + } - uint32 SorcererCount; - uint32 DeathCount; + void JustDied(Unit* /*killer*/) OVERRIDE + { + if (Creature* Shade = Unit::GetCreature((*me), ShadeGUID)) + if (Shade->IsAlive()) + CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; + me->GetMotionMaster()->Clear(true); + me->GetMotionMaster()->MoveIdle(); + } - uint32 ReduceHealthTimer; - uint32 SummonTimer; - uint32 ResetTimer; - uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer. + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE + { + if (!StartCombat) + { + if (spell->Id == SPELL_THREAT) + { + me->ClearUnitState(UNIT_STATE_ROOT); + me->RemoveAura(SPELL_AKAMA_SOUL_CHANNEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + if (Creature* Shade = Unit::GetCreature((*me), ShadeGUID)) + Shade->RemoveAura(SPELL_AKAMA_SOUL_CHANNEL); + StartCombat = true; + } + } + } - bool IsBanished; - bool HasKilledAkama; - bool reseting; - bool GridSearcherSucceeded; - bool HasKilledAkamaAndReseting; - SummonList summons; + void EnterCombat(Unit* /*who*/) OVERRIDE + { + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 2000); + events.ScheduleEvent(EVENT_DESTRUCTIVE_POISON, 5000); + } - void Reset() OVERRIDE + void UpdateAI(uint32 diff) OVERRIDE { - reseting = true; - HasKilledAkamaAndReseting = false; + if (StartChannel) + { + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SHADE_START: + if (instance) + { + ShadeGUID = instance->GetData64(DATA_SHADEOFAKAMA); + instance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->RemoveAura(SPELL_STEALTH); + me->SetWalk(true); + me->GetMotionMaster()->MovePoint(0, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z, false); + events.ScheduleEvent(EVENT_SHADE_CHANNEL, 10000); + break; + } + case EVENT_SHADE_CHANNEL: + me->AddUnitState(UNIT_STATE_ROOT); + me->SetFacingTo(3.118662f); + DoCast(me, SPELL_AKAMA_SOUL_CHANNEL); + me->setFaction(FACTION_COMBAT); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + events.ScheduleEvent(EVENT_FIXATE, 5000); + break; + case EVENT_FIXATE: + DoCast(SPELL_FIXATE); + StartChannel = false; + break; + default: + break; + } + } + } - GridSearcherSucceeded = false; + if (!UpdateVictim()) + return; - Sorcerers.clear(); - summons.DespawnAll();//despawn all adds + events.Update(diff); - if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID)) + while (uint32 eventId = events.ExecuteEvent()) { - Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event - if (Akama->isDead()) + switch (eventId) { - Akama->Respawn();//respawn akama if dead - Akama->AI()->EnterEvadeMode(); + case EVENT_CHAIN_LIGHTNING: + DoCastVictim(SPELL_CHAIN_LIGHTNING); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(10000, 15000)); + break; + case EVENT_DESTRUCTIVE_POISON: + DoCast(me, SPELL_DESTRUCTIVE_POISON); + events.ScheduleEvent(EVENT_DESTRUCTIVE_POISON, urand(4000, 5000)); + break; + default: + break; } } - SorcererCount = 0; - DeathCount = 0; - SummonTimer = 10000; - ReduceHealthTimer = 0; - ResetTimer = 60000; - DefenderTimer = 15000; + DoMeleeAttackIfReady(); + } - IsBanished = true; - HasKilledAkama = false; + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) OVERRIDE + { + if (action == 0) + { + player->CLOSE_GOSSIP_MENU(); + StartChannel = true; + events.ScheduleEvent(EVENT_SHADE_START, 500); + } + } - me->SetVisible(true); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //me->GetMotionMaster()->Clear(); - //me->GetMotionMaster()->MoveIdle(); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + private: + InstanceScript* instance; + EventMap events; + uint64 ShadeGUID; + bool StartChannel; + bool ShadeHasDied; + bool StartCombat; + bool HasYelledOnce; - if (instance) - instance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); + }; - reseting = false; - } + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_akamaAI(creature); + } +}; - void JustDied(Unit* /*killer*/) OVERRIDE +// ######################################################## +// Ashtongue Channeler +// ######################################################## + +class npc_ashtongue_channeler : public CreatureScript +{ +public: + npc_ashtongue_channeler() : CreatureScript("npc_ashtongue_channeler") { } + + struct npc_ashtongue_channelerAI : public ScriptedAI + { + npc_ashtongue_channelerAI(Creature* creature) : ScriptedAI(creature) { - summons.DespawnAll(); + instance = creature->GetInstanceScript(); } - void JustSummoned(Creature* summon) OVERRIDE + void Reset() OVERRIDE { - if (summon->GetEntry() == NPC_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Summon(summon); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + events.ScheduleEvent(EVENT_CHANNEL, 2000); + events.ScheduleEvent(EVENT_GET_SHADE_GUID, 1000); } - void SummonedCreatureDespawn(Creature* summon) OVERRIDE + void JustDied(Unit* /*killer*/) OVERRIDE { - if (summon->GetEntry() == NPC_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Despawn(summon); + if (Creature* Shade = (Unit::GetCreature((*me), ShadeGUID))) + Shade->AI()->SetData(SETDATA_DATA, SETDATA_CHANNELER_DIED); } - void MoveInLineOfSight(Unit* /*who*/) OVERRIDE + void EnterCombat(Unit* /*who*/) OVERRIDE {} + void AttackStart(Unit* /*who*/) OVERRIDE {} + void UpdateAI(uint32 diff) OVERRIDE { - if (!GridSearcherSucceeded) - { - FindChannelers(); + events.Update(diff); - if (!Channelers.empty()) + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) { - for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - { - Creature* Channeler = (Unit::GetCreature(*me, *itr)); - if (Channeler) + case EVENT_CHANNEL: + if (Creature* Shade = (Unit::GetCreature((*me), ShadeGUID))) { - if (Channeler->isDead()) + if (Shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + DoCast(me, SPELL_SHADE_SOUL_CHANNEL); + else { - Channeler->RemoveCorpse(); - Channeler->Respawn(); + me->InterruptSpell(CURRENT_CHANNELED_SPELL); + Shade->AI()->SetData(SETDATA_DATA, SETDATA_CHANNELER_DIED); } - - Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true); - Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true); - Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - GridSearcherSucceeded = true; } - } + events.ScheduleEvent(EVENT_CHANNEL, 2000); + break; + case EVENT_GET_SHADE_GUID: + if (instance) + ShadeGUID = instance->GetData64(DATA_SHADEOFAKAMA); + break; + default: + break; } - else - TC_LOG_ERROR(LOG_FILTER_TSCR, "SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); } } - void AttackStart(Unit* who) OVERRIDE - { - if (!who || IsBanished) - return; + private: + InstanceScript* instance; + EventMap events; + uint64 ShadeGUID; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_ashtongue_channelerAI(creature); + } +}; + +// ######################################################## +// Creature Generator Akama +// ######################################################## + +class npc_creature_generator_akama : public CreatureScript +{ +public: + npc_creature_generator_akama() : CreatureScript("npc_creature_generator_akama") { } - if (who->isTargetableForAttack() && who != me) - DoStartMovement(who); + struct npc_creature_generator_akamaAI : public ScriptedAI + { + npc_creature_generator_akamaAI(Creature* creature) : ScriptedAI(creature), Summons(me) + { + instance = creature->GetInstanceScript(); } - void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer + void Reset() OVERRIDE { - if (reseting) - return; + Summons.DespawnAll(); - TC_LOG_DEBUG(LOG_FILTER_TSCR, "Increasing Death Count for Shade of Akama encounter"); - ++DeathCount; - me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); - if (guid) - { - if (Sorcerers.empty()) - TC_LOG_ERROR(LOG_FILTER_TSCR, "SD2 ERROR: Shade of Akama - attempt to remove guid " UI64FMTD " from Sorcerers list but list is already empty", guid); - else Sorcerers.remove(guid); - } + doSpawning = false; + leftSide = false; + + if (me->GetPositionY() < 400.0f) + leftSide = true; + } + + void JustSummoned(Creature* summon) OVERRIDE + { + Summons.Summon(summon); } - void SummonCreature() + void SetData(uint32 data, uint32 value) OVERRIDE { - uint32 random = rand()%2; - float X = SpawnLocations[random].x; - float Y = SpawnLocations[random].y; - // max of 6 sorcerers can be summoned - if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7)) + if (data == SETDATA_DATA) { - Creature* Sorcerer = me->SummonCreature(NPC_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Sorcerer) + doSpawning = true; + + switch (value) { - CAST_AI(npc_ashtongue_sorcerer::npc_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID(); - Sorcerer->SetWalk(false); - Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); - Sorcerer->SetTarget(me->GetGUID()); - Sorcerers.push_back(Sorcerer->GetGUID()); - --DeathCount; - ++SorcererCount; + case SETDATA_START_SPAWNING: + if (leftSide) + { + events.ScheduleEvent(EVENT_SPAWN_WAVE_B, 100); + events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, urand(2000, 5000)); + } + else + { + events.ScheduleEvent(EVENT_SPAWN_WAVE_B, 10000); + events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, urand(2000, 5000)); + } + break; + case SETDATA_STOP_SPAWNING: + doSpawning = false; + break; + case SETDATA_DESPAWN_ALL_SPAWNS: + doSpawning = false; + Summons.DespawnAll(); + break; + default: + break; } } - else + } + + void UpdateAI(uint32 diff) OVERRIDE + { + if (doSpawning) { - for (uint8 i = 0; i < 3; ++i) + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) { - Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Spawn) + switch (eventId) { - Spawn->SetWalk(false); - Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); - Spawn->AI()->AttackStart(target); + case EVENT_SPAWN_WAVE_B: + DoCast(me, SPELL_ASHTONGUE_WAVE_B); + events.ScheduleEvent(EVENT_SPAWN_WAVE_B, urand(45000, 50000)); + break; + case EVENT_SUMMON_ASHTONGUE_SORCERER: // left + DoCast(me, SPELL_SUMMON_ASHTONGUE_SORCERER); + events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, urand(30000, 35000)); + break; + case EVENT_SUMMON_ASHTONGUE_DEFENDER: // right + DoCast(me, SPELL_SUMMON_ASHTONGUE_DEFENDER); + events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, urand(30000, 35000)); + break; + default: + break; } } } } - void FindChannelers() + private: + InstanceScript* instance; + EventMap events; + SummonList Summons; + bool leftSide; + bool doSpawning; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_creature_generator_akamaAI(creature); + } +}; + +// ######################################################## +// Ashtongue Sorcerer +// ######################################################## + +class npc_ashtongue_sorcerer : public CreatureScript +{ +public: + npc_ashtongue_sorcerer() : CreatureScript("npc_ashtongue_sorcerer") { } + + struct npc_ashtongue_sorcererAI : public ScriptedAI + { + npc_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature) { - std::list<Creature*> ChannelerList; - me->GetCreatureListWithEntryInGrid(ChannelerList, NPC_CHANNELER, 50.0f); + instance = creature->GetInstanceScript(); - if (!ChannelerList.empty()) + if (instance) { - for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) - { - CAST_AI(npc_ashtongue_channeler::npc_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID(); - Channelers.push_back((*itr)->GetGUID()); - TC_LOG_DEBUG(LOG_FILTER_TSCR, "Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID()); - } + akamaGUID = instance->GetData64(DATA_AKAMA_SHADE); + shadeGUID = instance->GetData64(DATA_SHADEOFAKAMA); } - else TC_LOG_ERROR(LOG_FILTER_TSCR, "SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); } - void SetSelectableChannelers() + void Reset() OVERRIDE { - if (Channelers.empty()) + if (!startedBanishing) { - TC_LOG_ERROR(LOG_FILTER_TSCR, "SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); - return; + if (Creature* Shade = (Unit::GetCreature((*me), shadeGUID))) + { + if (Shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + me->GetMotionMaster()->MovePoint(0, Shade->GetPositionX(), Shade->GetPositionY(), Shade->GetPositionZ(), false); + else + { + if (Unit* target = me->GetCreature(*me, akamaGUID)) + AttackStart(target); + } + } } - for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - if (Creature* Channeler = (Unit::GetCreature(*me, *itr))) - Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summonerGuid = 0; + startedBanishing = false; + switchToCombat = false; } - void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; } + void JustDied(Unit* /*killer*/) OVERRIDE + { + if (Creature* Shade = (Unit::GetCreature((*me), shadeGUID))) + Shade->AI()->SetData(SETDATA_DATA, SETDATA_CHANNELER_DIED); + me->DespawnOrUnsummon(5000); + } - void UpdateAI(uint32 diff) OVERRIDE + void IsSummonedBy(Unit* /*summoner*/) OVERRIDE { - if (!me->IsInCombat()) - return; + if (Creature* summoner = (Unit::GetCreature((*me), summonerGuid))) + CAST_AI(npc_creature_generator_akama::npc_creature_generator_akamaAI, summoner->AI())->JustSummoned(me); + } - if (IsBanished) - { - // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check - if (me->getThreatManager().getThreatList().size() < 2) - { - EnterEvadeMode(); - return; - } + void EnterCombat(Unit* /*who*/) OVERRIDE {} - if (DefenderTimer <= diff) - { - uint32 ran = rand()%2; - Creature* Defender = me->SummonCreature(NPC_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Defender) - { - Defender->SetWalk(false); - bool move = true; - if (AkamaGUID) - { - if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID)) - { - float x, y, z; - Akama->GetPosition(x, y, z); - // They move towards AKama - Defender->GetMotionMaster()->MovePoint(0, x, y, z); - Defender->AI()->AttackStart(Akama); - } else move = false; - } else move = false; - if (!move) - Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z); - } - DefenderTimer = 15000; - } else DefenderTimer -= diff; + void AttackStart(Unit* who) OVERRIDE + { + if (!switchToCombat) + return; + ScriptedAI::AttackStart(who); + } - if (SummonTimer <= diff) - { - SummonCreature(); - SummonTimer = 35000; - } else SummonTimer -= diff; + void UpdateAI(uint32 diff) OVERRIDE + { + events.Update(diff); - if (DeathCount >= 6) + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*me), AkamaGUID); - if (Akama && Akama->IsAlive()) + case EVENT_SORCERER_CHANNEL: + if (Creature* Shade = (Unit::GetCreature((*me), shadeGUID))) { - IsBanished = false; - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveChase(Akama); - Akama->GetMotionMaster()->Clear(); - // Shade should move to Akama, not the other way around - Akama->GetMotionMaster()->MoveIdle(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Crazy amount of threat - me->AddThreat(Akama, 10000000.0f); - Akama->AddThreat(me, 10000000.0f); - me->Attack(Akama, true); - Akama->Attack(me, true); + if (Shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + me->SetFacingToObject(Shade); + DoCast(me, SPELL_SHADE_SOUL_CHANNEL); + events.ScheduleEvent(EVENT_SORCERER_CHANNEL, 2000); + } + else + { + me->InterruptSpell(CURRENT_CHANNELED_SPELL); + Shade->AI()->SetData(SETDATA_DATA, SETDATA_CHANNELER_DIED); + switchToCombat = true; + if (Unit* target = me->GetCreature(*me, akamaGUID)) + AttackStart(target); + } } - } + break; + default: + break; } } - else // No longer banished, let's fight Akama now - { - if (ReduceHealthTimer <= diff) - { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*me), AkamaGUID); - if (Akama && Akama->IsAlive()) - { - //10 % less health every few seconds. - me->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ReduceHealthTimer = 12000; - } - } - } else ReduceHealthTimer -= diff; - if (HasKilledAkama) + if (!startedBanishing) + { + Creature* Shade = Unit::GetCreature((*me), shadeGUID); + if (me->IsWithinDist(Shade, 20.0f, false)) { - if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug - { - HasKilledAkamaAndReseting = true; - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(); - //me->SetFullHealth(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->GetMotionMaster()->MoveTargetedHome(); - } - if (ResetTimer <= diff) - { - EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama - return; - } else ResetTimer -= diff; + me->StopMoving(); + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MovePoint(1, me->GetPositionX() + frand (-8.0f, 8.0f), me->GetPositionY() + frand (-8.0f, 8.0f), me->GetPositionZ(), false); + events.ScheduleEvent(EVENT_SORCERER_CHANNEL, 1500); + startedBanishing = true; } - - DoMeleeAttackIfReady(); } + + DoMeleeAttackIfReady(); } + + private: + InstanceScript* instance; + EventMap events; + uint64 akamaGUID; + uint64 shadeGUID; + uint64 summonerGuid; + float distanceToShade; + bool startedBanishing; + bool switchToCombat; }; + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_ashtongue_sorcererAI(creature); + } }; -void npc_ashtongue_channeler::npc_ashtongue_channelerAI::JustDied(Unit* /*killer*/) -{ - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade && Shade->IsAlive()) - CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); - else TC_LOG_ERROR(LOG_FILTER_TSCR, "SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); -} +// ######################################################## +// Ashtongue Defender +// ######################################################## -void npc_ashtongue_sorcerer::npc_ashtongue_sorcererAI::JustDied(Unit* /*killer*/) -{ - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade && Shade->IsAlive()) - CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID()); - else TC_LOG_ERROR(LOG_FILTER_TSCR, "SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); -} - -class npc_akama_shade : public CreatureScript +class npc_ashtongue_defender : public CreatureScript { public: - npc_akama_shade() : CreatureScript("npc_akama_shade") { } + npc_ashtongue_defender() : CreatureScript("npc_ashtongue_defender") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE + struct npc_ashtongue_defenderAI : public ScriptedAI { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + npc_ashtongue_defenderAI(Creature* creature) : ScriptedAI(creature) { - player->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_akama_shade::npc_akamaAI, creature->AI())->BeginEvent(player); + instance = creature->GetInstanceScript(); + if (instance) + akamaGUID = instance->GetData64(DATA_AKAMA_SHADE); } - return true; - } + void Reset() OVERRIDE + { + summonerGuid = 0; - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - if (player->IsAlive()) + if (Unit* target = me->GetCreature(*me, akamaGUID)) + AttackStart(target); + } + + void JustDied(Unit* /*killer*/) OVERRIDE { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(907, creature->GetGUID()); + me->DespawnOrUnsummon(5000); } - return true; - } + void IsSummonedBy(Unit* /*summoner*/) OVERRIDE + { + if (Creature* summoner = (Unit::GetCreature((*me), summonerGuid))) + CAST_AI(npc_creature_generator_akama::npc_creature_generator_akamaAI, summoner->AI())->JustSummoned(me); + } + + void EnterCombat(Unit* /*who*/) OVERRIDE + { + events.ScheduleEvent(EVENT_HEROIC_STRIKE, 5000); + events.ScheduleEvent(EVENT_SHIELD_BASH, urand(10000, 16000)); + events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, urand(10000, 16000)); + events.ScheduleEvent(EVENT_WINDFURY, urand(8000, 12000)); + } + + void UpdateAI(uint32 diff) OVERRIDE + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DEBILITATING_STRIKE: + DoCastVictim(SPELL_DEBILITATING_STRIKE); + events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, urand(8000, 16000)); + break; + case EVENT_HEROIC_STRIKE: + DoCast(me, SPELL_HEROIC_STRIKE); + events.ScheduleEvent(EVENT_HEROIC_STRIKE, urand(50000, 60000)); + break; + case EVENT_SHIELD_BASH: + DoCastVictim(SPELL_SHIELD_BASH); + events.ScheduleEvent(EVENT_SHIELD_BASH, urand(8000, 16000)); + break; + case EVENT_WINDFURY: + DoCastVictim(SPELL_WINDFURY); + events.ScheduleEvent(EVENT_WINDFURY, urand(6000 , 8000)); + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + + private: + InstanceScript* instance; + EventMap events; + uint64 akamaGUID; + uint64 summonerGuid; + }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_akamaAI (creature); + return new npc_ashtongue_defenderAI(creature); } +}; - struct npc_akamaAI : public ScriptedAI +// ######################################################## +// Ashtongue Rogue +// ######################################################## + +class npc_ashtongue_rogue : public CreatureScript +{ +public: + npc_ashtongue_rogue() : CreatureScript("npc_ashtongue_rogue") { } + + struct npc_ashtongue_rogueAI : public ScriptedAI { - npc_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me) + npc_ashtongue_rogueAI(Creature* creature) : ScriptedAI(creature) { - ShadeHasDied = false; - StartCombat = false; instance = creature->GetInstanceScript(); if (instance) - ShadeGUID = instance->GetData64(DATA_SHADEOFAKAMA); - else - ShadeGUID = NOT_STARTED; - me->setActive(true); - EventBegun = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; + akamaGUID = instance->GetData64(DATA_AKAMA_SHADE); } - InstanceScript* instance; - - uint64 ShadeGUID; - - uint32 DestructivePoisonTimer; - uint32 LightningBoltTimer; - uint32 CheckTimer; - uint32 CastSoulRetrieveTimer; - uint32 SoulRetrieveTimer; - uint32 SummonBrokenTimer; - uint32 EndingTalkCount; - uint32 WayPointId; - uint32 BrokenSummonIndex; - - std::list<uint64> BrokenList; - - bool EventBegun; - bool ShadeHasDied; - bool StartCombat; - bool HasYelledOnce; - SummonList summons; - void Reset() OVERRIDE { - DestructivePoisonTimer = 15000; - LightningBoltTimer = 10000; - CheckTimer = 2000; + summonerGuid = 0; - if (!EventBegun) - { - me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - summons.DespawnAll(); + if (Unit* target = me->GetCreature(*me, akamaGUID)) + AttackStart(target); } - void JustSummoned(Creature* summon) OVERRIDE + void JustDied(Unit* /*killer*/) OVERRIDE { - if (summon->GetEntry() == NPC_BROKEN) - summons.Summon(summon); + me->DespawnOrUnsummon(5000); } - void SummonedCreatureDespawn(Creature* summon) OVERRIDE + void IsSummonedBy(Unit* /*summoner*/) OVERRIDE { - if (summon->GetEntry() == NPC_BROKEN) - summons.Despawn(summon); + if (Creature* summoner = (Unit::GetCreature((*me), summonerGuid))) + CAST_AI(npc_creature_generator_akama::npc_creature_generator_akamaAI, summoner->AI())->JustSummoned(me); } - void EnterCombat(Unit* /*who*/) OVERRIDE {} + void EnterCombat(Unit* /*who*/) OVERRIDE + { + events.ScheduleEvent(EVENT_DEBILITATING_POISON, urand(500, 2000)); + events.ScheduleEvent(EVENT_EVISCERATE, urand(2000, 5000)); + } - void BeginEvent(Player* player) + void UpdateAI(uint32 diff) OVERRIDE { - if (!instance) + if (!UpdateVictim()) return; - ShadeGUID = instance->GetData64(DATA_SHADEOFAKAMA); - if (!ShadeGUID) - return; + events.Update(diff); - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade) + while (uint32 eventId = events.ExecuteEvent()) { - instance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); - // Prevent players from trying to restart event - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(me->GetGUID()); - CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); - Shade->AddThreat(me, 1000000.0f); - me->CombatStart(Shade); - Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Shade->SetTarget(me->GetGUID()); - if (player) - Shade->AddThreat(player, 1.0f); - DoZoneInCombat(Shade); - EventBegun = true; + switch (eventId) + { + case EVENT_DEBILITATING_POISON: + DoCastVictim(SPELL_DEBILITATING_POISON); + events.ScheduleEvent(EVENT_DEBILITATING_POISON, urand(14000, 18000)); + break; + case EVENT_EVISCERATE: + DoCastVictim(SPELL_EVISCERATE); + events.ScheduleEvent(EVENT_EVISCERATE, urand(12000, 16000)); + break; + default: + break; + } } + DoMeleeAttackIfReady(); } - void MovementInform(uint32 type, uint32 id) OVERRIDE + private: + InstanceScript* instance; + EventMap events; + uint64 akamaGUID; + uint64 summonerGuid; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_ashtongue_rogueAI(creature); + } +}; + +// ######################################################## +// Ashtongue Elementalist +// ######################################################## + +class npc_ashtongue_elementalist : public CreatureScript +{ +public: + npc_ashtongue_elementalist() : CreatureScript("npc_ashtongue_elementalist") { } + + struct npc_ashtongue_elementalistAI : public ScriptedAI + { + npc_ashtongue_elementalistAI(Creature* creature) : ScriptedAI(creature) { - if (type != POINT_MOTION_TYPE) - return; + instance = creature->GetInstanceScript(); + if (instance) + akamaGUID = instance->GetData64(DATA_AKAMA_SHADE); + } - switch (id) - { - case 0: - ++WayPointId; - break; + void Reset() OVERRIDE + { + summonerGuid = 0; - case 1: - if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) - { - me->SetTarget(ShadeGUID); - DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); - EndingTalkCount = 0; - SoulRetrieveTimer = 16000; - } - break; - } + if (Unit* target = me->GetCreature(*me, akamaGUID)) + AttackStart(target); } void JustDied(Unit* /*killer*/) OVERRIDE { - Talk(SAY_DEATH); - EventBegun = false; - ShadeHasDied = false; - StartCombat = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && Shade->IsAlive()) - CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; - summons.DespawnAll(); + me->DespawnOrUnsummon(5000); + } + + void IsSummonedBy(Unit* /*summoner*/) OVERRIDE + { + if (Creature* summoner = (Unit::GetCreature((*me), summonerGuid))) + CAST_AI(npc_creature_generator_akama::npc_creature_generator_akamaAI, summoner->AI())->JustSummoned(me); + } + + void EnterCombat(Unit* /*who*/) OVERRIDE + { + events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 18000); + events.ScheduleEvent(EVENT_LIGHTNING_BOLT, 6000); } void UpdateAI(uint32 diff) OVERRIDE { - if (!EventBegun) + if (!UpdateVictim()) return; - if (HealthBelowPct(15) && !HasYelledOnce) - { - Talk(SAY_LOW_HEALTH); - HasYelledOnce = true; - } + events.Update(diff); - if (ShadeGUID && !StartCombat) + while (uint32 eventId = events.ExecuteEvent()) { - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade && Shade->IsAlive()) + switch (eventId) { - if (CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IsBanished) - { - if (CastSoulRetrieveTimer <= diff) - { - DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL); - CastSoulRetrieveTimer = 500; - } else CastSoulRetrieveTimer -= diff; - } - else - { - me->InterruptNonMeleeSpells(false); - StartCombat = true; - } + case EVENT_RAIN_OF_FIRE: + DoCastVictim(SPELL_RAIN_OF_FIRE); + events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 20000); + break; + case EVENT_LIGHTNING_BOLT: + DoCastVictim(SPELL_LIGHTNING_BOLT); + events.ScheduleEvent(EVENT_LIGHTNING_BOLT, 15000); + break; + default: + break; } } + DoMeleeAttackIfReady(); + } - if (ShadeHasDied && (WayPointId == 1)) - { - if (instance) - instance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); - me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z); - ++WayPointId; - } + private: + InstanceScript* instance; + EventMap events; + uint64 akamaGUID; + uint64 summonerGuid; + }; - if (!ShadeHasDied && StartCombat) - { - if (CheckTimer <= diff) - { - if (ShadeGUID) - { - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && !Shade->IsAlive()) - { - ShadeHasDied = true; - WayPointId = 0; - me->SetWalk(true); - me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); - } - if (Shade && Shade->IsAlive()) - { - if (Shade->getThreatManager().getThreatList().size() < 2) - Shade->AI()->EnterEvadeMode(); - } - } - CheckTimer = 5000; - } else CheckTimer -= diff; - } + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_ashtongue_elementalistAI(creature); + } +}; - if (SummonBrokenTimer && BrokenSummonIndex < 4) - { - if (SummonBrokenTimer <= diff) - { - for (uint8 i = 0; i < 4; ++i) - { - float x = BrokenCoords[BrokenSummonIndex].x + (i*5); - float y = BrokenCoords[BrokenSummonIndex].y + (1*5); - float z = BrokenCoords[BrokenSummonIndex].z; - float o = BrokenCoords[BrokenSummonIndex].o; - Creature* Broken = me->SummonCreature(NPC_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); - if (Broken) - { - float wx = BrokenWP[BrokenSummonIndex].x + (i*5); - float wy = BrokenWP[BrokenSummonIndex].y + (i*5); - float wz = BrokenWP[BrokenSummonIndex].z; - Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz); - Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - BrokenList.push_back(Broken->GetGUID()); - } - } - ++BrokenSummonIndex; - SummonBrokenTimer = 1000; - } else SummonBrokenTimer -= diff; - } +// ######################################################## +// Ashtongue Spiritbinder +// ######################################################## + +class npc_ashtongue_spiritbinder : public CreatureScript +{ +public: + npc_ashtongue_spiritbinder() : CreatureScript("npc_ashtongue_spiritbinder") { } + + struct npc_ashtongue_spiritbinderAI : public ScriptedAI + { + npc_ashtongue_spiritbinderAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + if (instance) + akamaGUID = instance->GetData64(DATA_AKAMA_SHADE); + } + + void Reset() OVERRIDE + { + spiritMend = false; + chainHeal = false; + summonerGuid = 0; + + if (Unit* target = me->GetCreature(*me, akamaGUID)) + AttackStart(target); + } + + void JustDied(Unit* /*killer*/) OVERRIDE + { + me->DespawnOrUnsummon(5000); + } + + void IsSummonedBy(Unit* /*summoner*/) OVERRIDE + { + if (Creature* summoner = (Unit::GetCreature((*me), summonerGuid))) + CAST_AI(npc_creature_generator_akama::npc_creature_generator_akamaAI, summoner->AI())->JustSummoned(me); + } - if (SoulRetrieveTimer) + void EnterCombat(Unit* /*who*/) OVERRIDE + { + events.ScheduleEvent(EVENT_SPIRIT_HEAL, urand (5000, 6000)); + } + + void UpdateAI(uint32 diff) OVERRIDE + { + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) { - if (SoulRetrieveTimer <= diff) + switch (eventId) { - switch (EndingTalkCount) - { - case 0: - me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - ++EndingTalkCount; - SoulRetrieveTimer = 2000; - SummonBrokenTimer = 1; + case EVENT_SPIRIT_HEAL: + DoCast(me, SPELL_SPIRITBINDER_SPIRIT_HEAL); + events.ScheduleEvent(EVENT_SPIRIT_HEAL, urand (13000, 16000)); break; - case 1: - Talk(SAY_FREE); - ++EndingTalkCount; - SoulRetrieveTimer = 25000; + default: break; - case 2: - if (!BrokenList.empty()) - { - bool Yelled = false; - for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* unit = Unit::GetCreature(*me, *itr)) - { - if (!Yelled) - { - unit->AI()->Talk(SAY_BROKEN_FREE_01); - Yelled = true; - } - unit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); - } - } - ++EndingTalkCount; - SoulRetrieveTimer = 1500; - break; - case 3: - if (!BrokenList.empty()) - { - for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* unit = Unit::GetCreature(*me, *itr)) - // This is the incorrect spell, but can't seem to find the right one. - unit->CastSpell(unit, 39656, true); - } - ++EndingTalkCount; - SoulRetrieveTimer = 5000; - break; - case 4: - if (!BrokenList.empty()) - { - for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* unit = Unit::GetCreature((*me), *itr)) - unit->AI()->Talk(SAY_BROKEN_FREE_02); - } - SoulRetrieveTimer = 0; - break; - } - } else SoulRetrieveTimer -= diff; + } } if (!UpdateVictim()) return; - if (DestructivePoisonTimer <= diff) + if (!spiritMend) { - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && Shade->IsAlive()) - DoCast(Shade, SPELL_DESTRUCTIVE_POISON); - DestructivePoisonTimer = 15000; - } else DestructivePoisonTimer -= diff; + if (HealthBelowPct(25)) + { + DoCast(me, SPELL_SPIRIT_MEND); + spiritMend = true; + } + } - if (LightningBoltTimer <= diff) + if (!chainHeal) { - DoCastVictim(SPELL_LIGHTNING_BOLT); - LightningBoltTimer = 10000; - } else LightningBoltTimer -= diff; + if (HealthBelowPct(40)) + { + DoCast(me, SPELL_CHAIN_HEAL); + chainHeal = true; + } + } DoMeleeAttackIfReady(); } + + private: + InstanceScript* instance; + EventMap events; + uint64 akamaGUID; + uint64 summonerGuid; + bool spiritMend; + bool chainHeal; }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_ashtongue_spiritbinderAI(creature); + } }; void AddSC_boss_shade_of_akama() { new boss_shade_of_akama(); + new npc_akama_shade(); new npc_ashtongue_channeler(); + new npc_creature_generator_akama(); new npc_ashtongue_sorcerer(); - new npc_akama_shade(); + new npc_ashtongue_defender(); + new npc_ashtongue_rogue(); + new npc_ashtongue_elementalist(); + new npc_ashtongue_spiritbinder(); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 806d11a3906..fbc3e387e8e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -65,7 +65,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new molten_flameAI (creature); + return new molten_flameAI(creature); } struct molten_flameAI : public NullCreatureAI @@ -90,7 +90,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_supremusAI (creature); + return new boss_supremusAI(creature); } struct boss_supremusAI : public ScriptedAI @@ -269,7 +269,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_volcanoAI (creature); + return new npc_volcanoAI(creature); } struct npc_volcanoAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index dc212e69d87..a861980ae42 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -217,7 +217,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_teron_gorefiendAI (creature); + return new boss_teron_gorefiendAI(creature); } struct boss_teron_gorefiendAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index e70acb40556..532c66bb14a 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -78,7 +78,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_najentusAI (creature); + return new boss_najentusAI(creature); } struct boss_najentusAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 8b135316704..3d7a143d59e 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -218,7 +218,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_illidari_councilAI (creature); + return new npc_illidari_councilAI(creature); } struct npc_illidari_councilAI : public ScriptedAI @@ -477,7 +477,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gathios_the_shattererAI (creature); + return new boss_gathios_the_shattererAI(creature); } struct boss_gathios_the_shattererAI : public boss_illidari_councilAI @@ -609,7 +609,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_nethermancer_zerevorAI (creature); + return new boss_high_nethermancer_zerevorAI(creature); } struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI @@ -713,7 +713,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_malandeAI (creature); + return new boss_lady_malandeAI(creature); } struct boss_lady_malandeAI : public boss_illidari_councilAI @@ -791,7 +791,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_veras_darkshadowAI (creature); + return new boss_veras_darkshadowAI(creature); } struct boss_veras_darkshadowAI : public boss_illidari_councilAI diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index 60092689cc0..2a82810a3c1 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -28,8 +28,6 @@ EndScriptData */ #include "black_temple.h" #include "Player.h" -#define MAX_ENCOUNTER 9 - /* Black Temple encounters: 0 - High Warlord Naj'entus event 1 - Supremus Event @@ -56,7 +54,7 @@ public: { instance_black_temple_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 m_auiEncounter[EncounterCount]; std::string str_data; uint64 Najentus; @@ -89,37 +87,37 @@ public: { memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - Najentus = 0; - Akama = 0; - Akama_Shade = 0; - ShadeOfAkama = 0; - Supremus = 0; - LadyMalande = 0; - GathiosTheShatterer = 0; + Najentus = 0; + Akama = 0; + Akama_Shade = 0; + ShadeOfAkama = 0; + Supremus = 0; + LadyMalande = 0; + GathiosTheShatterer = 0; HighNethermancerZerevor = 0; - VerasDarkshadow = 0; - IllidariCouncil = 0; - BloodElfCouncilVoice = 0; - IllidanStormrage = 0; - - NajentusGate = 0; - MainTempleDoors = 0; - ShadeOfAkamaDoor= 0; - CommonDoor = 0;//teron + VerasDarkshadow = 0; + IllidariCouncil = 0; + BloodElfCouncilVoice = 0; + IllidanStormrage = 0; + + NajentusGate = 0; + MainTempleDoors = 0; + ShadeOfAkamaDoor = 0; + CommonDoor = 0; // teron TeronDoor = 0; GuurtogDoor = 0; MotherDoor = 0; TempleDoor = 0; - SimpleDoor = 0;//Bycouncil + SimpleDoor = 0; // Bycouncil CouncilDoor = 0; - IllidanGate = 0; - IllidanDoor[0] = 0; - IllidanDoor[1] = 0; + IllidanGate = 0; + IllidanDoor[0] = 0; + IllidanDoor[1] = 0; } bool IsEncounterInProgress() const { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + for (uint8 i = 0; i < EncounterCount; ++i) if (m_auiEncounter[i] == IN_PROGRESS) return true; @@ -149,7 +147,7 @@ public: { case 22887: Najentus = creature->GetGUID(); break; case 23089: Akama = creature->GetGUID(); break; - case 22990: Akama_Shade = creature->GetGUID(); break; + case 23191: Akama_Shade = creature->GetGUID(); break; case 22841: ShadeOfAkama = creature->GetGUID(); break; case 22898: Supremus = creature->GetGUID(); break; case 22917: IllidanStormrage = creature->GetGUID(); break; @@ -167,13 +165,13 @@ public: switch (go->GetEntry()) { case 185483: - NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) + NajentusGate = go->GetGUID(); // Gate past Naj'entus (at the entrance to Supermoose's courtyards) if (m_auiEncounter[0] == DONE) HandleGameObject(0, true, go); break; case 185882: - MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) + MainTempleDoors = go->GetGUID(); // Main Temple Doors - right past Supermoose (Supremus) if (m_auiEncounter[1] == DONE) HandleGameObject(0, true, go); break; @@ -386,7 +384,7 @@ public: >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8]; - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + for (uint8 i = 0; i < EncounterCount; ++i) if (m_auiEncounter[i] == IN_PROGRESS) m_auiEncounter[i] = NOT_STARTED; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 545dbed7975..a27677f60f5 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -104,7 +104,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomlord_karathressAI (creature); + return new boss_fathomlord_karathressAI(creature); } struct boss_fathomlord_karathressAI : public ScriptedAI @@ -312,7 +312,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomguard_sharkkisAI (creature); + return new boss_fathomguard_sharkkisAI(creature); } struct boss_fathomguard_sharkkisAI : public ScriptedAI @@ -459,7 +459,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomguard_tidalvessAI (creature); + return new boss_fathomguard_tidalvessAI(creature); } struct boss_fathomguard_tidalvessAI : public ScriptedAI @@ -582,7 +582,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomguard_caribdisAI (creature); + return new boss_fathomguard_caribdisAI(creature); } struct boss_fathomguard_caribdisAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index c96c0e0f269..db270c943e5 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -86,7 +86,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_hydross_the_unstableAI (creature); + return new boss_hydross_the_unstableAI(creature); } struct boss_hydross_the_unstableAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 978a8fe6356..4499cb98475 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -140,12 +140,12 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_vashjAI (creature); + return new boss_lady_vashjAI(creature); } struct boss_lady_vashjAI : public ScriptedAI { - boss_lady_vashjAI (Creature* creature) : ScriptedAI(creature) + boss_lady_vashjAI(Creature* creature) : ScriptedAI(creature) { instance = creature->GetInstanceScript(); Intro = false; @@ -551,7 +551,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_enchanted_elementalAI (creature); + return new npc_enchanted_elementalAI(creature); } struct npc_enchanted_elementalAI : public ScriptedAI @@ -646,7 +646,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tainted_elementalAI (creature); + return new npc_tainted_elementalAI(creature); } struct npc_tainted_elementalAI : public ScriptedAI @@ -715,7 +715,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toxic_sporebatAI (creature); + return new npc_toxic_sporebatAI(creature); } struct npc_toxic_sporebatAI : public ScriptedAI @@ -814,7 +814,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shield_generator_channelAI (creature); + return new npc_shield_generator_channelAI(creature); } struct npc_shield_generator_channelAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index b477d020d6a..a87ad44ef1c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -76,7 +76,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_inner_demonAI (creature); + return new npc_inner_demonAI(creature); } struct npc_inner_demonAI : public ScriptedAI @@ -181,7 +181,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_leotheras_the_blindAI (creature); + return new boss_leotheras_the_blindAI(creature); } struct boss_leotheras_the_blindAI : public ScriptedAI @@ -604,7 +604,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_leotheras_the_blind_demonformAI (creature); + return new boss_leotheras_the_blind_demonformAI(creature); } struct boss_leotheras_the_blind_demonformAI : public ScriptedAI @@ -677,7 +677,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_greyheart_spellbinderAI (creature); + return new npc_greyheart_spellbinderAI(creature); } struct npc_greyheart_spellbinderAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index e3a7c379414..cd56005b3f6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -81,7 +81,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_the_lurker_belowAI (creature); + return new boss_the_lurker_belowAI(creature); } struct boss_the_lurker_belowAI : public ScriptedAI @@ -373,7 +373,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_coilfang_ambusherAI (creature); + return new npc_coilfang_ambusherAI(creature); } struct npc_coilfang_ambusherAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index b0c6305abf1..e0469dbfbfb 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -91,7 +91,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_morogrim_tidewalkerAI (creature); + return new boss_morogrim_tidewalkerAI(creature); } struct boss_morogrim_tidewalkerAI : public ScriptedAI @@ -294,7 +294,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_water_globuleAI (creature); + return new npc_water_globuleAI(creature); } struct npc_water_globuleAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp index ce28180bb78..57cca36b854 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -54,7 +54,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_thespiaAI (creature); + return new boss_thespiaAI(creature); } struct boss_thespiaAI : public ScriptedAI @@ -154,7 +154,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_coilfang_waterelementalAI (creature); + return new npc_coilfang_waterelementalAI(creature); } struct npc_coilfang_waterelementalAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index 8662b2c93ec..fa2fac2b0cb 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_mekgineer_steamriggerAI (creature); + return new boss_mekgineer_steamriggerAI(creature); } struct boss_mekgineer_steamriggerAI : public ScriptedAI @@ -203,7 +203,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_steamrigger_mechanicAI (creature); + return new npc_steamrigger_mechanicAI(creature); } struct npc_steamrigger_mechanicAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index ee3e9a69c65..4314b43e0e8 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -51,7 +51,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_naga_distillerAI (creature); + return new npc_naga_distillerAI(creature); } struct npc_naga_distillerAI : public ScriptedAI @@ -109,7 +109,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_warlord_kalithreshAI (creature); + return new boss_warlord_kalithreshAI(creature); } struct boss_warlord_kalithreshAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp index 9377ea9197f..0db48d83ebb 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_hungarfenAI (creature); + return new boss_hungarfenAI(creature); } struct boss_hungarfenAI : public ScriptedAI @@ -111,7 +111,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_underbog_mushroomAI (creature); + return new npc_underbog_mushroomAI(creature); } struct npc_underbog_mushroomAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index c76e677d206..c22dedd269e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -49,7 +49,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_the_black_stalkerAI (creature); + return new boss_the_black_stalkerAI(creature); } struct boss_the_black_stalkerAI : public ScriptedAI diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 9144411fcc6..31f854803bc 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -62,7 +62,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gruulAI (creature); + return new boss_gruulAI(creature); } struct boss_gruulAI : public ScriptedAI diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index 6fa6b9b2e20..d216c0b02ee 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -112,7 +112,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_king_maulgarAI (creature); + return new boss_high_king_maulgarAI(creature); } struct boss_high_king_maulgarAI : public ScriptedAI @@ -311,7 +311,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_olm_the_summonerAI (creature); + return new boss_olm_the_summonerAI(creature); } struct boss_olm_the_summonerAI : public ScriptedAI @@ -439,7 +439,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kiggler_the_crazedAI (creature); + return new boss_kiggler_the_crazedAI(creature); } struct boss_kiggler_the_crazedAI : public ScriptedAI @@ -560,7 +560,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_blindeye_the_seerAI (creature); + return new boss_blindeye_the_seerAI(creature); } struct boss_blindeye_the_seerAI : public ScriptedAI @@ -670,7 +670,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_krosh_firehandAI (creature); + return new boss_krosh_firehandAI(creature); } struct boss_krosh_firehandAI : public ScriptedAI diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index 5edf604a108..a87aefa72af 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "Player.h" +#include "hellfire_ramparts.h" enum Says { @@ -53,28 +54,15 @@ class boss_omor_the_unscarred : public CreatureScript { public: - boss_omor_the_unscarred() - : CreatureScript("boss_omor_the_unscarred") - { - } + boss_omor_the_unscarred() : CreatureScript("boss_omor_the_unscarred") { } - struct boss_omor_the_unscarredAI : public ScriptedAI + struct boss_omor_the_unscarredAI : public BossAI { - boss_omor_the_unscarredAI(Creature* creature) : ScriptedAI(creature) + boss_omor_the_unscarredAI(Creature* creature) : BossAI(creature, DATA_OMOR_THE_UNSCARRED) { SetCombatMovement(false); } - uint32 OrbitalStrike_Timer; - uint32 ShadowWhip_Timer; - uint32 Aura_Timer; - uint32 DemonicShield_Timer; - uint32 Shadowbolt_Timer; - uint32 Summon_Timer; - uint32 SummonedCount; - uint64 PlayerGUID; - bool CanPullBack; - void Reset() OVERRIDE { Talk(SAY_WIPE); @@ -88,10 +76,13 @@ class boss_omor_the_unscarred : public CreatureScript SummonedCount = 0; PlayerGUID = 0; CanPullBack = false; + + _Reset(); } void EnterCombat(Unit* /*who*/) OVERRIDE { + _EnterCombat(); Talk(SAY_AGGRO); } @@ -116,6 +107,7 @@ class boss_omor_the_unscarred : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { Talk(SAY_DIE); + _JustDied(); } void UpdateAI(uint32 diff) OVERRIDE @@ -217,6 +209,17 @@ class boss_omor_the_unscarred : public CreatureScript DoMeleeAttackIfReady(); } + + private: + uint32 OrbitalStrike_Timer; + uint32 ShadowWhip_Timer; + uint32 Aura_Timer; + uint32 DemonicShield_Timer; + uint32 Shadowbolt_Timer; + uint32 Summon_Timer; + uint32 SummonedCount; + uint64 PlayerGUID; + bool CanPullBack; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 65e389f9eea..0f5cea6c4c6 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -26,6 +26,19 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellInfo.h" +#include "hellfire_ramparts.h" + +enum Says +{ + SAY_INTRO = 0, + + SAY_WIPE = 0, + SAY_AGGRO = 1, + SAY_KILL = 2, + SAY_DIE = 3, + + EMOTE = 0 +}; enum Spells { @@ -42,62 +55,27 @@ enum Spells SPELL_FIRE_NOVA_VISUAL = 19823 }; -enum Units -{ - ENTRY_HELLFIRE_SENTRY = 17517, - ENTRY_VAZRUDEN_HERALD = 17307, - ENTRY_VAZRUDEN = 17537, - ENTRY_NAZAN = 17536, - ENTRY_LIQUID_FIRE = 22515, - ENTRY_REINFORCED_FEL_IRON_CHEST = 185168, - ENTRY_REINFORCED_FEL_IRON_CHEST_H = 185169 -}; - -enum Says -{ - SAY_INTRO = 0, - - SAY_WIPE = 0, - SAY_AGGRO = 1, - SAY_KILL = 2, - SAY_DIE = 3, - - EMOTE = 0 -}; +const float VazrudenMiddle[3] = { -1406.5f, 1746.5f, 81.2f }; -const float VazrudenMiddle[3] = {-1406.5f, 1746.5f, 81.2f}; const float VazrudenRing[2][3] = { - {-1430, 1705, 112}, - {-1377, 1760, 112} + { -1430.0f, 1705.0f, 112.0f }, + { -1377.0f, 1760.0f, 112.0f } }; class boss_nazan : public CreatureScript { public: + boss_nazan() : CreatureScript("boss_nazan") { } - boss_nazan() - : CreatureScript("boss_nazan") + struct boss_nazanAI : public BossAI { - } - - struct boss_nazanAI : public ScriptedAI - { - boss_nazanAI(Creature* creature) : ScriptedAI(creature) + boss_nazanAI(Creature* creature) : BossAI(creature, DATA_NAZAN) { VazrudenGUID = 0; flight = true; } - uint32 Fireball_Timer; - uint32 ConeOfFire_Timer; - uint32 BellowingRoar_Timer; - uint32 Fly_Timer; - uint32 Turn_Timer; - bool flight; - uint64 VazrudenGUID; - SpellInfo* liquid_fire; - void Reset() OVERRIDE { Fireball_Timer = 4000; @@ -107,9 +85,15 @@ class boss_nazan : public CreatureScript void EnterCombat(Unit* /*who*/) OVERRIDE {} + void IsSummonedBy(Unit* summoner) OVERRIDE + { + if (summoner->GetEntry() == NPC_VAZRUDEN_HERALD) + VazrudenGUID = summoner->GetGUID(); + } + void JustSummoned(Creature* summoned) OVERRIDE { - if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE) + if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE) { summoned->SetLevel(me->getLevel()); summoned->setFaction(me->getFaction()); @@ -121,7 +105,7 @@ class boss_nazan : public CreatureScript void SpellHitTarget(Unit* target, const SpellInfo* entry) OVERRIDE { if (target && entry->Id == uint32(SPELL_FIREBALL)) - me->SummonCreature(ENTRY_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000); + me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000); } void UpdateAI(uint32 diff) OVERRIDE @@ -193,6 +177,16 @@ class boss_nazan : public CreatureScript DoMeleeAttackIfReady(); } } + + private: + uint32 Fireball_Timer; + uint32 ConeOfFire_Timer; + uint32 BellowingRoar_Timer; + uint32 Fly_Timer; + uint32 Turn_Timer; + bool flight; + uint64 VazrudenGUID; + SpellInfo* liquid_fire; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -204,36 +198,29 @@ class boss_nazan : public CreatureScript class boss_vazruden : public CreatureScript { public: + boss_vazruden() : CreatureScript("boss_vazruden") { } - boss_vazruden() - : CreatureScript("boss_vazruden") - { - } - struct boss_vazrudenAI : public ScriptedAI + struct boss_vazrudenAI : public BossAI { - boss_vazrudenAI(Creature* creature) : ScriptedAI(creature) - { - } - - uint32 Revenge_Timer; - bool WipeSaid; - uint32 UnsummonCheck; + boss_vazrudenAI(Creature* creature) : BossAI(creature, DATA_VAZRUDEN) { } void Reset() OVERRIDE { Revenge_Timer = 4000; UnsummonCheck = 2000; WipeSaid = false; + _Reset(); } void EnterCombat(Unit* /*who*/) OVERRIDE { Talk(SAY_AGGRO); + _EnterCombat(); } void KilledUnit(Unit* who) OVERRIDE { - if (who && who->GetEntry() != ENTRY_VAZRUDEN) + if (who && who->GetEntry() != NPC_VAZRUDEN) Talk(SAY_KILL); } @@ -241,6 +228,7 @@ class boss_vazruden : public CreatureScript { if (killer && killer != me) Talk(SAY_DIE); + _JustDied(); } void UpdateAI(uint32 diff) OVERRIDE @@ -272,7 +260,13 @@ class boss_vazruden : public CreatureScript DoMeleeAttackIfReady(); } + + private: + uint32 Revenge_Timer; + bool WipeSaid; + uint32 UnsummonCheck; }; + CreatureAI* GetAI(Creature* creature) const OVERRIDE { return new boss_vazrudenAI(creature); @@ -282,11 +276,7 @@ class boss_vazruden : public CreatureScript class boss_vazruden_the_herald : public CreatureScript { public: - - boss_vazruden_the_herald() - : CreatureScript("boss_vazruden_the_herald") - { - } + boss_vazruden_the_herald() : CreatureScript("boss_vazruden_the_herald") { } struct boss_vazruden_the_heraldAI : public ScriptedAI { @@ -299,15 +289,6 @@ class boss_vazruden_the_herald : public CreatureScript VazrudenGUID = 0; } - uint32 phase; - uint32 waypoint; - uint32 check; - bool sentryDown; - uint64 NazanGUID; - uint64 VazrudenGUID; - bool summoned; - bool lootSpawned; - void Reset() OVERRIDE { phase = 0; @@ -322,7 +303,7 @@ class boss_vazruden_the_herald : public CreatureScript { Creature* Nazan = Unit::GetCreature(*me, NazanGUID); if (!Nazan) - Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000); + Nazan = me->FindNearestCreature(NPC_NAZAN, 5000); if (Nazan) { Nazan->DisappearAndDie(); @@ -331,7 +312,7 @@ class boss_vazruden_the_herald : public CreatureScript Creature* Vazruden = Unit::GetCreature(*me, VazrudenGUID); if (!Vazruden) - Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000); + Vazruden = me->FindNearestCreature(NPC_VAZRUDEN, 5000); if (Vazruden) { Vazruden->DisappearAndDie(); @@ -347,9 +328,9 @@ class boss_vazruden_the_herald : public CreatureScript { if (!summoned) { - if (Creature* Vazruden = me->SummonCreature(ENTRY_VAZRUDEN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000)) + if (Creature* Vazruden = me->SummonCreature(NPC_VAZRUDEN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000)) VazrudenGUID = Vazruden->GetGUID(); - if (Creature* Nazan = me->SummonCreature(ENTRY_NAZAN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000)) + if (Creature* Nazan = me->SummonCreature(NPC_NAZAN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000)) NazanGUID = Nazan->GetGUID(); summoned = true; me->SetVisible(false); @@ -372,9 +353,8 @@ class boss_vazruden_the_herald : public CreatureScript if (!summoned) return; Unit* victim = me->GetVictim(); - if (summoned->GetEntry() == ENTRY_NAZAN) + if (summoned->GetEntry() == NPC_NAZAN) { - CAST_AI(boss_nazan::boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; summoned->SetDisableGravity(true); summoned->SetSpeed(MOVE_FLIGHT, 2.5f); if (victim) @@ -440,7 +420,7 @@ class boss_vazruden_the_herald : public CreatureScript } else if (!lootSpawned) { - me->SummonGameObject(DUNGEON_MODE(ENTRY_REINFORCED_FEL_IRON_CHEST, ENTRY_REINFORCED_FEL_IRON_CHEST_H), VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, 0, 0, 0, 0, 0); + me->SummonGameObject(DUNGEON_MODE(GO_FEL_IRON_CHEST_NORMAL, GO_FEL_IRON_CHECT_HEROIC), VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, 0, 0, 0, 0, 0); me->SetLootRecipient(NULL); // don't think this is necessary.. //me->Kill(me); lootSpawned = true; @@ -452,6 +432,16 @@ class boss_vazruden_the_herald : public CreatureScript break; } } + + private: + uint32 phase; + uint32 waypoint; + uint32 check; + bool sentryDown; + uint64 NazanGUID; + uint64 VazrudenGUID; + bool summoned; + bool lootSpawned; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -463,17 +453,12 @@ class boss_vazruden_the_herald : public CreatureScript class npc_hellfire_sentry : public CreatureScript { public: + npc_hellfire_sentry() : CreatureScript("npc_hellfire_sentry") { } - npc_hellfire_sentry() - : CreatureScript("npc_hellfire_sentry") - { - } struct npc_hellfire_sentryAI : public ScriptedAI { npc_hellfire_sentryAI(Creature* creature) : ScriptedAI(creature) {} - uint32 KidneyShot_Timer; - void Reset() OVERRIDE { KidneyShot_Timer = urand(3000, 7000); @@ -483,7 +468,7 @@ class npc_hellfire_sentry : public CreatureScript void JustDied(Unit* killer) OVERRIDE { - if (Creature* herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD, 150)) + if (Creature* herald = me->FindNearestCreature(NPC_VAZRUDEN_HERALD, 150)) CAST_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(killer); } @@ -503,7 +488,11 @@ class npc_hellfire_sentry : public CreatureScript DoMeleeAttackIfReady(); } + + private: + uint32 KidneyShot_Timer; }; + CreatureAI* GetAI(Creature* creature) const OVERRIDE { return new npc_hellfire_sentryAI(creature); diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index 837384dda2d..493630a7650 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "hellfire_ramparts.h" enum Says { @@ -44,41 +45,36 @@ enum Spells SPELL_RETALIATION = 22857 }; +enum Events +{ + EVENT_MORTAL_WOUND = 1, + EVENT_SURGE = 2, + EVENT_RETALIATION = 3 +}; + class boss_watchkeeper_gargolmar : public CreatureScript { public: + boss_watchkeeper_gargolmar() : CreatureScript("boss_watchkeeper_gargolmar") { } - boss_watchkeeper_gargolmar() - : CreatureScript("boss_watchkeeper_gargolmar") + struct boss_watchkeeper_gargolmarAI : public BossAI { - } - - struct boss_watchkeeper_gargolmarAI : public ScriptedAI - { - boss_watchkeeper_gargolmarAI(Creature* creature) : ScriptedAI(creature) - { - } - - uint32 Surge_Timer; - uint32 MortalWound_Timer; - uint32 Retaliation_Timer; - - bool HasTaunted; - bool YelledForHeal; + boss_watchkeeper_gargolmarAI(Creature* creature) : BossAI(creature, DATA_WATCHKEEPER_GARGOLMAR) { } void Reset() OVERRIDE { - Surge_Timer = 5000; - MortalWound_Timer = 4000; - Retaliation_Timer = 0; - - HasTaunted = false; - YelledForHeal = false; + hasTaunted = false; + yelledForHeal = false; + retaliation = false; + _Reset(); } void EnterCombat(Unit* /*who*/) OVERRIDE { Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_MORTAL_WOUND, 5000); + events.ScheduleEvent(EVENT_SURGE, 4000); + _EnterCombat(); } void MoveInLineOfSight(Unit* who) OVERRIDE @@ -95,10 +91,10 @@ class boss_watchkeeper_gargolmar : public CreatureScript //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); AttackStart(who); } - else if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) + else if (!hasTaunted && me->IsWithinDistInMap(who, 60.0f)) { Talk(SAY_TAUNT); - HasTaunted = true; + hasTaunted = true; } } } @@ -111,6 +107,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { Talk(SAY_DIE); + _JustDied(); } void UpdateAI(uint32 diff) OVERRIDE @@ -118,48 +115,56 @@ class boss_watchkeeper_gargolmar : public CreatureScript if (!UpdateVictim()) return; - if (MortalWound_Timer <= diff) - { - DoCastVictim(SPELL_MORTAL_WOUND); - MortalWound_Timer = 5000+rand()%8000; - } - else - MortalWound_Timer -= diff; + events.Update(diff); - if (Surge_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - Talk(SAY_SURGE); - - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SURGE); - - Surge_Timer = 5000+rand()%8000; + switch (eventId) + { + case EVENT_MORTAL_WOUND: + DoCastVictim(SPELL_MORTAL_WOUND); + events.ScheduleEvent(EVENT_MORTAL_WOUND, urand (5000, 13000)); + break; + case EVENT_SURGE: + Talk(SAY_SURGE); + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_SURGE); + events.ScheduleEvent(EVENT_SURGE, urand (5000, 13000)); + break; + case EVENT_RETALIATION: + DoCast(me, SPELL_RETALIATION); + events.ScheduleEvent(EVENT_RETALIATION, 30000); + break; + default: + break; + } } - else - Surge_Timer -= diff; - if (HealthBelowPct(20)) + if (!retaliation) { - if (Retaliation_Timer <= diff) + if (HealthBelowPct(20)) { - DoCast(me, SPELL_RETALIATION); - Retaliation_Timer = 30000; + events.ScheduleEvent(EVENT_RETALIATION, 1000); + retaliation = true; } - else - Retaliation_Timer -= diff; } - if (!YelledForHeal) + if (!yelledForHeal) { if (HealthBelowPct(40)) { Talk(SAY_HEAL); - YelledForHeal = true; + yelledForHeal = true; } } DoMeleeAttackIfReady(); } + + private: + bool hasTaunted; + bool yelledForHeal; + bool retaliation; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h index 6009f6ca8e2..880640659b0 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h @@ -19,12 +19,29 @@ #ifndef DEF_RAMPARTS_H #define DEF_RAMPARTS_H -#define MAX_ENCOUNTER 2 +uint32 const EncounterCount = 4; enum DataTypes { - TYPE_VAZRUDEN = 1, - TYPE_NAZAN = 2 + DATA_WATCHKEEPER_GARGOLMAR = 0, + DATA_OMOR_THE_UNSCARRED = 1, + DATA_VAZRUDEN = 2, + DATA_NAZAN = 3 +}; + +enum CreatureIds +{ + NPC_HELLFIRE_SENTRY = 17517, + NPC_VAZRUDEN_HERALD = 17307, + NPC_VAZRUDEN = 17537, + NPC_NAZAN = 17536, + NPC_LIQUID_FIRE = 22515 +}; + +enum GameobjectIds +{ + GO_FEL_IRON_CHEST_NORMAL = 185168, + GO_FEL_IRON_CHECT_HEROIC = 185169 }; #endif diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp index b1d780c18ca..98f6f194c0f 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp @@ -30,65 +30,95 @@ EndScriptData */ class instance_ramparts : public InstanceMapScript { public: - instance_ramparts() - : InstanceMapScript("instance_ramparts", 543) - { - } + instance_ramparts() : InstanceMapScript("instance_ramparts", 543) { } struct instance_ramparts_InstanceMapScript : public InstanceScript { instance_ramparts_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 m_uiChestNGUID; - uint64 m_uiChestHGUID; - bool spawned; - void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiChestNGUID = 0; - m_uiChestHGUID = 0; + SetBossNumber(EncounterCount); + felIronChestGUID = 0; } void OnGameObjectCreate(GameObject* go) { switch (go->GetEntry()) { - case 185168: - m_uiChestNGUID = go->GetGUID(); - break; - case 185169: - m_uiChestHGUID = go->GetGUID(); + case GO_FEL_IRON_CHEST_NORMAL: + case GO_FEL_IRON_CHECT_HEROIC: + felIronChestGUID = go->GetGUID(); break; } } - void SetData(uint32 uiType, uint32 uiData) + bool SetBossState(uint32 type, EncounterState state) { - TC_LOG_DEBUG(LOG_FILTER_TSCR, "Instance Ramparts: SetData received for type %u with data %u", uiType, uiData); + if (!InstanceScript::SetBossState(type, state)) + return false; - switch (uiType) + switch (type) { - case TYPE_VAZRUDEN: - if (uiData == DONE && m_auiEncounter[1] == DONE && !spawned) - { - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS); - spawned = true; - } - m_auiEncounter[0] = uiData; - break; - case TYPE_NAZAN: - if (uiData == DONE && m_auiEncounter[0] == DONE && !spawned) + case DATA_VAZRUDEN: + case DATA_NAZAN: + if (GetBossState(DATA_VAZRUDEN) == DONE && GetBossState(DATA_NAZAN) == DONE && !spawned) { - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS); + DoRespawnGameObject(felIronChestGUID, HOUR*IN_MILLISECONDS); spawned = true; } - m_auiEncounter[1] = uiData; break; } + return true; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "H R " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* strIn) + { + if (!strIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(strIn); + + char dataHead1, dataHead2; + + std::istringstream loadStream(strIn); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'H' && dataHead2 == 'R') + { + for (uint8 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; } + + protected: + uint64 felIronChestGUID; + bool spawned; }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index 3381524f17e..0dbd21ff94a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -46,7 +46,7 @@ enum Says enum Spells { - SPELL_DEATH_COIL = 30500, + SPELL_DEATH_COIL = 30500, // 30741 heroic SPELL_DARK_SPIN = 30502, // core bug spell attack caster :D SPELL_SHADOW_FISSURE = 30496, // Summon the ShadowFissure NPC SPELL_SHADOW_CLEAVE = 30495, @@ -54,40 +54,36 @@ enum Spells SPELL_HEMORRHAGE = 30478, SPELL_CONSUMPTION = 30497, SPELL_TEMPORARY_VISUAL = 39312, // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should + + SPELL_SHADOW_SEAR = 30735 // cast on entry 17083 which then makes sound 1343 + // 30948 cast on self by 17687 }; -class boss_grand_warlock_nethekurse : public CreatureScript +enum SetData { - public: - - boss_grand_warlock_nethekurse() - : CreatureScript("boss_grand_warlock_nethekurse") - { - } - - struct boss_grand_warlock_nethekurseAI : public ScriptedAI - { - boss_grand_warlock_nethekurseAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } + SETDATA_DATA = 1, + SETDATA_PEON_AGGRO = 1, + SETDATA_PEON_DEATH = 2 +}; - InstanceScript* instance; +enum Events +{ + // Fel Orc Convert + EVENT_HEMORRHAGE = 1 +}; - bool IntroOnce; - bool IsIntroEvent; - bool IsMainEvent; - bool SpinOnce; - //bool HasTaunted; - bool Phase; +// ######################################################## +// Grand Warlock Nethekurse +// ######################################################## - uint32 PeonEngagedCount; - uint32 PeonKilledCount; +class boss_grand_warlock_nethekurse : public CreatureScript +{ + public: + boss_grand_warlock_nethekurse() : CreatureScript("boss_grand_warlock_nethekurse") { } - uint32 IntroEvent_Timer; - uint32 DeathCoil_Timer; - uint32 ShadowFissure_Timer; - uint32 Cleave_Timer; + struct boss_grand_warlock_nethekurseAI : public BossAI + { + boss_grand_warlock_nethekurseAI(Creature* creature) : BossAI(creature, DATA_NETHEKURSE) { } void Reset() OVERRIDE { @@ -103,34 +99,50 @@ class boss_grand_warlock_nethekurse : public CreatureScript PeonEngagedCount = 0; PeonKilledCount = 0; - IntroEvent_Timer = 90000; //how long before getting bored and kills his minions? + IntroEvent_Timer = 90000; // how long before getting bored and kills his minions? DeathCoil_Timer = 20000; ShadowFissure_Timer = 8000; Cleave_Timer = 5000; } - void DoYellForPeonAggro() + void JustDied(Unit* /*killer*/) OVERRIDE { - if (PeonEngagedCount >= 4) - return; + Talk(SAY_DIE); - Talk(SAY_PEON_ATTACKED); - ++PeonEngagedCount; + if (instance) + instance->SetBossState(DATA_NETHEKURSE, DONE); } - void DoYellForPeonDeath() + void SetData(uint32 data, uint32 value) OVERRIDE { - if (PeonKilledCount >= 4) + if (data != SETDATA_DATA) return; - Talk(SAY_PEON_DIES); - ++PeonKilledCount; - - if (PeonKilledCount == 4) + switch (value) { - IsIntroEvent = false; - IsMainEvent = true; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + case SETDATA_PEON_AGGRO: + if (PeonEngagedCount >= 4) + return; + + Talk(SAY_PEON_ATTACKED); + ++PeonEngagedCount; + break; + case SETDATA_PEON_DEATH: + if (PeonKilledCount >= 4) + return; + + Talk(SAY_PEON_DIES); + ++PeonKilledCount; + + if (PeonKilledCount == 4) + { + IsIntroEvent = false; + IsMainEvent = true; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + break; + default: + break; } } @@ -163,7 +175,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript void MoveInLineOfSight(Unit* who) OVERRIDE { - if (!IntroOnce && me->IsWithinDistInMap(who, 50.0f)) + if (!IntroOnce && me->IsWithinDistInMap(who, 30.0f)) { if (who->GetTypeId() != TYPEID_PLAYER) return; @@ -173,7 +185,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript IsIntroEvent = true; if (instance) - instance->SetData(TYPE_NETHEKURSE, IN_PROGRESS); + instance->SetBossState(DATA_NETHEKURSE, IN_PROGRESS); } if (IsIntroEvent || !IsMainEvent) @@ -203,17 +215,6 @@ class boss_grand_warlock_nethekurse : public CreatureScript Talk(SAY_SLAY); } - void JustDied(Unit* /*killer*/) OVERRIDE - { - Talk(SAY_DIE); - - if (!instance) - return; - - instance->SetData(TYPE_NETHEKURSE, DONE); - instance->HandleGameObject(instance->GetData64(DATA_NETHEKURSE_DOOR), true); - } - void UpdateAI(uint32 diff) OVERRIDE { if (IsIntroEvent) @@ -221,7 +222,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript if (!instance) return; - if (instance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + if (instance->GetBossState(DATA_NETHEKURSE) == IN_PROGRESS) { if (IntroEvent_Timer <= diff) DoTauntPeons(); @@ -278,6 +279,20 @@ class boss_grand_warlock_nethekurse : public CreatureScript DoMeleeAttackIfReady(); } } + + private: + uint32 PeonEngagedCount; + uint32 PeonKilledCount; + uint32 IntroEvent_Timer; + uint32 DeathCoil_Timer; + uint32 ShadowFissure_Timer; + uint32 Cleave_Timer; + bool IntroOnce; + bool IsIntroEvent; + bool IsMainEvent; + bool SpinOnce; + //bool HasTaunted; + bool Phase; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -286,14 +301,14 @@ class boss_grand_warlock_nethekurse : public CreatureScript } }; +// ######################################################## +// Fel Orc Convert +// ######################################################## + class npc_fel_orc_convert : public CreatureScript { public: - - npc_fel_orc_convert() - : CreatureScript("npc_fel_orc_convert") - { - } + npc_fel_orc_convert() : CreatureScript("npc_fel_orc_convert") { } struct npc_fel_orc_convertAI : public ScriptedAI { @@ -302,49 +317,32 @@ class npc_fel_orc_convert : public CreatureScript instance = creature->GetInstanceScript(); } - InstanceScript* instance; - uint32 Hemorrhage_Timer; - void Reset() OVERRIDE { me->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!) - Hemorrhage_Timer = 3000; } - void MoveInLineOfSight(Unit* /*who*/) OVERRIDE - - { - } + void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { } void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance) - { - if (instance->GetData64(DATA_NETHEKURSE)) - { - Creature* pKurse = Unit::GetCreature(*me, instance->GetData64(DATA_NETHEKURSE)); - if (pKurse && me->IsWithinDist(pKurse, 45.0f)) - { - CAST_AI(boss_grand_warlock_nethekurse::boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); + events.ScheduleEvent(EVENT_HEMORRHAGE, 3000); - if (instance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) - return; - else - instance->SetData(TYPE_NETHEKURSE, IN_PROGRESS); - } - } - } + if (instance) + if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE))) + if (Kurse && me->IsWithinDist(Kurse, 45.0f)) + Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_AGGRO); } void JustDied(Unit* /*killer*/) OVERRIDE { if (instance) { - if (instance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) + if (instance->GetBossState(DATA_NETHEKURSE) != IN_PROGRESS) return; - if (instance->GetData64(DATA_NETHEKURSE)) - if (Creature* pKurse = Unit::GetCreature(*me, instance->GetData64(DATA_NETHEKURSE))) - CAST_AI(boss_grand_warlock_nethekurse::boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); + + if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE))) + Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_DEATH); } } @@ -353,14 +351,20 @@ class npc_fel_orc_convert : public CreatureScript if (!UpdateVictim()) return; - if (Hemorrhage_Timer <= diff) + events.Update(diff); + + if (events.ExecuteEvent() == EVENT_HEMORRHAGE) { DoCastVictim(SPELL_HEMORRHAGE); - Hemorrhage_Timer = 15000; - } else Hemorrhage_Timer -= diff; + events.ScheduleEvent(EVENT_HEMORRHAGE, 15000); + } DoMeleeAttackIfReady(); } + + private: + InstanceScript* instance; + EventMap events; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -369,15 +373,14 @@ class npc_fel_orc_convert : public CreatureScript } }; -//NOTE: this Creature are also summoned by other spells, for different creatures +// ######################################################## +// Lesser Shadow Fissure +// ######################################################## + class npc_lesser_shadow_fissure : public CreatureScript { public: - - npc_lesser_shadow_fissure() - : CreatureScript("npc_lesser_shadow_fissure") - { - } + npc_lesser_shadow_fissure() : CreatureScript("npc_lesser_shadow_fissure") { } struct npc_lesser_shadow_fissureAI : public ScriptedAI { @@ -385,14 +388,13 @@ class npc_lesser_shadow_fissure : public CreatureScript void Reset() OVERRIDE {} void MoveInLineOfSight(Unit* /*who*/) OVERRIDE {} - void AttackStart(Unit* /*who*/) OVERRIDE {} void EnterCombat(Unit* /*who*/) OVERRIDE {} }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_lesser_shadow_fissureAI (creature); + return new npc_lesser_shadow_fissureAI(creature); } }; @@ -402,4 +404,3 @@ void AddSC_boss_grand_warlock_nethekurse() new npc_fel_orc_convert(); new npc_lesser_shadow_fissure(); } - diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index 0387fca0e18..9c4be7c0b1b 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -55,6 +55,18 @@ enum Creatures NPC_RIGHT_HEAD = 19524 }; +enum SetData +{ + SETDATA_DATA = 1, + SETDATA_YELL = 1 +}; + +enum Events +{ + // Omrogg Heads + EVENT_DEATH_YELL = 1 +}; + struct Yell { int32 id; @@ -67,6 +79,7 @@ static Yell GoCombat[]= {1, NPC_LEFT_HEAD}, {2, NPC_LEFT_HEAD}, }; + static Yell GoCombatDelay[]= { {0, NPC_RIGHT_HEAD}, @@ -81,6 +94,7 @@ static Yell Threat[]= {4, NPC_LEFT_HEAD}, {5, NPC_LEFT_HEAD}, }; + static Yell ThreatDelay1[]= { {4, NPC_RIGHT_HEAD}, @@ -88,6 +102,7 @@ static Yell ThreatDelay1[]= {5, NPC_RIGHT_HEAD}, {6, NPC_RIGHT_HEAD}, }; + static Yell ThreatDelay2[]= { {7, NPC_LEFT_HEAD}, @@ -108,104 +123,34 @@ static Yell KillingDelay[]= {11, NPC_LEFT_HEAD}, }; -class npc_omrogg_heads : public CreatureScript -{ - public: - - npc_omrogg_heads() - : CreatureScript("npc_omrogg_heads") - { - } - - struct npc_omrogg_headsAI : public ScriptedAI - { - npc_omrogg_headsAI(Creature* creature) : ScriptedAI(creature) {} - - bool DeathYell; - uint32 Death_Timer; - - void Reset() OVERRIDE - { - Death_Timer = 4000; - DeathYell = false; - } - void EnterCombat(Unit* /*who*/) OVERRIDE {} - - void DoDeathYell() - { - DeathYell = true; - } - - void UpdateAI(uint32 diff) OVERRIDE - { - if (!DeathYell) - return; - - if (Death_Timer <= diff) - { - Talk(YELL_DIE_R); - Death_Timer = false; - me->setDeathState(JUST_DIED); - } else Death_Timer -= diff; - } - }; - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_omrogg_headsAI(creature); - } -}; +// ######################################################## +// Warbringer_Omrogg +// ######################################################## class boss_warbringer_omrogg : public CreatureScript { public: + boss_warbringer_omrogg() : CreatureScript("boss_warbringer_omrogg") { } - boss_warbringer_omrogg() - : CreatureScript("boss_warbringer_omrogg") - { - } - - struct boss_warbringer_omroggAI : public ScriptedAI + struct boss_warbringer_omroggAI : public BossAI { - boss_warbringer_omroggAI(Creature* creature) : ScriptedAI(creature) + boss_warbringer_omroggAI(Creature* creature) : BossAI(creature, DATA_OMROGG) { LeftHeadGUID = 0; RightHeadGUID = 0; - instance = creature->GetInstanceScript(); } - InstanceScript* instance; - - uint64 LeftHeadGUID; - uint64 RightHeadGUID; - int iaggro; - int ithreat; - int ikilling; - - bool AggroYell; - bool ThreatYell; - bool ThreatYell2; - bool KillingYell; - - uint32 Delay_Timer; - uint32 BlastWave_Timer; - uint32 BlastCount; - uint32 Fear_Timer; - uint32 BurningMaul_Timer; - uint32 ThunderClap_Timer; - uint32 ResetThreat_Timer; - void Reset() OVERRIDE { - if (Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID)) + if (Unit* LeftHead = Unit::GetUnit(*me, LeftHeadGUID)) { - pLeftHead->setDeathState(JUST_DIED); + LeftHead->setDeathState(JUST_DIED); LeftHeadGUID = 0; } - if (Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID)) + if (Unit* RightHead = Unit::GetUnit(*me, RightHeadGUID)) { - pRightHead->setDeathState(JUST_DIED); + RightHead->setDeathState(JUST_DIED); RightHeadGUID = 0; } @@ -223,20 +168,20 @@ class boss_warbringer_omrogg : public CreatureScript ResetThreat_Timer = 30000; if (instance) - instance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. + instance->SetData(DATA_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. } void DoYellForThreat() { - Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); - Creature* pRightHead = Unit::GetCreature(*me, RightHeadGUID); + Creature* LeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* RightHead = Unit::GetCreature(*me, RightHeadGUID); - if (!pLeftHead || !pRightHead) + if (!LeftHead || !RightHead) return; ithreat = rand()%4; - Creature* source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); + Creature* source = (LeftHead->GetEntry() == Threat[ithreat].creature ? LeftHead : RightHead); source->AI()->Talk(Threat[ithreat].id); @@ -249,18 +194,18 @@ class boss_warbringer_omrogg : public CreatureScript me->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); me->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID)) + if (Creature* LeftHead = Creature::GetCreature(*me, LeftHeadGUID)) { iaggro = rand()%3; - pLeftHead->AI()->Talk(GoCombat[iaggro].id); + LeftHead->AI()->Talk(GoCombat[iaggro].id); Delay_Timer = 3500; AggroYell = true; } if (instance) - instance->SetData(TYPE_OMROGG, IN_PROGRESS); + instance->SetBossState(DATA_OMROGG, IN_PROGRESS); } void JustSummoned(Creature* summoned) OVERRIDE @@ -278,15 +223,15 @@ class boss_warbringer_omrogg : public CreatureScript void KilledUnit(Unit* /*victim*/) OVERRIDE { - Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); - Creature* pRightHead = Creature::GetCreature(*me, RightHeadGUID); + Creature* LeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* RightHead = Creature::GetCreature(*me, RightHeadGUID); - if (!pLeftHead || !pRightHead) + if (!LeftHead || !RightHead) return; ikilling = rand()%2; - Creature* source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); + Creature* source = (LeftHead->GetEntry() == Killing[ikilling].creature ? LeftHead : RightHead); switch (ikilling) { @@ -304,18 +249,18 @@ class boss_warbringer_omrogg : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); - Creature* pRightHead = Creature::GetCreature(*me, RightHeadGUID); + Creature* LeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* RightHead = Creature::GetCreature(*me, RightHeadGUID); - if (!pLeftHead || !pRightHead) + if (!LeftHead || !RightHead) return; - pLeftHead->AI()->Talk(YELL_DIE_L); + LeftHead->AI()->Talk(YELL_DIE_L); - CAST_AI(npc_omrogg_heads::npc_omrogg_headsAI, pRightHead->ToCreature()->AI())->DoDeathYell(); + RightHead->AI()->SetData(SETDATA_DATA, SETDATA_YELL); if (instance) - instance->SetData(TYPE_OMROGG, DONE); + instance->SetBossState(DATA_OMROGG, DONE); } void UpdateAI(uint32 diff) OVERRIDE @@ -324,21 +269,21 @@ class boss_warbringer_omrogg : public CreatureScript { Delay_Timer = 3500; - Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); - Creature* pRightHead = Creature::GetCreature(*me, RightHeadGUID); + Creature* LeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* RightHead = Creature::GetCreature(*me, RightHeadGUID); - if (!pLeftHead || !pRightHead) + if (!LeftHead || !RightHead) return; if (AggroYell) { - pRightHead->AI()->Talk(GoCombatDelay[iaggro].id); + RightHead->AI()->Talk(GoCombatDelay[iaggro].id); AggroYell = false; } if (ThreatYell2) { - Creature* source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); + Creature* source = (LeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? LeftHead : RightHead); source->AI()->Talk(ThreatDelay2[ithreat].id); ThreatYell2 = false; @@ -346,7 +291,7 @@ class boss_warbringer_omrogg : public CreatureScript if (ThreatYell) { - Creature* source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); + Creature* source = (LeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? LeftHead : RightHead); source->AI()->Talk(ThreatDelay1[ithreat].id); ThreatYell = false; @@ -355,7 +300,7 @@ class boss_warbringer_omrogg : public CreatureScript if (KillingYell) { - Creature* source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); + Creature* source = (LeftHead->GetEntry() == KillingDelay[ikilling].creature ? LeftHead : RightHead); source->AI()->Talk(KillingDelay[ikilling].id); KillingYell = false; @@ -419,16 +364,86 @@ class boss_warbringer_omrogg : public CreatureScript DoMeleeAttackIfReady(); } + + private: + uint64 LeftHeadGUID; + uint64 RightHeadGUID; + int iaggro; + int ithreat; + int ikilling; + + bool AggroYell; + bool ThreatYell; + bool ThreatYell2; + bool KillingYell; + + uint32 Delay_Timer; + uint32 BlastWave_Timer; + uint32 BlastCount; + uint32 Fear_Timer; + uint32 BurningMaul_Timer; + uint32 ThunderClap_Timer; + uint32 ResetThreat_Timer; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new boss_warbringer_omroggAI(creature); + } +}; + +// ######################################################## +// Omrogg Heads +// ######################################################## + +class npc_omrogg_heads : public CreatureScript +{ + public: + npc_omrogg_heads() : CreatureScript("npc_omrogg_heads") { } + + struct npc_omrogg_headsAI : public ScriptedAI + { + npc_omrogg_headsAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } + + void Reset() OVERRIDE { } + + void EnterCombat(Unit* /*who*/) OVERRIDE { } + + void SetData(uint32 data, uint32 value) + { + if (data == SETDATA_DATA && value == SETDATA_YELL) + { + events.ScheduleEvent(EVENT_DEATH_YELL, 4000); + } + } + + void UpdateAI(uint32 diff) OVERRIDE + { + events.Update(diff); + + if (events.ExecuteEvent() == EVENT_DEATH_YELL) + { + Talk(YELL_DIE_R); + me->setDeathState(JUST_DIED); + } + } + + private: + InstanceScript* instance; + EventMap events; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_warbringer_omroggAI (creature); + return new npc_omrogg_headsAI(creature); } }; + void AddSC_boss_warbringer_omrogg() { new boss_warbringer_omrogg(); new npc_omrogg_heads(); } - diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index 05f1bb7121c..f9ec3edb362 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -29,6 +29,7 @@ EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "shattered_halls.h" enum Says { @@ -39,8 +40,8 @@ enum Says enum Spells { - SPELL_BLADE_DANCE = 30739, - H_SPELL_CHARGE = 25821, + SPELL_BLADE_DANCE = 30739, + H_SPELL_CHARGE = 25821 }; enum Creatures @@ -48,45 +49,23 @@ enum Creatures NPC_SHATTERED_ASSASSIN = 17695, NPC_HEARTHEN_GUARD = 17621, NPC_SHARPSHOOTER_GUARD = 17622, - NPC_REAVER_GUARD = 17623, + NPC_REAVER_GUARD = 17623 }; -#define TARGET_NUM 5 +#define TARGET_NUM 5 -float AssassEntrance[3] = {275.136f, -84.29f, 2.3f}; // y -8 -float AssassExit[3] = {184.233f, -84.29f, 2.3f}; // y -8 -float AddsEntrance[3] = {306.036f, -84.29f, 1.93f}; +float AssassEntrance[3] = { 275.136f, -84.29f, 2.3f }; // y -8 +float AssassExit[3] = { 184.233f, -84.29f, 2.3f }; // y -8 +float AddsEntrance[3] = { 306.036f, -84.29f, 1.93f }; class boss_warchief_kargath_bladefist : public CreatureScript { public: + boss_warchief_kargath_bladefist() : CreatureScript("boss_warchief_kargath_bladefist") { } - boss_warchief_kargath_bladefist() - : CreatureScript("boss_warchief_kargath_bladefist") + struct boss_warchief_kargath_bladefistAI : public BossAI { - } - - struct boss_warchief_kargath_bladefistAI : public ScriptedAI - { - boss_warchief_kargath_bladefistAI(Creature* creature) : ScriptedAI(creature) - { - } - - std::vector<uint64> adds; - std::vector<uint64> assassins; - - uint32 Charge_timer; - uint32 Blade_Dance_Timer; - uint32 Summon_Assistant_Timer; - uint32 resetcheck_timer; - uint32 Wait_Timer; - - uint32 Assassins_Timer; - - uint32 summoned; - bool InBlade; - - uint32 target_num; + boss_warchief_kargath_bladefistAI(Creature* creature) : BossAI(creature, DATA_KARGATH) { } void Reset() OVERRIDE { @@ -106,6 +85,15 @@ class boss_warchief_kargath_bladefist : public CreatureScript resetcheck_timer = 5000; } + void JustDied(Unit* /*killer*/) OVERRIDE + { + Talk(SAY_DEATH); + removeAdds(); + + if (instance) + instance->SetBossState(DATA_KARGATH, DONE); + } + void EnterCombat(Unit* /*who*/) OVERRIDE { Talk(SAY_AGGRO); @@ -135,12 +123,6 @@ class boss_warchief_kargath_bladefist : public CreatureScript } } - void JustDied(Unit* /*killer*/) OVERRIDE - { - Talk(SAY_DEATH); - removeAdds(); - } - void MovementInform(uint32 type, uint32 id) OVERRIDE { if (InBlade) @@ -312,6 +294,19 @@ class boss_warchief_kargath_bladefist : public CreatureScript else resetcheck_timer -= diff; } + + private: + std::vector<uint64> adds; + std::vector<uint64> assassins; + uint32 Charge_timer; + uint32 Blade_Dance_Timer; + uint32 Summon_Assistant_Timer; + uint32 resetcheck_timer; + uint32 Wait_Timer; + uint32 Assassins_Timer; + uint32 summoned; + uint32 target_num; + bool InBlade; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -324,4 +319,3 @@ void AddSC_boss_warchief_kargath_bladefist() { new boss_warchief_kargath_bladefist(); } - diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp index 0f00d73a81d..1919e74e4ee 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Instance_Shattered_Halls SD%Complete: 50 -SDComment: currently missing info about door. instance not complete +SDComment: instance not complete SDCategory: Hellfire Citadel, Shattered Halls EndScriptData */ @@ -27,99 +27,144 @@ EndScriptData */ #include "InstanceScript.h" #include "shattered_halls.h" -#define MAX_ENCOUNTER 2 - -#define DOOR_NETHEKURSE 1 - class instance_shattered_halls : public InstanceMapScript { public: - instance_shattered_halls() - : InstanceMapScript("instance_shattered_halls", 540) + instance_shattered_halls() : InstanceMapScript("instance_shattered_halls", 540) { } + + InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE { + return new instance_shattered_halls_InstanceMapScript(map); } + struct instance_shattered_halls_InstanceMapScript : public InstanceScript { - instance_shattered_halls_InstanceMapScript(Map* map) : InstanceScript(map) {} - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 nethekurseGUID; - uint64 nethekurseDoorGUID; + instance_shattered_halls_InstanceMapScript(Map* map) : InstanceScript(map) { } void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - nethekurseGUID = 0; - nethekurseDoorGUID = 0; + SetBossNumber(EncounterCount); + nethekurseGUID = 0; + nethekurseDoor1GUID = 0; + nethekurseDoor2GUID = 0; } - void OnGameObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject* go) OVERRIDE { switch (go->GetEntry()) { - case DOOR_NETHEKURSE: - nethekurseDoorGUID = go->GetGUID(); + case GO_GRAND_WARLOCK_CHAMBER_DOOR_1: + nethekurseDoor1GUID = go->GetGUID(); + break; + case GO_GRAND_WARLOCK_CHAMBER_DOOR_2: + nethekurseDoor2GUID = go->GetGUID(); break; } } - void OnCreatureCreate(Creature* creature) + void OnCreatureCreate(Creature* creature) OVERRIDE { switch (creature->GetEntry()) { - case 16807: + case NPC_GRAND_WARLOCK_NETHEKURSE: nethekurseGUID = creature->GetGUID(); break; } } - void SetData(uint32 type, uint32 data) OVERRIDE + bool SetBossState(uint32 type, EncounterState state) OVERRIDE { + if (!InstanceScript::SetBossState(type, state)) + return false; + switch (type) { - case TYPE_NETHEKURSE: - m_auiEncounter[0] = data; + case DATA_NETHEKURSE: + if (state == IN_PROGRESS) + { + HandleGameObject(nethekurseDoor1GUID, false); + HandleGameObject(nethekurseDoor2GUID, false); + } + else + { + HandleGameObject(nethekurseDoor1GUID, true); + HandleGameObject(nethekurseDoor2GUID, true); + } break; - case TYPE_OMROGG: - m_auiEncounter[1] = data; + case DATA_OMROGG: break; } + return true; } - uint32 GetData(uint32 type) const OVERRIDE + uint64 GetData64(uint32 data) const OVERRIDE { - switch (type) + switch (data) { - case TYPE_NETHEKURSE: - return m_auiEncounter[0]; - case TYPE_OMROGG: - return m_auiEncounter[1]; + case NPC_GRAND_WARLOCK_NETHEKURSE: + return nethekurseGUID; + break; + case GO_GRAND_WARLOCK_CHAMBER_DOOR_1: + return nethekurseDoor1GUID; + break; + case GO_GRAND_WARLOCK_CHAMBER_DOOR_2: + return nethekurseDoor2GUID; + break; } return 0; } - uint64 GetData64(uint32 data) const OVERRIDE + std::string GetSaveData() { - switch (data) + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "S H " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* strIn) + { + if (!strIn) { - case DATA_NETHEKURSE: - return nethekurseGUID; - case DATA_NETHEKURSE_DOOR: - return nethekurseDoorGUID; + OUT_LOAD_INST_DATA_FAIL; + return; } - return 0; + + OUT_LOAD_INST_DATA(strIn); + + char dataHead1, dataHead2; + + std::istringstream loadStream(strIn); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'S' && dataHead2 == 'H') + { + for (uint8 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; } - }; - InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE - { - return new instance_shattered_halls_InstanceMapScript(map); - } + protected: + uint64 nethekurseGUID; + uint64 nethekurseDoor1GUID; + uint64 nethekurseDoor2GUID; + }; }; void AddSC_instance_shattered_halls() { new instance_shattered_halls(); } - diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h index 9d9fbf6aec0..888a9cb5010 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h @@ -19,12 +19,24 @@ #ifndef DEF_SHATTERED_H #define DEF_SHATTERED_H +uint32 const EncounterCount = 3; + enum DataTypes { - TYPE_NETHEKURSE = 1, - DATA_NETHEKURSE = 2, - DATA_NETHEKURSE_DOOR = 3, + DATA_NETHEKURSE = 1, + DATA_OMROGG = 2, + DATA_KARGATH = 3 +}; - TYPE_OMROGG = 4 +enum CreatureIds +{ + NPC_GRAND_WARLOCK_NETHEKURSE = 16807 }; + +enum GameobjectIds +{ + GO_GRAND_WARLOCK_CHAMBER_DOOR_1 = 182539, + GO_GRAND_WARLOCK_CHAMBER_DOOR_2 = 182540 +}; + #endif diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 389634a50bf..09fb235edb9 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -75,11 +75,8 @@ enum WaitEventType class boss_alar : public CreatureScript { public: + boss_alar() : CreatureScript("boss_alar") { } - boss_alar() - : CreatureScript("boss_alar") - { - } struct boss_alarAI : public ScriptedAI { boss_alarAI(Creature* creature) : ScriptedAI(creature) @@ -162,7 +159,6 @@ class boss_alar : public CreatureScript void MoveInLineOfSight(Unit* /*who*/) OVERRIDE {} - void AttackStart(Unit* who) OVERRIDE { if (Phase1) @@ -462,11 +458,7 @@ class boss_alar : public CreatureScript class npc_ember_of_alar : public CreatureScript { public: - - npc_ember_of_alar() - : CreatureScript("npc_ember_of_alar") - { - } + npc_ember_of_alar() : CreatureScript("npc_ember_of_alar") { } struct npc_ember_of_alarAI : public ScriptedAI { @@ -484,10 +476,12 @@ class npc_ember_of_alar : public CreatureScript { toDie = false; } + void EnterCombat(Unit* /*who*/) OVERRIDE { DoZoneInCombat(); } + void EnterEvadeMode() OVERRIDE { me->setDeathState(JUST_DIED); @@ -541,11 +535,7 @@ class npc_ember_of_alar : public CreatureScript class npc_flame_patch_alar : public CreatureScript { public: - - npc_flame_patch_alar() - : CreatureScript("npc_flame_patch_alar") - { - } + npc_flame_patch_alar() : CreatureScript("npc_flame_patch_alar") { } struct npc_flame_patch_alarAI : public ScriptedAI { @@ -570,4 +560,3 @@ void AddSC_boss_alar() new npc_ember_of_alar(); new npc_flame_patch_alar(); } - diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 5a070017986..597cccda102 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -419,7 +419,7 @@ class boss_high_astromancer_solarian : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_astromancer_solarianAI (creature); + return new boss_high_astromancer_solarianAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp index d4a38cc3566..a2c6ba399a3 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -117,7 +117,7 @@ class boss_gatewatcher_gyrokill : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gatewatcher_gyrokillAI (creature); + return new boss_gatewatcher_gyrokillAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index 30194bb20d9..1bcdcd48fce 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -160,7 +160,7 @@ class boss_pathaleon_the_calculator : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_pathaleon_the_calculatorAI (creature); + return new boss_pathaleon_the_calculatorAI(creature); } }; @@ -232,7 +232,7 @@ class npc_nether_wraith : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_nether_wraithAI (creature); + return new npc_nether_wraithAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp index ea20626281c..c7765eb24ad 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -275,7 +275,7 @@ class boss_harbinger_skyriss : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_harbinger_skyrissAI (creature); + return new boss_harbinger_skyrissAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index d3fe23353e7..36a17996f94 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -73,7 +73,7 @@ class npc_warp_splinter_treant : public CreatureScript } struct npc_warp_splinter_treantAI : public ScriptedAI { - npc_warp_splinter_treantAI (Creature* creature) : ScriptedAI(creature) + npc_warp_splinter_treantAI(Creature* creature) : ScriptedAI(creature) { WarpGuid = 0; } diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 943838ae85d..82849691fcd 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -171,7 +171,7 @@ class boss_doomlord_kazzak : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_doomlordkazzakAI (creature); + return new boss_doomlordkazzakAI(creature); } }; diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index ccce7450923..295d86bbce3 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -161,7 +161,7 @@ class boss_doomwalker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_doomwalkerAI (creature); + return new boss_doomwalkerAI(creature); } }; diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index 1321b1457f1..6273731f292 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -62,7 +62,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_bladespire_ogreAI (creature); + return new npc_bladespire_ogreAI(creature); } struct npc_bladespire_ogreAI : public ScriptedAI @@ -114,7 +114,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_nether_drakeAI (creature); + return new npc_nether_drakeAI(creature); } struct npc_nether_drakeAI : public ScriptedAI @@ -279,7 +279,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_daranelleAI (creature); + return new npc_daranelleAI(creature); } struct npc_daranelleAI : public ScriptedAI diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 3f1266701db..fc7f4d2ae00 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_aeranasAI (creature); + return new npc_aeranasAI(creature); } struct npc_aeranasAI : public ScriptedAI diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 4269c69cfe0..1d5e1b8b6a5 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -323,7 +323,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_creditmarker_visit_with_ancestorsAI (creature); + return new npc_creditmarker_visit_with_ancestorsAI(creature); } struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 553817f01d8..7c419243c20 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -76,7 +76,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_manaforge_control_consoleAI (creature); + return new npc_manaforge_control_consoleAI(creature); } struct npc_manaforge_control_consoleAI : public ScriptedAI @@ -741,7 +741,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_phase_hunterAI (creature); + return new npc_phase_hunterAI(creature); } struct npc_phase_hunterAI : public ScriptedAI diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index a391ec03228..6f4694a5924 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -81,7 +81,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_raliq_the_drunkAI (creature); + return new npc_raliq_the_drunkAI(creature); } struct npc_raliq_the_drunkAI : public ScriptedAI @@ -157,7 +157,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_salsalabimAI (creature); + return new npc_salsalabimAI(creature); } struct npc_salsalabimAI : public ScriptedAI @@ -527,7 +527,7 @@ public: if (creature->IsQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); - if (!player->hasQuest(10211)) + if (player->GetQuestStatus(10211) != QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(9243, creature->GetGUID()); diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 34763d8946c..2cf82cce4d1 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_unkor_the_ruthlessAI (creature); + return new npc_unkor_the_ruthlessAI(creature); } struct npc_unkor_the_ruthlessAI : public ScriptedAI @@ -170,7 +170,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_infested_root_walkerAI (creature); + return new npc_infested_root_walkerAI(creature); } struct npc_infested_root_walkerAI : public ScriptedAI @@ -257,7 +257,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_rotting_forest_ragerAI (creature); + return new npc_rotting_forest_ragerAI(creature); } struct npc_rotting_forest_ragerAI : public ScriptedAI @@ -300,7 +300,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_netherweb_victimAI (creature); + return new npc_netherweb_victimAI(creature); } struct npc_netherweb_victimAI : public ScriptedAI @@ -390,7 +390,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_floonAI (creature); + return new npc_floonAI(creature); } struct npc_floonAI : public ScriptedAI diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index 8bacc778f4b..be938582d9c 100644 --- a/src/server/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -209,7 +209,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_cooshcooshAI (creature); + return new npc_cooshcooshAI(creature); } bool OnGossipHello(Player* player, Creature* creature) OVERRIDE diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 0399134fddb..e1305d71b73 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -32,28 +32,35 @@ enum DeathKnightSpells SPELL_DK_BLACK_ICE_R1 = 49140, SPELL_DK_BLOOD_BOIL_TRIGGERED = 65658, SPELL_DK_BLOOD_GORGED_HEAL = 50454, + SPELL_DK_BLOOD_PRESENCE = 48266, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999, SPELL_DK_CORPSE_EXPLOSION_VISUAL = 51270, SPELL_DK_DEATH_COIL_DAMAGE = 47632, SPELL_DK_DEATH_COIL_HEAL = 47633, SPELL_DK_DEATH_STRIKE_HEAL = 45470, + SPELL_DK_FROST_PRESENCE = 48263, + SPELL_DK_FROST_PRESENCE_TRIGGERED = 61261, SPELL_DK_GHOUL_EXPLODE = 47496, SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE = 58625, - SPELL_DK_RUNIC_POWER_ENERGIZE = 49088, - SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, - SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, - SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284, - SPELL_DK_BLOOD_PRESENCE = 48266, + SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1 = 50365, + SPELL_DK_IMPROVED_FROST_PRESENCE_R1 = 50384, + SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1 = 50391, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, - SPELL_DK_UNHOLY_PRESENCE = 48265, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962, SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736, + SPELL_DK_RUNIC_POWER_ENERGIZE = 49088, + SPELL_DK_SCENT_OF_BLOOD = 50422, + SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, + SPELL_DK_UNHOLY_PRESENCE = 48265, + SPELL_DK_UNHOLY_PRESENCE_TRIGGERED = 49772, + SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, + SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284 }; enum DeathKnightSpellIcons { - DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751, + DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751 }; // 50462 - Anti-Magic Shell (on raid member) @@ -687,7 +694,7 @@ class spell_dk_icebound_fortitude : public SpellScriptLoader } }; -// 50365, 50371 - Improved Blood Presence +// -50365 - Improved Blood Presence class spell_dk_improved_blood_presence : public SpellScriptLoader { public: @@ -699,7 +706,10 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) return false; return true; } @@ -707,11 +717,8 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE) && !target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) - { - int32 basePoints1 = aurEff->GetAmount(); - target->CastCustomSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, 0, aurEff); - } + if ((target->HasAura(SPELL_DK_FROST_PRESENCE) || target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) && !target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT1, aurEff->GetAmount(), target, true, NULL, aurEff); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -734,7 +741,54 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader } }; -// 50391, 50392 - Improved Unholy Presence +// -50384 - Improved Frost Presence +class spell_dk_improved_frost_presence : public SpellScriptLoader +{ + public: + spell_dk_improved_frost_presence() : SpellScriptLoader("spell_dk_improved_frost_presence") { } + + class spell_dk_improved_frost_presence_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_improved_frost_presence_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE_TRIGGERED)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if ((target->HasAura(SPELL_DK_BLOOD_PRESENCE) || target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) && !target->HasAura(SPELL_DK_FROST_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_FROST_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff); + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target->HasAura(SPELL_DK_FROST_PRESENCE)) + target->RemoveAura(SPELL_DK_FROST_PRESENCE_TRIGGERED); + } + + void Register() OVERRIDE + { + AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_frost_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_frost_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_dk_improved_frost_presence_AuraScript(); + } +}; + +// -50391 - Improved Unholy Presence class spell_dk_improved_unholy_presence : public SpellScriptLoader { public: @@ -746,7 +800,11 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) return false; return true; } @@ -757,14 +815,22 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader if (target->HasAura(SPELL_DK_UNHOLY_PRESENCE) && !target->HasAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) { // Not listed as any effect, only base points set in dbc - int32 basePoints0 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0, &basePoints0, &basePoints0, true, 0, aurEff); + int32 basePoints = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints, &basePoints, &basePoints, true, NULL, aurEff); } + + if ((target->HasAura(SPELL_DK_BLOOD_PRESENCE) || target->HasAura(SPELL_DK_FROST_PRESENCE)) && !target->HasAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + Unit* target = GetTarget(); + + target->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + + if (!target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) + target->RemoveAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED); } void Register() OVERRIDE @@ -780,6 +846,101 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader } }; +// 48266 - Blood Presence +// 48263 - Frost Presence +// 48265 - Unholy Presence +class spell_dk_presence : public SpellScriptLoader +{ + public: + spell_dk_presence() : SpellScriptLoader("spell_dk_presence") { } + + class spell_dk_presence_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_presence_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_FROST_PRESENCE_R1) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) + return false; + + return true; + } + + void HandleImprovedBloodPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + + if (GetSpellInfo()->Id == SPELL_DK_BLOOD_PRESENCE) + target->CastSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, true); + else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1, EFFECT_0)) + if (!target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT1, impAurEff->GetAmount(), target, true, NULL, aurEff); + } + + void HandleImprovedFrostPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + + if (GetSpellInfo()->Id == SPELL_DK_FROST_PRESENCE) + target->CastSpell(target, SPELL_DK_FROST_PRESENCE_TRIGGERED, true); + else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_R1, EFFECT_0)) + if (!target->HasAura(SPELL_DK_FROST_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_FROST_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, impAurEff->GetAmount(), target, true, NULL, aurEff); + } + + void HandleImprovedUnholyPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + + if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE) + target->CastSpell(target, SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, true); + + if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0)) + { + if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE) + { + // Not listed as any effect, only base points set + int32 bp = impAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &bp, &bp, &bp, true, NULL, aurEff); + } + else if (!target->HasAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, impAurEff->GetAmount(), target, true, NULL, aurEff); + } + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED); + target->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + target->RemoveAura(SPELL_DK_FROST_PRESENCE_TRIGGERED); + target->RemoveAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED); + } + + void Register() OVERRIDE + { + AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleImprovedBloodPresence, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL); + AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleImprovedFrostPresence, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL); + AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleImprovedUnholyPresence, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_dk_presence_AuraScript(); + } +}; + // 59754 Rune Tap - Party class spell_dk_rune_tap_party : public SpellScriptLoader { @@ -807,6 +968,42 @@ class spell_dk_rune_tap_party : public SpellScriptLoader } }; +// 50421 - Scent of Blood +class spell_dk_scent_of_blood : public SpellScriptLoader +{ + public: + spell_dk_scent_of_blood() : SpellScriptLoader("spell_dk_scent_of_blood") { } + + class spell_dk_scent_of_blood_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_scent_of_blood_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCENT_OF_BLOOD)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, NULL, aurEff); + GetTarget()->RemoveAuraFromStack(GetSpellInfo()->Id); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_dk_scent_of_blood_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_dk_scent_of_blood_AuraScript(); + } +}; + // 55090 - Scourge Strike (55265, 55270, 55271) class spell_dk_scourge_strike : public SpellScriptLoader { @@ -953,11 +1150,15 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) OVERRIDE { + SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1); + if (!firstRankSpellInfo) + return false; + // can't use other spell than will of the necropolis due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id)) + if (!spellInfo->IsRankOf(firstRankSpellInfo)) return false; - uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id); + uint8 rank = spellInfo->GetRank(); if (!sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true)) return false; @@ -981,7 +1182,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { // min pct of hp is stored in effect 0 of talent spell - uint32 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + uint8 rank = GetSpellInfo()->GetRank(); SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage()); @@ -1021,8 +1222,11 @@ void AddSC_deathknight_spell_scripts() new spell_dk_ghoul_explode(); new spell_dk_icebound_fortitude(); new spell_dk_improved_blood_presence(); + new spell_dk_improved_frost_presence(); new spell_dk_improved_unholy_presence(); + new spell_dk_presence(); new spell_dk_rune_tap_party(); + new spell_dk_scent_of_blood(); new spell_dk_scourge_strike(); new spell_dk_spell_deflection(); new spell_dk_vampiric_blood(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 40b33c13a40..61966ef8a8e 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -75,7 +75,7 @@ class spell_dru_dash : public SpellScriptLoader } }; -// -5229 - Enrage +// 5229 - Enrage class spell_dru_enrage : public SpellScriptLoader { public: @@ -85,6 +85,14 @@ class spell_dru_enrage : public SpellScriptLoader { PrepareSpellScript(spell_dru_enrage_SpellScript); + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_KING_OF_THE_JUNGLE) + || !sSpellMgr->GetSpellInfo(SPELL_DRUID_ENRAGE_MOD_DAMAGE)) + return false; + return true; + } + void OnHit() { if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_0)) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index e1928060100..2e6594714c9 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -62,7 +62,7 @@ class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader void Register() OVERRIDE { - OnEffectAbsorb += AuraEffectAbsorbFn(spell_gen_absorb0_hitlimit1_AuraScript::Absorb, EFFECT_0); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_gen_absorb0_hitlimit1_AuraScript::Absorb, EFFECT_0); } }; @@ -163,962 +163,566 @@ class spell_gen_adaptive_warding : public SpellScriptLoader } }; -// 41337 Aura of Anger -class spell_gen_aura_of_anger : public SpellScriptLoader -{ - public: - spell_gen_aura_of_anger() : SpellScriptLoader("spell_gen_aura_of_anger") { } - - class spell_gen_aura_of_anger_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_aura_of_anger_AuraScript); - - void HandleEffectPeriodicUpdate(AuraEffect* aurEff) - { - if (AuraEffect* aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1)) - aurEff1->ChangeAmount(aurEff1->GetAmount() + 5); - aurEff->SetAmount(100 * aurEff->GetTickNumber()); - } - - void Register() OVERRIDE - { - OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_aura_of_anger_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); - } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_gen_aura_of_anger_AuraScript(); - } -}; - -class spell_gen_av_drekthar_presence : public SpellScriptLoader -{ - public: - spell_gen_av_drekthar_presence() : SpellScriptLoader("spell_gen_av_drekthar_presence") { } - - class spell_gen_av_drekthar_presence_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_av_drekthar_presence_AuraScript); - - bool CheckAreaTarget(Unit* target) - { - switch (target->GetEntry()) - { - // alliance - case 14762: // Dun Baldar North Marshal - case 14763: // Dun Baldar South Marshal - case 14764: // Icewing Marshal - case 14765: // Stonehearth Marshal - case 11948: // Vandar Stormspike - // horde - case 14772: // East Frostwolf Warmaster - case 14776: // Tower Point Warmaster - case 14773: // Iceblood Warmaster - case 14777: // West Frostwolf Warmaster - case 11946: // Drek'thar - return true; - default: - return false; - break; - } - } - void Register() OVERRIDE - { - DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_gen_av_drekthar_presence_AuraScript::CheckAreaTarget); - } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_gen_av_drekthar_presence_AuraScript(); - } -}; - -// 46394 Brutallus Burn -class spell_gen_burn_brutallus : public SpellScriptLoader +class spell_gen_allow_cast_from_item_only : public SpellScriptLoader { public: - spell_gen_burn_brutallus() : SpellScriptLoader("spell_gen_burn_brutallus") { } + spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } - class spell_gen_burn_brutallus_AuraScript : public AuraScript + class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_burn_brutallus_AuraScript); + PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); - void HandleEffectPeriodicUpdate(AuraEffect* aurEff) + SpellCastResult CheckRequirement() { - if (aurEff->GetTickNumber() % 11 == 0) - aurEff->SetAmount(aurEff->GetAmount() * 2); + if (!GetCastItem()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + return SPELL_CAST_OK; } void Register() OVERRIDE { - OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_burn_brutallus_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); } }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_burn_brutallus_AuraScript(); + return new spell_gen_allow_cast_from_item_only_SpellScript(); } }; -enum CannibalizeSpells +enum AnimalBloodPoolSpell { - SPELL_CANNIBALIZE_TRIGGERED = 20578, + SPELL_ANIMAL_BLOOD = 46221, + SPELL_SPAWN_BLOOD_POOL = 63471 }; -class spell_gen_cannibalize : public SpellScriptLoader +class spell_gen_animal_blood : public SpellScriptLoader { public: - spell_gen_cannibalize() : SpellScriptLoader("spell_gen_cannibalize") { } + spell_gen_animal_blood() : SpellScriptLoader("spell_gen_animal_blood") { } - class spell_gen_cannibalize_SpellScript : public SpellScript + class spell_gen_animal_blood_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_cannibalize_SpellScript); + PrepareAuraScript(spell_gen_animal_blood_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_CANNIBALIZE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_SPAWN_BLOOD_POOL)) return false; return true; } - SpellCastResult CheckIfCorpseNear() + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* caster = GetCaster(); - float max_range = GetSpellInfo()->GetMaxRange(false); - WorldObject* result = NULL; - // search for nearby enemy corpse in range - Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); - Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check); - caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); - if (!result) - return SPELL_FAILED_NO_EDIBLE_CORPSES; - return SPELL_CAST_OK; + // Remove all auras with spell id 46221, except the one currently being applied + while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura())) + GetUnitOwner()->RemoveOwnedAura(aur); } - void HandleDummy(SpellEffIndex /*effIndex*/) + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* caster = GetCaster(); - caster->CastSpell(caster, SPELL_CANNIBALIZE_TRIGGERED, false); + if (Unit* owner = GetUnitOwner()) + if (owner->IsInWater()) + owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_gen_cannibalize_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnCheckCast += SpellCheckCastFn(spell_gen_cannibalize_SpellScript::CheckIfCorpseNear); + AfterEffectApply += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_cannibalize_SpellScript(); + return new spell_gen_animal_blood_AuraScript(); } }; -// 63845 - Create Lance -enum CreateLanceSpells -{ - SPELL_CREATE_LANCE_ALLIANCE = 63914, - SPELL_CREATE_LANCE_HORDE = 63919 -}; - -class spell_gen_create_lance : public SpellScriptLoader +// 41337 Aura of Anger +class spell_gen_aura_of_anger : public SpellScriptLoader { public: - spell_gen_create_lance() : SpellScriptLoader("spell_gen_create_lance") { } + spell_gen_aura_of_anger() : SpellScriptLoader("spell_gen_aura_of_anger") { } - class spell_gen_create_lance_SpellScript : public SpellScript + class spell_gen_aura_of_anger_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_create_lance_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_ALLIANCE) || !sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_HORDE)) - return false; - return true; - } + PrepareAuraScript(spell_gen_aura_of_anger_AuraScript); - void HandleScript(SpellEffIndex effIndex) + void HandleEffectPeriodicUpdate(AuraEffect* aurEff) { - PreventHitDefaultEffect(effIndex); - - if (Player* target = GetHitPlayer()) - { - if (target->GetTeam() == ALLIANCE) - GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_ALLIANCE, true); - else - GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_HORDE, true); - } + if (AuraEffect* aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1)) + aurEff1->ChangeAmount(aurEff1->GetAmount() + 5); + aurEff->SetAmount(100 * aurEff->GetTickNumber()); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_create_lance_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_aura_of_anger_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_create_lance_SpellScript(); + return new spell_gen_aura_of_anger_AuraScript(); } }; -// 28702 - Netherbloom -enum Netherbloom +enum ServiceUniform { - SPELL_NETHERBLOOM_POLLEN_1 = 28703 + // Spells + SPELL_SERVICE_UNIFORM = 71450, + + // Models + MODEL_GOBLIN_MALE = 31002, + MODEL_GOBLIN_FEMALE = 31003 }; -class spell_gen_netherbloom : public SpellScriptLoader +class spell_gen_aura_service_uniform : public SpellScriptLoader { public: - spell_gen_netherbloom() : SpellScriptLoader("spell_gen_netherbloom") { } + spell_gen_aura_service_uniform() : SpellScriptLoader("spell_gen_aura_service_uniform") { } - class spell_gen_netherbloom_SpellScript : public SpellScript + class spell_gen_aura_service_uniform_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_netherbloom_SpellScript); + PrepareAuraScript(spell_gen_aura_service_uniform_AuraScript); bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - for (uint8 i = 0; i < 5; ++i) - if (!sSpellMgr->GetSpellInfo(SPELL_NETHERBLOOM_POLLEN_1 + i)) - return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SERVICE_UNIFORM)) + return false; return true; } - void HandleScript(SpellEffIndex effIndex) + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - PreventHitDefaultEffect(effIndex); - - if (Unit* target = GetHitUnit()) + // Apply model goblin + Unit* target = GetTarget(); + if (target->GetTypeId() == TYPEID_PLAYER) { - // 25% chance of casting a random buff - if (roll_chance_i(75)) - return; - - // triggered spells are 28703 to 28707 - // Note: some sources say, that there was the possibility of - // receiving a debuff. However, this seems to be removed by a patch. - - // don't overwrite an existing aura - for (uint8 i = 0; i < 5; ++i) - if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i)) - return; - - target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true); + if (target->getGender() == GENDER_MALE) + target->SetDisplayId(MODEL_GOBLIN_MALE); + else + target->SetDisplayId(MODEL_GOBLIN_FEMALE); } } - void Register() OVERRIDE - { - OnEffectHitTarget += SpellEffectFn(spell_gen_netherbloom_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const OVERRIDE - { - return new spell_gen_netherbloom_SpellScript(); - } -}; - -// 28720 - Nightmare Vine -enum NightmareVine -{ - SPELL_NIGHTMARE_POLLEN = 28721 -}; - -class spell_gen_nightmare_vine : public SpellScriptLoader -{ - public: - spell_gen_nightmare_vine() : SpellScriptLoader("spell_gen_nightmare_vine") { } - - class spell_gen_nightmare_vine_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_nightmare_vine_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_NIGHTMARE_POLLEN)) - return false; - return true; - } - - void HandleScript(SpellEffIndex effIndex) + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - PreventHitDefaultEffect(effIndex); - - if (Unit* target = GetHitUnit()) - { - // 25% chance of casting Nightmare Pollen - if (roll_chance_i(25)) - target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true); - } + Unit* target = GetTarget(); + if (target->GetTypeId() == TYPEID_PLAYER) + target->RestoreDisplayId(); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_nightmare_vine_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + AfterEffectApply += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_nightmare_vine_SpellScript(); + return new spell_gen_aura_service_uniform_AuraScript(); } }; -// 27539 - Obsidian Armor -enum ObsidianArmor -{ - SPELL_GEN_OBSIDIAN_ARMOR_HOLY = 27536, - SPELL_GEN_OBSIDIAN_ARMOR_FIRE = 27533, - SPELL_GEN_OBSIDIAN_ARMOR_NATURE = 27538, - SPELL_GEN_OBSIDIAN_ARMOR_FROST = 27534, - SPELL_GEN_OBSIDIAN_ARMOR_SHADOW = 27535, - SPELL_GEN_OBSIDIAN_ARMOR_ARCANE = 27540 -}; - -class spell_gen_obsidian_armor : public SpellScriptLoader +class spell_gen_av_drekthar_presence : public SpellScriptLoader { public: - spell_gen_obsidian_armor() : SpellScriptLoader("spell_gen_obsidian_armor") { } + spell_gen_av_drekthar_presence() : SpellScriptLoader("spell_gen_av_drekthar_presence") { } - class spell_gen_obsidian_armor_AuraScript : public AuraScript + class spell_gen_av_drekthar_presence_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_obsidian_armor_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_HOLY) || - !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FIRE) || - !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_NATURE) || - !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FROST) || - !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_SHADOW) || - !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_ARCANE)) - return false; - return true; - } - - bool CheckProc(ProcEventInfo& eventInfo) - { - if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() - return false; - - if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL) - return false; - - return true; - } + PrepareAuraScript(spell_gen_av_drekthar_presence_AuraScript); - void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + bool CheckAreaTarget(Unit* target) { - PreventDefaultAction(); - - uint32 spellId = 0; - switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask())) + switch (target->GetEntry()) { - case SPELL_SCHOOL_HOLY: - spellId = SPELL_GEN_OBSIDIAN_ARMOR_HOLY; - break; - case SPELL_SCHOOL_FIRE: - spellId = SPELL_GEN_OBSIDIAN_ARMOR_FIRE; - break; - case SPELL_SCHOOL_NATURE: - spellId = SPELL_GEN_OBSIDIAN_ARMOR_NATURE; - break; - case SPELL_SCHOOL_FROST: - spellId = SPELL_GEN_OBSIDIAN_ARMOR_FROST; - break; - case SPELL_SCHOOL_SHADOW: - spellId = SPELL_GEN_OBSIDIAN_ARMOR_SHADOW; - break; - case SPELL_SCHOOL_ARCANE: - spellId = SPELL_GEN_OBSIDIAN_ARMOR_ARCANE; - break; + // alliance + case 14762: // Dun Baldar North Marshal + case 14763: // Dun Baldar South Marshal + case 14764: // Icewing Marshal + case 14765: // Stonehearth Marshal + case 11948: // Vandar Stormspike + // horde + case 14772: // East Frostwolf Warmaster + case 14776: // Tower Point Warmaster + case 14773: // Iceblood Warmaster + case 14777: // West Frostwolf Warmaster + case 11946: // Drek'thar + return true; default: - return; + return false; } - GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); } void Register() OVERRIDE { - DoCheckProc += AuraCheckProcFn(spell_gen_obsidian_armor_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_gen_obsidian_armor_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_gen_av_drekthar_presence_AuraScript::CheckAreaTarget); } }; AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_obsidian_armor_AuraScript(); + return new spell_gen_av_drekthar_presence_AuraScript(); } }; -// 45472 Parachute -enum ParachuteSpells +enum GenericBandage { - SPELL_PARACHUTE = 45472, - SPELL_PARACHUTE_BUFF = 44795, + SPELL_RECENTLY_BANDAGED = 11196 }; -class spell_gen_parachute : public SpellScriptLoader +class spell_gen_bandage : public SpellScriptLoader { public: - spell_gen_parachute() : SpellScriptLoader("spell_gen_parachute") { } + spell_gen_bandage() : SpellScriptLoader("spell_gen_bandage") { } - class spell_gen_parachute_AuraScript : public AuraScript + class spell_gen_bandage_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_parachute_AuraScript); + PrepareSpellScript(spell_gen_bandage_SpellScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED)) return false; return true; } - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - if (Player* target = GetTarget()->ToPlayer()) - if (target->IsFalling()) - { - target->RemoveAurasDueToSpell(SPELL_PARACHUTE); - target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); - } - } - - void Register() OVERRIDE - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_gen_parachute_AuraScript(); - } -}; - -enum NPCEntries -{ - NPC_DOOMGUARD = 11859, - NPC_INFERNAL = 89, - NPC_IMP = 416, -}; - -class spell_gen_pet_summoned : public SpellScriptLoader -{ - public: - spell_gen_pet_summoned() : SpellScriptLoader("spell_gen_pet_summoned") { } - - class spell_gen_pet_summoned_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_pet_summoned_SpellScript); - - bool Load() OVERRIDE - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - void HandleScript(SpellEffIndex /*effIndex*/) + SpellCastResult CheckCast() { - Player* player = GetCaster()->ToPlayer(); - if (player->GetLastPetNumber()) + if (Unit* target = GetExplTargetUnit()) { - PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; - if (Pet* newPet = new Pet(player, newPetType)) - { - if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true)) - { - // revive the pet if it is dead - if (newPet->getDeathState() == DEAD) - newPet->setDeathState(ALIVE); - - newPet->SetFullHealth(); - newPet->SetPower(newPet->getPowerType(), newPet->GetMaxPower(newPet->getPowerType())); - - switch (newPet->GetEntry()) - { - case NPC_DOOMGUARD: - case NPC_INFERNAL: - newPet->SetEntry(NPC_IMP); - break; - default: - break; - } - } - else - delete newPet; - } + if (target->HasAura(SPELL_RECENTLY_BANDAGED)) + return SPELL_FAILED_TARGET_AURASTATE; } + return SPELL_CAST_OK; } - void Register() OVERRIDE - { - OnEffectHitTarget += SpellEffectFn(spell_gen_pet_summoned_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const OVERRIDE - { - return new spell_gen_pet_summoned_SpellScript(); - } -}; - -class spell_gen_remove_flight_auras : public SpellScriptLoader -{ - public: - spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") {} - - class spell_gen_remove_flight_auras_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) + void HandleScript() { if (Unit* target = GetHitUnit()) - { - target->RemoveAurasByType(SPELL_AURA_FLY); - target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); - } + GetCaster()->CastSpell(target, SPELL_RECENTLY_BANDAGED, true); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + OnCheckCast += SpellCheckCastFn(spell_gen_bandage_SpellScript::CheckCast); + AfterHit += SpellHitFn(spell_gen_bandage_SpellScript::HandleScript); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_remove_flight_auras_SpellScript(); + return new spell_gen_bandage_SpellScript(); } }; -enum EluneCandle +enum Bonked { - NPC_OMEN = 15467, - - SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622, - SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624, - SPELL_ELUNE_CANDLE_OMEN_HAND_R = 26625, - SPELL_ELUNE_CANDLE_OMEN_HAND_L = 26649, - SPELL_ELUNE_CANDLE_NORMAL = 26636, + SPELL_BONKED = 62991, + SPELL_FOAM_SWORD_DEFEAT = 62994, + SPELL_ON_GUARD = 62972 }; -class spell_gen_elune_candle : public SpellScriptLoader +class spell_gen_bonked : public SpellScriptLoader { public: - spell_gen_elune_candle() : SpellScriptLoader("spell_gen_elune_candle") {} + spell_gen_bonked() : SpellScriptLoader("spell_gen_bonked") { } - class spell_gen_elune_candle_SpellScript : public SpellScript + class spell_gen_bonked_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_elune_candle_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL)) - return false; - return true; - } + PrepareSpellScript(spell_gen_bonked_SpellScript); void HandleScript(SpellEffIndex /*effIndex*/) { - uint32 spellId = 0; - - if (GetHitUnit()->GetEntry() == NPC_OMEN) + if (Player* target = GetHitPlayer()) { - switch (urand(0, 3)) + Aura const* aura = GetHitAura(); + if (!(aura && aura->GetStackAmount() == 3)) + return; + + target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true); + target->RemoveAurasDueToSpell(SPELL_BONKED); + + if (Aura const* aura = target->GetAura(SPELL_ON_GUARD)) { - case 0: spellId = SPELL_ELUNE_CANDLE_OMEN_HEAD; break; - case 1: spellId = SPELL_ELUNE_CANDLE_OMEN_CHEST; break; - case 2: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_R; break; - case 3: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_L; break; + if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID())) + target->DestroyItemCount(item->GetEntry(), 1, true); } } - else - spellId = SPELL_ELUNE_CANDLE_NORMAL; - - GetCaster()->CastSpell(GetHitUnit(), spellId, true, NULL); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_elune_candle_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_gen_bonked_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_elune_candle_SpellScript(); + return new spell_gen_bonked_SpellScript(); } }; -class spell_creature_permanent_feign_death : public SpellScriptLoader -{ - public: - spell_creature_permanent_feign_death() : SpellScriptLoader("spell_creature_permanent_feign_death") { } - - class spell_creature_permanent_feign_death_AuraScript : public AuraScript - { - PrepareAuraScript(spell_creature_permanent_feign_death_AuraScript); - - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); - - if (target->GetTypeId() == TYPEID_UNIT) - target->ToCreature()->SetReactState(REACT_PASSIVE); - } +/* DOCUMENTATION: Break-Shield spells + Break-Shield spells can be classified in three groups: - void Register() OVERRIDE - { - OnEffectApply += AuraEffectApplyFn(spell_creature_permanent_feign_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; + - Spells on vehicle bar used by players: + + EFFECT_0: SCRIPT_EFFECT + + EFFECT_1: NONE + + EFFECT_2: NONE + - Spells casted by players triggered by script: + + EFFECT_0: SCHOOL_DAMAGE + + EFFECT_1: SCRIPT_EFFECT + + EFFECT_2: FORCE_CAST + - Spells casted by NPCs on players: + + EFFECT_0: SCHOOL_DAMAGE + + EFFECT_1: SCRIPT_EFFECT + + EFFECT_2: NONE - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_creature_permanent_feign_death_AuraScript(); - } -}; + In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1. + - When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case + and we'll trigger "Spells casted by players triggered by script" + - When handling EFFECT_1 we're in the "Spells casted by players triggered by script" + or "Spells casted by NPCs on players" so we'll search for the first defend layer and drop it. +*/ -enum PvPTrinketTriggeredSpells +enum BreakShieldSpells { - SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER = 72752, - SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF = 72757, + SPELL_BREAK_SHIELD_DAMAGE_2K = 62626, + SPELL_BREAK_SHIELD_DAMAGE_10K = 64590, + + SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS = 62575, // Also on ToC5 mounts + SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE = 64595, + SPELL_BREAK_SHIELD_TRIGGER_UNK = 66480 }; -class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader +class spell_gen_break_shield: public SpellScriptLoader { public: - spell_pvp_trinket_wotf_shared_cd() : SpellScriptLoader("spell_pvp_trinket_wotf_shared_cd") {} + spell_gen_break_shield(const char* name) : SpellScriptLoader(name) { } - class spell_pvp_trinket_wotf_shared_cd_SpellScript : public SpellScript + class spell_gen_break_shield_SpellScript : public SpellScript { - PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript); + PrepareSpellScript(spell_gen_break_shield_SpellScript) - bool Load() OVERRIDE + void HandleScriptEffect(SpellEffIndex effIndex) { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } + Unit* target = GetHitUnit(); - bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) - return false; - return true; - } + switch (effIndex) + { + case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual) + { + uint32 spellId; - void HandleScript() - { - // This is only needed because spells cast from spell_linked_spell are triggered by default - // Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD - GetCaster()->ToPlayer()->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell()); + switch (GetSpellInfo()->Id) + { + case SPELL_BREAK_SHIELD_TRIGGER_UNK: + case SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE: + spellId = SPELL_BREAK_SHIELD_DAMAGE_10K; + break; + case SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS: + spellId = SPELL_BREAK_SHIELD_DAMAGE_2K; + break; + default: + return; + } + + if (Unit* rider = GetCaster()->GetCharmer()) + rider->CastSpell(target, spellId, false); + else + GetCaster()->CastSpell(target, spellId, false); + break; + } + case EFFECT_1: // On damaging spells, for removing a defend layer + { + Unit::AuraApplicationMap const& auras = target->GetAppliedAuras(); + for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + if (Aura* aura = itr->second->GetBase()) + { + SpellInfo const* auraInfo = aura->GetSpellInfo(); + if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)) + { + aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); + // Remove dummys from rider (Necessary for updating visual shields) + if (Unit* rider = target->GetCharmer()) + if (Aura* defend = rider->GetAura(aura->GetId())) + defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); + break; + } + } + } + break; + } + default: + break; + } } void Register() OVERRIDE { - AfterCast += SpellCastFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript); + OnEffectHitTarget += SpellEffectFn(spell_gen_break_shield_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_pvp_trinket_wotf_shared_cd_SpellScript(); + return new spell_gen_break_shield_SpellScript(); } }; -enum AnimalBloodPoolSpell -{ - SPELL_ANIMAL_BLOOD = 46221, - SPELL_SPAWN_BLOOD_POOL = 63471, -}; - -class spell_gen_animal_blood : public SpellScriptLoader +// 46394 Brutallus Burn +class spell_gen_burn_brutallus : public SpellScriptLoader { public: - spell_gen_animal_blood() : SpellScriptLoader("spell_gen_animal_blood") { } + spell_gen_burn_brutallus() : SpellScriptLoader("spell_gen_burn_brutallus") { } - class spell_gen_animal_blood_AuraScript : public AuraScript + class spell_gen_burn_brutallus_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_animal_blood_AuraScript); - - bool Validate(SpellInfo const* /*spell*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_SPAWN_BLOOD_POOL)) - return false; - return true; - } - - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - // Remove all auras with spell id 46221, except the one currently being applied - while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura())) - GetUnitOwner()->RemoveOwnedAura(aur); - } + PrepareAuraScript(spell_gen_burn_brutallus_AuraScript); - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleEffectPeriodicUpdate(AuraEffect* aurEff) { - if (Unit* owner = GetUnitOwner()) - if (owner->IsInWater()) - owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true); + if (aurEff->GetTickNumber() % 11 == 0) + aurEff->SetAmount(aurEff->GetAmount() * 2); } void Register() OVERRIDE { - AfterEffectApply += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_burn_brutallus_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); } }; AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_animal_blood_AuraScript(); + return new spell_gen_burn_brutallus_AuraScript(); } }; -enum DivineStormSpell +enum CannibalizeSpells { - SPELL_DIVINE_STORM = 53385, + SPELL_CANNIBALIZE_TRIGGERED = 20578 }; -// 70769 Divine Storm! -class spell_gen_divine_storm_cd_reset : public SpellScriptLoader +class spell_gen_cannibalize : public SpellScriptLoader { public: - spell_gen_divine_storm_cd_reset() : SpellScriptLoader("spell_gen_divine_storm_cd_reset") {} + spell_gen_cannibalize() : SpellScriptLoader("spell_gen_cannibalize") { } - class spell_gen_divine_storm_cd_reset_SpellScript : public SpellScript + class spell_gen_cannibalize_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript); - - bool Load() OVERRIDE - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } + PrepareSpellScript(spell_gen_cannibalize_SpellScript); bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM)) + if (!sSpellMgr->GetSpellInfo(SPELL_CANNIBALIZE_TRIGGERED)) return false; return true; } - void HandleScript(SpellEffIndex /*effIndex*/) - { - Player* caster = GetCaster()->ToPlayer(); - if (caster->HasSpellCooldown(SPELL_DIVINE_STORM)) - caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true); - } - - void Register() OVERRIDE - { - OnEffectHitTarget += SpellEffectFn(spell_gen_divine_storm_cd_reset_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const OVERRIDE - { - return new spell_gen_divine_storm_cd_reset_SpellScript(); - } -}; - -class spell_gen_gunship_portal : public SpellScriptLoader -{ - public: - spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { } - - class spell_gen_gunship_portal_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_gunship_portal_SpellScript); - - bool Load() OVERRIDE + SpellCastResult CheckIfCorpseNear() { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; + Unit* caster = GetCaster(); + float max_range = GetSpellInfo()->GetMaxRange(false); + WorldObject* result = NULL; + // search for nearby enemy corpse in range + Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); + Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check); + caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); + if (!result) + return SPELL_FAILED_NO_EDIBLE_CORPSES; + return SPELL_CAST_OK; } - void HandleScript(SpellEffIndex /*effIndex*/) + void HandleDummy(SpellEffIndex /*effIndex*/) { - Player* caster = GetCaster()->ToPlayer(); - if (Battleground* bg = caster->GetBattleground()) - if (bg->GetTypeID(true) == BATTLEGROUND_IC) - bg->DoAction(1, caster->GetGUID()); + GetCaster()->CastSpell(GetCaster(), SPELL_CANNIBALIZE_TRIGGERED, false); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHit += SpellEffectFn(spell_gen_cannibalize_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_gen_cannibalize_SpellScript::CheckIfCorpseNear); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_gunship_portal_SpellScript(); + return new spell_gen_cannibalize_SpellScript(); } }; -enum parachuteIC -{ - SPELL_PARACHUTE_IC = 66657, -}; - -class spell_gen_parachute_ic : public SpellScriptLoader +enum ChaosBlast { - public: - spell_gen_parachute_ic() : SpellScriptLoader("spell_gen_parachute_ic") { } - - class spell_gen_parachute_ic_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_parachute_ic_AuraScript) - - void HandleTriggerSpell(AuraEffect const* /*aurEff*/) - { - if (Player* target = GetTarget()->ToPlayer()) - if (target->m_movementInfo.fallTime > 2000) - target->CastSpell(target, SPELL_PARACHUTE_IC, true); - } - - void Register() OVERRIDE - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_gen_parachute_ic_AuraScript(); - } + SPELL_CHAOS_BLAST = 37675 }; -class spell_gen_dungeon_credit : public SpellScriptLoader +class spell_gen_chaos_blast : public SpellScriptLoader { public: - spell_gen_dungeon_credit() : SpellScriptLoader("spell_gen_dungeon_credit") { } + spell_gen_chaos_blast() : SpellScriptLoader("spell_gen_chaos_blast") { } - class spell_gen_dungeon_credit_SpellScript : public SpellScript + class spell_gen_chaos_blast_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_dungeon_credit_SpellScript); + PrepareSpellScript(spell_gen_chaos_blast_SpellScript) - bool Load() OVERRIDE + bool Validate(SpellInfo const* /*SpellEntry*/) OVERRIDE { - _handled = false; - return GetCaster()->GetTypeId() == TYPEID_UNIT; + if (!sSpellMgr->GetSpellInfo(SPELL_CHAOS_BLAST)) + return false; + return true; } - - void CreditEncounter() + void HandleDummy(SpellEffIndex /* effIndex */) { - // This hook is executed for every target, make sure we only credit instance once - if (_handled) - return; - - _handled = true; + int32 basepoints0 = 100; Unit* caster = GetCaster(); - if (InstanceScript* instance = caster->GetInstanceScript()) - instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, caster); - } - - void Register() OVERRIDE - { - AfterHit += SpellHitFn(spell_gen_dungeon_credit_SpellScript::CreditEncounter); - } - - bool _handled; - }; - - SpellScript* GetSpellScript() const OVERRIDE - { - return new spell_gen_dungeon_credit_SpellScript(); - } -}; - -class spell_gen_profession_research : public SpellScriptLoader -{ - public: - spell_gen_profession_research() : SpellScriptLoader("spell_gen_profession_research") {} - - class spell_gen_profession_research_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_profession_research_SpellScript); - - bool Load() OVERRIDE - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - SpellCastResult CheckRequirement() - { - if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) - { - SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER); - return SPELL_FAILED_CUSTOM_ERROR; - } - - return SPELL_CAST_OK; - } - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Player* caster = GetCaster()->ToPlayer(); - uint32 spellId = GetSpellInfo()->Id; - - // learn random explicit discovery recipe (if any) - if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster)) - caster->learnSpell(discoveredSpellId, false); - - caster->UpdateCraftSkill(spellId); + if (Unit* target = GetHitUnit()) + caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, NULL, NULL, true); } void Register() OVERRIDE { - OnCheckCast += SpellCheckCastFn(spell_gen_profession_research_SpellScript::CheckRequirement); - OnEffectHitTarget += SpellEffectFn(spell_gen_profession_research_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_chaos_blast_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_profession_research_SpellScript(); + return new spell_gen_chaos_blast_SpellScript(); } }; -class spell_generic_clone : public SpellScriptLoader +class spell_gen_clone : public SpellScriptLoader { public: - spell_generic_clone() : SpellScriptLoader("spell_generic_clone") { } + spell_gen_clone() : SpellScriptLoader("spell_gen_clone") { } - class spell_generic_clone_SpellScript : public SpellScript + class spell_gen_clone_SpellScript : public SpellScript { - PrepareSpellScript(spell_generic_clone_SpellScript); + PrepareSpellScript(spell_gen_clone_SpellScript); void HandleScriptEffect(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - uint32 spellId = uint32(GetSpellInfo()->Effects[effIndex].CalcValue()); - GetHitUnit()->CastSpell(GetCaster(), spellId, true); + GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_generic_clone_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); - OnEffectHitTarget += SpellEffectFn(spell_generic_clone_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_clone_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_clone_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_generic_clone_SpellScript(); + return new spell_gen_clone_SpellScript(); } }; @@ -1134,14 +738,14 @@ enum CloneWeaponSpells SPELL_COPY_RANGED_AURA = 57594 }; -class spell_generic_clone_weapon : public SpellScriptLoader +class spell_gen_clone_weapon : public SpellScriptLoader { public: - spell_generic_clone_weapon() : SpellScriptLoader("spell_generic_clone_weapon") { } + spell_gen_clone_weapon() : SpellScriptLoader("spell_gen_clone_weapon") { } - class spell_generic_clone_weapon_SpellScript : public SpellScript + class spell_gen_clone_weapon_SpellScript : public SpellScript { - PrepareSpellScript(spell_generic_clone_weapon_SpellScript); + PrepareSpellScript(spell_gen_clone_weapon_SpellScript); void HandleScriptEffect(SpellEffIndex effIndex) { @@ -1149,22 +753,18 @@ class spell_generic_clone_weapon : public SpellScriptLoader Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) - { - - uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue()); - caster->CastSpell(target, spellId, true); - } + caster->CastSpell(target, GetEffectValue(), true); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_generic_clone_weapon_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_clone_weapon_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_generic_clone_weapon_SpellScript(); + return new spell_gen_clone_weapon_SpellScript(); } }; @@ -1181,8 +781,12 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3_AURA) - || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED_AURA)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) || + !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2_AURA) || + !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3_AURA) || + !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_AURA) || + !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2_AURA) || + !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED_AURA)) return false; return true; } @@ -1191,7 +795,6 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader { Unit* caster = GetCaster(); Unit* target = GetTarget(); - if (!caster) return; @@ -1253,21 +856,15 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader case SPELL_COPY_WEAPON_AURA: case SPELL_COPY_WEAPON_2_AURA: case SPELL_COPY_WEAPON_3_AURA: - { target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, prevItem); break; - } case SPELL_COPY_OFFHAND_AURA: case SPELL_COPY_OFFHAND_2_AURA: - { target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, prevItem); break; - } case SPELL_COPY_RANGED_AURA: - { target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, prevItem); break; - } default: break; } @@ -1287,430 +884,459 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader } }; -enum SeaforiumSpells -{ - SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT = 60937, -}; - -class spell_gen_seaforium_blast : public SpellScriptLoader +class spell_gen_count_pct_from_max_hp : public SpellScriptLoader { public: - spell_gen_seaforium_blast() : SpellScriptLoader("spell_gen_seaforium_blast") {} + spell_gen_count_pct_from_max_hp(char const* name, int32 damagePct = 0) : SpellScriptLoader(name), _damagePct(damagePct) { } - class spell_gen_seaforium_blast_SpellScript : public SpellScript + class spell_gen_count_pct_from_max_hp_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_seaforium_blast_SpellScript); + PrepareSpellScript(spell_gen_count_pct_from_max_hp_SpellScript) - bool Validate(SpellInfo const* /*spell*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT)) - return false; - return true; - } + public: + spell_gen_count_pct_from_max_hp_SpellScript(int32 damagePct) : SpellScript(), _damagePct(damagePct) { } - bool Load() OVERRIDE + void RecalculateDamage() { - // OriginalCaster is always available in Spell::prepare - return GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; - } + if (!_damagePct) + _damagePct = GetHitDamage(); - void AchievementCredit(SpellEffIndex /*effIndex*/) - { - // but in effect handling OriginalCaster can become NULL - if (Unit* originalCaster = GetOriginalCaster()) - if (GameObject* go = GetHitGObj()) - if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING) - originalCaster->CastSpell(originalCaster, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true); + SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct)); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_seaforium_blast_SpellScript::AchievementCredit, EFFECT_1, SPELL_EFFECT_GAMEOBJECT_DAMAGE); + OnHit += SpellHitFn(spell_gen_count_pct_from_max_hp_SpellScript::RecalculateDamage); } + + private: + int32 _damagePct; }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_seaforium_blast_SpellScript(); + return new spell_gen_count_pct_from_max_hp_SpellScript(_damagePct); } + + private: + int32 _damagePct; }; -enum FriendOrFowl +// 63845 - Create Lance +enum CreateLanceSpells { - SPELL_TURKEY_VENGEANCE = 25285, + SPELL_CREATE_LANCE_ALLIANCE = 63914, + SPELL_CREATE_LANCE_HORDE = 63919 }; -class spell_gen_turkey_marker : public SpellScriptLoader +class spell_gen_create_lance : public SpellScriptLoader { public: - spell_gen_turkey_marker() : SpellScriptLoader("spell_gen_turkey_marker") { } + spell_gen_create_lance() : SpellScriptLoader("spell_gen_create_lance") { } - class spell_gen_turkey_marker_AuraScript : public AuraScript + class spell_gen_create_lance_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_turkey_marker_AuraScript); + PrepareSpellScript(spell_gen_create_lance_SpellScript); - void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - // store stack apply times, so we can pop them while they expire - _applyTimes.push_back(getMSTime()); - Unit* target = GetTarget(); - - // on stack 15 cast the achievement crediting spell - if (GetStackAmount() >= 15) - target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID()); + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_ALLIANCE) || + !sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_HORDE)) + return false; + return true; } - void OnPeriodic(AuraEffect const* /*aurEff*/) + void HandleScript(SpellEffIndex effIndex) { - if (_applyTimes.empty()) - return; + PreventHitDefaultEffect(effIndex); - // pop stack if it expired for us - if (_applyTimes.front() + GetMaxDuration() < getMSTime()) - ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE); + if (Player* target = GetHitPlayer()) + { + if (target->GetTeam() == ALLIANCE) + GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_ALLIANCE, true); + else + GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_HORDE, true); + } } void Register() OVERRIDE { - AfterEffectApply += AuraEffectApplyFn(spell_gen_turkey_marker_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_turkey_marker_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_gen_create_lance_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } - - std::list<uint32> _applyTimes; }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_turkey_marker_AuraScript(); + return new spell_gen_create_lance_SpellScript(); } }; -class spell_gen_lifeblood : public SpellScriptLoader +class spell_gen_creature_permanent_feign_death : public SpellScriptLoader { public: - spell_gen_lifeblood() : SpellScriptLoader("spell_gen_lifeblood") { } + spell_gen_creature_permanent_feign_death() : SpellScriptLoader("spell_gen_creature_permanent_feign_death") { } - class spell_gen_lifeblood_AuraScript : public AuraScript + class spell_gen_creature_permanent_feign_death_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_lifeblood_AuraScript); + PrepareAuraScript(spell_gen_creature_permanent_feign_death_AuraScript); - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* owner = GetUnitOwner()) - amount += int32(CalculatePct(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks())); + Unit* target = GetTarget(); + target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); + + if (target->GetTypeId() == TYPEID_UNIT) + target->ToCreature()->SetReactState(REACT_PASSIVE); } void Register() OVERRIDE { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_lifeblood_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + OnEffectApply += AuraEffectApplyFn(spell_gen_creature_permanent_feign_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_lifeblood_AuraScript(); + return new spell_gen_creature_permanent_feign_death_AuraScript(); } }; -enum MagicRoosterSpells +enum DalaranDisguiseSpells { - SPELL_MAGIC_ROOSTER_NORMAL = 66122, - SPELL_MAGIC_ROOSTER_DRAENEI_MALE = 66123, - SPELL_MAGIC_ROOSTER_TAUREN_MALE = 66124, + SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672, + SPELL_SUNREAVER_DISGUISE_FEMALE = 70973, + SPELL_SUNREAVER_DISGUISE_MALE = 70974, + + SPELL_SILVER_COVENANT_DISGUISE_TRIGGER = 69673, + SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971, + SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972 }; -class spell_gen_magic_rooster : public SpellScriptLoader +class spell_gen_dalaran_disguise : public SpellScriptLoader { public: - spell_gen_magic_rooster() : SpellScriptLoader("spell_gen_magic_rooster") { } + spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) { } - class spell_gen_magic_rooster_SpellScript : public SpellScript + class spell_gen_dalaran_disguise_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_magic_rooster_SpellScript); + PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript); + bool Validate(SpellInfo const* spellEntry) OVERRIDE + { + switch (spellEntry->Id) + { + case SPELL_SUNREAVER_DISGUISE_TRIGGER: + if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE) || + !sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE)) + return false; + break; + case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: + if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || + !sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE)) + return false; + break; + } + return true; + } - void HandleScript(SpellEffIndex effIndex) + void HandleScript(SpellEffIndex /*effIndex*/) { - PreventHitDefaultEffect(effIndex); - if (Player* target = GetHitPlayer()) + if (Player* player = GetHitPlayer()) { - // prevent client crashes from stacking mounts - target->RemoveAurasByType(SPELL_AURA_MOUNTED); + uint8 gender = player->getGender(); - uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL; - switch (target->getRace()) + uint32 spellId = GetSpellInfo()->Id; + + switch (spellId) { - case RACE_DRAENEI: - if (target->getGender() == GENDER_MALE) - spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE; + case SPELL_SUNREAVER_DISGUISE_TRIGGER: + spellId = gender ? SPELL_SUNREAVER_DISGUISE_FEMALE : SPELL_SUNREAVER_DISGUISE_MALE; break; - case RACE_TAUREN: - if (target->getGender() == GENDER_MALE) - spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE; + case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: + spellId = gender ? SPELL_SILVER_COVENANT_DISGUISE_FEMALE : SPELL_SILVER_COVENANT_DISGUISE_MALE; break; default: break; } - target->CastSpell(target, spellId, true); + GetCaster()->CastSpell(player, spellId, true); } } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_magic_rooster_SpellScript::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_dalaran_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_magic_rooster_SpellScript(); + return new spell_gen_dalaran_disguise_SpellScript(); } }; -class spell_gen_allow_cast_from_item_only : public SpellScriptLoader +enum DamageReductionAura +{ + SPELL_BLESSING_OF_SANCTUARY = 20911, + SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899, + SPELL_RENEWED_HOPE = 63944, + SPELL_VIGILANCE = 50720, + SPELL_DAMAGE_REDUCTION_AURA = 68066 +}; + +class spell_gen_damage_reduction_aura : public SpellScriptLoader { public: - spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } + spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { } - class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript + class spell_gen_damage_reduction_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); + PrepareAuraScript(spell_gen_damage_reduction_AuraScript); - SpellCastResult CheckRequirement() + bool Validate(SpellInfo const* /*SpellEntry*/) OVERRIDE { - if (!GetCastItem()) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - return SPELL_CAST_OK; + if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) + return false; + return true; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_RENEWED_HOPE) || + target->HasAura(SPELL_VIGILANCE))) + { + target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); + } } void Register() OVERRIDE { - OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } + }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_allow_cast_from_item_only_SpellScript(); + return new spell_gen_damage_reduction_AuraScript(); } }; -enum Launch +enum DefendVisuals { - SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251 + SPELL_VISUAL_SHIELD_1 = 63130, + SPELL_VISUAL_SHIELD_2 = 63131, + SPELL_VISUAL_SHIELD_3 = 63132 }; -class spell_gen_launch : public SpellScriptLoader +class spell_gen_defend : public SpellScriptLoader { public: - spell_gen_launch() : SpellScriptLoader("spell_gen_launch") {} + spell_gen_defend() : SpellScriptLoader("spell_gen_defend") { } - class spell_gen_launch_SpellScript : public SpellScript + class spell_gen_defend_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_launch_SpellScript); + PrepareAuraScript(spell_gen_defend_AuraScript); - void HandleScript(SpellEffIndex /*effIndex*/) + bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE { - if (Player* player = GetHitPlayer()) - player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3)) + return false; + return true; } - void Launch() + void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - WorldLocation const* const position = GetExplTargetDest(); - - if (Player* player = GetHitPlayer()) + if (GetCaster()) { - player->ExitVehicle(); - - // A better research is needed - // There is no spell for this, the following calculation was based on void Spell::CalculateJumpSpeeds + Unit* target = GetTarget(); - float speedZ = 10.0f; - float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY()); - float speedXY = dist; + for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i) + target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i); - player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ); + target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, NULL, aurEff); } + else + GetTarget()->RemoveAurasDueToSpell(GetId()); + } + + void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i) + GetTarget()->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i); + } + + void RemoveDummyFromDriver(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (TempSummon* vehicle = caster->ToTempSummon()) + if (Unit* rider = vehicle->GetSummoner()) + rider->RemoveAurasDueToSpell(GetId()); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST); - AfterHit += SpellHitFn(spell_gen_launch_SpellScript::Launch); + SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId); + + // Defend spells casted by NPCs (add visuals) + if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) + { + AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + } + + // Remove Defend spell from player when he dismounts + if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); + + // Defend spells casted by players (add/remove visuals) + if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY) + { + AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + } } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_launch_SpellScript(); + return new spell_gen_defend_AuraScript(); } }; -enum VehicleScaling -{ - SPELL_GEAR_SCALING = 66668, -}; - -class spell_gen_vehicle_scaling : public SpellScriptLoader +class spell_gen_despawn_self : public SpellScriptLoader { public: - spell_gen_vehicle_scaling() : SpellScriptLoader("spell_gen_vehicle_scaling") { } + spell_gen_despawn_self() : SpellScriptLoader("spell_gen_despawn_self") { } - class spell_gen_vehicle_scaling_AuraScript : public AuraScript + class spell_gen_despawn_self_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_vehicle_scaling_AuraScript); + PrepareSpellScript(spell_gen_despawn_self_SpellScript); bool Load() OVERRIDE { - return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void HandleDummy(SpellEffIndex effIndex) { - Unit* caster = GetCaster(); - float factor; - uint16 baseItemLevel; - - /// @todo Reserach coeffs for different vehicles - switch (GetId()) - { - case SPELL_GEAR_SCALING: - factor = 1.0f; - baseItemLevel = 205; - break; - default: - factor = 1.0f; - baseItemLevel = 170; - break; - } - - float avgILvl = caster->ToPlayer()->GetAverageItemLevel(); - if (avgILvl < baseItemLevel) - return; /// @todo Research possibility of scaling down - - amount = uint16((avgILvl - baseItemLevel) * factor); + if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_SCRIPT_EFFECT) + GetCaster()->ToCreature()->DespawnOrUnsummon(); } void Register() OVERRIDE { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT); - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT); + OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY); } }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_vehicle_scaling_AuraScript(); + return new spell_gen_despawn_self_SpellScript(); } }; +enum DivineStormSpell +{ + SPELL_DIVINE_STORM = 53385, +}; -class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader +// 70769 Divine Storm! +class spell_gen_divine_storm_cd_reset : public SpellScriptLoader { public: - spell_gen_oracle_wolvar_reputation() : SpellScriptLoader("spell_gen_oracle_wolvar_reputation") { } + spell_gen_divine_storm_cd_reset() : SpellScriptLoader("spell_gen_divine_storm_cd_reset") { } - class spell_gen_oracle_wolvar_reputation_SpellScript : public SpellScript + class spell_gen_divine_storm_cd_reset_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_oracle_wolvar_reputation_SpellScript); + PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript); bool Load() OVERRIDE { return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - void HandleDummy(SpellEffIndex effIndex) + bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE { - Player* player = GetCaster()->ToPlayer(); - uint32 factionId = GetSpellInfo()->Effects[effIndex].CalcValue(); - int32 repChange = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - - FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); - - if (!factionEntry) - return; - - // Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated) - // Not when player already has equal or higher rep with this faction - if (player->GetReputationMgr().GetBaseReputation(factionEntry) < repChange) - player->GetReputationMgr().SetReputation(factionEntry, repChange); + if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM)) + return false; + return true; + } - // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (caster->HasSpellCooldown(SPELL_DIVINE_STORM)) + caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_gen_divine_storm_cd_reset_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_oracle_wolvar_reputation_SpellScript(); + return new spell_gen_divine_storm_cd_reset_SpellScript(); } }; -enum DamageReductionAura -{ - SPELL_BLESSING_OF_SANCTUARY = 20911, - SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899, - SPELL_RENEWED_HOPE = 63944, - SPELL_VIGILANCE = 50720, - SPELL_DAMAGE_REDUCTION_AURA = 68066, -}; - -class spell_gen_damage_reduction_aura : public SpellScriptLoader +class spell_gen_ds_flush_knockback : public SpellScriptLoader { public: - spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { } + spell_gen_ds_flush_knockback() : SpellScriptLoader("spell_gen_ds_flush_knockback") { } - class spell_gen_damage_reduction_AuraScript : public AuraScript + class spell_gen_ds_flush_knockback_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_damage_reduction_AuraScript); - - bool Validate(SpellInfo const* /*SpellEntry*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) - return false; - return true; - } - - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); - } + PrepareSpellScript(spell_gen_ds_flush_knockback_SpellScript); - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleScript(SpellEffIndex /*effIndex*/) { - Unit* target = GetTarget(); - if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_RENEWED_HOPE) || - target->HasAura(SPELL_VIGILANCE))) - target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); + // Here the target is the water spout and determines the position where the player is knocked from + if (Unit* target = GetHitUnit()) + { + if (Player* player = GetCaster()->ToPlayer()) + { + float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target)); + float verticalSpeed = 8.0f; + // This method relies on the Dalaran Sewer map disposition and Water Spout position + // What we do is knock the player from a position exactly behind him and at the end of the pipe + player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed); + } + } } void Register() OVERRIDE { - OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectHitTarget += SpellEffectFn(spell_gen_ds_flush_knockback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); } - }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_damage_reduction_AuraScript(); + return new spell_gen_ds_flush_knockback_SpellScript(); } }; enum DummyTrigger { SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470, - SPELL_PERSISTANT_SHIELD = 26467, + SPELL_PERSISTANT_SHIELD = 26467 }; class spell_gen_dummy_trigger : public SpellScriptLoader @@ -1724,7 +1350,8 @@ class spell_gen_dummy_trigger : public SpellScriptLoader bool Validate(SpellInfo const* /*SpellEntry*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD)) + if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) || + !sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD)) return false; return true; } @@ -1749,43 +1376,119 @@ class spell_gen_dummy_trigger : public SpellScriptLoader { return new spell_gen_dummy_trigger_SpellScript(); } - }; -class spell_gen_spirit_healer_res : public SpellScriptLoader +class spell_gen_dungeon_credit : public SpellScriptLoader { public: - spell_gen_spirit_healer_res(): SpellScriptLoader("spell_gen_spirit_healer_res") { } + spell_gen_dungeon_credit() : SpellScriptLoader("spell_gen_dungeon_credit") { } - class spell_gen_spirit_healer_res_SpellScript : public SpellScript + class spell_gen_dungeon_credit_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_spirit_healer_res_SpellScript); + PrepareSpellScript(spell_gen_dungeon_credit_SpellScript); bool Load() OVERRIDE { - return GetOriginalCaster() && GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; + _handled = false; + return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void HandleDummy(SpellEffIndex /* effIndex */) + void CreditEncounter() { - Player* originalCaster = GetOriginalCaster()->ToPlayer(); - if (Unit* target = GetHitUnit()) + // This hook is executed for every target, make sure we only credit instance once + if (_handled) + return; + + _handled = true; + Unit* caster = GetCaster(); + if (InstanceScript* instance = caster->GetInstanceScript()) + instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, caster); + } + + void Register() OVERRIDE + { + AfterHit += SpellHitFn(spell_gen_dungeon_credit_SpellScript::CreditEncounter); + } + + private: + bool _handled; + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_gen_dungeon_credit_SpellScript(); + } +}; + +enum EluneCandle +{ + // Creatures + NPC_OMEN = 15467, + + // Spells + SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622, + SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624, + SPELL_ELUNE_CANDLE_OMEN_HAND_R = 26625, + SPELL_ELUNE_CANDLE_OMEN_HAND_L = 26649, + SPELL_ELUNE_CANDLE_NORMAL = 26636 +}; + +class spell_gen_elune_candle : public SpellScriptLoader +{ + public: + spell_gen_elune_candle() : SpellScriptLoader("spell_gen_elune_candle") { } + + class spell_gen_elune_candle_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_elune_candle_SpellScript); + bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD) || + !sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST) || + !sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R) || + !sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L) || + !sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + uint32 spellId = 0; + + if (GetHitUnit()->GetEntry() == NPC_OMEN) { - WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); - data << uint64(target->GetGUID()); - originalCaster->GetSession()->SendPacket(&data); + switch (urand(0, 3)) + { + case 0: + spellId = SPELL_ELUNE_CANDLE_OMEN_HEAD; + break; + case 1: + spellId = SPELL_ELUNE_CANDLE_OMEN_CHEST; + break; + case 2: + spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_R; + break; + case 3: + spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_L; + break; + } } + else + spellId = SPELL_ELUNE_CANDLE_NORMAL; + + GetCaster()->CastSpell(GetHitUnit(), spellId, true, NULL); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_spirit_healer_res_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_gen_elune_candle_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_spirit_healer_res_SpellScript(); + return new spell_gen_elune_candle_SpellScript(); } }; @@ -1793,7 +1496,7 @@ enum TransporterBackfires { SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH = 23444, SPELL_TRANSPORTER_EVIL_TWIN = 23445, - SPELL_TRANSPORTER_MALFUNCTION_MISS = 36902, + SPELL_TRANSPORTER_MALFUNCTION_MISS = 36902 }; class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader @@ -1807,8 +1510,9 @@ class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader bool Validate(SpellInfo const* /*SpellEntry*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_EVIL_TWIN) - || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_MISS)) + if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH) || + !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_EVIL_TWIN) || + !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_MISS)) return false; return true; } @@ -1837,10 +1541,63 @@ class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader } }; + +class spell_gen_gift_of_naaru : public SpellScriptLoader +{ + public: + spell_gen_gift_of_naaru() : SpellScriptLoader("spell_gen_gift_of_naaru") { } + + class spell_gen_gift_of_naaru_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_gift_of_naaru_AuraScript); + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster()) + return; + + float heal = 0.0f; + switch (GetSpellInfo()->SpellFamilyName) + { + case SPELLFAMILY_MAGE: + case SPELLFAMILY_WARLOCK: + case SPELLFAMILY_PRIEST: + heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())); + break; + case SPELLFAMILY_PALADIN: + case SPELLFAMILY_SHAMAN: + heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK))); + break; + case SPELLFAMILY_WARRIOR: + case SPELLFAMILY_HUNTER: + case SPELLFAMILY_DEATHKNIGHT: + heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK))); + break; + case SPELLFAMILY_GENERIC: + default: + break; + } + + int32 healTick = floor(heal / aurEff->GetTotalTicks()); + amount += int32(std::max(healTick, 0)); + } + + void Register() OVERRIDE + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_gift_of_naaru_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_gen_gift_of_naaru_AuraScript(); + } +}; + enum GnomishTransporter { SPELL_TRANSPORTER_SUCCESS = 23441, - SPELL_TRANSPORTER_FAILURE = 23446, + SPELL_TRANSPORTER_FAILURE = 23446 }; class spell_gen_gnomish_transporter : public SpellScriptLoader @@ -1854,15 +1611,15 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader bool Validate(SpellInfo const* /*SpellEntry*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_FAILURE)) + if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_SUCCESS) || + !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_FAILURE)) return false; return true; } void HandleDummy(SpellEffIndex /* effIndex */) { - Unit* caster = GetCaster(); - caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE, true); + GetCaster()->CastSpell(GetCaster(), roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE, true); } void Register() OVERRIDE @@ -1877,183 +1634,401 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader } }; -enum DalaranDisguiseSpells +class spell_gen_gunship_portal : public SpellScriptLoader { - SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672, - SPELL_SUNREAVER_DISGUISE_FEMALE = 70973, - SPELL_SUNREAVER_DISGUISE_MALE = 70974, + public: + spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { } - SPELL_SILVER_COVENANT_DISGUISE_TRIGGER = 69673, - SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971, - SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972, + class spell_gen_gunship_portal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_gunship_portal_SpellScript); + + bool Load() OVERRIDE + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Battleground* bg = caster->GetBattleground()) + if (bg->GetTypeID(true) == BATTLEGROUND_IC) + bg->DoAction(1, caster->GetGUID()); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_gen_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_gen_gunship_portal_SpellScript(); + } }; -class spell_gen_dalaran_disguise : public SpellScriptLoader +enum Launch +{ + SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251 +}; + +class spell_gen_launch : public SpellScriptLoader { public: - spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) {} + spell_gen_launch() : SpellScriptLoader("spell_gen_launch") { } - class spell_gen_dalaran_disguise_SpellScript : public SpellScript + class spell_gen_launch_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript); - bool Validate(SpellInfo const* spellEntry) OVERRIDE + PrepareSpellScript(spell_gen_launch_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) { - switch (spellEntry->Id) + if (Player* player = GetHitPlayer()) + player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage + } + + void Launch() + { + WorldLocation const* const position = GetExplTargetDest(); + + if (Player* player = GetHitPlayer()) { - case SPELL_SUNREAVER_DISGUISE_TRIGGER: - if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE)) - return false; - break; - case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: - if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE)) - return false; - break; + player->ExitVehicle(); + + // A better research is needed + // There is no spell for this, the following calculation was based on void Spell::CalculateJumpSpeeds + + float speedZ = 10.0f; + float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY()); + float speedXY = dist; + + player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ); } + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_gen_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST); + AfterHit += SpellHitFn(spell_gen_launch_SpellScript::Launch); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_gen_launch_SpellScript(); + } +}; + + +class spell_gen_lifeblood : public SpellScriptLoader +{ + public: + spell_gen_lifeblood() : SpellScriptLoader("spell_gen_lifeblood") { } + + class spell_gen_lifeblood_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_lifeblood_AuraScript); + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* owner = GetUnitOwner()) + amount += int32(CalculatePct(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks())); + } + + void Register() OVERRIDE + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_lifeblood_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_gen_lifeblood_AuraScript(); + } +}; + +enum GenericLifebloom +{ + SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL = 43422, + SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL = 52552, + SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL = 53692, + SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL = 57763, + SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL = 66094 +}; + +class spell_gen_lifebloom : public SpellScriptLoader +{ + public: + spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { } + + class spell_gen_lifebloom_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_lifebloom_AuraScript); + + public: + spell_gen_lifebloom_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { } + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(_spellId)) + return false; return true; } - void HandleScript(SpellEffIndex /*effIndex*/) + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - if (Player* player = GetHitPlayer()) - { - uint8 gender = player->getGender(); + // Final heal only on duration end + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) + return; - uint32 spellId = GetSpellInfo()->Id; + // final heal + GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID()); + } - switch (spellId) + void Register() OVERRIDE + { + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + } + + private: + uint32 _spellId; + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_gen_lifebloom_AuraScript(_spellId); + } + + private: + uint32 _spellId; +}; + +enum MagicRoosterSpells +{ + SPELL_MAGIC_ROOSTER_NORMAL = 66122, + SPELL_MAGIC_ROOSTER_DRAENEI_MALE = 66123, + SPELL_MAGIC_ROOSTER_TAUREN_MALE = 66124 +}; + +class spell_gen_magic_rooster : public SpellScriptLoader +{ + public: + spell_gen_magic_rooster() : SpellScriptLoader("spell_gen_magic_rooster") { } + + class spell_gen_magic_rooster_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_magic_rooster_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (Player* target = GetHitPlayer()) + { + // prevent client crashes from stacking mounts + target->RemoveAurasByType(SPELL_AURA_MOUNTED); + + uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL; + switch (target->getRace()) { - case SPELL_SUNREAVER_DISGUISE_TRIGGER: - spellId = gender ? SPELL_SUNREAVER_DISGUISE_FEMALE : SPELL_SUNREAVER_DISGUISE_MALE; + case RACE_DRAENEI: + if (target->getGender() == GENDER_MALE) + spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE; break; - case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: - spellId = gender ? SPELL_SILVER_COVENANT_DISGUISE_FEMALE : SPELL_SILVER_COVENANT_DISGUISE_MALE; + case RACE_TAUREN: + if (target->getGender() == GENDER_MALE) + spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE; break; default: break; } - GetCaster()->CastSpell(player, spellId, true); + + target->CastSpell(target, spellId, true); } } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_dalaran_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_magic_rooster_SpellScript::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_dalaran_disguise_SpellScript(); + return new spell_gen_magic_rooster_SpellScript(); } }; -/* DOCUMENTATION: Break-Shield spells - Break-Shield spells can be classified in three groups: +enum Mounts +{ + SPELL_COLD_WEATHER_FLYING = 54197, - - Spells on vehicle bar used by players: - + EFFECT_0: SCRIPT_EFFECT - + EFFECT_1: NONE - + EFFECT_2: NONE - - Spells casted by players triggered by script: - + EFFECT_0: SCHOOL_DAMAGE - + EFFECT_1: SCRIPT_EFFECT - + EFFECT_2: FORCE_CAST - - Spells casted by NPCs on players: - + EFFECT_0: SCHOOL_DAMAGE - + EFFECT_1: SCRIPT_EFFECT - + EFFECT_2: NONE + // Magic Broom + SPELL_MAGIC_BROOM_60 = 42680, + SPELL_MAGIC_BROOM_100 = 42683, + SPELL_MAGIC_BROOM_150 = 42667, + SPELL_MAGIC_BROOM_280 = 42668, - In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1. - - When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case - and we'll trigger "Spells casted by players triggered by script" - - When handling EFFECT_1 we're in the "Spells casted by players triggered by script" - or "Spells casted by NPCs on players" so we'll search for the first defend layer and drop it. -*/ + // Headless Horseman's Mount + SPELL_HEADLESS_HORSEMAN_MOUNT_60 = 51621, + SPELL_HEADLESS_HORSEMAN_MOUNT_100 = 48024, + SPELL_HEADLESS_HORSEMAN_MOUNT_150 = 51617, + SPELL_HEADLESS_HORSEMAN_MOUNT_280 = 48023, -enum BreakShieldSpells -{ - SPELL_BREAK_SHIELD_DAMAGE_2K = 62626, - SPELL_BREAK_SHIELD_DAMAGE_10K = 64590, + // Winged Steed of the Ebon Blade + SPELL_WINGED_STEED_150 = 54726, + SPELL_WINGED_STEED_280 = 54727, - SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS = 62575, // Also on ToC5 mounts - SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE = 64595, - SPELL_BREAK_SHIELD_TRIGGER_UNK = 66480, + // Big Love Rocket + SPELL_BIG_LOVE_ROCKET_0 = 71343, + SPELL_BIG_LOVE_ROCKET_60 = 71344, + SPELL_BIG_LOVE_ROCKET_100 = 71345, + SPELL_BIG_LOVE_ROCKET_150 = 71346, + SPELL_BIG_LOVE_ROCKET_310 = 71347, + + // Invincible + SPELL_INVINCIBLE_60 = 72281, + SPELL_INVINCIBLE_100 = 72282, + SPELL_INVINCIBLE_150 = 72283, + SPELL_INVINCIBLE_310 = 72284, + + // Blazing Hippogryph + SPELL_BLAZING_HIPPOGRYPH_150 = 74854, + SPELL_BLAZING_HIPPOGRYPH_280 = 74855, + + // Celestial Steed + SPELL_CELESTIAL_STEED_60 = 75619, + SPELL_CELESTIAL_STEED_100 = 75620, + SPELL_CELESTIAL_STEED_150 = 75617, + SPELL_CELESTIAL_STEED_280 = 75618, + SPELL_CELESTIAL_STEED_310 = 76153, + + // X-53 Touring Rocket + SPELL_X53_TOURING_ROCKET_150 = 75957, + SPELL_X53_TOURING_ROCKET_280 = 75972, + SPELL_X53_TOURING_ROCKET_310 = 76154 }; -class spell_gen_break_shield: public SpellScriptLoader +class spell_gen_mount : public SpellScriptLoader { public: - spell_gen_break_shield(const char* name) : SpellScriptLoader(name) {} + spell_gen_mount(const char* name, uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScriptLoader(name), + _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { } - class spell_gen_break_shield_SpellScript : public SpellScript + class spell_gen_mount_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_break_shield_SpellScript) + PrepareSpellScript(spell_gen_mount_SpellScript); - void HandleScriptEffect(SpellEffIndex effIndex) + public: + spell_gen_mount_SpellScript(uint32 mount0, uint32 mount60, uint32 mount100, uint32 mount150, uint32 mount280, uint32 mount310) : SpellScript(), + _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { } + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - Unit* target = GetHitUnit(); + if (_mount0 && !sSpellMgr->GetSpellInfo(_mount0)) + return false; + if (_mount60 && !sSpellMgr->GetSpellInfo(_mount60)) + return false; + if (_mount100 && !sSpellMgr->GetSpellInfo(_mount100)) + return false; + if (_mount150 && !sSpellMgr->GetSpellInfo(_mount150)) + return false; + if (_mount280 && !sSpellMgr->GetSpellInfo(_mount280)) + return false; + if (_mount310 && !sSpellMgr->GetSpellInfo(_mount310)) + return false; + return true; + } - switch (effIndex) + void HandleMount(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + if (Player* target = GetHitPlayer()) { - case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual) - { - uint32 spellId; + // Prevent stacking of mounts and client crashes upon dismounting + target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura()); - switch (GetSpellInfo()->Id) - { - case SPELL_BREAK_SHIELD_TRIGGER_UNK: - case SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE: - spellId = SPELL_BREAK_SHIELD_DAMAGE_10K; - break; - case SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS: - spellId = SPELL_BREAK_SHIELD_DAMAGE_2K; - break; - default: - return; - } + // Triggered spell id dependent on riding skill and zone + bool canFly = false; + uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); + if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) + canFly = true; - if (Unit* rider = GetCaster()->GetCharmer()) - rider->CastSpell(target, spellId, false); - else - GetCaster()->CastSpell(target, spellId, false); - break; - } - case EFFECT_1: // On damaging spells, for removing a defend layer + float x, y, z; + target->GetPosition(x, y, z); + uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z); + AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag); + if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE))) + canFly = false; + + uint32 mount = 0; + switch (target->GetBaseSkillValue(SKILL_RIDING)) { - Unit::AuraApplicationMap const& auras = target->GetAppliedAuras(); - for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - { - if (Aura* aura = itr->second->GetBase()) + case 0: + mount = _mount0; + break; + case 75: + mount = _mount60; + break; + case 150: + mount = _mount100; + break; + case 225: + if (canFly) + mount = _mount150; + else + mount = _mount100; + break; + case 300: + if (canFly) { - SpellInfo const* auraInfo = aura->GetSpellInfo(); - if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)) - { - aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); - // Remove dummys from rider (Necessary for updating visual shields) - if (Unit* rider = target->GetCharmer()) - if (Aura* defend = rider->GetAura(aura->GetId())) - defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL); - break; - } + if (_mount310 && target->Has310Flyer(false)) + mount = _mount310; + else + mount = _mount280; } - } - break; + else + mount = _mount100; + break; + default: + break; + } + + if (mount) + { + PreventHitAura(); + target->CastSpell(target, mount, true); } - default: - break; } } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_break_shield_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_mount_SpellScript::HandleMount, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); } + + private: + uint32 _mount0; + uint32 _mount60; + uint32 _mount100; + uint32 _mount150; + uint32 _mount280; + uint32 _mount310; }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_break_shield_SpellScript(); + return new spell_gen_mount_SpellScript(_mount0, _mount60, _mount100, _mount150, _mount280, _mount310); } + + private: + uint32 _mount0; + uint32 _mount60; + uint32 _mount100; + uint32 _mount150; + uint32 _mount280; + uint32 _mount310; }; /* DOCUMENTATION: Charge spells @@ -2217,285 +2192,290 @@ class spell_gen_mounted_charge: public SpellScriptLoader } }; -enum DefendVisuals +enum Netherbloom { - SPELL_VISUAL_SHIELD_1 = 63130, - SPELL_VISUAL_SHIELD_2 = 63131, - SPELL_VISUAL_SHIELD_3 = 63132, + SPELL_NETHERBLOOM_POLLEN_1 = 28703 }; -class spell_gen_defend : public SpellScriptLoader +// 28702 - Netherbloom +class spell_gen_netherbloom : public SpellScriptLoader { public: - spell_gen_defend() : SpellScriptLoader("spell_gen_defend") { } + spell_gen_netherbloom() : SpellScriptLoader("spell_gen_netherbloom") { } - class spell_gen_defend_AuraScript : public AuraScript + class spell_gen_netherbloom_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_defend_AuraScript); + PrepareSpellScript(spell_gen_netherbloom_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3)) - return false; + for (uint8 i = 0; i < 5; ++i) + if (!sSpellMgr->GetSpellInfo(SPELL_NETHERBLOOM_POLLEN_1 + i)) + return false; return true; } - void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void HandleScript(SpellEffIndex effIndex) { - if (GetCaster()) - { - Unit* target = GetTarget(); + PreventHitDefaultEffect(effIndex); - for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i) - target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i); + if (Unit* target = GetHitUnit()) + { + // 25% chance of casting a random buff + if (roll_chance_i(75)) + return; - target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, NULL, aurEff); - } - else - GetTarget()->RemoveAurasDueToSpell(GetId()); - } + // triggered spells are 28703 to 28707 + // Note: some sources say, that there was the possibility of + // receiving a debuff. However, this seems to be removed by a patch. - void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i) - GetTarget()->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i); - } + // don't overwrite an existing aura + for (uint8 i = 0; i < 5; ++i) + if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i)) + return; - void RemoveDummyFromDriver(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* caster = GetCaster()) - if (TempSummon* vehicle = caster->ToTempSummon()) - if (Unit* rider = vehicle->GetSummoner()) - rider->RemoveAurasDueToSpell(GetId()); + target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true); + } } void Register() OVERRIDE { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId); - - // Defend spells casted by NPCs (add visuals) - if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) - { - AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); - } - - // Remove Defend spell from player when he dismounts - if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) - OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); - - // Defend spells casted by players (add/remove visuals) - if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY) - { - AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); - } + OnEffectHitTarget += SpellEffectFn(spell_gen_netherbloom_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_defend_AuraScript(); + return new spell_gen_netherbloom_SpellScript(); } }; -enum MountedDuelSpells +enum NightmareVine { - SPELL_ON_TOURNAMENT_MOUNT = 63034, - SPELL_MOUNTED_DUEL = 62875, + SPELL_NIGHTMARE_POLLEN = 28721 }; -class spell_gen_tournament_duel : public SpellScriptLoader +// 28720 - Nightmare Vine +class spell_gen_nightmare_vine : public SpellScriptLoader { public: - spell_gen_tournament_duel() : SpellScriptLoader("spell_gen_tournament_duel") { } + spell_gen_nightmare_vine() : SpellScriptLoader("spell_gen_nightmare_vine") { } - class spell_gen_tournament_duel_SpellScript : public SpellScript + class spell_gen_nightmare_vine_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_tournament_duel_SpellScript); + PrepareSpellScript(spell_gen_nightmare_vine_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL)) + if (!sSpellMgr->GetSpellInfo(SPELL_NIGHTMARE_POLLEN)) return false; return true; } - void HandleScriptEffect(SpellEffIndex /*effIndex*/) + void HandleScript(SpellEffIndex effIndex) { - if (Unit* rider = GetCaster()->GetCharmer()) + PreventHitDefaultEffect(effIndex); + + if (Unit* target = GetHitUnit()) { - if (Player* plrTarget = GetHitPlayer()) - { - if (plrTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && plrTarget->GetVehicleBase()) - rider->CastSpell(plrTarget, SPELL_MOUNTED_DUEL, true); - } - else if (Unit* unitTarget = GetHitUnit()) - { - if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT)) - rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true); - } + // 25% chance of casting Nightmare Pollen + if (roll_chance_i(25)) + target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true); } } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_tournament_duel_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_nightmare_vine_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_tournament_duel_SpellScript(); + return new spell_gen_nightmare_vine_SpellScript(); } }; -enum TournamentMountsSpells +enum ObsidianArmor { - SPELL_LANCE_EQUIPPED = 62853, + SPELL_GEN_OBSIDIAN_ARMOR_HOLY = 27536, + SPELL_GEN_OBSIDIAN_ARMOR_FIRE = 27533, + SPELL_GEN_OBSIDIAN_ARMOR_NATURE = 27538, + SPELL_GEN_OBSIDIAN_ARMOR_FROST = 27534, + SPELL_GEN_OBSIDIAN_ARMOR_SHADOW = 27535, + SPELL_GEN_OBSIDIAN_ARMOR_ARCANE = 27540 }; -class spell_gen_summon_tournament_mount : public SpellScriptLoader +// 27539 - Obsidian Armor +class spell_gen_obsidian_armor : public SpellScriptLoader { public: - spell_gen_summon_tournament_mount() : SpellScriptLoader("spell_gen_summon_tournament_mount") { } + spell_gen_obsidian_armor() : SpellScriptLoader("spell_gen_obsidian_armor") { } - class spell_gen_summon_tournament_mount_SpellScript : public SpellScript + class spell_gen_obsidian_armor_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_summon_tournament_mount_SpellScript); + PrepareAuraScript(spell_gen_obsidian_armor_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED)) + if (!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_HOLY) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FIRE) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_NATURE) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FROST) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_SHADOW) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_ARCANE)) return false; return true; } - SpellCastResult CheckIfLanceEquiped() + bool CheckProc(ProcEventInfo& eventInfo) { - if (GetCaster()->IsInDisallowedMountForm()) - GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT); + if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + return false; - if (!GetCaster()->HasAura(SPELL_LANCE_EQUIPPED)) + if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL) + return false; + + return true; + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + uint32 spellId = 0; + switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask())) { - SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED); - return SPELL_FAILED_CUSTOM_ERROR; + case SPELL_SCHOOL_HOLY: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_HOLY; + break; + case SPELL_SCHOOL_FIRE: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_FIRE; + break; + case SPELL_SCHOOL_NATURE: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_NATURE; + break; + case SPELL_SCHOOL_FROST: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_FROST; + break; + case SPELL_SCHOOL_SHADOW: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_SHADOW; + break; + case SPELL_SCHOOL_ARCANE: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_ARCANE; + break; + default: + return; } - - return SPELL_CAST_OK; + GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); } void Register() OVERRIDE { - OnCheckCast += SpellCheckCastFn(spell_gen_summon_tournament_mount_SpellScript::CheckIfLanceEquiped); + DoCheckProc += AuraCheckProcFn(spell_gen_obsidian_armor_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_gen_obsidian_armor_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_summon_tournament_mount_SpellScript(); + return new spell_gen_obsidian_armor_AuraScript(); } }; enum TournamentPennantSpells { - SPELL_PENNANT_STORMWIND_ASPIRANT = 62595, - SPELL_PENNANT_STORMWIND_VALIANT = 62596, - SPELL_PENNANT_STORMWIND_CHAMPION = 62594, - SPELL_PENNANT_GNOMEREGAN_ASPIRANT = 63394, - SPELL_PENNANT_GNOMEREGAN_VALIANT = 63395, - SPELL_PENNANT_GNOMEREGAN_CHAMPION = 63396, - SPELL_PENNANT_SEN_JIN_ASPIRANT = 63397, - SPELL_PENNANT_SEN_JIN_VALIANT = 63398, - SPELL_PENNANT_SEN_JIN_CHAMPION = 63399, - SPELL_PENNANT_SILVERMOON_ASPIRANT = 63401, - SPELL_PENNANT_SILVERMOON_VALIANT = 63402, - SPELL_PENNANT_SILVERMOON_CHAMPION = 63403, - SPELL_PENNANT_DARNASSUS_ASPIRANT = 63404, - SPELL_PENNANT_DARNASSUS_VALIANT = 63405, - SPELL_PENNANT_DARNASSUS_CHAMPION = 63406, - SPELL_PENNANT_EXODAR_ASPIRANT = 63421, - SPELL_PENNANT_EXODAR_VALIANT = 63422, - SPELL_PENNANT_EXODAR_CHAMPION = 63423, - SPELL_PENNANT_IRONFORGE_ASPIRANT = 63425, - SPELL_PENNANT_IRONFORGE_VALIANT = 63426, - SPELL_PENNANT_IRONFORGE_CHAMPION = 63427, - SPELL_PENNANT_UNDERCITY_ASPIRANT = 63428, - SPELL_PENNANT_UNDERCITY_VALIANT = 63429, - SPELL_PENNANT_UNDERCITY_CHAMPION = 63430, - SPELL_PENNANT_ORGRIMMAR_ASPIRANT = 63431, - SPELL_PENNANT_ORGRIMMAR_VALIANT = 63432, - SPELL_PENNANT_ORGRIMMAR_CHAMPION = 63433, - SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT = 63434, - SPELL_PENNANT_THUNDER_BLUFF_VALIANT = 63435, - SPELL_PENNANT_THUNDER_BLUFF_CHAMPION = 63436, - SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT = 63606, - SPELL_PENNANT_ARGENT_CRUSADE_VALIANT = 63500, - SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION = 63501, - SPELL_PENNANT_EBON_BLADE_ASPIRANT = 63607, - SPELL_PENNANT_EBON_BLADE_VALIANT = 63608, - SPELL_PENNANT_EBON_BLADE_CHAMPION = 63609, + SPELL_PENNANT_STORMWIND_ASPIRANT = 62595, + SPELL_PENNANT_STORMWIND_VALIANT = 62596, + SPELL_PENNANT_STORMWIND_CHAMPION = 62594, + SPELL_PENNANT_GNOMEREGAN_ASPIRANT = 63394, + SPELL_PENNANT_GNOMEREGAN_VALIANT = 63395, + SPELL_PENNANT_GNOMEREGAN_CHAMPION = 63396, + SPELL_PENNANT_SEN_JIN_ASPIRANT = 63397, + SPELL_PENNANT_SEN_JIN_VALIANT = 63398, + SPELL_PENNANT_SEN_JIN_CHAMPION = 63399, + SPELL_PENNANT_SILVERMOON_ASPIRANT = 63401, + SPELL_PENNANT_SILVERMOON_VALIANT = 63402, + SPELL_PENNANT_SILVERMOON_CHAMPION = 63403, + SPELL_PENNANT_DARNASSUS_ASPIRANT = 63404, + SPELL_PENNANT_DARNASSUS_VALIANT = 63405, + SPELL_PENNANT_DARNASSUS_CHAMPION = 63406, + SPELL_PENNANT_EXODAR_ASPIRANT = 63421, + SPELL_PENNANT_EXODAR_VALIANT = 63422, + SPELL_PENNANT_EXODAR_CHAMPION = 63423, + SPELL_PENNANT_IRONFORGE_ASPIRANT = 63425, + SPELL_PENNANT_IRONFORGE_VALIANT = 63426, + SPELL_PENNANT_IRONFORGE_CHAMPION = 63427, + SPELL_PENNANT_UNDERCITY_ASPIRANT = 63428, + SPELL_PENNANT_UNDERCITY_VALIANT = 63429, + SPELL_PENNANT_UNDERCITY_CHAMPION = 63430, + SPELL_PENNANT_ORGRIMMAR_ASPIRANT = 63431, + SPELL_PENNANT_ORGRIMMAR_VALIANT = 63432, + SPELL_PENNANT_ORGRIMMAR_CHAMPION = 63433, + SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT = 63434, + SPELL_PENNANT_THUNDER_BLUFF_VALIANT = 63435, + SPELL_PENNANT_THUNDER_BLUFF_CHAMPION = 63436, + SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT = 63606, + SPELL_PENNANT_ARGENT_CRUSADE_VALIANT = 63500, + SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION = 63501, + SPELL_PENNANT_EBON_BLADE_ASPIRANT = 63607, + SPELL_PENNANT_EBON_BLADE_VALIANT = 63608, + SPELL_PENNANT_EBON_BLADE_CHAMPION = 63609 }; enum TournamentMounts { - NPC_STORMWIND_STEED = 33217, - NPC_IRONFORGE_RAM = 33316, - NPC_GNOMEREGAN_MECHANOSTRIDER = 33317, - NPC_EXODAR_ELEKK = 33318, - NPC_DARNASSIAN_NIGHTSABER = 33319, - NPC_ORGRIMMAR_WOLF = 33320, - NPC_DARK_SPEAR_RAPTOR = 33321, - NPC_THUNDER_BLUFF_KODO = 33322, - NPC_SILVERMOON_HAWKSTRIDER = 33323, - NPC_FORSAKEN_WARHORSE = 33324, - NPC_ARGENT_WARHORSE = 33782, - NPC_ARGENT_STEED_ASPIRANT = 33845, - NPC_ARGENT_HAWKSTRIDER_ASPIRANT = 33844, + NPC_STORMWIND_STEED = 33217, + NPC_IRONFORGE_RAM = 33316, + NPC_GNOMEREGAN_MECHANOSTRIDER = 33317, + NPC_EXODAR_ELEKK = 33318, + NPC_DARNASSIAN_NIGHTSABER = 33319, + NPC_ORGRIMMAR_WOLF = 33320, + NPC_DARK_SPEAR_RAPTOR = 33321, + NPC_THUNDER_BLUFF_KODO = 33322, + NPC_SILVERMOON_HAWKSTRIDER = 33323, + NPC_FORSAKEN_WARHORSE = 33324, + NPC_ARGENT_WARHORSE = 33782, + NPC_ARGENT_STEED_ASPIRANT = 33845, + NPC_ARGENT_HAWKSTRIDER_ASPIRANT = 33844 }; enum TournamentQuestsAchievements { - ACHIEVEMENT_CHAMPION_STORMWIND = 2781, - ACHIEVEMENT_CHAMPION_DARNASSUS = 2777, - ACHIEVEMENT_CHAMPION_IRONFORGE = 2780, - ACHIEVEMENT_CHAMPION_GNOMEREGAN = 2779, - ACHIEVEMENT_CHAMPION_THE_EXODAR = 2778, - ACHIEVEMENT_CHAMPION_ORGRIMMAR = 2783, - ACHIEVEMENT_CHAMPION_SEN_JIN = 2784, - ACHIEVEMENT_CHAMPION_THUNDER_BLUFF = 2786, - ACHIEVEMENT_CHAMPION_UNDERCITY = 2787, - ACHIEVEMENT_CHAMPION_SILVERMOON = 2785, - ACHIEVEMENT_ARGENT_VALOR = 2758, - ACHIEVEMENT_CHAMPION_ALLIANCE = 2782, - ACHIEVEMENT_CHAMPION_HORDE = 2788, - - QUEST_VALIANT_OF_STORMWIND = 13593, - QUEST_A_VALIANT_OF_STORMWIND = 13684, - QUEST_VALIANT_OF_DARNASSUS = 13706, - QUEST_A_VALIANT_OF_DARNASSUS = 13689, - QUEST_VALIANT_OF_IRONFORGE = 13703, - QUEST_A_VALIANT_OF_IRONFORGE = 13685, - QUEST_VALIANT_OF_GNOMEREGAN = 13704, - QUEST_A_VALIANT_OF_GNOMEREGAN = 13688, - QUEST_VALIANT_OF_THE_EXODAR = 13705, - QUEST_A_VALIANT_OF_THE_EXODAR = 13690, - QUEST_VALIANT_OF_ORGRIMMAR = 13707, - QUEST_A_VALIANT_OF_ORGRIMMAR = 13691, - QUEST_VALIANT_OF_SEN_JIN = 13708, - QUEST_A_VALIANT_OF_SEN_JIN = 13693, - QUEST_VALIANT_OF_THUNDER_BLUFF = 13709, - QUEST_A_VALIANT_OF_THUNDER_BLUFF = 13694, - QUEST_VALIANT_OF_UNDERCITY = 13710, - QUEST_A_VALIANT_OF_UNDERCITY = 13695, - QUEST_VALIANT_OF_SILVERMOON = 13711, - QUEST_A_VALIANT_OF_SILVERMOON = 13696, + ACHIEVEMENT_CHAMPION_STORMWIND = 2781, + ACHIEVEMENT_CHAMPION_DARNASSUS = 2777, + ACHIEVEMENT_CHAMPION_IRONFORGE = 2780, + ACHIEVEMENT_CHAMPION_GNOMEREGAN = 2779, + ACHIEVEMENT_CHAMPION_THE_EXODAR = 2778, + ACHIEVEMENT_CHAMPION_ORGRIMMAR = 2783, + ACHIEVEMENT_CHAMPION_SEN_JIN = 2784, + ACHIEVEMENT_CHAMPION_THUNDER_BLUFF = 2786, + ACHIEVEMENT_CHAMPION_UNDERCITY = 2787, + ACHIEVEMENT_CHAMPION_SILVERMOON = 2785, + ACHIEVEMENT_ARGENT_VALOR = 2758, + ACHIEVEMENT_CHAMPION_ALLIANCE = 2782, + ACHIEVEMENT_CHAMPION_HORDE = 2788, + + QUEST_VALIANT_OF_STORMWIND = 13593, + QUEST_A_VALIANT_OF_STORMWIND = 13684, + QUEST_VALIANT_OF_DARNASSUS = 13706, + QUEST_A_VALIANT_OF_DARNASSUS = 13689, + QUEST_VALIANT_OF_IRONFORGE = 13703, + QUEST_A_VALIANT_OF_IRONFORGE = 13685, + QUEST_VALIANT_OF_GNOMEREGAN = 13704, + QUEST_A_VALIANT_OF_GNOMEREGAN = 13688, + QUEST_VALIANT_OF_THE_EXODAR = 13705, + QUEST_A_VALIANT_OF_THE_EXODAR = 13690, + QUEST_VALIANT_OF_ORGRIMMAR = 13707, + QUEST_A_VALIANT_OF_ORGRIMMAR = 13691, + QUEST_VALIANT_OF_SEN_JIN = 13708, + QUEST_A_VALIANT_OF_SEN_JIN = 13693, + QUEST_VALIANT_OF_THUNDER_BLUFF = 13709, + QUEST_A_VALIANT_OF_THUNDER_BLUFF = 13694, + QUEST_VALIANT_OF_UNDERCITY = 13710, + QUEST_A_VALIANT_OF_UNDERCITY = 13695, + QUEST_VALIANT_OF_SILVERMOON = 13711, + QUEST_A_VALIANT_OF_SILVERMOON = 13696 }; class spell_gen_on_tournament_mount : public SpellScriptLoader @@ -2656,376 +2636,499 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader } }; -class spell_gen_tournament_pennant : public SpellScriptLoader +class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader { public: - spell_gen_tournament_pennant() : SpellScriptLoader("spell_gen_tournament_pennant") { } + spell_gen_oracle_wolvar_reputation() : SpellScriptLoader("spell_gen_oracle_wolvar_reputation") { } - class spell_gen_tournament_pennant_AuraScript : public AuraScript + class spell_gen_oracle_wolvar_reputation_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_tournament_pennant_AuraScript); + PrepareSpellScript(spell_gen_oracle_wolvar_reputation_SpellScript); bool Load() OVERRIDE { - return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleDummy(SpellEffIndex effIndex) { - if (Unit* caster = GetCaster()) - if (!caster->GetVehicleBase()) - caster->RemoveAurasDueToSpell(GetId()); + Player* player = GetCaster()->ToPlayer(); + uint32 factionId = GetSpellInfo()->Effects[effIndex].CalcValue(); + int32 repChange = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + + FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); + + if (!factionEntry) + return; + + // Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated) + // Not when player already has equal or higher rep with this faction + if (player->GetReputationMgr().GetBaseReputation(factionEntry) < repChange) + player->GetReputationMgr().SetReputation(factionEntry, repChange); + + // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation } void Register() OVERRIDE { - OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennant_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectHit += SpellEffectFn(spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_tournament_pennant_AuraScript(); + return new spell_gen_oracle_wolvar_reputation_SpellScript(); } }; -enum ChaosBlast +enum OrcDisguiseSpells { - SPELL_CHAOS_BLAST = 37675, + SPELL_ORC_DISGUISE_TRIGGER = 45759, + SPELL_ORC_DISGUISE_MALE = 45760, + SPELL_ORC_DISGUISE_FEMALE = 45762 }; -class spell_gen_chaos_blast : public SpellScriptLoader +class spell_gen_orc_disguise : public SpellScriptLoader { public: - spell_gen_chaos_blast() : SpellScriptLoader("spell_gen_chaos_blast") { } + spell_gen_orc_disguise() : SpellScriptLoader("spell_gen_orc_disguise") { } - class spell_gen_chaos_blast_SpellScript : public SpellScript + class spell_gen_orc_disguise_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_chaos_blast_SpellScript) + PrepareSpellScript(spell_gen_orc_disguise_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_CHAOS_BLAST)) + if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) || + !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) || + !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_FEMALE)) return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + + void HandleScript(SpellEffIndex /*effIndex*/) { - int32 basepoints0 = 100; Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) - caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, NULL, NULL, true); + if (Player* target = GetHitPlayer()) + { + uint8 gender = target->getGender(); + if (!gender) + caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true); + else + caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true); + } } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_chaos_blast_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_gen_orc_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_chaos_blast_SpellScript(); + return new spell_gen_orc_disguise_SpellScript(); } +}; +enum ParachuteSpells +{ + SPELL_PARACHUTE = 45472, + SPELL_PARACHUTE_BUFF = 44795, }; -class spell_gen_ds_flush_knockback : public SpellScriptLoader +// 45472 Parachute +class spell_gen_parachute : public SpellScriptLoader { public: - spell_gen_ds_flush_knockback() : SpellScriptLoader("spell_gen_ds_flush_knockback") {} + spell_gen_parachute() : SpellScriptLoader("spell_gen_parachute") { } - class spell_gen_ds_flush_knockback_SpellScript : public SpellScript + class spell_gen_parachute_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_ds_flush_knockback_SpellScript); + PrepareAuraScript(spell_gen_parachute_AuraScript); - void HandleScript(SpellEffIndex /*effIndex*/) + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - // Here the target is the water spout and determines the position where the player is knocked from - if (Unit* target = GetHitUnit()) - { - if (Player* player = GetCaster()->ToPlayer()) + if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || + !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + if (Player* target = GetTarget()->ToPlayer()) + if (target->IsFalling()) { - float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target)); - float verticalSpeed = 8.0f; - // This method relies on the Dalaran Sewer map disposition and Water Spout position - // What we do is knock the player from a position exactly behind him and at the end of the pipe - player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed); + target->RemoveAurasDueToSpell(SPELL_PARACHUTE); + target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); } - } } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_ds_flush_knockback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_ds_flush_knockback_SpellScript(); + return new spell_gen_parachute_AuraScript(); } }; -class spell_gen_wg_water : public SpellScriptLoader +enum ParachuteIC +{ + SPELL_PARACHUTE_IC = 66657 +}; + +class spell_gen_parachute_ic : public SpellScriptLoader { public: - spell_gen_wg_water() : SpellScriptLoader("spell_gen_wg_water") {} + spell_gen_parachute_ic() : SpellScriptLoader("spell_gen_parachute_ic") { } - class spell_gen_wg_water_SpellScript : public SpellScript + class spell_gen_parachute_ic_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_wg_water_SpellScript); + PrepareAuraScript(spell_gen_parachute_ic_AuraScript) - SpellCastResult CheckCast() + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) { - if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster())) - return SPELL_FAILED_DONT_REPORT; - return SPELL_CAST_OK; + if (Player* target = GetTarget()->ToPlayer()) + if (target->m_movementInfo.fallTime > 2000) + target->CastSpell(target, SPELL_PARACHUTE_IC, true); } void Register() OVERRIDE { - OnCheckCast += SpellCheckCastFn(spell_gen_wg_water_SpellScript::CheckCast); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_wg_water_SpellScript(); + return new spell_gen_parachute_ic_AuraScript(); } }; -class spell_gen_count_pct_from_max_hp : public SpellScriptLoader +enum PetSummoned +{ + NPC_DOOMGUARD = 11859, + NPC_INFERNAL = 89, + NPC_IMP = 416 +}; + +class spell_gen_pet_summoned : public SpellScriptLoader { public: - spell_gen_count_pct_from_max_hp(char const* name, int32 damagePct = 0) : SpellScriptLoader(name), _damagePct(damagePct) { } + spell_gen_pet_summoned() : SpellScriptLoader("spell_gen_pet_summoned") { } - class spell_gen_count_pct_from_max_hp_SpellScript : public SpellScript + class spell_gen_pet_summoned_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_count_pct_from_max_hp_SpellScript) + PrepareSpellScript(spell_gen_pet_summoned_SpellScript); - public: - spell_gen_count_pct_from_max_hp_SpellScript(int32 damagePct) : SpellScript(), _damagePct(damagePct) { } + bool Load() OVERRIDE + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - void RecalculateDamage() + void HandleScript(SpellEffIndex /*effIndex*/) { - if (!_damagePct) - _damagePct = GetHitDamage(); + Player* player = GetCaster()->ToPlayer(); + if (player->GetLastPetNumber()) + { + PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; + if (Pet* newPet = new Pet(player, newPetType)) + { + if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true)) + { + // revive the pet if it is dead + if (newPet->getDeathState() == DEAD) + newPet->setDeathState(ALIVE); - SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct)); + newPet->SetFullHealth(); + newPet->SetPower(newPet->getPowerType(), newPet->GetMaxPower(newPet->getPowerType())); + + switch (newPet->GetEntry()) + { + case NPC_DOOMGUARD: + case NPC_INFERNAL: + newPet->SetEntry(NPC_IMP); + break; + default: + break; + } + } + else + delete newPet; + } + } } void Register() OVERRIDE { - OnHit += SpellHitFn(spell_gen_count_pct_from_max_hp_SpellScript::RecalculateDamage); + OnEffectHitTarget += SpellEffectFn(spell_gen_pet_summoned_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } - - private: - int32 _damagePct; }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_count_pct_from_max_hp_SpellScript(_damagePct); + return new spell_gen_pet_summoned_SpellScript(); } - - private: - int32 _damagePct; }; -class spell_gen_despawn_self : public SpellScriptLoader +class spell_gen_profession_research : public SpellScriptLoader { -public: - spell_gen_despawn_self() : SpellScriptLoader("spell_gen_despawn_self") { } - - class spell_gen_despawn_self_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_despawn_self_SpellScript); + public: + spell_gen_profession_research() : SpellScriptLoader("spell_gen_profession_research") { } - bool Load() OVERRIDE + class spell_gen_profession_research_SpellScript : public SpellScript { - return GetCaster()->GetTypeId() == TYPEID_UNIT; - } + PrepareSpellScript(spell_gen_profession_research_SpellScript); - void HandleDummy(SpellEffIndex effIndex) - { - if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_SCRIPT_EFFECT) - GetCaster()->ToCreature()->DespawnOrUnsummon(); - } + bool Load() OVERRIDE + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + SpellCastResult CheckRequirement() + { + if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + uint32 spellId = GetSpellInfo()->Id; + + // learn random explicit discovery recipe (if any) + if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster)) + caster->learnSpell(discoveredSpellId, false); + + caster->UpdateCraftSkill(spellId); + } + + void Register() OVERRIDE + { + OnCheckCast += SpellCheckCastFn(spell_gen_profession_research_SpellScript::CheckRequirement); + OnEffectHitTarget += SpellEffectFn(spell_gen_profession_research_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; - void Register() OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY); + return new spell_gen_profession_research_SpellScript(); } - }; - - SpellScript* GetSpellScript() const OVERRIDE - { - return new spell_gen_despawn_self_SpellScript(); - } }; -class spell_gen_touch_the_nightmare : public SpellScriptLoader +class spell_gen_remove_flight_auras : public SpellScriptLoader { -public: - spell_gen_touch_the_nightmare() : SpellScriptLoader("spell_gen_touch_the_nightmare") { } - - class spell_gen_touch_the_nightmare_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_touch_the_nightmare_SpellScript); + public: + spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") { } - void HandleDamageCalc(SpellEffIndex /*effIndex*/) + class spell_gen_remove_flight_auras_SpellScript : public SpellScript { - uint32 bp = GetCaster()->GetMaxHealth() * 0.3f; - SetHitDamage(bp); - } + PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript); - void Register() OVERRIDE + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + target->RemoveAurasByType(SPELL_AURA_FLY); + target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); + } + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_touch_the_nightmare_SpellScript::HandleDamageCalc, EFFECT_2, SPELL_EFFECT_SCHOOL_DAMAGE); + return new spell_gen_remove_flight_auras_SpellScript(); } - }; - - SpellScript* GetSpellScript() const OVERRIDE - { - return new spell_gen_touch_the_nightmare_SpellScript(); - } }; -class spell_gen_dream_funnel: public SpellScriptLoader +enum Replenishment { -public: - spell_gen_dream_funnel() : SpellScriptLoader("spell_gen_dream_funnel") { } + SPELL_REPLENISHMENT = 57669, + SPELL_INFINITE_REPLENISHMENT = 61782 +}; - class spell_gen_dream_funnel_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_dream_funnel_AuraScript); +class spell_gen_replenishment : public SpellScriptLoader +{ + public: + spell_gen_replenishment() : SpellScriptLoader("spell_gen_replenishment") { } - void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + class spell_gen_replenishment_AuraScript : public AuraScript { - if (GetCaster()) - amount = GetCaster()->GetMaxHealth() * 0.05f; + PrepareAuraScript(spell_gen_replenishment_AuraScript); - canBeRecalculated = false; - } + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT) || + !sSpellMgr->GetSpellInfo(SPELL_INFINITE_REPLENISHMENT)) + return false; + return true; + } - void Register() OVERRIDE + bool Load() OVERRIDE + { + return GetUnitOwner()->GetPower(POWER_MANA); + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + switch (GetSpellInfo()->Id) + { + case SPELL_REPLENISHMENT: + amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; + break; + case SPELL_INFINITE_REPLENISHMENT: + amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; + break; + default: + break; + } + } + + void Register() OVERRIDE + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_replenishment_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_ENERGIZE); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE); + return new spell_gen_replenishment_AuraScript(); } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_gen_dream_funnel_AuraScript(); - } }; -enum GenericBandage +enum SeaforiumSpells { - SPELL_RECENTLY_BANDAGED = 11196, + SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT = 60937 }; -class spell_gen_bandage : public SpellScriptLoader +class spell_gen_seaforium_blast : public SpellScriptLoader { public: - spell_gen_bandage() : SpellScriptLoader("spell_gen_bandage") { } + spell_gen_seaforium_blast() : SpellScriptLoader("spell_gen_seaforium_blast") { } - class spell_gen_bandage_SpellScript : public SpellScript + class spell_gen_seaforium_blast_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_bandage_SpellScript); + PrepareSpellScript(spell_gen_seaforium_blast_SpellScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED)) + if (!sSpellMgr->GetSpellInfo(SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT)) return false; return true; } - SpellCastResult CheckCast() + bool Load() OVERRIDE { - if (Unit* target = GetExplTargetUnit()) - { - if (target->HasAura(SPELL_RECENTLY_BANDAGED)) - return SPELL_FAILED_TARGET_AURASTATE; - } - return SPELL_CAST_OK; + // OriginalCaster is always available in Spell::prepare + return GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; } - void HandleScript() + void AchievementCredit(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetHitUnit()) - GetCaster()->CastSpell(target, SPELL_RECENTLY_BANDAGED, true); + // but in effect handling OriginalCaster can become NULL + if (Unit* originalCaster = GetOriginalCaster()) + if (GameObject* go = GetHitGObj()) + if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING) + originalCaster->CastSpell(originalCaster, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true); } void Register() OVERRIDE { - OnCheckCast += SpellCheckCastFn(spell_gen_bandage_SpellScript::CheckCast); - AfterHit += SpellHitFn(spell_gen_bandage_SpellScript::HandleScript); + OnEffectHitTarget += SpellEffectFn(spell_gen_seaforium_blast_SpellScript::AchievementCredit, EFFECT_1, SPELL_EFFECT_GAMEOBJECT_DAMAGE); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_bandage_SpellScript(); + return new spell_gen_seaforium_blast_SpellScript(); } }; -enum GenericLifebloom +enum SpectatorCheerTrigger { - SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL = 43422, - SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL = 52552, - SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL = 53692, - SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL = 57763, - SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL = 66094, + EMOTE_ONE_SHOT_CHEER = 4, + EMOTE_ONE_SHOT_EXCLAMATION = 5, + EMOTE_ONE_SHOT_APPLAUD = 21 }; -class spell_gen_lifebloom : public SpellScriptLoader +uint8 const EmoteArray[3] = { EMOTE_ONE_SHOT_CHEER, EMOTE_ONE_SHOT_EXCLAMATION, EMOTE_ONE_SHOT_APPLAUD }; + +class spell_gen_spectator_cheer_trigger : public SpellScriptLoader { public: - spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { } + spell_gen_spectator_cheer_trigger() : SpellScriptLoader("spell_gen_spectator_cheer_trigger") { } - class spell_gen_lifebloom_AuraScript : public AuraScript + class spell_gen_spectator_cheer_trigger_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_lifebloom_AuraScript); + PrepareSpellScript(spell_gen_spectator_cheer_trigger_SpellScript) - public: - spell_gen_lifebloom_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { } + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->HandleEmoteCommand(EmoteArray[urand(0, 2)]); + } - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + void Register() OVERRIDE { - if (!sSpellMgr->GetSpellInfo(_spellId)) - return false; - return true; + OnEffectHitTarget += SpellEffectFn(spell_gen_spectator_cheer_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } + }; - void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_gen_spectator_cheer_trigger_SpellScript(); + } +}; + +class spell_gen_spirit_healer_res : public SpellScriptLoader +{ + public: + spell_gen_spirit_healer_res(): SpellScriptLoader("spell_gen_spirit_healer_res") { } + + class spell_gen_spirit_healer_res_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_spirit_healer_res_SpellScript); + + bool Load() OVERRIDE { - // Final heal only on duration end - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) - return; + return GetOriginalCaster() && GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; + } - // final heal - GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID()); + void HandleDummy(SpellEffIndex /* effIndex */) + { + Player* originalCaster = GetOriginalCaster()->ToPlayer(); + if (Unit* target = GetHitUnit()) + { + WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); + data << uint64(target->GetGUID()); + originalCaster->GetSession()->SendPacket(&data); + } } void Register() OVERRIDE { - AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + OnEffectHitTarget += SpellEffectFn(spell_gen_spirit_healer_res_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - - private: - uint32 _spellId; }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_lifebloom_AuraScript(_spellId); + return new spell_gen_spirit_healer_res_SpellScript(); } - - private: - uint32 _spellId; }; enum SummonElemental @@ -3046,7 +3149,7 @@ class spell_gen_summon_elemental : public SpellScriptLoader public: spell_gen_summon_elemental_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { } - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { if (!sSpellMgr->GetSpellInfo(_spellId)) return false; @@ -3087,658 +3190,490 @@ class spell_gen_summon_elemental : public SpellScriptLoader uint32 _spellId; }; -enum Mounts +enum TournamentMountsSpells { - SPELL_COLD_WEATHER_FLYING = 54197, - - // Magic Broom - SPELL_MAGIC_BROOM_60 = 42680, - SPELL_MAGIC_BROOM_100 = 42683, - SPELL_MAGIC_BROOM_150 = 42667, - SPELL_MAGIC_BROOM_280 = 42668, - - // Headless Horseman's Mount - SPELL_HEADLESS_HORSEMAN_MOUNT_60 = 51621, - SPELL_HEADLESS_HORSEMAN_MOUNT_100 = 48024, - SPELL_HEADLESS_HORSEMAN_MOUNT_150 = 51617, - SPELL_HEADLESS_HORSEMAN_MOUNT_280 = 48023, - - // Winged Steed of the Ebon Blade - SPELL_WINGED_STEED_150 = 54726, - SPELL_WINGED_STEED_280 = 54727, - - // Big Love Rocket - SPELL_BIG_LOVE_ROCKET_0 = 71343, - SPELL_BIG_LOVE_ROCKET_60 = 71344, - SPELL_BIG_LOVE_ROCKET_100 = 71345, - SPELL_BIG_LOVE_ROCKET_150 = 71346, - SPELL_BIG_LOVE_ROCKET_310 = 71347, - - // Invincible - SPELL_INVINCIBLE_60 = 72281, - SPELL_INVINCIBLE_100 = 72282, - SPELL_INVINCIBLE_150 = 72283, - SPELL_INVINCIBLE_310 = 72284, - - // Blazing Hippogryph - SPELL_BLAZING_HIPPOGRYPH_150 = 74854, - SPELL_BLAZING_HIPPOGRYPH_280 = 74855, - - // Celestial Steed - SPELL_CELESTIAL_STEED_60 = 75619, - SPELL_CELESTIAL_STEED_100 = 75620, - SPELL_CELESTIAL_STEED_150 = 75617, - SPELL_CELESTIAL_STEED_280 = 75618, - SPELL_CELESTIAL_STEED_310 = 76153, - - // X-53 Touring Rocket - SPELL_X53_TOURING_ROCKET_150 = 75957, - SPELL_X53_TOURING_ROCKET_280 = 75972, - SPELL_X53_TOURING_ROCKET_310 = 76154, + SPELL_LANCE_EQUIPPED = 62853 }; -class spell_gen_mount : public SpellScriptLoader +class spell_gen_summon_tournament_mount : public SpellScriptLoader { public: - spell_gen_mount(const char* name, uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScriptLoader(name), - _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { } + spell_gen_summon_tournament_mount() : SpellScriptLoader("spell_gen_summon_tournament_mount") { } - class spell_gen_mount_SpellScript : public SpellScript + class spell_gen_summon_tournament_mount_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_mount_SpellScript); - - public: - spell_gen_mount_SpellScript(uint32 mount0, uint32 mount60, uint32 mount100, uint32 mount150, uint32 mount280, uint32 mount310) : SpellScript(), - _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { } + PrepareSpellScript(spell_gen_summon_tournament_mount_SpellScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE { - if (_mount0 && !sSpellMgr->GetSpellInfo(_mount0)) - return false; - if (_mount60 && !sSpellMgr->GetSpellInfo(_mount60)) - return false; - if (_mount100 && !sSpellMgr->GetSpellInfo(_mount100)) - return false; - if (_mount150 && !sSpellMgr->GetSpellInfo(_mount150)) - return false; - if (_mount280 && !sSpellMgr->GetSpellInfo(_mount280)) - return false; - if (_mount310 && !sSpellMgr->GetSpellInfo(_mount310)) + if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED)) return false; return true; } - void HandleMount(SpellEffIndex effIndex) + SpellCastResult CheckIfLanceEquiped() { - PreventHitDefaultEffect(effIndex); + if (GetCaster()->IsInDisallowedMountForm()) + GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT); - if (Player* target = GetHitPlayer()) + if (!GetCaster()->HasAura(SPELL_LANCE_EQUIPPED)) { - // Prevent stacking of mounts and client crashes upon dismounting - target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura()); - - // Triggered spell id dependent on riding skill and zone - bool canFly = false; - uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); - if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) - canFly = true; - - float x, y, z; - target->GetPosition(x, y, z); - uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag); - if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE))) - canFly = false; - - uint32 mount = 0; - switch (target->GetBaseSkillValue(SKILL_RIDING)) - { - case 0: - mount = _mount0; - break; - case 75: - mount = _mount60; - break; - case 150: - mount = _mount100; - break; - case 225: - if (canFly) - mount = _mount150; - else - mount = _mount100; - break; - case 300: - if (canFly) - { - if (_mount310 && target->Has310Flyer(false)) - mount = _mount310; - else - mount = _mount280; - } - else - mount = _mount100; - break; - default: - break; - } - - if (mount) - { - PreventHitAura(); - target->CastSpell(target, mount, true); - } + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED); + return SPELL_FAILED_CUSTOM_ERROR; } + + return SPELL_CAST_OK; } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_mount_SpellScript::HandleMount, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + OnCheckCast += SpellCheckCastFn(spell_gen_summon_tournament_mount_SpellScript::CheckIfLanceEquiped); } - - private: - uint32 _mount0; - uint32 _mount60; - uint32 _mount100; - uint32 _mount150; - uint32 _mount280; - uint32 _mount310; }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_mount_SpellScript(_mount0, _mount60, _mount100, _mount150, _mount280, _mount310); + return new spell_gen_summon_tournament_mount_SpellScript(); } - - private: - uint32 _mount0; - uint32 _mount60; - uint32 _mount100; - uint32 _mount150; - uint32 _mount280; - uint32 _mount310; }; -enum FoamSword -{ - ITEM_FOAM_SWORD_GREEN = 45061, - ITEM_FOAM_SWORD_PINK = 45176, - ITEM_FOAM_SWORD_BLUE = 45177, - ITEM_FOAM_SWORD_RED = 45178, - ITEM_FOAM_SWORD_YELLOW = 45179, - SPELL_BONKED = 62991, - SPELL_FOAM_SWORD_DEFEAT = 62994, - SPELL_ON_GUARD = 62972, +enum MountedDuelSpells +{ + SPELL_ON_TOURNAMENT_MOUNT = 63034, + SPELL_MOUNTED_DUEL = 62875 }; -class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader +class spell_gen_tournament_duel : public SpellScriptLoader { public: - spell_gen_upper_deck_create_foam_sword() : SpellScriptLoader("spell_gen_upper_deck_create_foam_sword") { } + spell_gen_tournament_duel() : SpellScriptLoader("spell_gen_tournament_duel") { } - class spell_gen_upper_deck_create_foam_sword_SpellScript : public SpellScript + class spell_gen_tournament_duel_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_upper_deck_create_foam_sword_SpellScript); + PrepareSpellScript(spell_gen_tournament_duel_SpellScript); - void HandleScript(SpellEffIndex effIndex) + bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE { - if (Player* player = GetHitPlayer()) + if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT) || + !sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* rider = GetCaster()->GetCharmer()) { - static uint32 const itemId[5] = { ITEM_FOAM_SWORD_GREEN, ITEM_FOAM_SWORD_PINK, ITEM_FOAM_SWORD_BLUE, ITEM_FOAM_SWORD_RED, ITEM_FOAM_SWORD_YELLOW }; - // player can only have one of these items - for (uint8 i = 0; i < 5; ++i) + if (Player* playerTarget = GetHitPlayer()) { - if (player->HasItemCount(itemId[i], 1, true)) - return; + if (playerTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && playerTarget->GetVehicleBase()) + rider->CastSpell(playerTarget, SPELL_MOUNTED_DUEL, true); + } + else if (Unit* unitTarget = GetHitUnit()) + { + if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT)) + rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true); } - - CreateItem(effIndex, itemId[urand(0, 4)]); } } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_upper_deck_create_foam_sword_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_gen_tournament_duel_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_upper_deck_create_foam_sword_SpellScript(); + return new spell_gen_tournament_duel_SpellScript(); } }; -class spell_gen_bonked : public SpellScriptLoader +class spell_gen_tournament_pennant : public SpellScriptLoader { public: - spell_gen_bonked() : SpellScriptLoader("spell_gen_bonked") { } + spell_gen_tournament_pennant() : SpellScriptLoader("spell_gen_tournament_pennant") { } - class spell_gen_bonked_SpellScript : public SpellScript + class spell_gen_tournament_pennant_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_bonked_SpellScript); + PrepareAuraScript(spell_gen_tournament_pennant_AuraScript); - void HandleScript(SpellEffIndex /*effIndex*/) + bool Load() OVERRIDE { - if (Player* target = GetHitPlayer()) - { - Aura const* aura = GetHitAura(); - if (!(aura && aura->GetStackAmount() == 3)) - return; - - target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true); - target->RemoveAurasDueToSpell(SPELL_BONKED); + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - if (Aura const* aura = target->GetAura(SPELL_ON_GUARD)) - { - if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID())) - target->DestroyItemCount(item->GetEntry(), 1, true); - } - } + void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (!caster->GetVehicleBase()) + caster->RemoveAurasDueToSpell(GetId()); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_bonked_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennant_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_bonked_SpellScript(); + return new spell_gen_tournament_pennant_AuraScript(); } }; -class spell_gen_gift_of_naaru : public SpellScriptLoader + + +enum PvPTrinketTriggeredSpells +{ + SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER = 72752, + SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF = 72757 +}; + +class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader { public: - spell_gen_gift_of_naaru() : SpellScriptLoader("spell_gen_gift_of_naaru") { } + spell_pvp_trinket_wotf_shared_cd() : SpellScriptLoader("spell_pvp_trinket_wotf_shared_cd") { } - class spell_gen_gift_of_naaru_AuraScript : public AuraScript + class spell_pvp_trinket_wotf_shared_cd_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_gift_of_naaru_AuraScript); + PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript); - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + bool Load() OVERRIDE { - if (!GetCaster()) - return; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - float heal = 0.0f; - switch (GetSpellInfo()->SpellFamilyName) - { - case SPELLFAMILY_MAGE: - case SPELLFAMILY_WARLOCK: - case SPELLFAMILY_PRIEST: - heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())); - break; - case SPELLFAMILY_PALADIN: - case SPELLFAMILY_SHAMAN: - heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK))); - break; - case SPELLFAMILY_WARRIOR: - case SPELLFAMILY_HUNTER: - case SPELLFAMILY_DEATHKNIGHT: - heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK))); - break; - case SPELLFAMILY_GENERIC: - default: - break; - } + bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER) || + !sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) + return false; + return true; + } - int32 healTick = floor(heal / aurEff->GetTotalTicks()); - amount += int32(std::max(healTick, 0)); + void HandleScript() + { + // This is only needed because spells cast from spell_linked_spell are triggered by default + // Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD + GetCaster()->ToPlayer()->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell()); } void Register() OVERRIDE { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_gift_of_naaru_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + AfterCast += SpellCastFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript); } }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_gift_of_naaru_AuraScript(); + return new spell_pvp_trinket_wotf_shared_cd_SpellScript(); } }; -enum Replenishment +enum FriendOrFowl { - SPELL_REPLENISHMENT = 57669, - SPELL_INFINITE_REPLENISHMENT = 61782 + SPELL_TURKEY_VENGEANCE = 25285 }; -class spell_gen_replenishment : public SpellScriptLoader +class spell_gen_turkey_marker : public SpellScriptLoader { public: - spell_gen_replenishment() : SpellScriptLoader("spell_gen_replenishment") { } + spell_gen_turkey_marker() : SpellScriptLoader("spell_gen_turkey_marker") { } - class spell_gen_replenishment_AuraScript : public AuraScript + class spell_gen_turkey_marker_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_replenishment_AuraScript); + PrepareAuraScript(spell_gen_turkey_marker_AuraScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT) || - !sSpellMgr->GetSpellInfo(SPELL_INFINITE_REPLENISHMENT)) - return false; - return true; - } + // store stack apply times, so we can pop them while they expire + _applyTimes.push_back(getMSTime()); + Unit* target = GetTarget(); - bool Load() OVERRIDE - { - return GetUnitOwner()->GetPower(POWER_MANA); + // on stack 15 cast the achievement crediting spell + if (GetStackAmount() >= 15) + target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID()); } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void OnPeriodic(AuraEffect const* /*aurEff*/) { - switch (GetSpellInfo()->Id) - { - case SPELL_REPLENISHMENT: - amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; - break; - case SPELL_INFINITE_REPLENISHMENT: - amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; - break; - default: - break; - } + if (_applyTimes.empty()) + return; + + // pop stack if it expired for us + if (_applyTimes.front() + GetMaxDuration() < getMSTime()) + ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE); } void Register() OVERRIDE { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_replenishment_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_ENERGIZE); + AfterEffectApply += AuraEffectApplyFn(spell_gen_turkey_marker_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_turkey_marker_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); } + + std::list<uint32> _applyTimes; }; AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_replenishment_AuraScript(); + return new spell_gen_turkey_marker_AuraScript(); } }; -enum ServiceUniform +enum FoamSword { - SPELL_SERVICE_UNIFORM = 71450, - - MODEL_GOBLIN_MALE = 31002, - MODEL_GOBLIN_FEMALE = 31003, + ITEM_FOAM_SWORD_GREEN = 45061, + ITEM_FOAM_SWORD_PINK = 45176, + ITEM_FOAM_SWORD_BLUE = 45177, + ITEM_FOAM_SWORD_RED = 45178, + ITEM_FOAM_SWORD_YELLOW = 45179 }; -class spell_gen_aura_service_uniform : public SpellScriptLoader +class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader { public: - spell_gen_aura_service_uniform() : SpellScriptLoader("spell_gen_aura_service_uniform") { } + spell_gen_upper_deck_create_foam_sword() : SpellScriptLoader("spell_gen_upper_deck_create_foam_sword") { } - class spell_gen_aura_service_uniform_AuraScript : public AuraScript + class spell_gen_upper_deck_create_foam_sword_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_aura_service_uniform_AuraScript); - - bool Validate(SpellInfo const* /*spell*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_SERVICE_UNIFORM)) - return false; - return true; - } + PrepareSpellScript(spell_gen_upper_deck_create_foam_sword_SpellScript); - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleScript(SpellEffIndex effIndex) { - // Apply model goblin - Unit* target = GetTarget(); - if (target->GetTypeId() == TYPEID_PLAYER) + if (Player* player = GetHitPlayer()) { - if (target->getGender() == GENDER_MALE) - target->SetDisplayId(MODEL_GOBLIN_MALE); - else - target->SetDisplayId(MODEL_GOBLIN_FEMALE); - } - } + static uint32 const itemId[5] = { ITEM_FOAM_SWORD_GREEN, ITEM_FOAM_SWORD_PINK, ITEM_FOAM_SWORD_BLUE, ITEM_FOAM_SWORD_RED, ITEM_FOAM_SWORD_YELLOW }; + // player can only have one of these items + for (uint8 i = 0; i < 5; ++i) + { + if (player->HasItemCount(itemId[i], 1, true)) + return; + } - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (target->GetTypeId() == TYPEID_PLAYER) - target->RestoreDisplayId(); + CreateItem(effIndex, itemId[urand(0, 4)]); + } } void Register() OVERRIDE { - AfterEffectApply += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); + OnEffectHitTarget += SpellEffectFn(spell_gen_upper_deck_create_foam_sword_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_aura_service_uniform_AuraScript(); + return new spell_gen_upper_deck_create_foam_sword_SpellScript(); } }; -enum OrcDisguiseSpells +enum VehicleScaling { - SPELL_ORC_DISGUISE_TRIGGER = 45759, - SPELL_ORC_DISGUISE_MALE = 45760, - SPELL_ORC_DISGUISE_FEMALE = 45762, + SPELL_GEAR_SCALING = 66668 }; -class spell_gen_orc_disguise : public SpellScriptLoader +class spell_gen_vehicle_scaling : public SpellScriptLoader { public: - spell_gen_orc_disguise() : SpellScriptLoader("spell_gen_orc_disguise") { } + spell_gen_vehicle_scaling() : SpellScriptLoader("spell_gen_vehicle_scaling") { } - class spell_gen_orc_disguise_SpellScript : public SpellScript + class spell_gen_vehicle_scaling_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_orc_disguise_SpellScript); + PrepareAuraScript(spell_gen_vehicle_scaling_AuraScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Load() OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) || - !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_FEMALE)) - return false; - return true; + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; } - void HandleScript(SpellEffIndex /*effIndex*/) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { Unit* caster = GetCaster(); - if (Player* target = GetHitPlayer()) + float factor; + uint16 baseItemLevel; + + /// @todo Reserach coeffs for different vehicles + switch (GetId()) { - uint8 gender = target->getGender(); - if (!gender) - caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true); - else - caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true); + case SPELL_GEAR_SCALING: + factor = 1.0f; + baseItemLevel = 205; + break; + default: + factor = 1.0f; + baseItemLevel = 170; + break; } + + float avgILvl = caster->ToPlayer()->GetAverageItemLevel(); + if (avgILvl < baseItemLevel) + return; /// @todo Research possibility of scaling down + + amount = uint16((avgILvl - baseItemLevel) * factor); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_orc_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_orc_disguise_SpellScript(); + return new spell_gen_vehicle_scaling_AuraScript(); } }; -enum WhisperGulchYoggSaronWhisper +enum VendorBarkTrigger { - SPELL_YOGG_SARON_WHISPER_DUMMY = 29072 + NPC_AMPHITHEATER_VENDOR = 30098, + SAY_AMPHITHEATER_VENDOR = 0 }; -class spell_gen_whisper_gulch_yogg_saron_whisper : public SpellScriptLoader +class spell_gen_vendor_bark_trigger : public SpellScriptLoader { public: - spell_gen_whisper_gulch_yogg_saron_whisper() : SpellScriptLoader("spell_gen_whisper_gulch_yogg_saron_whisper") { } + spell_gen_vendor_bark_trigger() : SpellScriptLoader("spell_gen_vendor_bark_trigger") { } - class spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript : public AuraScript + class spell_gen_vendor_bark_trigger_SpellScript : public SpellScript { - PrepareAuraScript(spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_YOGG_SARON_WHISPER_DUMMY)) - return false; - return true; - } + PrepareSpellScript(spell_gen_vendor_bark_trigger_SpellScript) - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + void HandleDummy(SpellEffIndex /* effIndex */) { - PreventDefaultAction(); - GetTarget()->CastSpell((Unit*)NULL, SPELL_YOGG_SARON_WHISPER_DUMMY, true); + if (Creature* vendor = GetCaster()->ToCreature()) + if (vendor->GetEntry() == NPC_AMPHITHEATER_VENDOR) + vendor->AI()->Talk(SAY_AMPHITHEATER_VENDOR); } void Register() OVERRIDE { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_gen_vendor_bark_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; - AuraScript* GetAuraScript() const OVERRIDE + SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript(); + return new spell_gen_vendor_bark_trigger_SpellScript(); } -}; -enum SpectatorCheerTrigger -{ - EMOTE_ONE_SHOT_CHEER = 4, - EMOTE_ONE_SHOT_EXCLAMATION = 5, - EMOTE_ONE_SHOT_APPLAUD = 21 }; -uint8 const EmoteArray[3] = { EMOTE_ONE_SHOT_CHEER, EMOTE_ONE_SHOT_EXCLAMATION, EMOTE_ONE_SHOT_APPLAUD }; - -class spell_gen_spectator_cheer_trigger : public SpellScriptLoader +class spell_gen_wg_water : public SpellScriptLoader { public: - spell_gen_spectator_cheer_trigger() : SpellScriptLoader("spell_gen_spectator_cheer_trigger") { } + spell_gen_wg_water() : SpellScriptLoader("spell_gen_wg_water") { } - class spell_gen_spectator_cheer_trigger_SpellScript : public SpellScript + class spell_gen_wg_water_SpellScript : public SpellScript { - PrepareSpellScript(spell_gen_spectator_cheer_trigger_SpellScript) + PrepareSpellScript(spell_gen_wg_water_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) + SpellCastResult CheckCast() { - GetCaster()->HandleEmoteCommand(EmoteArray[urand(0, 2)]); + if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster())) + return SPELL_FAILED_DONT_REPORT; + return SPELL_CAST_OK; } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_spectator_cheer_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_gen_wg_water_SpellScript::CheckCast); } }; SpellScript* GetSpellScript() const OVERRIDE { - return new spell_gen_spectator_cheer_trigger_SpellScript(); + return new spell_gen_wg_water_SpellScript(); } - }; -enum VendorBarkTrigger - +enum WhisperGulchYoggSaronWhisper { - NPC_AMPHITHEATER_VENDOR = 30098, - SAY_AMPHITHEATER_VENDOR = 0 + SPELL_YOGG_SARON_WHISPER_DUMMY = 29072 }; -class spell_gen_vendor_bark_trigger : public SpellScriptLoader +class spell_gen_whisper_gulch_yogg_saron_whisper : public SpellScriptLoader { public: - spell_gen_vendor_bark_trigger() : SpellScriptLoader("spell_gen_vendor_bark_trigger") { } + spell_gen_whisper_gulch_yogg_saron_whisper() : SpellScriptLoader("spell_gen_whisper_gulch_yogg_saron_whisper") { } - class spell_gen_vendor_bark_trigger_SpellScript : public SpellScript + class spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript : public AuraScript { - PrepareSpellScript(spell_gen_vendor_bark_trigger_SpellScript) + PrepareAuraScript(spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript); - void HandleDummy(SpellEffIndex /* effIndex */) + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (Creature* vendor = GetCaster()->ToCreature()) - if (vendor->GetEntry() == NPC_AMPHITHEATER_VENDOR) - vendor->AI()->Talk(SAY_AMPHITHEATER_VENDOR); + if (!sSpellMgr->GetSpellInfo(SPELL_YOGG_SARON_WHISPER_DUMMY)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell((Unit*)NULL, SPELL_YOGG_SARON_WHISPER_DUMMY, true); } void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_gen_vendor_bark_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); } }; - SpellScript* GetSpellScript() const OVERRIDE + AuraScript* GetAuraScript() const OVERRIDE { - return new spell_gen_vendor_bark_trigger_SpellScript(); + return new spell_gen_whisper_gulch_yogg_saron_whisper_AuraScript(); } - }; void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); new spell_gen_adaptive_warding(); + new spell_gen_allow_cast_from_item_only(); + new spell_gen_animal_blood(); new spell_gen_aura_of_anger(); + new spell_gen_aura_service_uniform(); new spell_gen_av_drekthar_presence(); + new spell_gen_bandage(); + new spell_gen_bonked(); + new spell_gen_break_shield("spell_gen_break_shield"); + new spell_gen_break_shield("spell_gen_tournament_counterattack"); new spell_gen_burn_brutallus(); new spell_gen_cannibalize(); - new spell_gen_create_lance(); - new spell_gen_netherbloom(); - new spell_gen_nightmare_vine(); - new spell_gen_obsidian_armor(); - new spell_gen_parachute(); - new spell_gen_pet_summoned(); - new spell_gen_remove_flight_auras(); - new spell_creature_permanent_feign_death(); - new spell_pvp_trinket_wotf_shared_cd(); - new spell_gen_animal_blood(); - new spell_gen_divine_storm_cd_reset(); - new spell_gen_parachute_ic(); - new spell_gen_gunship_portal(); - new spell_gen_dungeon_credit(); - new spell_gen_profession_research(); - new spell_generic_clone(); - new spell_generic_clone_weapon(); + new spell_gen_chaos_blast(); + new spell_gen_clone(); + new spell_gen_clone_weapon(); new spell_gen_clone_weapon_aura(); - new spell_gen_seaforium_blast(); - new spell_gen_turkey_marker(); - new spell_gen_lifeblood(); - new spell_gen_magic_rooster(); - new spell_gen_allow_cast_from_item_only(); - new spell_gen_launch(); - new spell_gen_vehicle_scaling(); - new spell_gen_oracle_wolvar_reputation(); - new spell_gen_damage_reduction_aura(); - new spell_gen_dummy_trigger(); - new spell_gen_spirit_healer_res(); - new spell_gen_gadgetzan_transporter_backfire(); - new spell_gen_gnomish_transporter(); + new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); + new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); + new spell_gen_create_lance(); + new spell_gen_creature_permanent_feign_death(); new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise"); new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise"); - new spell_gen_elune_candle(); - new spell_gen_break_shield("spell_gen_break_shield"); - new spell_gen_break_shield("spell_gen_tournament_counterattack"); - new spell_gen_mounted_charge(); + new spell_gen_damage_reduction_aura(); new spell_gen_defend(); - new spell_gen_tournament_duel(); - new spell_gen_summon_tournament_mount(); - new spell_gen_on_tournament_mount(); - new spell_gen_tournament_pennant(); - new spell_gen_chaos_blast(); - new spell_gen_ds_flush_knockback(); - new spell_gen_wg_water(); - new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); - new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); new spell_gen_despawn_self(); - new spell_gen_touch_the_nightmare(); - new spell_gen_dream_funnel(); - new spell_gen_bandage(); + new spell_gen_divine_storm_cd_reset(); + new spell_gen_ds_flush_knockback(); + new spell_gen_dummy_trigger(); + new spell_gen_dungeon_credit(); + new spell_gen_elune_candle(); + new spell_gen_gadgetzan_transporter_backfire(); + new spell_gen_gift_of_naaru(); + new spell_gen_gnomish_transporter(); + new spell_gen_gunship_portal(); + new spell_gen_launch(); + new spell_gen_lifeblood(); new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_twisted_visage_lifebloom", SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL); - new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL); - new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL); + new spell_gen_magic_rooster(); new spell_gen_mount("spell_magic_broom", 0, SPELL_MAGIC_BROOM_60, SPELL_MAGIC_BROOM_100, SPELL_MAGIC_BROOM_150, SPELL_MAGIC_BROOM_280); new spell_gen_mount("spell_headless_horseman_mount", 0, SPELL_HEADLESS_HORSEMAN_MOUNT_60, SPELL_HEADLESS_HORSEMAN_MOUNT_100, SPELL_HEADLESS_HORSEMAN_MOUNT_150, SPELL_HEADLESS_HORSEMAN_MOUNT_280); new spell_gen_mount("spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280); @@ -3747,13 +3682,32 @@ void AddSC_generic_spell_scripts() new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280); new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310); new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310); - new spell_gen_upper_deck_create_foam_sword(); - new spell_gen_bonked(); - new spell_gen_gift_of_naaru(); - new spell_gen_replenishment(); - new spell_gen_aura_service_uniform(); + new spell_gen_mounted_charge(); + new spell_gen_netherbloom(); + new spell_gen_nightmare_vine(); + new spell_gen_obsidian_armor(); + new spell_gen_on_tournament_mount(); + new spell_gen_oracle_wolvar_reputation(); new spell_gen_orc_disguise(); - new spell_gen_whisper_gulch_yogg_saron_whisper(); + new spell_gen_parachute(); + new spell_gen_parachute_ic(); + new spell_gen_pet_summoned(); + new spell_gen_profession_research(); + new spell_gen_remove_flight_auras(); + new spell_gen_replenishment(); + new spell_gen_seaforium_blast(); new spell_gen_spectator_cheer_trigger(); + new spell_gen_spirit_healer_res(); + new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL); + new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL); + new spell_gen_summon_tournament_mount(); + new spell_gen_tournament_duel(); + new spell_gen_tournament_pennant(); + new spell_pvp_trinket_wotf_shared_cd(); + new spell_gen_turkey_marker(); + new spell_gen_upper_deck_create_foam_sword(); + new spell_gen_vehicle_scaling(); new spell_gen_vendor_bark_trigger(); + new spell_gen_wg_water(); + new spell_gen_whisper_gulch_yogg_saron_whisper(); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 9b8e7d489ce..09be427d330 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -73,6 +73,46 @@ class spell_item_trigger_spell : public SpellScriptLoader } }; +enum AegisOfPreservation +{ + SPELL_AEGIS_HEAL = 23781 +}; + +// 23780 - Aegis of Preservation +class spell_item_aegis_of_preservation : public SpellScriptLoader +{ + public: + spell_item_aegis_of_preservation() : SpellScriptLoader("spell_item_aegis_of_preservation") { } + + class spell_item_aegis_of_preservation_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_aegis_of_preservation_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_AEGIS_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_item_aegis_of_preservation_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_item_aegis_of_preservation_AuraScript(); + } +}; + // 26400 - Arcane Shroud class spell_item_arcane_shroud : public SpellScriptLoader { @@ -217,6 +257,46 @@ class spell_item_defibrillate : public SpellScriptLoader uint32 _failSpell; }; +enum DesperateDefense +{ + SPELL_DESPERATE_RAGE = 33898 +}; + +// 33896 - Desperate Defense +class spell_item_desperate_defense : public SpellScriptLoader +{ + public: + spell_item_desperate_defense() : SpellScriptLoader("spell_item_desperate_defense") { } + + class spell_item_desperate_defense_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_desperate_defense_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DESPERATE_RAGE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_item_desperate_defense_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_item_desperate_defense_AuraScript(); + } +}; + // http://www.wowhead.com/item=6522 Deviate Fish // 8063 Deviate Fish enum DeviateFishSpells @@ -523,15 +603,21 @@ class spell_item_necrotic_touch : public SpellScriptLoader return true; } + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive(); + } + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff); } void Register() OVERRIDE { + DoCheckProc += AuraCheckProcFn(spell_item_necrotic_touch_AuraScript::CheckProc); OnEffectProc += AuraEffectProcFn(spell_item_necrotic_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); } }; @@ -2477,11 +2563,13 @@ void AddSC_item_spell_scripts() // 23075 Mithril Mechanical Dragonling new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING); + new spell_item_aegis_of_preservation(); new spell_item_arcane_shroud(); new spell_item_blessing_of_ancient_kings(); new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL); new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL); new spell_item_defibrillate("spell_item_gnomish_army_knife", 33); + new spell_item_desperate_defense(); new spell_item_deviate_fish(); new spell_item_flask_of_the_north(); new spell_item_gnomish_death_ray(); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index fa3c6be7f72..18d3e07d43b 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -55,16 +55,32 @@ enum PaladinSpells SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, SPELL_PALADIN_DIVINE_SACRIFICE = 64205, + SPELL_PALADIN_ITEM_HEALING_TRANCE = 37706, + SPELL_PALADIN_GLYPH_OF_SALVATION = 63225, SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790, SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742, + SPELL_PALADIN_CONCENTRACTION_AURA = 19746, + SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1 = 31869, + SPELL_PALADIN_SWIFT_RETRIBUTION_R1 = 53379, + + SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA = 63510, + SPELL_PALADIN_IMPROVED_DEVOTION_AURA = 63514, + SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA = 63531, + SPELL_PALADIN_AURA_MASTERY_IMMUNE = 64364, + SPELL_GENERIC_ARENA_DAMPENING = 74410, SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411 }; +enum PaladinSpellIcons +{ + PALADIN_ICON_ID_RETRIBUTION_AURA = 555 +}; + // 31850 - Ardent Defender class spell_pal_ardent_defender : public SpellScriptLoader { @@ -141,6 +157,80 @@ class spell_pal_ardent_defender : public SpellScriptLoader } }; +// 31821 - Aura Mastery +class spell_pal_aura_mastery : public SpellScriptLoader +{ + public: + spell_pal_aura_mastery() : SpellScriptLoader("spell_pal_aura_mastery") { } + + class spell_pal_aura_mastery_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_aura_mastery_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AURA_MASTERY_IMMUNE)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_AURA_MASTERY_IMMUNE, true); + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveOwnedAura(SPELL_PALADIN_AURA_MASTERY_IMMUNE, GetCasterGUID()); + } + + void Register() OVERRIDE + { + AfterEffectApply += AuraEffectApplyFn(spell_pal_aura_mastery_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_pal_aura_mastery_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pal_aura_mastery_AuraScript(); + } +}; + +// 64364 - Aura Mastery Immune +class spell_pal_aura_mastery_immune : public SpellScriptLoader +{ + public: + spell_pal_aura_mastery_immune() : SpellScriptLoader("spell_pal_aura_mastery_immune") { } + + class spell_pal_aura_mastery_immune_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_aura_mastery_immune_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_CONCENTRACTION_AURA)) + return false; + return true; + } + + bool CheckAreaTarget(Unit* target) + { + return target->HasAura(SPELL_PALADIN_CONCENTRACTION_AURA, GetCasterGUID()); + } + + void Register() OVERRIDE + { + DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_pal_aura_mastery_immune_AuraScript::CheckAreaTarget); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pal_aura_mastery_immune_AuraScript(); + } +}; + // 37877 - Blessing of Faith class spell_pal_blessing_of_faith : public SpellScriptLoader { @@ -597,16 +687,17 @@ class spell_pal_holy_shock : public SpellScriptLoader { PrepareSpellScript(spell_pal_holy_shock_SpellScript); - bool Validate(SpellInfo const* spell) OVERRIDE + bool Validate(SpellInfo const* spellInfo) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1)) + SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1); + if (!firstRankSpellInfo) return false; // can't use other spell than holy shock due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(SPELL_PALADIN_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id)) + if (!spellInfo->IsRankOf(firstRankSpellInfo)) return false; - uint8 rank = sSpellMgr->GetSpellRank(spell->Id); + uint8 rank = spellInfo->GetRank(); if (!sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank, true)) return false; @@ -618,11 +709,11 @@ class spell_pal_holy_shock : public SpellScriptLoader Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) { - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + uint8 rank = GetSpellInfo()->GetRank(); if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true); else - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true); } } @@ -658,6 +749,148 @@ class spell_pal_holy_shock : public SpellScriptLoader } }; +// Maybe this is incorrect +// These spells should always be cast on login, regardless of whether the player has the talent or not + +// -20254 - Improved Concentration Aura +// -20138 - Improved Devotion Aura +// 31869 - Sanctified Retribution +// -53379 - Swift Retribution +class spell_pal_improved_aura : public SpellScriptLoader +{ + public: + spell_pal_improved_aura(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { } + + class spell_pal_improved_aura_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_improved_aura_AuraScript); + + public: + spell_pal_improved_aura_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { } + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(_spellId) + || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1) + || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SWIFT_RETRIBUTION_R1)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target->GetOwnedAura(_spellId)) + target->CastSpell(target, _spellId, true); + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + uint32 spellId = GetSpellInfo()->GetFirstRankSpell()->Id; + + if ((spellId == SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1 && GetTarget()->GetAuraOfRankedSpell(SPELL_PALADIN_SWIFT_RETRIBUTION_R1)) + || (spellId == SPELL_PALADIN_SWIFT_RETRIBUTION_R1 && GetTarget()->GetAuraOfRankedSpell(SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1))) + return; + + GetTarget()->RemoveOwnedAura(_spellId, GetCasterGUID()); + } + + void Register() OVERRIDE + { + AfterEffectApply += AuraEffectApplyFn(spell_pal_improved_aura_AuraScript::HandleEffectApply, EFFECT_FIRST_FOUND, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_pal_improved_aura_AuraScript::HandleEffectRemove, EFFECT_FIRST_FOUND, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL); + } + + private: + uint32 _spellId; + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pal_improved_aura_AuraScript(_spellId); + } + + private: + uint32 _spellId; +}; + +// 63510 - Improved Concentraction Aura (Area Aura) +// 63514 - Improved Devotion Aura (Area Aura) +// 63531 - Sanctified Retribution (Area Aura) +class spell_pal_improved_aura_effect : public SpellScriptLoader +{ + public: + spell_pal_improved_aura_effect(char const* name) : SpellScriptLoader(name) { } + + class spell_pal_improved_aura_effect_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_improved_aura_effect_AuraScript); + + bool CheckAreaTarget(Unit* target) + { + Unit::AuraApplicationMap& appliedAuras = target->GetAppliedAuras(); + for (Unit::AuraApplicationMap::iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr) + { + Aura const* aura = itr->second->GetBase(); + if (aura->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA && aura->GetCasterGUID() == GetCasterGUID()) + { + // Not allow for Retribution Aura (prevent stacking) - Retribution Aura Overflow and Retribution Aura has same spell effects + if (GetSpellInfo()->Id == SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA && aura->GetSpellInfo()->SpellIconID == PALADIN_ICON_ID_RETRIBUTION_AURA) + return false; + return true; + } + } + + return false; + } + + void Register() OVERRIDE + { + DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_pal_improved_aura_effect_AuraScript::CheckAreaTarget); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pal_improved_aura_effect_AuraScript(); + } +}; + +// 37705 - Healing Discount +class spell_pal_item_healing_discount : public SpellScriptLoader +{ + public: + spell_pal_item_healing_discount() : SpellScriptLoader("spell_pal_item_healing_discount") { } + + class spell_pal_item_healing_discount_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_item_healing_discount_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ITEM_HEALING_TRANCE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_pal_item_healing_discount_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pal_item_healing_discount_AuraScript(); + } +}; + // 20425 - Judgement of Command class spell_pal_judgement_of_command : public SpellScriptLoader { @@ -900,6 +1133,8 @@ class spell_pal_seal_of_righteousness : public SpellScriptLoader void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); + new spell_pal_aura_mastery(); + new spell_pal_aura_mastery_immune(); new spell_pal_blessing_of_faith(); new spell_pal_blessing_of_sanctuary(); new spell_pal_divine_sacrifice(); @@ -911,6 +1146,14 @@ void AddSC_paladin_spell_scripts() new spell_pal_hand_of_sacrifice(); new spell_pal_hand_of_salvation(); new spell_pal_holy_shock(); + new spell_pal_improved_aura("spell_pal_improved_concentraction_aura", SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA); + new spell_pal_improved_aura("spell_pal_improved_devotion_aura", SPELL_PALADIN_IMPROVED_DEVOTION_AURA); + new spell_pal_improved_aura("spell_pal_sanctified_retribution", SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA); + new spell_pal_improved_aura("spell_pal_swift_retribution", SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA); + new spell_pal_improved_aura_effect("spell_pal_improved_concentraction_aura_effect"); + new spell_pal_improved_aura_effect("spell_pal_improved_devotion_aura_effect"); + new spell_pal_improved_aura_effect("spell_pal_sanctified_retribution_effect"); + new spell_pal_item_healing_discount(); new spell_pal_judgement_of_command(); new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index cf52909ee3f..0d3da30377a 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -34,6 +34,7 @@ enum PriestSpells SPELL_PRIEST_GLYPH_OF_LIGHTWELL = 55673, SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL = 56161, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL = 48153, + SPELL_PRIEST_ITEM_EFFICIENCY = 37595, SPELL_PRIEST_MANA_LEECH_PROC = 34650, SPELL_PRIEST_PENANCE_R1 = 47540, SPELL_PRIEST_PENANCE_R1_DAMAGE = 47758, @@ -140,7 +141,7 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader } }; -// -47788 - Guardian Spirit +// 47788 - Guardian Spirit class spell_pri_guardian_spirit : public SpellScriptLoader { public: @@ -197,6 +198,41 @@ class spell_pri_guardian_spirit : public SpellScriptLoader } }; +// 37594 - Greater Heal Refund +class spell_pri_item_greater_heal_refund : public SpellScriptLoader +{ + public: + spell_pri_item_greater_heal_refund() : SpellScriptLoader("spell_pri_item_greater_heal_refund") { } + + class spell_pri_item_greater_heal_refund_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_item_greater_heal_refund_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ITEM_EFFICIENCY)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_pri_item_greater_heal_refund_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pri_item_greater_heal_refund_AuraScript(); + } +}; + // -7001 - Lightwell Renew class spell_pri_lightwell_renew : public SpellScriptLoader { @@ -229,7 +265,7 @@ class spell_pri_lightwell_renew : public SpellScriptLoader } }; -// -8129 - Mana Burn +// 8129 - Mana Burn class spell_pri_mana_burn : public SpellScriptLoader { public: @@ -382,13 +418,15 @@ class spell_pri_penance : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_PENANCE_R1)) + SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PRIEST_PENANCE_R1); + if (!firstRankSpellInfo) return false; + // can't use other spell than this penance due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(SPELL_PRIEST_PENANCE_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id)) + if (!spellInfo->IsRankOf(firstRankSpellInfo)) return false; - uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id); + uint8 rank = spellInfo->GetRank(); if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank, true)) return false; if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank, true)) @@ -405,12 +443,12 @@ class spell_pri_penance : public SpellScriptLoader if (!unitTarget->IsAlive()) return; - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + uint8 rank = GetSpellInfo()->GetRank(); if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank), false, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank), false); else - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank), false, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank), false); } } @@ -491,12 +529,11 @@ class spell_pri_power_word_shield : public SpellScriptLoader if (dmgInfo.GetAttacker() == target) return; - if (Unit* caster = GetCaster()) - if (AuraEffect* talentAurEff = caster->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) - { - int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); - } + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) + { + int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); + target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } } void Register() OVERRIDE @@ -633,7 +670,7 @@ class spell_pri_vampiric_touch : public SpellScriptLoader { PrepareAuraScript(spell_pri_vampiric_touch_AuraScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL)) return false; @@ -669,6 +706,7 @@ void AddSC_priest_spell_scripts() new spell_pri_divine_aegis(); new spell_pri_glyph_of_prayer_of_healing(); new spell_pri_guardian_spirit(); + new spell_pri_item_greater_heal_refund(); new spell_pri_lightwell_renew(); new spell_pri_mana_burn(); new spell_pri_mana_leech(); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 69e02a37272..3a02a8b8c09 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -41,6 +41,9 @@ enum ShamanSpells SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM = 55456, SPELL_SHAMAN_GLYPH_OF_MANA_TIDE = 55441, SPELL_SHAMAN_GLYPH_OF_THUNDERSTORM = 62132, + SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD = 23552, + SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE = 27635, + SPELL_SHAMAN_ITEM_MANA_SURGE = 23571, SPELL_SHAMAN_LAVA_FLOWS_R1 = 51480, SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, SPELL_SHAMAN_MANA_SPRING_TOTEM_ENERGIZE = 52032, @@ -55,8 +58,8 @@ enum ShamanSpells enum ShamanSpellIcons { - SHAMAN_ICON_ID_RESTORATIVE_TOTEMS = 338, - SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087 + SHAMAN_ICON_ID_RESTORATIVE_TOTEMS = 338, + SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087 }; // 52759 - Ancestral Awakening (Proc) @@ -128,8 +131,8 @@ class spell_sha_astral_shift : public SpellScriptLoader void Register() OVERRIDE { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_astral_shift_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_sha_astral_shift_AuraScript::Absorb, EFFECT_0); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_astral_shift_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_sha_astral_shift_AuraScript::Absorb, EFFECT_0); } }; @@ -302,17 +305,22 @@ class spell_sha_earth_shield : public SpellScriptLoader } } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + bool CheckProc(ProcEventInfo& /*eventInfo*/) { - PreventDefaultAction(); - //! HACK due to currenct proc system implementation if (Player* player = GetTarget()->ToPlayer()) if (player->HasSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL)) - return; + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID()); + /// @hack: due to currenct proc system implementation if (Player* player = GetTarget()->ToPlayer()) player->AddSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, time(NULL) + 3); } @@ -320,6 +328,7 @@ class spell_sha_earth_shield : public SpellScriptLoader void Register() OVERRIDE { DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_earth_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY); + DoCheckProc += AuraCheckProcFn(spell_sha_earth_shield_AuraScript::CheckProc); OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); } }; @@ -441,10 +450,11 @@ class spell_sha_fire_nova : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id)) + SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FIRE_NOVA_R1); + if (!firstRankSpellInfo || !spellInfo->IsRankOf(firstRankSpellInfo)) return false; - uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id); + uint8 rank = spellInfo->GetRank(); if (!sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank, true)) return false; return true; @@ -464,15 +474,12 @@ class spell_sha_fire_nova : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* caster = GetCaster()) + Unit* caster = GetCaster(); + if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1])) { - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - if (uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank)) - { - Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); - if (totem && totem->IsTotem()) - caster->CastSpell(totem, spellId, true); - } + uint8 rank = GetSpellInfo()->GetRank(); + if (totem->IsTotem()) + caster->CastSpell(totem, sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank), true); } } @@ -514,10 +521,11 @@ class spell_sha_flame_shock : public SpellScriptLoader // Lava Flows if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0)) { - if (sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) + SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_R1); + if (!aurEff->GetSpellInfo()->IsRankOf(firstRankSpellInfo)) return; - uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); + uint8 rank = aurEff->GetSpellInfo()->GetRank(); caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); } } @@ -632,6 +640,120 @@ class spell_sha_heroism : public SpellScriptLoader } }; +// 23551 - Lightning Shield +class spell_sha_item_lightning_shield : public SpellScriptLoader +{ + public: + spell_sha_item_lightning_shield() : SpellScriptLoader("spell_sha_item_lightning_shield") { } + + class spell_sha_item_lightning_shield_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_item_lightning_shield_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_sha_item_lightning_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_sha_item_lightning_shield_AuraScript(); + } +}; + +// 23552 - Lightning Shield +class spell_sha_item_lightning_shield_trigger : public SpellScriptLoader +{ + public: + spell_sha_item_lightning_shield_trigger() : SpellScriptLoader("spell_sha_item_lightning_shield_trigger") { } + + class spell_sha_item_lightning_shield_trigger_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_item_lightning_shield_trigger_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_MANA_SURGE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_sha_item_lightning_shield_trigger_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_sha_item_lightning_shield_trigger_AuraScript(); + } +}; + +// 23572 - Mana Surge +class spell_sha_item_mana_surge : public SpellScriptLoader +{ + public: + spell_sha_item_mana_surge() : SpellScriptLoader("spell_sha_item_mana_surge") { } + + class spell_sha_item_mana_surge_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_item_mana_surge_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetDamageInfo()->GetSpellInfo(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 mana = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetSchoolMask()); + int32 damage = CalculatePct(mana, 35); + + GetTarget()->CastCustomSpell(SPELL_SHAMAN_ITEM_MANA_SURGE, SPELLVALUE_BASE_POINT0, damage, GetTarget(), true, NULL, aurEff); + } + + void Register() OVERRIDE + { + DoCheckProc += AuraCheckProcFn(spell_sha_item_mana_surge_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_sha_item_mana_surge_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_sha_item_mana_surge_AuraScript(); + } +}; + // 60103 - Lava Lash class spell_sha_lava_lash : public SpellScriptLoader { @@ -851,6 +973,9 @@ void AddSC_shaman_spell_scripts() new spell_sha_flame_shock(); new spell_sha_healing_stream_totem(); new spell_sha_heroism(); + new spell_sha_item_lightning_shield(); + new spell_sha_item_lightning_shield_trigger(); + new spell_sha_item_mana_surge(); new spell_sha_lava_lash(); new spell_sha_mana_spring_totem(); new spell_sha_mana_tide_totem(); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index be060e32030..6aea2d7ad34 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -38,15 +38,16 @@ enum WarlockSpells SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, SPELL_WARLOCK_FEL_SYNERGY_HEAL = 54181, + SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME = 63311, SPELL_WARLOCK_GLYPH_OF_SIPHON_LIFE = 63106, + SPELL_WARLOCK_HAUNT = 48181, + SPELL_WARLOCK_HAUNT_HEAL = 48210, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, - SPELL_WARLOCK_HAUNT = 48181, - SPELL_WARLOCK_HAUNT_HEAL = 48210, SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, SPELL_WARLOCK_SOULSHATTER = 32835, @@ -60,7 +61,7 @@ enum WarlockSpellIcons WARLOCK_ICON_ID_MANA_FEED = 1982 }; -// 710, 18647 - Banish +// -710 - Banish class spell_warl_banish : public SpellScriptLoader { public: @@ -135,7 +136,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader { if (Player* caster = GetCaster()->ToPlayer()) { - uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + uint8 spellRank = GetSpellInfo()->GetRank(); ItemPosCountVec dest; InventoryResult msg = caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, iTypes[spellRank - 1][0], 1, NULL); if (msg != EQUIP_ERR_OK) @@ -165,7 +166,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader break; } } - uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + uint8 spellRank = GetSpellInfo()->GetRank(); if (spellRank > 0 && spellRank <= 8) CreateItem(effIndex, iTypes[spellRank - 1][rank]); } @@ -205,7 +206,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader { PrepareAuraScript(spell_warl_curse_of_doom_AuraScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_CURSE_OF_DOOM_EFFECT)) return false; @@ -242,7 +243,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader } }; -// 48018 - Demonic Circle Summon +// 48018 - Demonic Circle: Summon class spell_warl_demonic_circle_summon : public SpellScriptLoader { public: @@ -294,7 +295,7 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader } }; -// 48020 - Demonic Circle Teleport +// 48020 - Demonic Circle: Teleport class spell_warl_demonic_circle_teleport : public SpellScriptLoader { public: @@ -464,6 +465,41 @@ class spell_warl_fel_synergy : public SpellScriptLoader } }; +// 63310 - Glyph of Shadowflame +class spell_warl_glyph_of_shadowflame : public SpellScriptLoader +{ + public: + spell_warl_glyph_of_shadowflame() : SpellScriptLoader("spell_warl_glyph_of_shadowflame") { } + + class spell_warl_glyph_of_shadowflame_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_glyph_of_shadowflame_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_warl_glyph_of_shadowflame_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_warl_glyph_of_shadowflame_AuraScript(); + } +}; + // -48181 - Haunt class spell_warl_haunt : public SpellScriptLoader { @@ -491,7 +527,7 @@ class spell_warl_haunt : public SpellScriptLoader { PrepareAuraScript(spell_warl_haunt_AuraScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_HAUNT_HEAL)) return false; @@ -753,7 +789,7 @@ class spell_warl_siphon_life : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetDamageInfo()->GetDamage(); + return eventInfo.GetDamageInfo()->GetDamage() && GetTarget()->IsAlive(); } void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) @@ -791,7 +827,7 @@ class spell_warl_soulshatter : public SpellScriptLoader { PrepareSpellScript(spell_warl_soulshatter_SpellScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOULSHATTER)) return false; @@ -830,7 +866,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader { PrepareAuraScript(spell_warl_unstable_affliction_AuraScript); - bool Validate(SpellInfo const* /*spell*/) OVERRIDE + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL)) return false; @@ -870,6 +906,7 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_empowerment(); new spell_warl_everlasting_affliction(); new spell_warl_fel_synergy(); + new spell_warl_glyph_of_shadowflame(); new spell_warl_haunt(); new spell_warl_health_funnel(); new spell_warl_life_tap(); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 9e7ca75890f..78dcaaa669c 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -50,8 +50,11 @@ enum WarriorSpells SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, SPELL_WARRIOR_VIGILANCE_PROC = 50725, - SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665, + SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665 +}; +enum MiscSpells +{ SPELL_PALADIN_BLESSING_OF_SANCTUARY = 20911, SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY = 25899, SPELL_PRIEST_RENEWED_HOPE = 63944, @@ -60,7 +63,7 @@ enum WarriorSpells enum WarriorSpellIcons { - WARRIOR_ICON_ID_SUDDEN_DEATH = 1989, + WARRIOR_ICON_ID_SUDDEN_DEATH = 1989 }; // 23881 - Bloodthirst @@ -264,7 +267,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader // apply percent damage mods damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); + ApplyPct(damage, 16 * GetSpellInfo()->GetRank()); damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); @@ -424,11 +427,9 @@ class spell_warr_last_stand : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* caster = GetCaster()) - { - int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); - caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); - } + Unit* caster = GetCaster(); + int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue())); + caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); } void Register() OVERRIDE diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 774c4e63071..0243b08e80e 100644 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -40,7 +40,7 @@ class achievement_resilient_victory : public AchievementCriteriaScript if (bg->GetTypeID(true) != BATTLEGROUND_AB) return false; - if (!static_cast<BattlegroundAB*>(bg)->IsTeamScores500Disadvantage(source->GetTeam())) + if (!bg->ToBattlegroundAB()->IsTeamScores500Disadvantage(source->GetTeam())) return false; return true; @@ -84,7 +84,7 @@ class achievement_save_the_day : public AchievementCriteriaScript if (bg->GetTypeID(true) != BATTLEGROUND_WS) return false; - if (static_cast<BattlegroundWS*>(bg)->GetFlagState(player->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE) + if (bg->ToBattlegroundWS()->GetFlagState(player->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE) return true; } return false; @@ -209,7 +209,7 @@ class achievement_everything_counts : public AchievementCriteriaScript if (bg->GetTypeID(true) != BATTLEGROUND_AV) return false; - if (static_cast<BattlegroundAV*>(bg)->IsBothMinesControlledByTeam(source->GetTeam())) + if (bg->ToBattlegroundAV()->IsBothMinesControlledByTeam(source->GetTeam())) return true; return false; @@ -230,7 +230,7 @@ class achievement_bg_av_perfection : public AchievementCriteriaScript if (bg->GetTypeID(true) != BATTLEGROUND_AV) return false; - if (static_cast<BattlegroundAV*>(bg)->IsAllTowersControlledAndCaptainAlive(source->GetTeam())) + if (bg->ToBattlegroundAV()->IsAllTowersControlledAndCaptainAlive(source->GetTeam())) return true; return false; @@ -253,10 +253,10 @@ class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript if (!battleground) return false; - if (player->GetTeamId() == static_cast<BattlegroundSA*>(battleground)->Attackers) + if (player->GetTeamId() == battleground->ToBattlegroundSA()->Attackers) return false; - if (!static_cast<BattlegroundSA*>(battleground)->gateDestroyed) + if (!battleground->ToBattlegroundSA()->gateDestroyed) return true; return false; @@ -308,7 +308,7 @@ class achievement_not_even_a_scratch : public AchievementCriteriaScript if (!battleground) return false; - if (static_cast<BattlegroundSA*>(battleground)->notEvenAScratch(source->GetTeam())) + if (battleground->ToBattlegroundSA()->notEvenAScratch(source->GetTeam())) return true; return false; diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 1847e3390ef..ce44cb57eef 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -18,9 +18,6 @@ /* ContentData go_cat_figurine (the "trap" version of GO, two different exist) -go_northern_crystal_pylon -go_eastern_crystal_pylon -go_western_crystal_pylon go_barov_journal go_ethereum_prison go_ethereum_stasis @@ -80,69 +77,6 @@ public: }; /*###### -## go_crystal_pylons (3x) -######*/ -class go_northern_crystal_pylon : public GameObjectScript -{ -public: - go_northern_crystal_pylon() : GameObjectScript("go_northern_crystal_pylon") { } - - bool OnGossipHello(Player* player, GameObject* go) OVERRIDE - { - if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) - { - player->PrepareQuestMenu(go->GetGUID()); - player->SendPreparedQuest(go->GetGUID()); - } - - if (player->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(4285); - - return true; - } -}; - -class go_eastern_crystal_pylon : public GameObjectScript -{ -public: - go_eastern_crystal_pylon() : GameObjectScript("go_eastern_crystal_pylon") { } - - bool OnGossipHello(Player* player, GameObject* go) OVERRIDE - { - if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) - { - player->PrepareQuestMenu(go->GetGUID()); - player->SendPreparedQuest(go->GetGUID()); - } - - if (player->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(4287); - - return true; - } -}; - -class go_western_crystal_pylon : public GameObjectScript -{ -public: - go_western_crystal_pylon() : GameObjectScript("go_western_crystal_pylon") { } - - bool OnGossipHello(Player* player, GameObject* go) OVERRIDE - { - if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) - { - player->PrepareQuestMenu(go->GetGUID()); - player->SendPreparedQuest(go->GetGUID()); - } - - if (player->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(4288); - - return true; - } -}; - -/*###### ## go_barov_journal ######*/ @@ -1151,11 +1085,11 @@ public: { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_USE_OUTHOUSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, go->GetGUID()); - return true; } else player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, go->GetGUID()); - return true; + + return true; } bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) OVERRIDE @@ -1246,8 +1180,7 @@ class go_gjalerbron_cage : public GameObjectScript { if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f)) { - if (player) - player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0); + player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE); prisoner->DespawnOrUnsummon(6000); @@ -1375,44 +1308,41 @@ public: void AddSC_go_scripts() { - new go_cat_figurine; - new go_northern_crystal_pylon; - new go_eastern_crystal_pylon; - new go_western_crystal_pylon; - new go_barov_journal; - new go_field_repair_bot_74A; - new go_gilded_brazier; - new go_orb_of_command; - new go_shrine_of_the_birds; - new go_southfury_moonstone; - new go_tablet_of_madness; - new go_tablet_of_the_seven; - new go_jump_a_tron; - new go_ethereum_prison; - new go_ethereum_stasis; - new go_resonite_cask; - new go_sacred_fire_of_life; - new go_tele_to_dalaran_crystal; - new go_tele_to_violet_stand; - new go_fel_crystalforge; - new go_bashir_crystalforge; - new go_matrix_punchograph; - new go_scourge_cage; - new go_arcane_prison; - new go_blood_filled_orb; - new go_jotunheim_cage; - new go_table_theka; - new go_inconspicuous_landmark; - new go_ethereal_teleport_pad; - new go_soulwell; - new go_tadpole_cage; - new go_dragonflayer_cage; - new go_amberpine_outhouse; - new go_hive_pod; - new go_massive_seaforium_charge; - new go_gjalerbron_cage; - new go_large_gjalerbron_cage; - new go_veil_skith_cage; - new go_frostblade_shrine; - new go_midsummer_bonfire; + new go_cat_figurine(); + new go_barov_journal(); + new go_field_repair_bot_74A(); + new go_gilded_brazier(); + new go_orb_of_command(); + new go_shrine_of_the_birds(); + new go_southfury_moonstone(); + new go_tablet_of_madness(); + new go_tablet_of_the_seven(); + new go_jump_a_tron(); + new go_ethereum_prison(); + new go_ethereum_stasis(); + new go_resonite_cask(); + new go_sacred_fire_of_life(); + new go_tele_to_dalaran_crystal(); + new go_tele_to_violet_stand(); + new go_fel_crystalforge(); + new go_bashir_crystalforge(); + new go_matrix_punchograph(); + new go_scourge_cage(); + new go_arcane_prison(); + new go_blood_filled_orb(); + new go_jotunheim_cage(); + new go_table_theka(); + new go_inconspicuous_landmark(); + new go_ethereal_teleport_pad(); + new go_soulwell(); + new go_tadpole_cage(); + new go_dragonflayer_cage(); + new go_amberpine_outhouse(); + new go_hive_pod(); + new go_massive_seaforium_charge(); + new go_gjalerbron_cage(); + new go_large_gjalerbron_cage(); + new go_veil_skith_cage(); + new go_frostblade_shrine(); + new go_midsummer_bonfire(); } diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp index 5d5cc02616b..47d59a57100 100644 --- a/src/server/shared/Configuration/Config.cpp +++ b/src/server/shared/Configuration/Config.cpp @@ -17,72 +17,79 @@ */ #include "Config.h" -#include <ace/Auto_Ptr.h> -#include <ace/Configuration_Import_Export.h> -#include <ace/Thread_Mutex.h> +#include "Errors.h" -namespace ConfigMgr +// Defined here as it must not be exposed to end-users. +bool ConfigMgr::GetValueHelper(const char* name, ACE_TString &result) { + GuardType guard(_configLock); -namespace -{ - typedef ACE_Thread_Mutex LockType; - typedef ACE_Guard<LockType> GuardType; + if (_config.get() == 0) + return false; - std::string _filename; - ACE_Auto_Ptr<ACE_Configuration_Heap> _config; - LockType m_configLock; + ACE_TString section_name; + ACE_Configuration_Section_Key section_key; + const ACE_Configuration_Section_Key &root_key = _config->root_section(); - // Defined here as it must not be exposed to end-users. - bool GetValueHelper(const char* name, ACE_TString &result) + int i = 0; + while (_config->enumerate_sections(root_key, i, section_name) == 0) { - GuardType guard(m_configLock); - - if (_config.get() == 0) - return false; - - ACE_TString section_name; - ACE_Configuration_Section_Key section_key; - const ACE_Configuration_Section_Key &root_key = _config->root_section(); - - int i = 0; - while (_config->enumerate_sections(root_key, i, section_name) == 0) - { - _config->open_section(root_key, section_name.c_str(), 0, section_key); - if (_config->get_string_value(section_key, name, result) == 0) - return true; - ++i; - } - - return false; + _config->open_section(root_key, section_name.c_str(), 0, section_key); + if (_config->get_string_value(section_key, name, result) == 0) + return true; + ++i; } + + return false; } -bool Load(const char* file) +bool ConfigMgr::LoadInitial(char const* file) { - GuardType guard(m_configLock); + ASSERT(file); - if (file) - _filename = file; + GuardType guard(_configLock); - _config.reset(new ACE_Configuration_Heap); + _filename = file; + _config.reset(new ACE_Configuration_Heap()); if (_config->open() == 0) - { - ACE_Ini_ImpExp config_importer(*_config.get()); - if (config_importer.import_config(_filename.c_str()) == 0) + if (LoadData(_filename.c_str())) return true; - } + _config.reset(); return false; } -std::string GetStringDefault(const char* name, const std::string &def) +bool ConfigMgr::LoadMore(char const* file) +{ + ASSERT(file); + ASSERT(_config); + + GuardType guard(_configLock); + + return LoadData(file); +} + +bool ConfigMgr::Reload() +{ + return LoadInitial(_filename.c_str()); +} + +bool ConfigMgr::LoadData(char const* file) +{ + ACE_Ini_ImpExp config_importer(*_config.get()); + if (config_importer.import_config(file) == 0) + return true; + + return false; +} + +std::string ConfigMgr::GetStringDefault(const char* name, const std::string &def) { ACE_TString val; return GetValueHelper(name, val) ? val.c_str() : def; } -bool GetBoolDefault(const char* name, bool def) +bool ConfigMgr::GetBoolDefault(const char* name, bool def) { ACE_TString val; @@ -93,22 +100,20 @@ bool GetBoolDefault(const char* name, bool def) val == "1"); } -int GetIntDefault(const char* name, int def) +int ConfigMgr::GetIntDefault(const char* name, int def) { ACE_TString val; return GetValueHelper(name, val) ? atoi(val.c_str()) : def; } -float GetFloatDefault(const char* name, float def) +float ConfigMgr::GetFloatDefault(const char* name, float def) { ACE_TString val; return GetValueHelper(name, val) ? (float)atof(val.c_str()) : def; } -const std::string & GetFilename() +std::string const& ConfigMgr::GetFilename() { - GuardType guard(m_configLock); + GuardType guard(_configLock); return _filename; } - -} // namespace diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h index 778c25f2033..d633e37f0c4 100644 --- a/src/server/shared/Configuration/Config.h +++ b/src/server/shared/Configuration/Config.h @@ -20,17 +20,58 @@ #define CONFIG_H #include <string> +#include <map> +#include <ace/Singleton.h> +#include <ace/Configuration_Import_Export.h> +#include <ace/Thread_Mutex.h> +#include <AutoPtr.h> -namespace ConfigMgr +typedef Trinity::AutoPtr<ACE_Configuration_Heap, ACE_Null_Mutex> Config; + +class ConfigMgr { - bool Load(const char *file = NULL); + friend class ACE_Singleton<ConfigMgr, ACE_Null_Mutex>; + friend class ConfigLoader; + + ConfigMgr() { } + ~ConfigMgr() { } + +public: + /// Method used only for loading main configuration files (authserver.conf and worldserver.conf) + bool LoadInitial(char const* file); + + /** + * This method loads additional configuration files + * It is recommended to use this method in WorldScript::OnConfigLoad hooks + * + * @return true if loading was successful + */ + bool LoadMore(char const* file); + + bool Reload(); std::string GetStringDefault(const char* name, const std::string& def); bool GetBoolDefault(const char* name, bool def); int GetIntDefault(const char* name, int def); float GetFloatDefault(const char* name, float def); - const std::string & GetFilename(); -} + std::string const& GetFilename(); + +private: + bool GetValueHelper(const char* name, ACE_TString &result); + bool LoadData(char const* file); + + typedef ACE_Thread_Mutex LockType; + typedef ACE_Guard<LockType> GuardType; + + std::string _filename; + Config _config; + LockType _configLock; + + ConfigMgr(ConfigMgr const&); + ConfigMgr& operator=(ConfigMgr const&); +}; + +#define sConfigMgr ACE_Singleton<ConfigMgr, ACE_Null_Mutex>::instance() #endif diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 427ccfd5ebf..7e237614f62 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -105,7 +105,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_BOTH); - PrepareStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED, "SELECT g.guildid, g.name, gr.rname, gm.pnote, gm.offnote " + PrepareStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED, "SELECT g.guildid, g.name, gr.rname, gr.rid, gm.pnote, gm.offnote " "FROM guild g JOIN guild_member gm ON g.guildid = gm.guildid " "JOIN guild_rank gr ON g.guildid = gr.guildid AND gm.rank = gr.rid WHERE gm.guid = ?", CONNECTION_BOTH); PrepareStatement(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 312a3463aef..be7aab9cf5e 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -48,13 +48,13 @@ uint8 Log::NextAppenderId() int32 GetConfigIntDefault(std::string base, const char* name, int32 value) { base.append(name); - return ConfigMgr::GetIntDefault(base.c_str(), value); + return sConfigMgr->GetIntDefault(base.c_str(), value); } std::string GetConfigStringDefault(std::string base, const char* name, const char* value) { base.append(name); - return ConfigMgr::GetStringDefault(base.c_str(), value); + return sConfigMgr->GetStringDefault(base.c_str(), value); } // Returns default logger if the requested logger is not found @@ -83,7 +83,7 @@ void Log::CreateAppenderFromConfig(const char* name) // if type = Console. optional1 = Color std::string options = "Appender."; options.append(name); - options = ConfigMgr::GetStringDefault(options.c_str(), ""); + options = sConfigMgr->GetStringDefault(options.c_str(), ""); Tokenizer tokens(options, ','); Tokenizer::const_iterator iter = tokens.begin(); uint8 size = tokens.size(); @@ -173,7 +173,7 @@ void Log::CreateLoggerFromConfig(const char* name) std::string options = "Logger."; options.append(name); - options = ConfigMgr::GetStringDefault(options.c_str(), ""); + options = sConfigMgr->GetStringDefault(options.c_str(), ""); if (options.empty()) { @@ -235,7 +235,7 @@ void Log::CreateLoggerFromConfig(const char* name) void Log::ReadAppendersFromConfig() { - std::istringstream ss(ConfigMgr::GetStringDefault("Appenders", "")); + std::istringstream ss(sConfigMgr->GetStringDefault("Appenders", "")); std::string name; do @@ -249,7 +249,7 @@ void Log::ReadAppendersFromConfig() void Log::ReadLoggersFromConfig() { - std::istringstream ss(ConfigMgr::GetStringDefault("Loggers", "")); + std::istringstream ss(sConfigMgr->GetStringDefault("Loggers", "")); std::string name; do @@ -457,11 +457,11 @@ void Log::LoadFromConfig() { Close(); - if (ConfigMgr::GetBoolDefault("Log.Async.Enable", false)) + if (sConfigMgr->GetBoolDefault("Log.Async.Enable", false)) worker = new LogWorker(); AppenderId = 0; - m_logsDir = ConfigMgr::GetStringDefault("LogsDir", ""); + m_logsDir = sConfigMgr->GetStringDefault("LogsDir", ""); if (!m_logsDir.empty()) if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\')) m_logsDir.push_back('/'); diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 9cdfe0ad5a5..e136269e2a0 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -39,7 +39,7 @@ #include <readline/readline.h> #include <readline/history.h> -char * command_finder(const char* text, int state) +char* command_finder(const char* text, int state) { static int idx, len; const char* ret; @@ -70,19 +70,18 @@ char * command_finder(const char* text, int state) return ((char*)NULL); } -char ** cli_completion(const char * text, int start, int /*end*/) +char** cli_completion(const char* text, int start, int /*end*/) { - char ** matches; - matches = (char**)NULL; + char** matches = NULL; - if (start == 0) - matches = rl_completion_matches((char*)text, &command_finder); - else + if (start) rl_bind_key('\t', rl_abort); - return (matches); + else + matches = rl_completion_matches((char*)text, &command_finder); + return matches; } -int cli_hook_func(void) +int cli_hook_func() { if (World::IsStopped()) rl_done = 1; @@ -141,7 +140,7 @@ void CliRunnable::run() rl_event_hook = cli_hook_func; #endif - if (ConfigMgr::GetBoolDefault("BeepAtStart", true)) + if (sConfigMgr->GetBoolDefault("BeepAtStart", true)) printf("\a"); // \a = Alert // print this here the first time diff --git a/src/server/worldserver/CommandLine/CliRunnable.h b/src/server/worldserver/CommandLine/CliRunnable.h index bd14413ef2e..6e608f60881 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.h +++ b/src/server/worldserver/CommandLine/CliRunnable.h @@ -27,7 +27,9 @@ class CliRunnable : public ACE_Based::Runnable { public: - void run(); + void run() OVERRIDE; }; + #endif + /// @} diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index f9c672b4945..61aaf5f2ee9 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -33,7 +33,7 @@ #ifndef _TRINITY_CORE_CONFIG # define _TRINITY_CORE_CONFIG "worldserver.conf" -#endif //_TRINITY_CORE_CONFIG +#endif #ifdef _WIN32 #include "ServiceWin32.h" @@ -56,7 +56,7 @@ LoginDatabaseWorkerPool LoginDatabase; ///< Accessor to the uint32 realmID; ///< Id of the realm /// Print out the usage string for this program on the console. -void usage(const char *prog) +void usage(const char* prog) { printf("Usage:\n"); printf(" %s [<options>]\n", prog); @@ -70,14 +70,14 @@ void usage(const char *prog) } /// Launch the Trinity server -extern int main(int argc, char **argv) +extern int main(int argc, char** argv) { ///- Command line parsing to get the configuration file name char const* cfg_file = _TRINITY_CORE_CONFIG; int c = 1; - while ( c < argc ) + while (c < argc) { - if (strcmp(argv[c], "-c") == 0) + if (!strcmp(argv[c], "-c")) { if (++c >= argc) { @@ -90,10 +90,7 @@ extern int main(int argc, char **argv) } #ifdef _WIN32 - //////////// - //Services// - //////////// - if (strcmp(argv[c], "-s") == 0) + if (strcmp(argv[c], "-s") == 0) // Services { if (++c >= argc) { @@ -101,6 +98,7 @@ extern int main(int argc, char **argv) usage(argv[0]); return 1; } + if (strcmp(argv[c], "install") == 0) { if (WinServiceInstall()) @@ -120,16 +118,14 @@ extern int main(int argc, char **argv) return 1; } } + if (strcmp(argv[c], "--service") == 0) - { WinServiceRun(); - } - //// #endif ++c; } - if (!ConfigMgr::Load(cfg_file)) + if (!sConfigMgr->LoadInitial(cfg_file)) { printf("Invalid or missing configuration file : %s\n", cfg_file); printf("Verify that the file exists and has \'[worldserver]' written in the top of the file!\n"); diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 88165814d84..6fd57179140 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -50,22 +50,28 @@ extern int m_ServiceStatus; #endif +#ifdef __linux__ +#include <sched.h> +#include <sys/resource.h> +#define PROCESS_HIGH_PRIORITY -15 // [-20, 19], default is 0 +#endif + /// Handle worldservers's termination signals class WorldServerSignalHandler : public Trinity::SignalHandler { public: - virtual void HandleSignal(int SigNum) + virtual void HandleSignal(int sigNum) { - switch (SigNum) + switch (sigNum) { case SIGINT: World::StopNow(RESTART_EXIT_CODE); break; case SIGTERM: - #ifdef _WIN32 +#ifdef _WIN32 case SIGBREAK: if (m_ServiceStatus != 1) - #endif /* _WIN32 */ +#endif World::StopNow(SHUTDOWN_EXIT_CODE); break; } @@ -74,33 +80,35 @@ class WorldServerSignalHandler : public Trinity::SignalHandler class FreezeDetectorRunnable : public ACE_Based::Runnable { +private: + uint32 _loops; + uint32 _lastChange; + uint32 _delaytime; public: FreezeDetectorRunnable() { _delaytime = 0; } - uint32 m_loops, m_lastchange; - uint32 w_loops, w_lastchange; - uint32 _delaytime; + void SetDelayTime(uint32 t) { _delaytime = t; } - void run(void) + + void run() OVERRIDE { if (!_delaytime) return; + TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000); - m_loops = 0; - w_loops = 0; - m_lastchange = 0; - w_lastchange = 0; + _loops = 0; + _lastChange = 0; while (!World::IsStopped()) { ACE_Based::Thread::Sleep(1000); uint32 curtime = getMSTime(); // normal work - if (w_loops != World::m_worldLoopCounter) + if (_loops != World::m_worldLoopCounter) { - w_lastchange = curtime; - w_loops = World::m_worldLoopCounter; + _lastChange = curtime; + _loops = World::m_worldLoopCounter; } // possible freeze - else if (getMSTimeDiff(w_lastchange, curtime) > _delaytime) + else if (getMSTimeDiff(_lastChange, curtime) > _delaytime) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World Thread hangs, kicking out server!"); ASSERT(false); @@ -110,14 +118,6 @@ public: } }; -Master::Master() -{ -} - -Master::~Master() -{ -} - /// Main function int Master::Run() { @@ -138,17 +138,16 @@ int Master::Run() TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "http://TrinityCore.org \\/__/\n"); /// worldserver PID file creation - std::string pidfile = ConfigMgr::GetStringDefault("PidFile", ""); - if (!pidfile.empty()) + std::string pidFile = sConfigMgr->GetStringDefault("PidFile", ""); + if (!pidFile.empty()) { - uint32 pid = CreatePIDFile(pidfile); - if (!pid) + if (uint32 pid = CreatePIDFile(pidFile)) + TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Daemon PID: %u\n", pid); + else { - TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot create PID file %s.\n", pidfile.c_str()); + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot create PID file %s.\n", pidFile.c_str()); return 1; } - - TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Daemon PID: %u\n", pid); } ///- Start the databases @@ -162,70 +161,64 @@ int Master::Run() sWorld->SetInitialWorldSettings(); ///- Initialize the signal handlers - WorldServerSignalHandler SignalINT, SignalTERM; + WorldServerSignalHandler signalINT, signalTERM; #ifdef _WIN32 - WorldServerSignalHandler SignalBREAK; + WorldServerSignalHandler signalBREAK; #endif /* _WIN32 */ ///- Register worldserver's signal handlers - ACE_Sig_Handler Handler; - Handler.register_handler(SIGINT, &SignalINT); - Handler.register_handler(SIGTERM, &SignalTERM); - #ifdef _WIN32 - Handler.register_handler(SIGBREAK, &SignalBREAK); - #endif /* _WIN32 */ + ACE_Sig_Handler handle; + handle.register_handler(SIGINT, &signalINT); + handle.register_handler(SIGTERM, &signalTERM); +#ifdef _WIN32 + handle.register_handler(SIGBREAK, &signalBREAK); +#endif ///- Launch WorldRunnable thread - ACE_Based::Thread world_thread(new WorldRunnable); - world_thread.setPriority(ACE_Based::Highest); + ACE_Based::Thread worldThread(new WorldRunnable); + worldThread.setPriority(ACE_Based::Highest); ACE_Based::Thread* cliThread = NULL; #ifdef _WIN32 - if (ConfigMgr::GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) + if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) #else - if (ConfigMgr::GetBoolDefault("Console.Enable", true)) + if (sConfigMgr->GetBoolDefault("Console.Enable", true)) #endif { ///- Launch CliRunnable thread cliThread = new ACE_Based::Thread(new CliRunnable); } - ACE_Based::Thread rar_thread(new RARunnable); + ACE_Based::Thread rarThread(new RARunnable); - ///- Handle affinity for multiple processors and process priority on Windows - #ifdef _WIN32 + ///- Handle affinity for multiple processors and process priority + uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0); + bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false); + +#ifdef _WIN32 // Windows { HANDLE hProcess = GetCurrentProcess(); - uint32 Aff = ConfigMgr::GetIntDefault("UseProcessors", 0); - if (Aff > 0) + if (affinity > 0) { ULONG_PTR appAff; ULONG_PTR sysAff; if (GetProcessAffinityMask(hProcess, &appAff, &sysAff)) { - ULONG_PTR curAff = Aff & appAff; // remove non accessible processors + ULONG_PTR currentAffinity = affinity & appAff; // remove non accessible processors - if (!curAff) - { - TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", Aff, appAff); - } + if (!currentAffinity) + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", affinity, appAff); + else if (SetProcessAffinityMask(hProcess, currentAffinity)) + TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using processors (bitmask, hex): %x", currentAffinity); else - { - if (SetProcessAffinityMask(hProcess, curAff)) - TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using processors (bitmask, hex): %x", curAff); - else - TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x", curAff); - } + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x", currentAffinity); } } - bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false); - - //if (Prio && (m_ServiceStatus == -1) /* need set to default process priority class in service mode*/) - if (Prio) + if (highPriority) { if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "worldserver process priority class set to HIGH"); @@ -233,31 +226,61 @@ int Master::Run() TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set worldserver process priority class."); } } - #endif +#elif __linux__ // Linux + + if (affinity > 0) + { + cpu_set_t mask; + CPU_ZERO(&mask); + + for (unsigned int i = 0; i < sizeof(affinity) * 8; ++i) + if (affinity & (1 << i)) + CPU_SET(i, &mask); + + if (sched_setaffinity(0, sizeof(mask), &mask)) + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno)); + else + { + CPU_ZERO(&mask); + sched_getaffinity(0, sizeof(mask), &mask); + TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using processors (bitmask, hex): %x", *(uint32*)(&mask)); + } + } + + if (highPriority) + { + if (setpriority(PRIO_PROCESS, 0, PROCESS_HIGH_PRIORITY)) + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set worldserver process priority class, error: %s", strerror(errno)); + else + TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "worldserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); + } + +#endif + //Start soap serving thread - ACE_Based::Thread* soap_thread = NULL; + ACE_Based::Thread* soapThread = NULL; - if (ConfigMgr::GetBoolDefault("SOAP.Enabled", false)) + if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false)) { TCSoapRunnable* runnable = new TCSoapRunnable(); - runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(ConfigMgr::GetIntDefault("SOAP.Port", 7878))); - soap_thread = new ACE_Based::Thread(runnable); + runnable->SetListenArguments(sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878))); + soapThread = new ACE_Based::Thread(runnable); } ///- Start up freeze catcher thread - if (uint32 freeze_delay = ConfigMgr::GetIntDefault("MaxCoreStuckTime", 0)) + if (uint32 freezeDelay = sConfigMgr->GetIntDefault("MaxCoreStuckTime", 0)) { FreezeDetectorRunnable* fdr = new FreezeDetectorRunnable(); - fdr->SetDelayTime(freeze_delay * 1000); - ACE_Based::Thread freeze_thread(fdr); - freeze_thread.setPriority(ACE_Based::Highest); + fdr->SetDelayTime(freezeDelay * 1000); + ACE_Based::Thread freezeThread(fdr); + freezeThread.setPriority(ACE_Based::Highest); } ///- Launch the world listener socket - uint16 wsport = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD)); - std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0"); + uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD)); + std::string bindIp = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0"); - if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str()) == -1) + if (sWorldSocketMgr->StartNetwork(worldPort, bindIp.c_str()) == -1) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Failed to start network"); World::StopNow(ERROR_EXIT_CODE); @@ -271,14 +294,14 @@ int Master::Run() // when the main thread closes the singletons get unloaded // since worldrunnable uses them, it will crash if unloaded after master - world_thread.wait(); - rar_thread.wait(); + worldThread.wait(); + rarThread.wait(); - if (soap_thread) + if (soapThread) { - soap_thread->wait(); - soap_thread->destroy(); - delete soap_thread; + soapThread->wait(); + soapThread->destroy(); + delete soapThread; } // set server offline @@ -298,7 +321,7 @@ int Master::Run() // this only way to terminate CLI thread exist at Win32 (alt. way exist only in Windows Vista API) //_exit(1); // send keyboard input to safely unblock the CLI thread - INPUT_RECORD b[5]; + INPUT_RECORD b[4]; HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE); b[0].EventType = KEY_EVENT; b[0].Event.KeyEvent.bKeyDown = TRUE; @@ -354,83 +377,83 @@ bool Master::_StartDB() { MySQL::Library_Init(); - std::string dbstring; - uint8 async_threads, synch_threads; + std::string dbString; + uint8 asyncThreads, synchThreads; - dbstring = ConfigMgr::GetStringDefault("WorldDatabaseInfo", ""); - if (dbstring.empty()) + dbString = sConfigMgr->GetStringDefault("WorldDatabaseInfo", ""); + if (dbString.empty()) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World database not specified in configuration file"); return false; } - async_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1)); - if (async_threads < 1 || async_threads > 32) + asyncThreads = uint8(sConfigMgr->GetIntDefault("WorldDatabase.WorkerThreads", 1)); + if (asyncThreads < 1 || asyncThreads > 32) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World database: invalid number of worker threads specified. " "Please pick a value between 1 and 32."); return false; } - synch_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.SynchThreads", 1)); - ///- Initialise the world database - if (!WorldDatabase.Open(dbstring, async_threads, synch_threads)) + synchThreads = uint8(sConfigMgr->GetIntDefault("WorldDatabase.SynchThreads", 1)); + ///- Initialize the world database + if (!WorldDatabase.Open(dbString, asyncThreads, synchThreads)) { - TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to world database %s", dbstring.c_str()); + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to world database %s", dbString.c_str()); return false; } ///- Get character database info from configuration file - dbstring = ConfigMgr::GetStringDefault("CharacterDatabaseInfo", ""); - if (dbstring.empty()) + dbString = sConfigMgr->GetStringDefault("CharacterDatabaseInfo", ""); + if (dbString.empty()) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Character database not specified in configuration file"); return false; } - async_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1)); - if (async_threads < 1 || async_threads > 32) + asyncThreads = uint8(sConfigMgr->GetIntDefault("CharacterDatabase.WorkerThreads", 1)); + if (asyncThreads < 1 || asyncThreads > 32) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Character database: invalid number of worker threads specified. " "Please pick a value between 1 and 32."); return false; } - synch_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.SynchThreads", 2)); + synchThreads = uint8(sConfigMgr->GetIntDefault("CharacterDatabase.SynchThreads", 2)); - ///- Initialise the Character database - if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads)) + ///- Initialize the Character database + if (!CharacterDatabase.Open(dbString, asyncThreads, synchThreads)) { - TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to Character database %s", dbstring.c_str()); + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to Character database %s", dbString.c_str()); return false; } ///- Get login database info from configuration file - dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", ""); - if (dbstring.empty()) + dbString = sConfigMgr->GetStringDefault("LoginDatabaseInfo", ""); + if (dbString.empty()) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Login database not specified in configuration file"); return false; } - async_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1)); - if (async_threads < 1 || async_threads > 32) + asyncThreads = uint8(sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1)); + if (asyncThreads < 1 || asyncThreads > 32) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Login database: invalid number of worker threads specified. " "Please pick a value between 1 and 32."); return false; } - synch_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1)); + synchThreads = uint8(sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1)); ///- Initialise the login database - if (!LoginDatabase.Open(dbstring, async_threads, synch_threads)) + if (!LoginDatabase.Open(dbString, asyncThreads, synchThreads)) { - TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to login database %s", dbstring.c_str()); + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to login database %s", dbString.c_str()); return false; } ///- Get the realm Id from the configuration file - realmID = ConfigMgr::GetIntDefault("RealmID", 0); + realmID = sConfigMgr->GetIntDefault("RealmID", 0); if (!realmID) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Realm ID not defined in configuration file"); diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h index 4f07c24e8f8..93b2387feec 100644 --- a/src/server/worldserver/Master.h +++ b/src/server/worldserver/Master.h @@ -29,8 +29,6 @@ class Master { public: - Master(); - ~Master(); int Run(); private: @@ -41,5 +39,7 @@ class Master }; #define sMaster ACE_Singleton<Master, ACE_Null_Mutex>::instance() + #endif + /// @} diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp index edb7e048aa3..1493df7aa2f 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.cpp +++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp @@ -56,27 +56,25 @@ RARunnable::~RARunnable() void RARunnable::run() { - if (!ConfigMgr::GetBoolDefault("Ra.Enable", false)) + if (!sConfigMgr->GetBoolDefault("Ra.Enable", false)) return; ACE_Acceptor<RASocket, ACE_SOCK_ACCEPTOR> acceptor; - uint16 raport = uint16(ConfigMgr::GetIntDefault("Ra.Port", 3443)); - std::string stringip = ConfigMgr::GetStringDefault("Ra.IP", "0.0.0.0"); - ACE_INET_Addr listen_addr(raport, stringip.c_str()); + uint16 raPort = uint16(sConfigMgr->GetIntDefault("Ra.Port", 3443)); + std::string stringIp = sConfigMgr->GetStringDefault("Ra.IP", "0.0.0.0"); + ACE_INET_Addr listenAddress(raPort, stringIp.c_str()); - if (acceptor.open(listen_addr, m_Reactor) == -1) + if (acceptor.open(listenAddress, m_Reactor) == -1) { - TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Trinity RA can not bind to port %d on %s", raport, stringip.c_str()); + TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Trinity RA can not bind to port %d on %s", raPort, stringIp.c_str()); return; } - TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Starting Trinity RA on port %d on %s", raport, stringip.c_str()); + TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Starting Trinity RA on port %d on %s", raPort, stringIp.c_str()); while (!World::IsStopped()) { - // don't be too smart to move this outside the loop - // the run_reactor_event_loop will modify interval ACE_Time_Value interval(0, 100000); if (m_Reactor->run_reactor_event_loop(interval) == -1) break; diff --git a/src/server/worldserver/RemoteAccess/RARunnable.h b/src/server/worldserver/RemoteAccess/RARunnable.h index 6597e7c742f..a03e16e2154 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.h +++ b/src/server/worldserver/RemoteAccess/RARunnable.h @@ -31,7 +31,7 @@ class RARunnable : public ACE_Based::Runnable public: RARunnable(); virtual ~RARunnable(); - void run(); + void run() OVERRIDE; private: ACE_Reactor* m_Reactor; @@ -39,4 +39,5 @@ private: }; #endif /* _TRINITY_RARUNNABLE_H_ */ + /// @} diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index fa5fdfd3ca0..a4d402286ed 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -32,30 +32,26 @@ RASocket::RASocket() { - _minLevel = uint8(ConfigMgr::GetIntDefault("RA.MinLevel", 3)); + _minLevel = uint8(sConfigMgr->GetIntDefault("RA.MinLevel", 3)); _commandExecuting = false; } -RASocket::~RASocket() -{ -} - int RASocket::open(void *) { - ACE_INET_Addr remote_addr; + ACE_INET_Addr remoteAddress; - if (peer().get_remote_addr(remote_addr) == -1) + if (peer().get_remote_addr(remoteAddress) == -1) { TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno)); return -1; } - TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Incoming connection from %s", remote_addr.get_host_addr()); + TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Incoming connection from %s", remoteAddress.get_host_addr()); return activate(); } -int RASocket::handle_close(ACE_HANDLE, ACE_Reactor_Mask) +int RASocket::handle_close(ACE_HANDLE /*handle*/, ACE_Reactor_Mask /*mask*/) { TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Closing connection"); peer().close_reader(); @@ -89,9 +85,7 @@ int RASocket::recv_line(ACE_Message_Block& buffer) ssize_t n = peer().recv(&byte, sizeof(byte)); if (n < 0) - { return -1; - } if (n == 0) { @@ -110,8 +104,8 @@ int RASocket::recv_line(ACE_Message_Block& buffer) return -1; } - const char null_term = '\0'; - if (buffer.copy(&null_term, sizeof(null_term)) == -1) + const char nullTerm = '\0'; + if (buffer.copy(&nullTerm, sizeof(nullTerm)) == -1) return -1; return 0; diff --git a/src/server/worldserver/RemoteAccess/RASocket.h b/src/server/worldserver/RemoteAccess/RASocket.h index e92cb35eaf0..add23198bde 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.h +++ b/src/server/worldserver/RemoteAccess/RASocket.h @@ -31,33 +31,34 @@ #include <ace/SOCK_Acceptor.h> /// Remote Administration socket -class RASocket: public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH> +class RASocket : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH> { public: RASocket(); - virtual ~RASocket(); + virtual ~RASocket() { } - virtual int svc(void); - virtual int open(void * = 0); - virtual int handle_close(ACE_HANDLE = ACE_INVALID_HANDLE, ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); + virtual int svc() OVERRIDE; + virtual int open(void* = 0) OVERRIDE; + virtual int handle_close(ACE_HANDLE = ACE_INVALID_HANDLE, ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK) OVERRIDE; private: - int recv_line(std::string& out_line); + int recv_line(std::string& outLine); int recv_line(ACE_Message_Block& buffer); int process_command(const std::string& command); int authenticate(); - int subnegotiate(); //! Used by telnet protocol RFC 854 / 855 + int subnegotiate(); ///< Used by telnet protocol RFC 854 / 855 int check_access_level(const std::string& user); int check_password(const std::string& user, const std::string& pass); int send(const std::string& line); - static void zprint(void* callbackArg, const char * szText ); + static void zprint(void* callbackArg, const char* szText); static void commandFinished(void* callbackArg, bool success); private: - /// Minimum security level required to connect - uint8 _minLevel; + uint8 _minLevel; ///< Minimum security level required to connect ACE_Atomic_Op<ACE_Thread_Mutex, bool> _commandExecuting; }; + #endif + /// @} diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp index 3ccc3bccac9..e10968bcbee 100644 --- a/src/server/worldserver/TCSoap/TCSoap.cpp +++ b/src/server/worldserver/TCSoap/TCSoap.cpp @@ -33,13 +33,13 @@ void TCSoapRunnable::run() soap.accept_timeout = 3; soap.recv_timeout = 5; soap.send_timeout = 5; - if (!soap_valid_socket(soap_bind(&soap, m_host.c_str(), m_port, 100))) + if (!soap_valid_socket(soap_bind(&soap, _host.c_str(), _port, 100))) { - TC_LOG_ERROR(LOG_FILTER_SOAP, "Couldn't bind to %s:%d", m_host.c_str(), m_port); + TC_LOG_ERROR(LOG_FILTER_SOAP, "Couldn't bind to %s:%d", _host.c_str(), _port); exit(-1); } - TC_LOG_INFO(LOG_FILTER_SOAP, "Bound to http://%s:%d", m_host.c_str(), m_port); + TC_LOG_INFO(LOG_FILTER_SOAP, "Bound to http://%s:%d", _host.c_str(), _port); while (!World::IsStopped()) { @@ -121,9 +121,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) int acc = connection.pendingCommands.acquire(); if (acc) - { TC_LOG_ERROR(LOG_FILTER_SOAP, "Error while acquiring lock, acc = %i, errno = %u", acc, errno); - } // alright, command finished diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h index 63ccb6b304e..ff2a49a4d7e 100644 --- a/src/server/worldserver/TCSoap/TCSoap.h +++ b/src/server/worldserver/TCSoap/TCSoap.h @@ -24,21 +24,24 @@ #include <ace/Task.h> #include <Threading.h> -class TCSoapRunnable: public ACE_Based::Runnable +class TCSoapRunnable : public ACE_Based::Runnable { public: - TCSoapRunnable() : m_host(""), m_port(0) { } - void run(); - void setListenArguments(std::string host, uint16 port) + TCSoapRunnable() : _port(0) { } + + void run() OVERRIDE; + + void SetListenArguments(const std::string& host, uint16 port) { - m_host = host; - m_port = port; + _host = host; + _port = port; } + private: void process_message(ACE_Message_Block* mb); - std::string m_host; - uint16 m_port; + std::string _host; + uint16 _port; }; class SOAPCommand diff --git a/src/server/worldserver/WorldThread/WorldRunnable.h b/src/server/worldserver/WorldThread/WorldRunnable.h index 38fc96a9f9f..56a3b41eae7 100644 --- a/src/server/worldserver/WorldThread/WorldRunnable.h +++ b/src/server/worldserver/WorldThread/WorldRunnable.h @@ -27,7 +27,9 @@ class WorldRunnable : public ACE_Based::Runnable { public: - void run(); + void run() OVERRIDE; }; + #endif + /// @} diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 9577b3d841f..c4e19e851b3 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -149,7 +149,9 @@ BindIP = "0.0.0.0" # PERFORMANCE SETTINGS # # UseProcessors -# Description: Processors mask for Windows based multi-processor systems. +# Description: Processors mask for Windows and Linux based multi-processor systems. +# Example: A computer with 2 CPUs: +# 1 - 1st CPU only, 2 - 2nd CPU only, 3 - 1st and 2nd CPU, because 1 | 2 is 3 # Default: 0 - (Selected by OS) # 1+ - (Bit mask value of selected processors) @@ -157,11 +159,12 @@ UseProcessors = 0 # # ProcessPriority -# Description: Process priority setting for Windows based systems. -# Default: 1 - (High) -# 0 - (Normal) +# Description: Process priority setting for Windows and Linux based systems. +# Details: On Linux, a nice value of -15 is used. (requires superuser). On Windows, process is set to HIGH class. +# Default: 0 - (Normal) +# 1 - (High) -ProcessPriority = 1 +ProcessPriority = 0 # # Compression diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp index 9dfdf95643d..06a764690ca 100644 --- a/src/tools/mmaps_generator/MapBuilder.cpp +++ b/src/tools/mmaps_generator/MapBuilder.cpp @@ -716,8 +716,8 @@ namespace MMAP params.cs = config.cs; params.ch = config.ch; params.tileLayer = 0; - params.buildBvTree = true; - + params.buildBvTree = true; + // will hold final navmesh unsigned char* navData = NULL; int navDataSize = 0; |