Merge branch 'master' into Playerbot
This commit is contained in:
+18
-25
@@ -15,23 +15,16 @@ Versions of AzerothCore:
|
||||
| AzerothCore Branch | Supported |
|
||||
| ------------------ | ------------------ |
|
||||
| master | :white_check_mark: |
|
||||
| Any playerbot fork | :red_circle: |
|
||||
| Any NPCBot fork | :red_circle: |
|
||||
|
||||
Versions of MySQL:
|
||||
|
||||
| MySQL Version | Supported |
|
||||
| ------------- | ------------------ |
|
||||
| 8.1 | :white_check_mark: |
|
||||
| 8.4 | :white_check_mark: |
|
||||
| 8.0 | :white_check_mark: |
|
||||
| 5.7 | :white_check_mark: |
|
||||
| 5.6 and lower | :red_circle: |
|
||||
|
||||
Versions of MariaDB:
|
||||
|
||||
| MariaDB Version | Supported |
|
||||
| --------------- | ------------------ |
|
||||
| 10.6 | :white_check_mark: |
|
||||
| 10.5 | :white_check_mark: |
|
||||
| 10.4 and lower | :red_circle: |
|
||||
| 5.7 and lower | :red_circle: |
|
||||
|
||||
Versions of CLang:
|
||||
|
||||
@@ -43,26 +36,26 @@ Versions of CLang:
|
||||
|
||||
Versions of GCC:
|
||||
|
||||
| GCC Version | Supported |
|
||||
| ----------- | ------------------ |
|
||||
| 14 | :white_check_mark: |
|
||||
| 12 | :white_check_mark: |
|
||||
| 11 and lower| :red_circle: |
|
||||
| GCC Version | Supported |
|
||||
| ------------ | ------------------ |
|
||||
| 14 | :white_check_mark: |
|
||||
| 12 | :white_check_mark: |
|
||||
| 11 and lower | :red_circle: |
|
||||
|
||||
Versions of Ubuntu:
|
||||
|
||||
| Ubuntu version | Supported |
|
||||
| -------------- | ------------------ |
|
||||
| 24.04 | :white_check_mark: |
|
||||
| 22.04 | :white_check_mark: |
|
||||
| 20.04 and lower| :red_circle: |
|
||||
| Ubuntu version | Supported |
|
||||
| --------------- | ------------------ |
|
||||
| 24.04 | :white_check_mark: |
|
||||
| 22.04 | :white_check_mark: |
|
||||
| 20.04 and lower | :red_circle: |
|
||||
|
||||
Versions of macOS:
|
||||
|
||||
| macOS Version | Supported |
|
||||
| -------------- | ------------------ |
|
||||
| 12 | :white_check_mark: |
|
||||
| 11 and lower | :red_circle: |
|
||||
| macOS Version | Supported |
|
||||
| ------------- | ------------------ |
|
||||
| 14 | :white_check_mark: |
|
||||
| 12 and lower | :red_circle: |
|
||||
|
||||
**Note**: We do NOT support any repacks that may or may not have been made based on AzerothCore. This is because they are usually based on older versions and there is no way to know what is in the precompiled binaries. Instead, you should compile your binaries from the AzerothCore source. To get started, read the [Installation Guide](https://www.azerothcore.org/wiki/installation).
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- macos-12
|
||||
- macos-14
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: ${{ matrix.os }}
|
||||
steps:
|
||||
|
||||
@@ -27,8 +27,8 @@ time cmake ../../../ \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DMYSQL_ADD_INCLUDE_PATH=$mysql_include_path \
|
||||
-DMYSQL_LIBRARY=$mysql_lib_path \
|
||||
-DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include \
|
||||
-DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib \
|
||||
-DREADLINE_INCLUDE_DIR=$(brew --prefix readline)/include \
|
||||
-DREADLINE_LIBRARY=$(brew --prefix readline)/lib/libreadline.dylib \
|
||||
-DOPENSSL_INCLUDE_DIR="$OPENSSL_ROOT_DIR/include" \
|
||||
-DOPENSSL_SSL_LIBRARIES="$OPENSSL_ROOT_DIR/lib/libssl.dylib" \
|
||||
-DOPENSSL_CRYPTO_LIBRARIES="$OPENSSL_ROOT_DIR/lib/libcrypto.dylib" \
|
||||
|
||||
@@ -19,11 +19,11 @@ sudo apt-get update -y
|
||||
sudo apt-get install -y gdbserver gdb unzip curl \
|
||||
libncurses-dev libreadline-dev clang g++ \
|
||||
gcc git cmake make ccache \
|
||||
default-libmysqlclient-dev libssl-dev libbz2-dev \
|
||||
libssl-dev libbz2-dev \
|
||||
libboost-all-dev gnupg wget
|
||||
|
||||
# run noninteractive install for MYSQL 8.4 LTS
|
||||
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb
|
||||
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i ./mysql-apt-config_0.8.32-1_all.deb
|
||||
sudo apt-get update
|
||||
sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server
|
||||
sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server libmysqlclient-dev
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
REVOKE ALL PRIVILEGES ON * . * FROM 'acore'@'localhost';
|
||||
|
||||
REVOKE ALL PRIVILEGES ON `acore_world` . * FROM 'acore'@'localhost';
|
||||
|
||||
REVOKE GRANT OPTION ON `acore_world` . * FROM 'acore'@'localhost';
|
||||
|
||||
REVOKE ALL PRIVILEGES ON `acore_characters` . * FROM 'acore'@'localhost';
|
||||
|
||||
REVOKE GRANT OPTION ON `acore_characters` . * FROM 'acore'@'localhost';
|
||||
|
||||
REVOKE ALL PRIVILEGES ON `acore_auth` . * FROM 'acore'@'localhost';
|
||||
|
||||
REVOKE GRANT OPTION ON `acore_auth` . * FROM 'acore'@'localhost';
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'acore'@'localhost';
|
||||
|
||||
DROP USER 'acore'@'localhost';
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'acore'@'localhost';
|
||||
|
||||
DROP USER 'acore'@'localhost';
|
||||
|
||||
DROP DATABASE IF EXISTS `acore_world`;
|
||||
|
||||
DROP DATABASE IF EXISTS `acore_characters`;
|
||||
|
||||
DROP DATABASE IF EXISTS `acore_auth`;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- DB update 2024_09_03_00 -> 2024_09_22_00
|
||||
--
|
||||
ALTER TABLE `recovery_item`
|
||||
ADD COLUMN `DeleteDate` INT UNSIGNED NULL DEFAULT NULL AFTER `Count`;
|
||||
@@ -0,0 +1,6 @@
|
||||
-- DB update 2024_09_16_00 -> 2024_09_20_00
|
||||
UPDATE `creature_template` SET `flags_extra` = `flags_extra` | 134217728 WHERE `entry` = 23403;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23403) AND (`source_type` = 0) AND (`id` IN (2));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(23403, 0, 2, 0, 0, 0, 100, 0, 0, 15000, 30000, 40000, 0, 0, 11, 41392, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Illidari Assassin - In Combat - Cast Riposte');
|
||||
@@ -0,0 +1,5 @@
|
||||
-- DB update 2024_09_20_00 -> 2024_09_21_00
|
||||
--
|
||||
DELETE FROM `conditions` WHERE `SourceTypeorReferenceiD` = 18 and `SourceGroup` = 34125 AND `ConditionValue1` = 62853;
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=63215 AND `ScriptName`='spell_gen_summon_tournament_mount';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (63215, 'spell_gen_summon_tournament_mount');
|
||||
@@ -0,0 +1,3 @@
|
||||
-- DB update 2024_09_21_00 -> 2024_09_21_01
|
||||
DELETE FROM `command` WHERE `name` = 'debug cooldown';
|
||||
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('debug cooldown', 3, 'Syntax: .debug cooldown #spellID #cooldownTime #itemID\nApply a cooldown of the given duration (in milliseconds) for the given spell and item ID.');
|
||||
@@ -0,0 +1,2 @@
|
||||
-- DB update 2024_09_21_01 -> 2024_09_21_02
|
||||
UPDATE `creature` SET `equipment_id` = 1 WHERE `id1` = 37967;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- DB update 2024_09_21_02 -> 2024_09_22_00
|
||||
--
|
||||
UPDATE `quest_offer_reward` SET `RewardText`='We will leave this place on our own, $G Lord:Lady; $N - once we are certain that the evil within has been wholly destroyed. Your journey of legend is almost at an end.', `VerifiedBuild`=0 WHERE `ID`=8801;
|
||||
UPDATE `quest_request_items` SET `CompletionText`='$G Lord:Lady; $N, you have freed us of its grasp.', `VerifiedBuild`=0 WHERE `ID`=8801;
|
||||
@@ -0,0 +1,41 @@
|
||||
-- DB update 2024_09_22_00 -> 2024_09_22_01
|
||||
-- Unyielding Footman
|
||||
|
||||
-- Runecloth chance 50 (chance was 20)
|
||||
UPDATE `creature_loot_template`
|
||||
SET `Chance` = 50, `GroupId` = 1
|
||||
WHERE `Entry` = 16904 AND `Item` = 14047;
|
||||
|
||||
-- Netherweave Cloth chance 25 (chance was 60)
|
||||
UPDATE `creature_loot_template`
|
||||
SET `Chance` = 25, `GroupId` = 1
|
||||
WHERE `Entry` = 16904 AND `Item` = 21877;
|
||||
|
||||
|
||||
|
||||
-- Unyielding Sorcerer
|
||||
|
||||
-- Runecloth chance 50 (chance was 20)
|
||||
UPDATE `creature_loot_template`
|
||||
SET `Chance` = 50, `GroupId` = 1
|
||||
WHERE `Entry` = 16905 AND `Item` = 14047;
|
||||
|
||||
-- Netherweave Cloth chance 25 (chance was 60)
|
||||
UPDATE `creature_loot_template`
|
||||
SET `Chance` = 25, `GroupId` = 1
|
||||
WHERE `Entry` = 16905 AND `Item` = 21877;
|
||||
|
||||
|
||||
|
||||
-- Unyielding Knight
|
||||
|
||||
-- Runecloth chance 50 (chance was 20)
|
||||
UPDATE `creature_loot_template`
|
||||
SET `Chance` = 50, `GroupId` = 1
|
||||
WHERE `Entry` = 16906 AND `Item` = 14047;
|
||||
|
||||
-- Netherweave Cloth chance 25 (chance was 60)
|
||||
UPDATE `creature_loot_template`
|
||||
SET `Chance` = 25, `GroupId` = 1
|
||||
WHERE `Entry` = 16906 AND `Item` = 21877;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
-- DB update 2024_09_22_01 -> 2024_09_22_02
|
||||
-- AzjolNerub
|
||||
-- Anubarak 29120 txt line ruRU loc (BroadcastTextId unknown)
|
||||
DELETE FROM `creature_text_locale` WHERE `CreatureID`=29120 AND `GroupID`=5 AND `ID`=0 AND `locale`='ruRU' ;
|
||||
INSERT INTO `creature_text_locale` (`CreatureID`, `GroupID`, `ID`, `Locale`, `Text`) VALUES
|
||||
(29120, 5, 0, 'ruRU', 'Я был королем этой империи, когдато. При жизни я был героем смерти, я вернулся завоевателем. Теперь я снова оберегаю это королевство. Забавно, неправда ли?');
|
||||
|
||||
-- Pit of Saron
|
||||
-- Lady Sylvanas Windrunner 36990 use localized lines
|
||||
UPDATE `creature_text` SET `BroadcastTextId` = 37393 WHERE `CreatureID` = 36990 AND `GroupID`=7 AND `ID`=0;
|
||||
|
||||
-- Gorkun Ironskull 37320 use localized lines
|
||||
UPDATE `creature_text` SET `BroadcastTextId` = 37320 WHERE `CreatureID` = 37581 AND `GroupID`=61 AND `ID`=0;
|
||||
UPDATE `creature_text` SET `BroadcastTextId` = 37321 WHERE `CreatureID` = 37581 AND `GroupID`=62 AND `ID`=0;
|
||||
|
||||
-- Rescued Horde Slave 36889 use localized lines
|
||||
UPDATE `creature_text` SET `BroadcastTextId` = 36718 WHERE `CreatureID` = 36889 AND `GroupID`=0 AND `ID`=0;
|
||||
-- connect heroic version template
|
||||
UPDATE `creature_template` SET `difficulty_entry_1` = 37654 WHERE `entry` = 36889;
|
||||
|
||||
-- Rescued Alliance Slave connect heroic version template
|
||||
UPDATE `creature_template` SET `difficulty_entry_1` = 37653 WHERE `entry` = 36888;
|
||||
|
||||
-- remove duplicated line (already exist in GroupID=0
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`=36993 AND `GroupID`=36 AND `ID`=0;
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`=36990 AND `GroupID`=37 AND `ID`=0;
|
||||
|
||||
-- remove duplicated line (already exist in GroupID=1
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`=36990 AND `GroupID`=40 AND `ID`=0;
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`=36993 AND `GroupID`=39 AND `ID`=0;
|
||||
|
||||
-- remove duplicated line (already exist in GroupID=2
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`=36990 AND `GroupID`=46 AND `ID`=0;
|
||||
|
||||
-- update comment according to core cript
|
||||
UPDATE `creature_text` SET `comment` = 'Sylvanas SAY_SYLVANAS_KRICK_1' WHERE `CreatureID` = 36990 AND `GroupID`=0 AND `ID`=0;
|
||||
UPDATE `creature_text` SET `comment` = 'Sylvanas SAY_SYLVANAS_KRICK_2' WHERE `CreatureID` = 36990 AND `GroupID`=1 AND `ID`=0;
|
||||
UPDATE `creature_text` SET `comment` = 'Sylvanas SAY_SYLVANAS_KRICK_3' WHERE `CreatureID` = 36990 AND `GroupID`=2 AND `ID`=0;
|
||||
UPDATE `creature_text` SET `comment` = 'Jaina SAY_JAINA_KRICK_2' WHERE `CreatureID` = 36993 AND `GroupID`=1 AND `ID`=0;
|
||||
UPDATE `creature_text` SET `comment` = 'Jaina SAY_JAINA_KRICK_1' WHERE `CreatureID` = 36993 AND `GroupID`=0 AND `ID`=0;
|
||||
@@ -24,77 +24,6 @@
|
||||
|
||||
set( MYSQL_FOUND 0 )
|
||||
|
||||
# Find MariaDB for Windows
|
||||
if (WIN32)
|
||||
# Set know versions MariaDB
|
||||
set(_MARIADB_KNOWN_VERSIONS "MariaDB 10.9" "MariaDB 10.8" "MariaDB 10.7" "MariaDB 10.6" "MariaDB 10.5")
|
||||
|
||||
# Set default options
|
||||
set(MARIADB_FOUND_LIB 0)
|
||||
set(MARIADB_FOUND_INCLUDE 0)
|
||||
set(MARIADB_FOUND_EXECUTABLE 0)
|
||||
set(MARIADB_FOUND 0)
|
||||
|
||||
macro(FindLibMariaDB MariaDBVersion)
|
||||
# Find include
|
||||
find_path(MYSQL_INCLUDE_DIR
|
||||
NAMES
|
||||
mysql.h
|
||||
PATHS
|
||||
${MYSQL_ADD_INCLUDE_PATH}
|
||||
"$ENV{ProgramW6432}/${MariaDBVersion}/include/mysql"
|
||||
"$ENV{ProgramFiles}/${MariaDBVersion}/include/mysql"
|
||||
"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/mysql"
|
||||
DOC
|
||||
"Specify the directory containing mysql.h."
|
||||
)
|
||||
|
||||
if(MYSQL_INCLUDE_DIR)
|
||||
set(MARIADB_FOUND_INCLUDE 1)
|
||||
endif()
|
||||
|
||||
find_library(MYSQL_LIBRARY
|
||||
NAMES
|
||||
libmariadb
|
||||
PATHS
|
||||
${MYSQL_ADD_LIBRARIES_PATH}
|
||||
"$ENV{ProgramW6432}/${MariaDBVersion}/lib"
|
||||
"$ENV{ProgramW6432}/${MariaDBVersion}/lib/opt"
|
||||
"$ENV{ProgramFiles}/${MariaDBVersion}/lib"
|
||||
"$ENV{ProgramFiles}/${MariaDBVersion}/lib/opt"
|
||||
"$ENV{SystemDrive}/${MariaDBVersion}/lib/opt"
|
||||
"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib"
|
||||
DOC
|
||||
"Specify the location of the mysql library here."
|
||||
)
|
||||
|
||||
if(MYSQL_LIBRARY)
|
||||
set(MARIADB_FOUND_LIB 1)
|
||||
endif()
|
||||
|
||||
find_program(MYSQL_EXECUTABLE mysql
|
||||
PATHS
|
||||
"$ENV{ProgramW6432}/${MariaDBVersion}/bin"
|
||||
"$ENV{ProgramW6432}/${MariaDBVersion}/bin/opt"
|
||||
"$ENV{ProgramFiles}/${MariaDBVersion}/bin"
|
||||
"$ENV{ProgramFiles}/${MariaDBVersion}/bin/opt"
|
||||
"$ENV{SystemDrive}/${MariaDBVersion}/bin/opt"
|
||||
DOC
|
||||
"path to your mysql binary.")
|
||||
|
||||
if (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR AND MYSQL_EXECUTABLE)
|
||||
set(MARIADB_FOUND 1)
|
||||
endif()
|
||||
|
||||
endmacro(FindLibMariaDB)
|
||||
|
||||
foreach(version ${_MARIADB_KNOWN_VERSIONS})
|
||||
if (NOT MARIADB_FOUND)
|
||||
FindLibMariaDB(${version})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if( UNIX )
|
||||
set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH
|
||||
"preferred path to MySQL (mysql_config)"
|
||||
@@ -156,15 +85,12 @@ find_path(MYSQL_INCLUDE_DIR
|
||||
/usr/local/include/mysql
|
||||
/usr/local/mysql/include
|
||||
"C:/tools/mysql/current/include" # chocolatey package
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.1/include"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.4/include"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.4/include"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.4/include"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.0/include"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 5.7/include"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.1/include"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.0/include"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 5.7/include"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.1/include"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.0/include"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 5.7/include"
|
||||
"$ENV{MYSQL_INCLUDE_DIR}"
|
||||
"$ENV{MYSQL_DIR}/include"
|
||||
DOC
|
||||
@@ -195,15 +121,12 @@ if( WIN32 )
|
||||
PATHS
|
||||
${MYSQL_ADD_LIBRARIES_PATH}
|
||||
"C:/tools/mysql/current/lib" # chocolatey package
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.1/lib"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.4/lib"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.4/lib"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.4/lib"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.0/lib"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 5.7/lib"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.1/lib"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.0/lib"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 5.7/lib"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.1/lib"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.0/lib"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 5.7/lib"
|
||||
"$ENV{MYSQL_LIBRARY}"
|
||||
"$ENV{MYSQL_DIR}/lib"
|
||||
DOC "Specify the location of the mysql library here."
|
||||
@@ -242,15 +165,12 @@ if( WIN32 )
|
||||
find_program(MYSQL_EXECUTABLE mysql
|
||||
PATHS
|
||||
"C:/tools/mysql/current/bin" # chocolatey package
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.1/bin"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.4/bin"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.4/bin"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.4/bin"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 8.0/bin"
|
||||
"$ENV{ProgramW6432}/MySQL/MySQL Server 5.7/bin"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.1/bin"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.0/bin"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 5.7/bin"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.1/bin"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 8.0/bin"
|
||||
"$ENV{SystemDrive}/MySQL/MySQL Server 5.7/bin"
|
||||
"$ENV{MYSQL_ROOT}/bin"
|
||||
DOC
|
||||
"path to your mysql binary.")
|
||||
|
||||
@@ -153,7 +153,6 @@ if(WITH_STRICT_DATABASE_TYPE_CHECKS)
|
||||
message(" *** WITH_STRICT_DATABASE_TYPE_CHECKS - WARNING!")
|
||||
message(" *** Validates uses of database Get***() functions from Field class")
|
||||
message(" *** invalid calls will result in returning value 0")
|
||||
message(" *** NOT COMPATIBLE WITH MARIADB!")
|
||||
add_definitions(-DACORE_STRICT_DATABASE_TYPE_CHECKS)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ bool DynamicMapTree::isInLineOfSight(float x1, float y1, float z1, float x2, flo
|
||||
|
||||
float maxDist = (v2 - v1).magnitude();
|
||||
|
||||
if (!G3D::fuzzyGt(maxDist, 0) )
|
||||
if (!G3D::fuzzyGt(maxDist, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ namespace VMAP
|
||||
std::string model_name(buff, name_length);
|
||||
|
||||
WorldModel_Raw raw_model;
|
||||
if ( !raw_model.Read((iSrcDir + "/" + model_name).c_str()) )
|
||||
if (!raw_model.Read((iSrcDir + "/" + model_name).c_str()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -527,7 +527,7 @@ namespace VMAP
|
||||
READ_OR_RETURN_WITH_DELETE(vectorarray, nvectors * sizeof(float) * 3);
|
||||
for (uint32 i = 0; i < nvectors; ++i)
|
||||
{
|
||||
vertexArray.push_back( Vector3(vectorarray + 3 * i) );
|
||||
vertexArray.push_back( Vector3(vectorarray + 3 * i));
|
||||
}
|
||||
|
||||
delete[] vectorarray;
|
||||
|
||||
@@ -227,5 +227,4 @@ namespace VMAP
|
||||
if (check != nameLen) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace Acore
|
||||
//{
|
||||
// // The head element is bad
|
||||
// SPECIFIC_TYPE* t = Remove(elements._elements, obj);
|
||||
// return ( t != nullptr ? t : Remove(elements._TailElements, obj) );
|
||||
// return ( t != nullptr ? t : Remove(elements._TailElements, obj));
|
||||
//}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Acore
|
||||
template<class SPECIFIC_TYPE> bool Remove(ContainerMapList<SPECIFIC_TYPE>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
{
|
||||
typename std::map<OBJECT_HANDLE, CountedPtr<SPECIFIC_TYPE>>::iterator iter = elements._element.find(hdl);
|
||||
if ( iter != elements._element.end() )
|
||||
if (iter != elements._element.end())
|
||||
{
|
||||
elements._element.erase(iter);
|
||||
return true;
|
||||
@@ -163,6 +163,5 @@ namespace Acore
|
||||
bool t = Remove(elements._elements, obj, hdl);
|
||||
return ( !t ? Remove(elements._TailElements, obj, hdl) : t );
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -52,7 +52,7 @@ bool WinServiceInstall()
|
||||
if (serviceControlMgr)
|
||||
{
|
||||
char path[_MAX_PATH + 10];
|
||||
if (GetModuleFileName( 0, path, sizeof(path) / sizeof(path[0]) ) > 0)
|
||||
if (GetModuleFileName( 0, path, sizeof(path) / sizeof(path[0])) > 0)
|
||||
{
|
||||
SC_HANDLE service;
|
||||
std::strcat(path, " --service");
|
||||
@@ -170,7 +170,7 @@ void WINAPI ServiceControlHandler(DWORD controlCode)
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( controlCode >= 128 && controlCode <= 255 )
|
||||
if (controlCode >= 128 && controlCode <= 255)
|
||||
// user defined control code
|
||||
{
|
||||
break;
|
||||
@@ -198,7 +198,7 @@ void WINAPI ServiceMain(DWORD argc, char* argv[])
|
||||
|
||||
serviceStatusHandle = RegisterServiceCtrlHandler(serviceName, ServiceControlHandler);
|
||||
|
||||
if ( serviceStatusHandle )
|
||||
if (serviceStatusHandle)
|
||||
{
|
||||
char path[_MAX_PATH + 1];
|
||||
unsigned int i, last_slash = 0;
|
||||
|
||||
@@ -90,7 +90,7 @@ std::string secsToTimeString(uint64 timeInSecs, bool shortText)
|
||||
{
|
||||
ss << minutes << (shortText ? "m" : " minute(s) ");
|
||||
}
|
||||
if (secs || (!days && !hours && !minutes) )
|
||||
if (secs || (!days && !hours && !minutes))
|
||||
{
|
||||
ss << secs << (shortText ? "s" : " second(s) ");
|
||||
}
|
||||
|
||||
@@ -176,8 +176,7 @@ SourceDirectory = ""
|
||||
# MySQLExecutable
|
||||
# Description: The path to your MySQL CLI binary.
|
||||
# If the path is left empty, built-in path from cmake is used.
|
||||
# Example: "C:/Program Files/MariaDB 10.5/bin/mysql.exe"
|
||||
# "C:/Program Files/MySQL/MySQL Server 8.0/bin/mysql.exe"
|
||||
# Example: "C:/Program Files/MySQL/MySQL Server 8.4/bin/mysql.exe"
|
||||
# "mysql.exe"
|
||||
# "/usr/bin/mysql"
|
||||
# Default: ""
|
||||
|
||||
@@ -387,12 +387,6 @@ int main(int argc, char** argv)
|
||||
|
||||
sScriptMgr->OnStartup();
|
||||
|
||||
// Be kind and warn people of EOL deprecation :)
|
||||
#if !defined(MARIADB_VERSION_ID)
|
||||
if (MySQL::GetLibraryVersion() < 80000)
|
||||
LOG_WARN("server", "WARNING: You are using MySQL version 5.7 which is soon EOL!\nThis version will be deprecated. Consider upgrading to MySQL 8.0 or 8.1!");
|
||||
#endif
|
||||
|
||||
// Launch CliRunnable thread
|
||||
std::shared_ptr<std::thread> cliThread;
|
||||
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
|
||||
|
||||
@@ -2616,6 +2616,14 @@ ItemDelete.Quality = 3
|
||||
|
||||
ItemDelete.ItemLevel = 80
|
||||
|
||||
#
|
||||
# ItemDelete.KeepDays
|
||||
# Description: Time (in days)
|
||||
# Default: 0 - (Disabled, Don't delete any it)
|
||||
# 30 - (Enabled)
|
||||
|
||||
ItemDelete.KeepDays = 0
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
@@ -63,15 +63,10 @@ DatabaseWorkerPool<T>::DatabaseWorkerPool() :
|
||||
{
|
||||
WPFatal(mysql_thread_safe(), "Used MySQL library isn't thread-safe.");
|
||||
|
||||
#if !defined(MARIADB_VERSION_ID) || MARIADB_VERSION_ID < 100600
|
||||
bool isSupportClientDB = mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION;
|
||||
bool isSameClientDB = mysql_get_client_version() == MYSQL_VERSION_ID;
|
||||
#else // MariaDB 10.6+
|
||||
bool isSupportClientDB = mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION;
|
||||
bool isSameClientDB = true; // Client version 3.2.3?
|
||||
#endif
|
||||
|
||||
WPFatal(isSupportClientDB, "AzerothCore does not support MySQL versions below 5.7 or MariaDB versions below 10.5.\n\nFound version: {} / {}. Server compiled with: {}.\nSearch the wiki for ACE00043 in Common Errors (https://www.azerothcore.org/wiki/common-errors#ace00043).",
|
||||
WPFatal(isSupportClientDB, "AzerothCore does not support MySQL versions below 8.0\n\nFound version: {} / {}. Server compiled with: {}.\nSearch the wiki for ACE00043 in Common Errors (https://www.azerothcore.org/wiki/common-errors#ace00043).",
|
||||
mysql_get_client_info(), mysql_get_client_version(), MYSQL_VERSION_ID);
|
||||
WPFatal(isSameClientDB, "Used MySQL library version ({} id {}) does not match the version id used to compile AzerothCore (id {}).\nSearch the wiki for ACE00046 in Common Errors (https://www.azerothcore.org/wiki/common-errors#ace00046).",
|
||||
mysql_get_client_info(), mysql_get_client_version(), MYSQL_VERSION_ID);
|
||||
@@ -382,8 +377,6 @@ void DatabaseWorkerPool<T>::KeepAlive()
|
||||
*
|
||||
* DatabaseIncompatibleVersion("8.0.35") => false
|
||||
* DatabaseIncompatibleVersion("5.6.6") => true
|
||||
* DatabaseIncompatibleVersion("5.5.5-10.5.5-MariaDB") => false
|
||||
* DatabaseIncompatibleVersion("5.5.5-10.4.0-MariaDB") => true
|
||||
*
|
||||
* Adapted from stackoverflow response
|
||||
* https://stackoverflow.com/a/2941508
|
||||
@@ -414,17 +407,6 @@ bool DatabaseIncompatibleVersion(std::string const mysqlVersion)
|
||||
uint8 offset = 0;
|
||||
std::string minVersion = MIN_MYSQL_SERVER_VERSION;
|
||||
|
||||
// If the version string contains "MariaDB", use that
|
||||
if (mysqlVersion.find("MariaDB") != std::string::npos)
|
||||
{
|
||||
// All MariaDB 10.X versions have a prefix of 5.5.5 from the
|
||||
// mysql_get_server_info() function. To make matters more
|
||||
// annoying, this is removed in MariaDB 11.X
|
||||
if (mysqlVersion.rfind("5.5.5-", 0) == 0)
|
||||
offset = 6;
|
||||
minVersion = MIN_MARIADB_SERVER_VERSION;
|
||||
}
|
||||
|
||||
auto parsedMySQLVersion = parse(mysqlVersion.substr(offset));
|
||||
auto parsedMinVersion = parse(minVersion);
|
||||
|
||||
@@ -459,7 +441,7 @@ uint32 DatabaseWorkerPool<T>::OpenConnections(InternalIndex type, uint8 numConne
|
||||
}
|
||||
else if (DatabaseIncompatibleVersion(connection->GetServerInfo()))
|
||||
{
|
||||
LOG_ERROR("sql.driver", "AzerothCore does not support MySQL versions below 5.7 or MariaDB versions below 10.5.\n\nFound server version: {}. Server compiled with: {}.",
|
||||
LOG_ERROR("sql.driver", "AzerothCore does not support MySQL versions below 8.0\n\nFound server version: {}. Server compiled with: {}.",
|
||||
connection->GetServerInfo(), MYSQL_VERSION_ID);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -26,31 +26,17 @@
|
||||
|
||||
/** @file DatabaseWorkerPool.h */
|
||||
|
||||
/**
|
||||
* @def MIN_MYSQL_CLIENT_VERSION
|
||||
* The minimum MariaDB Client Version
|
||||
* MARIADB_VERSION_ID is defined if using libmariadbclient instead of libmysqlclient
|
||||
*/
|
||||
#if MARIADB_VERSION_ID >= 100600
|
||||
#define MIN_MYSQL_CLIENT_VERSION 30203u
|
||||
#else
|
||||
/**
|
||||
* @def MIN_MYSQL_CLIENT_VERSION
|
||||
* The minimum MySQL Client Version
|
||||
*/
|
||||
#define MIN_MYSQL_CLIENT_VERSION 50700u
|
||||
#endif
|
||||
#define MIN_MYSQL_CLIENT_VERSION 80000u
|
||||
|
||||
/**
|
||||
* @def MIN_MYSQL_SERVER_VERSION
|
||||
* The minimum MySQL Server Version
|
||||
*/
|
||||
#define MIN_MYSQL_SERVER_VERSION "5.7.0"
|
||||
/**
|
||||
* @def MIN_MARIADB_SERVER_VERSION
|
||||
* The minimum MariaDB Server Version
|
||||
*/
|
||||
#define MIN_MARIADB_SERVER_VERSION "10.5.0"
|
||||
#define MIN_MYSQL_SERVER_VERSION "8.0.0"
|
||||
|
||||
template <typename T>
|
||||
class ProducerConsumerQueue;
|
||||
@@ -253,4 +239,4 @@ private:
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _DATABASEWORKERPOOL_H
|
||||
|
||||
@@ -588,11 +588,13 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_UPD_QUEST_TRACK_ABANDON_TIME, "UPDATE quest_tracker SET quest_abandon_time = NOW() WHERE id = ? AND character_guid = ? ORDER BY quest_accept_time DESC LIMIT 1", CONNECTION_ASYNC);
|
||||
|
||||
// Recovery Item
|
||||
PrepareStatement(CHAR_INS_RECOVERY_ITEM, "INSERT INTO recovery_item (Guid, ItemEntry, Count) VALUES (?, ?, ?)", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_INS_RECOVERY_ITEM, "INSERT INTO recovery_item (Guid, ItemEntry, Count, DeleteDate) VALUES (?, ?, ?, UNIX_TIMESTAMP())", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_RECOVERY_ITEM, "SELECT id, itemEntry, Count, Guid FROM recovery_item WHERE id = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_RECOVERY_ITEM_LIST, "SELECT id, itemEntry, Count FROM recovery_item WHERE Guid = ? ORDER BY id DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_DEL_RECOVERY_ITEM, "DELETE FROM recovery_item WHERE Guid = ? AND ItemEntry = ? AND Count = ? ORDER BY Id DESC LIMIT 1", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_DEL_RECOVERY_ITEM_BY_RECOVERY_ID, "DELETE FROM recovery_item WHERE id = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_RECOVERY_ITEM_OLD_ITEMS, "SELECT Guid, ItemEntry FROM recovery_item WHERE DeleteDate IS NOT NULL AND DeleteDate < ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_DEL_RECOVERY_ITEM_BY_GUID, "DELETE FROM recovery_item WHERE Guid = ?", CONNECTION_ASYNC);
|
||||
|
||||
PrepareStatement(CHAR_SEL_HONORPOINTS, "SELECT totalHonorPoints FROM characters WHERE guid = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_ARENAPOINTS, "SELECT arenaPoints FROM characters WHERE guid = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -508,6 +508,8 @@ enum CharacterDatabaseStatements : uint32
|
||||
CHAR_SEL_RECOVERY_ITEM_LIST,
|
||||
CHAR_DEL_RECOVERY_ITEM,
|
||||
CHAR_DEL_RECOVERY_ITEM_BY_RECOVERY_ID,
|
||||
CHAR_SEL_RECOVERY_ITEM_OLD_ITEMS,
|
||||
CHAR_DEL_RECOVERY_ITEM_BY_GUID,
|
||||
|
||||
CHAR_SEL_HONORPOINTS,
|
||||
CHAR_SEL_ARENAPOINTS,
|
||||
|
||||
@@ -130,7 +130,6 @@ uint32 MySQLConnection::Open()
|
||||
|
||||
if (m_connectionInfo.ssl != "")
|
||||
{
|
||||
#if !defined(MARIADB_VERSION_ID) && MYSQL_VERSION_ID >= 80000
|
||||
mysql_ssl_mode opt_use_ssl = SSL_MODE_DISABLED;
|
||||
if (m_connectionInfo.ssl == "ssl")
|
||||
{
|
||||
@@ -138,15 +137,6 @@ uint32 MySQLConnection::Open()
|
||||
}
|
||||
|
||||
mysql_options(mysqlInit, MYSQL_OPT_SSL_MODE, (char const*)&opt_use_ssl);
|
||||
#else
|
||||
MySQLBool opt_use_ssl = MySQLBool(0);
|
||||
if (m_connectionInfo.ssl == "ssl")
|
||||
{
|
||||
opt_use_ssl = MySQLBool(1);
|
||||
}
|
||||
|
||||
mysql_options(mysqlInit, MYSQL_OPT_SSL_ENFORCE, (char const*)&opt_use_ssl);
|
||||
#endif
|
||||
}
|
||||
|
||||
m_Mysql = reinterpret_cast<MySQLHandle*>(mysql_real_connect(mysqlInit, m_connectionInfo.host.c_str(), m_connectionInfo.user.c_str(),
|
||||
@@ -227,7 +217,7 @@ bool MySQLConnection::Execute(PreparedStatementBase* stmt)
|
||||
|
||||
uint32 _s = getMSTime();
|
||||
|
||||
#if !defined(MARIADB_VERSION_ID) && (MYSQL_VERSION_ID >= 80300)
|
||||
#if MYSQL_VERSION_ID >= 80300
|
||||
if (mysql_stmt_bind_named_param(msql_STMT, msql_BIND, m_mStmt->GetParameterCount(), nullptr))
|
||||
#else
|
||||
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
|
||||
@@ -279,7 +269,7 @@ bool MySQLConnection::_Query(PreparedStatementBase* stmt, MySQLPreparedStatement
|
||||
|
||||
uint32 _s = getMSTime();
|
||||
|
||||
#if !defined(MARIADB_VERSION_ID) && (MYSQL_VERSION_ID >= 80300)
|
||||
#if MYSQL_VERSION_ID >= 80300
|
||||
if (mysql_stmt_bind_named_param(msql_STMT, msql_BIND, m_mStmt->GetParameterCount(), nullptr))
|
||||
#else
|
||||
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
|
||||
|
||||
@@ -551,18 +551,9 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
|
||||
// Set max allowed packet to 1 GB
|
||||
args.emplace_back("--max-allowed-packet=1GB");
|
||||
|
||||
#if !defined(MARIADB_VERSION_ID) && MYSQL_VERSION_ID >= 80000
|
||||
|
||||
if (ssl == "ssl")
|
||||
args.emplace_back("--ssl-mode=REQUIRED");
|
||||
|
||||
#else
|
||||
|
||||
if (ssl == "ssl")
|
||||
args.emplace_back("--ssl");
|
||||
|
||||
#endif
|
||||
|
||||
// Execute sql file
|
||||
args.emplace_back("-e");
|
||||
args.emplace_back(Acore::StringFormat("BEGIN; SOURCE {}; COMMIT;", path.generic_string()));
|
||||
|
||||
@@ -256,7 +256,7 @@ void TurretAI::UpdateAI(uint32 /*diff*/)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if( me->m_spells[0] )
|
||||
if (me->m_spells[0])
|
||||
DoSpellAttackIfReady(me->m_spells[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1562,7 +1562,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
// xinef: allow gameobjects to summon gameobjects!
|
||||
//if(!IsUnit((*itr)))
|
||||
//if (!IsUnit((*itr)))
|
||||
// continue;
|
||||
|
||||
target->GetPosition(x, y, z, o);
|
||||
|
||||
@@ -2352,7 +2352,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
LocaleConstant localeConstant = GetPlayer()->GetSession()->GetSessionDbLocaleIndex();
|
||||
if (localeConstant != LOCALE_enUS)
|
||||
{
|
||||
if(AchievementRewardLocale const* loc = sAchievementMgr->GetAchievementRewardLocale(achievement))
|
||||
if (AchievementRewardLocale const* loc = sAchievementMgr->GetAchievementRewardLocale(achievement))
|
||||
{
|
||||
ObjectMgr::GetLocaleString(loc->Subject, localeConstant, subject);
|
||||
ObjectMgr::GetLocaleString(loc->Text, localeConstant, text);
|
||||
@@ -2539,7 +2539,7 @@ bool AchievementGlobalMgr::IsStatisticAchievement(AchievementEntry const* achiev
|
||||
AchievementCategoryEntry const* cat = sAchievementCategoryStore.LookupEntry(achievement->categoryId);
|
||||
do
|
||||
{
|
||||
switch(cat->ID)
|
||||
switch (cat->ID)
|
||||
{
|
||||
case ACHIEVEMENT_CATEGORY_STATISTICS:
|
||||
return true;
|
||||
|
||||
@@ -250,7 +250,7 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMapByHouseId(uint8 auctionHouseI
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
return &_neutralAuctions;
|
||||
|
||||
switch(auctionHouseId)
|
||||
switch (auctionHouseId)
|
||||
{
|
||||
case AUCTIONHOUSE_ALLIANCE:
|
||||
return &_allianceAuctions;
|
||||
@@ -260,7 +260,6 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMapByHouseId(uint8 auctionHouseI
|
||||
}
|
||||
|
||||
return &_neutralAuctions;
|
||||
|
||||
}
|
||||
|
||||
uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count)
|
||||
|
||||
@@ -64,7 +64,7 @@ void BattlefieldMgr::InitBattlefield()
|
||||
/* For Cataclysm: Tol Barad
|
||||
pBf = new BattlefieldTB;
|
||||
// respawn, init variables
|
||||
if(!pBf->SetupBattlefield())
|
||||
if (!pBf->SetupBattlefield())
|
||||
{
|
||||
LOG_DEBUG("bg.battlefield", "Battlefield : Tol Barad init failed.");
|
||||
delete pBf;
|
||||
|
||||
@@ -73,7 +73,7 @@ void BattlegroundNA::FillInitialWorldStates(WorldPacket& data)
|
||||
bool BattlegroundNA::SetupBattleground()
|
||||
{
|
||||
// gates
|
||||
if ( !AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854f, 2966.833f, 12.0462f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
|
||||
if (!AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854f, 2966.833f, 12.0462f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
|
||||
|| !AddObject(BG_NA_OBJECT_DOOR_2, BG_NA_OBJECT_TYPE_DOOR_2, 4081.179f, 2874.97f, 12.00171f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)
|
||||
|| !AddObject(BG_NA_OBJECT_DOOR_3, BG_NA_OBJECT_TYPE_DOOR_3, 4023.709f, 2981.777f, 10.70117f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
|
||||
|| !AddObject(BG_NA_OBJECT_DOOR_4, BG_NA_OBJECT_TYPE_DOOR_4, 4090.064f, 2858.438f, 10.23631f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)
|
||||
|
||||
@@ -589,7 +589,7 @@ void BattlegroundSA::DefendersPortalTeleport(GameObject* portal, Player* plr)
|
||||
|
||||
uint32 portal_num = 0;
|
||||
//get it via X
|
||||
switch( (uint32)portal->GetPositionX() )
|
||||
switch ((uint32)portal->GetPositionX())
|
||||
{
|
||||
case 1394:
|
||||
portal_num = 0;
|
||||
@@ -947,7 +947,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
|
||||
uint32 npc = 0;
|
||||
uint32 flag = 0;
|
||||
|
||||
switch(i)
|
||||
switch (i)
|
||||
{
|
||||
case BG_SA_LEFT_CAPTURABLE_GY:
|
||||
flag = BG_SA_LEFT_FLAG;
|
||||
|
||||
@@ -536,7 +536,7 @@ private:
|
||||
uint32 GetGateIDFromEntry(uint32 id)
|
||||
{
|
||||
uint32 i = 0;
|
||||
switch(id)
|
||||
switch (id)
|
||||
{
|
||||
case 190722:
|
||||
i = BG_SA_GREEN_GATE;
|
||||
|
||||
@@ -28,7 +28,7 @@ enum CalendarMailAnswers
|
||||
{
|
||||
// else
|
||||
CALENDAR_EVENT_REMOVED_MAIL_SUBJECT = 0,
|
||||
// if ( *(_DWORD *)(a1 + 8292) & 0x100 )
|
||||
// if (*(_DWORD *)(a1 + 8292) & 0x100 )
|
||||
CALENDAR_INVITE_REMOVED_MAIL_SUBJECT = 0x100
|
||||
};
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace lfg
|
||||
//UpdateBestCompatibleInQueue(itQueue, strGuids);
|
||||
AddToCompatibles(strGuids);
|
||||
if (roleCheckResult && roleCheckResult <= 15)
|
||||
foundMask |= ( (((uint64)1) << (roleCheckResult - 1)) | (((uint64)1) << (16 + roleCheckResult - 1)) | (((uint64)1) << (32 + roleCheckResult - 1)) | (((uint64)1) << (48 + roleCheckResult - 1)) );
|
||||
foundMask |= ( (((uint64)1) << (roleCheckResult - 1)) | (((uint64)1) << (16 + roleCheckResult - 1)) | (((uint64)1) << (32 + roleCheckResult - 1)) | (((uint64)1) << (48 + roleCheckResult - 1)));
|
||||
return LFG_COMPATIBLES_WITH_LESS_PLAYERS;
|
||||
}
|
||||
|
||||
|
||||
@@ -3610,10 +3610,10 @@ float Creature::GetAttackDistance(Unit const* player) const
|
||||
if (creatureLevel + 5 <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
// detect range auras
|
||||
retDistance += static_cast<float>( GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE) );
|
||||
retDistance += static_cast<float>( GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE));
|
||||
|
||||
// detected range auras
|
||||
retDistance += static_cast<float>( player->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE) );
|
||||
retDistance += static_cast<float>( player->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE));
|
||||
}
|
||||
|
||||
// "Minimum Aggro Radius for a mob seems to be combat range (5 yards)"
|
||||
|
||||
@@ -2252,7 +2252,10 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
|
||||
summon->SetVisibleBySummonerOnly(visibleBySummonerOnly);
|
||||
|
||||
if (!AddToMap(summon->ToCreature(), summon->GetOwnerGUID().IsPlayer() || (summoner && summoner->GetTransport())))
|
||||
bool summonerHasTransport = summoner && summoner->GetTransport();
|
||||
bool summonerIsVehicle = summoner && summoner->IsUnit() && summoner->ToUnit()->IsVehicle();
|
||||
bool checkTransport = summon->GetOwnerGUID().IsPlayer() || (summonerHasTransport && !summonerIsVehicle);
|
||||
if (!AddToMap(summon->ToCreature(), checkTransport))
|
||||
{
|
||||
delete summon;
|
||||
return nullptr;
|
||||
|
||||
@@ -1175,7 +1175,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
|
||||
}
|
||||
|
||||
switch(GetEntry())
|
||||
switch (GetEntry())
|
||||
{
|
||||
case NPC_FELGUARD:
|
||||
{
|
||||
|
||||
@@ -4336,6 +4336,49 @@ void Player::DeleteOldCharacters(uint32 keepDays)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Items which were kept back in the database after being deleted and are now too old (see config option "ItemDelete.KeepDays"), will be completely deleted.
|
||||
*/
|
||||
void Player::DeleteOldRecoveryItems()
|
||||
{
|
||||
uint32 keepDays = sWorld->getIntConfig(CONFIG_ITEMDELETE_KEEP_DAYS);
|
||||
if (!keepDays)
|
||||
return;
|
||||
|
||||
Player::DeleteOldRecoveryItems(keepDays);
|
||||
}
|
||||
|
||||
/**
|
||||
* Items which were kept back in the database after being deleted and are older than the specified amount of days, will be completely deleted.
|
||||
*/
|
||||
void Player::DeleteOldRecoveryItems(uint32 keepDays)
|
||||
{
|
||||
LOG_INFO("server.loading", "Player::DeleteOldRecoveryItems: Deleting all items which have been deleted {} days before...", keepDays);
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_RECOVERY_ITEM_OLD_ITEMS);
|
||||
stmt->SetData(0, uint32(GameTime::GetGameTime().count() - time_t(keepDays * DAY)));
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
{
|
||||
LOG_INFO("server.loading", "Player::DeleteOldRecoveryItems: Found {} item(s) to delete", result->GetRowCount());
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[0].Get<uint32>();
|
||||
uint32 itemEntry = fields[1].Get<uint32>();
|
||||
|
||||
CharacterDatabasePreparedStatement* deleteStmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_RECOVERY_ITEM_BY_GUID);
|
||||
deleteStmt->SetData(0, guid);
|
||||
CharacterDatabase.Execute(deleteStmt);
|
||||
|
||||
LOG_INFO("server.loading", "Deleted item from recovery_item table where guid {} and item id {}", guid, itemEntry);
|
||||
} while (result->NextRow());
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SetMovement(PlayerMovementType pType)
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -4686,7 +4729,7 @@ void Player::DurabilityLossAll(double percent, bool inventory)
|
||||
|
||||
void Player::DurabilityLoss(Item* item, double percent)
|
||||
{
|
||||
if(!item || percent == 0.0)
|
||||
if (!item || percent == 0.0)
|
||||
return;
|
||||
|
||||
uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
|
||||
@@ -10012,13 +10055,13 @@ void Player::RemoveSpellMods(Spell* spell)
|
||||
spell->m_appliedMods.erase(iterMod);
|
||||
|
||||
// MAGE T8P4 BONUS
|
||||
if( spellInfo->SpellFamilyName == SPELLFAMILY_MAGE )
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE)
|
||||
{
|
||||
SpellInfo const* sp = mod->ownerAura->GetSpellInfo();
|
||||
// Missile Barrage, Hot Streak, Brain Freeze (trigger spell - Fireball!)
|
||||
if( sp->SpellIconID == 3261 || sp->SpellIconID == 2999 || sp->SpellIconID == 2938 )
|
||||
if( AuraEffect* aurEff = GetAuraEffectDummy(64869) )
|
||||
if( roll_chance_i(aurEff->GetAmount()) )
|
||||
if (sp->SpellIconID == 3261 || sp->SpellIconID == 2999 || sp->SpellIconID == 2938)
|
||||
if (AuraEffect* aurEff = GetAuraEffectDummy(64869))
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
{
|
||||
mod->charges = 1;
|
||||
continue;
|
||||
@@ -15454,7 +15497,7 @@ void Player::PrepareCharmAISpells()
|
||||
}
|
||||
else if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE)
|
||||
{
|
||||
if( (int32)periodic_damage < CalculateSpellDamage(this, spellInfo, i) )
|
||||
if ((int32)periodic_damage < CalculateSpellDamage(this, spellInfo, i))
|
||||
{
|
||||
m_charmAISpells[SPELL_DOT_DAMAGE] = spellInfo->Id;
|
||||
break;
|
||||
|
||||
@@ -1568,6 +1568,9 @@ public:
|
||||
static void DeleteOldCharacters();
|
||||
static void DeleteOldCharacters(uint32 keepDays);
|
||||
|
||||
static void DeleteOldRecoveryItems();
|
||||
static void DeleteOldRecoveryItems(uint32 keepDays);
|
||||
|
||||
bool m_mailsUpdated;
|
||||
|
||||
void SetBindPoint(ObjectGuid guid);
|
||||
|
||||
@@ -294,7 +294,7 @@ bool Player::CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedSta
|
||||
return false;
|
||||
|
||||
// Xinef: take seasonals into account
|
||||
if(!qInfo->IsRepeatable() && !qInfo->IsSeasonal() && IsQuestRewarded(quest_id))
|
||||
if (!qInfo->IsRepeatable() && !qInfo->IsSeasonal() && IsQuestRewarded(quest_id))
|
||||
return false; // not allow re-complete quest
|
||||
|
||||
// auto complete quest
|
||||
|
||||
@@ -991,7 +991,7 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, Ite
|
||||
|
||||
// skip not existed bag or self targeted bag
|
||||
Bag* pBag = GetBagByPos(bag);
|
||||
if (!pBag || pBag == pSrcItem || (pSrcItem && (pSrcItem->GetGUID() == pBag->GetGUID())) )
|
||||
if (!pBag || pBag == pSrcItem || (pSrcItem && (pSrcItem->GetGUID() == pBag->GetGUID())))
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
|
||||
if (pSrcItem && pSrcItem->IsNotEmptyBag())
|
||||
@@ -1119,8 +1119,8 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& des
|
||||
if (pItem)
|
||||
{
|
||||
// you bad chet0rz, wpe pro
|
||||
if( bag == NULL_BAG && slot == NULL_SLOT )
|
||||
if( pItem->IsBag() && pItem->IsNotEmptyBag() )
|
||||
if (bag == NULL_BAG && slot == NULL_SLOT)
|
||||
if (pItem->IsBag() && pItem->IsNotEmptyBag())
|
||||
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;
|
||||
|
||||
// Xinef: Removed next loot generated check
|
||||
@@ -7197,7 +7197,7 @@ void Player::_SaveAuras(CharacterDatabaseTransaction trans, bool logout)
|
||||
continue;
|
||||
|
||||
Aura* aura = itr->second;
|
||||
if( !logout && aura->GetDuration() < 60 * IN_MILLISECONDS )
|
||||
if (!logout && aura->GetDuration() < 60 * IN_MILLISECONDS )
|
||||
continue;
|
||||
|
||||
int32 damage[MAX_SPELL_EFFECTS];
|
||||
|
||||
@@ -237,7 +237,7 @@ void Player::UpdateResistances(uint32 school)
|
||||
AuraEffectList const& mResbyIntellect = GetAuraEffectsByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
|
||||
for(AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
|
||||
{
|
||||
if((*i)->GetMiscValue() & (1 << (school - 1)) )
|
||||
if ((*i)->GetMiscValue() & (1 << (school - 1)))
|
||||
value += int32(GetStat(Stats((*i)->GetMiscValueB())) * (*i)->GetAmount() / 100.0f);
|
||||
}
|
||||
|
||||
@@ -923,7 +923,7 @@ void Player::ApplyHealthRegenBonus(int32 amount, bool apply)
|
||||
|
||||
void Player::UpdateManaRegen()
|
||||
{
|
||||
if( HasAuraTypeWithMiscvalue(SPELL_AURA_PREVENT_REGENERATE_POWER, POWER_MANA + 1) )
|
||||
if (HasAuraTypeWithMiscvalue(SPELL_AURA_PREVENT_REGENERATE_POWER, POWER_MANA + 1))
|
||||
{
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, 0);
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0);
|
||||
|
||||
@@ -2772,7 +2772,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackTy
|
||||
|
||||
// Critical hit chance
|
||||
float crit_chance = GetUnitCriticalChance(attType, victim);
|
||||
if( crit_chance < 0 )
|
||||
if (crit_chance < 0)
|
||||
crit_chance = 0;
|
||||
|
||||
float dodge_chance = victim->GetUnitDodgeChance();
|
||||
@@ -4956,7 +4956,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
|
||||
if (Aura* noxious = Aura::TryCreate(aura->GetSpellInfo(), aura->GetEffectMask(), dispeller, caster))
|
||||
{
|
||||
noxious->SetDuration(aura->GetDuration() * aureff->GetAmount() / 100);
|
||||
if (aura->GetUnitOwner() )
|
||||
if (aura->GetUnitOwner())
|
||||
if (const std::vector<int32>* spell_triggered = sSpellMgr->GetSpellLinked(-int32(aura->GetId())))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
aura->GetUnitOwner()->RemoveAurasDueToSpell(*itr);
|
||||
@@ -5691,7 +5691,7 @@ bool Unit::HasVisibleAuraType(AuraType auraType) const
|
||||
{
|
||||
AuraEffectList const& mAuraList = GetAuraEffectsByType(auraType);
|
||||
for (AuraEffectList::const_iterator i = mAuraList.begin(); i != mAuraList.end(); ++i)
|
||||
if( (*i)->GetBase()->CanBeSentToClient() )
|
||||
if ((*i)->GetBase()->CanBeSentToClient())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -6221,7 +6221,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
|
||||
}
|
||||
|
||||
go->SetOwnerGUID(ObjectGuid::Empty);
|
||||
if(del)
|
||||
if (del)
|
||||
{
|
||||
go->SetRespawnTime(0);
|
||||
go->Delete();
|
||||
@@ -6236,7 +6236,7 @@ void Unit::RemoveAllGameObjects()
|
||||
while(!m_gameObj.empty())
|
||||
{
|
||||
GameObject* go = ObjectAccessor::GetGameObject(*this, *m_gameObj.begin());
|
||||
if(go)
|
||||
if (go)
|
||||
{
|
||||
go->SetOwnerGUID(ObjectGuid::Empty);
|
||||
go->SetRespawnTime(0);
|
||||
@@ -7537,7 +7537,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
}
|
||||
case SPELLFAMILY_ROGUE:
|
||||
{
|
||||
switch(dummySpell->Id)
|
||||
switch (dummySpell->Id)
|
||||
{
|
||||
// Glyph of Backstab
|
||||
case 56800:
|
||||
@@ -7546,7 +7546,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (AuraEffect* aurEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0, 0, GetGUID()))
|
||||
if (Aura* aur = aurEff->GetBase())
|
||||
if (!aur->IsRemoved() && aur->GetDuration() > 0)
|
||||
if ((aur->GetApplyTime() + aur->GetMaxDuration() / 1000 + 5) > (GameTime::GetGameTime().count() + aur->GetDuration() / 1000) )
|
||||
if ((aur->GetApplyTime() + aur->GetMaxDuration() / 1000 + 5) > (GameTime::GetGameTime().count() + aur->GetDuration() / 1000))
|
||||
{
|
||||
aur->SetDuration(aur->GetDuration() + 2000);
|
||||
return true;
|
||||
@@ -7565,7 +7565,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
}
|
||||
}
|
||||
// Master of subtlety
|
||||
if( dummySpell->SpellIconID == 2114 )
|
||||
if (dummySpell->SpellIconID == 2114)
|
||||
{
|
||||
triggered_spell_id = 31665;
|
||||
basepoints0 = triggerAmount;
|
||||
@@ -8317,7 +8317,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
// Lightning Overload
|
||||
if (dummySpell->SpellIconID == 2018) // only this spell have SpellFamily Shaman SpellIconID == 2018 and dummy aura
|
||||
{
|
||||
if(!procSpell || !IsPlayer() || !victim)
|
||||
if (!procSpell || !IsPlayer() || !victim)
|
||||
return false;
|
||||
|
||||
if (procEx & PROC_EX_CRITICAL_HIT)
|
||||
@@ -8548,7 +8548,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
basepoints0 = triggerEntry->Effects[EFFECT_0].BasePoints * 2;
|
||||
|
||||
SetCantProc(true);
|
||||
if(basepoints0)
|
||||
if (basepoints0)
|
||||
CastCustomSpell(target, triggered_spell_id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura, originalCaster);
|
||||
else
|
||||
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster);
|
||||
@@ -8688,7 +8688,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
AddSpellCooldown(cooldown_spell_id, 0, cooldown);
|
||||
}
|
||||
|
||||
if(basepoints0)
|
||||
if (basepoints0)
|
||||
CastCustomSpell(target, triggered_spell_id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura, originalCaster);
|
||||
else
|
||||
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster);
|
||||
@@ -9586,7 +9586,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
{
|
||||
if (cooldown)
|
||||
{
|
||||
if (pTarget->HasSpellCooldown(trigger_spell_id) )
|
||||
if (pTarget->HasSpellCooldown(trigger_spell_id))
|
||||
return false;
|
||||
pTarget->AddSpellCooldown(trigger_spell_id, 0, cooldown);
|
||||
}
|
||||
@@ -9622,7 +9622,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
// Ruby Drake, Evasive Aura
|
||||
case 50241:
|
||||
{
|
||||
if( GetAura(50240) )
|
||||
if (GetAura(50240))
|
||||
return false;
|
||||
|
||||
break;
|
||||
@@ -9812,7 +9812,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
AddSpellCooldown(triggerEntry->Id, 0, cooldown);
|
||||
}
|
||||
|
||||
if(basepoints0)
|
||||
if (basepoints0)
|
||||
CastCustomSpell(target, triggerEntry->Id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
else
|
||||
CastSpell(target, triggerEntry->Id, true, castItem, triggeredByAura);
|
||||
@@ -10483,11 +10483,11 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
|
||||
Unit::AuraMap& tAuras = GetOwnedAuras();
|
||||
for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
|
||||
{
|
||||
if( (*itr).second->IsRemoved() )
|
||||
if ((*itr).second->IsRemoved())
|
||||
continue;
|
||||
|
||||
if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if( AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()) )
|
||||
if ((*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if (AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()))
|
||||
(*itr).second->HandleAllEffects(aurApp, AURA_EFFECT_HANDLE_REAL, true);
|
||||
}
|
||||
}
|
||||
@@ -10503,8 +10503,8 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
|
||||
Unit::AuraMap& tAuras = GetOwnedAuras();
|
||||
for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
|
||||
{
|
||||
if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if( AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()) )
|
||||
if ((*itr).second->GetSpellInfo()->CasterAuraState == flag )
|
||||
if (AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()))
|
||||
(*itr).second->HandleAllEffects(aurApp, AURA_EFFECT_HANDLE_REAL, false);
|
||||
}
|
||||
}
|
||||
@@ -11400,7 +11400,7 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
|
||||
// Merciless Combat
|
||||
if ((*i)->GetSpellInfo()->SpellIconID == 2656)
|
||||
{
|
||||
if( (spellProto && spellProto->SpellFamilyFlags[0] & 0x2) || spellProto->SpellFamilyFlags[1] & 0x2 )
|
||||
if ((spellProto && spellProto->SpellFamilyFlags[0] & 0x2) || spellProto->SpellFamilyFlags[1] & 0x2 )
|
||||
if (!victim->HealthAbovePct(35))
|
||||
AddPct(DoneTotalMod, (*i)->GetAmount());
|
||||
}
|
||||
@@ -12480,7 +12480,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
||||
|
||||
// Check for table values
|
||||
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
|
||||
if(bonus)
|
||||
if (bonus)
|
||||
{
|
||||
if (damagetype == DOT)
|
||||
{
|
||||
@@ -12728,7 +12728,7 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
|
||||
// If m_immuneToDamage type contain magic, IMMUNE damage.
|
||||
SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
|
||||
if((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
if ((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -12760,7 +12760,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const
|
||||
// If m_immuneToDamage type contain magic, IMMUNE damage.
|
||||
SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
|
||||
if((itr->type & schoolMask) == schoolMask)
|
||||
if ((itr->type & schoolMask) == schoolMask)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -12813,7 +12813,7 @@ bool Unit::IsImmunedToSchool(SpellSchoolMask meleeSchoolMask) const
|
||||
// If m_immuneToSchool type contain this school type, IMMUNE damage.
|
||||
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
if((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
if ((itr->type & meleeSchoolMask) == meleeSchoolMask)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -12835,7 +12835,7 @@ bool Unit::IsImmunedToSchool(SpellInfo const* spellInfo) const
|
||||
// If m_immuneToSchool type contain this school type, IMMUNE damage.
|
||||
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
if((itr->type & schoolMask) == schoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->spellId)))
|
||||
if ((itr->type & schoolMask) == schoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->spellId)))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -13914,7 +13914,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
{
|
||||
Player* owner = GetAffectingPlayer();
|
||||
Unit const* const thisUnit = owner ? owner : this;
|
||||
if (!(target->IsPlayer() && thisUnit->IsPlayer()) &&
|
||||
if (!(target->IsPlayer() && thisUnit->IsPlayer()) &&
|
||||
!(target->IsCreature() && thisUnit->IsCreature()))
|
||||
{
|
||||
Player const* player = target->IsPlayer() ? target->ToPlayer() : thisUnit->ToPlayer();
|
||||
@@ -15402,7 +15402,7 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType, Unit* victim) con
|
||||
if (attType == RANGED_ATTACK)
|
||||
{
|
||||
int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS);
|
||||
if( victim )
|
||||
if (victim)
|
||||
ap += victim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS);
|
||||
|
||||
if (ap < 0)
|
||||
@@ -15412,7 +15412,7 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType, Unit* victim) con
|
||||
else
|
||||
{
|
||||
int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS);
|
||||
if( victim )
|
||||
if (victim)
|
||||
ap += victim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS);
|
||||
|
||||
if (ap < 0)
|
||||
@@ -20259,13 +20259,24 @@ void Unit::OutDebugInfo() const
|
||||
class AuraMunchingQueue : public BasicEvent
|
||||
{
|
||||
public:
|
||||
AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId) : _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId) { }
|
||||
AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId, AuraEffect* aurEff, AuraType auraType) : _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId), _aurEff(aurEff), _auraType(auraType) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
|
||||
{
|
||||
if (_owner.IsInWorld() && _owner.FindMap())
|
||||
if (Unit* target = ObjectAccessor::GetUnit(_owner, _targetGUID))
|
||||
_owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, _owner.GetGUID());
|
||||
{
|
||||
bool auraFound = false; // Used to ensure _aurEff exists to avoid wild pointer access/crash
|
||||
Unit::AuraEffectList const& auraEffects = target->GetAuraEffectsByType(_auraType);
|
||||
for (Unit::AuraEffectList::const_iterator j = auraEffects.begin(); j != auraEffects.end(); ++j)
|
||||
if ((*j) == _aurEff)
|
||||
auraFound = true;
|
||||
|
||||
if (!auraFound)
|
||||
_aurEff = nullptr;
|
||||
|
||||
_owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, _aurEff, _owner.GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -20275,13 +20286,16 @@ private:
|
||||
ObjectGuid _targetGUID;
|
||||
int32 _basePoints;
|
||||
uint32 _spellId;
|
||||
AuraEffect* _aurEff;
|
||||
AuraType _auraType;
|
||||
};
|
||||
|
||||
void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex)
|
||||
{
|
||||
AuraEffect* aurEff = nullptr;
|
||||
for (AuraEffectList::iterator i = m_modAuras[auraType].begin(); i != m_modAuras[auraType].end(); ++i)
|
||||
{
|
||||
AuraEffect* aurEff = *i;
|
||||
aurEff = *i;
|
||||
if (aurEff->GetCasterGUID() != caster->GetGUID() || aurEff->GetId() != spellId || aurEff->GetEffIndex() != effectIndex || !aurEff->GetTotalTicks())
|
||||
continue;
|
||||
|
||||
@@ -20291,9 +20305,9 @@ void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, Aura
|
||||
|
||||
// xinef: delay only for casting on different unit
|
||||
if (this == caster || !sWorld->getBoolConfig(CONFIG_MUNCHING_BLIZZLIKE))
|
||||
caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, caster->GetGUID());
|
||||
caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, aurEff, caster->GetGUID());
|
||||
else
|
||||
caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId), caster->m_Events.CalculateQueueTime(400));
|
||||
caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId, aurEff, auraType), caster->m_Events.CalculateQueueTime(400));
|
||||
}
|
||||
|
||||
void Unit::SendClearTarget()
|
||||
|
||||
@@ -702,7 +702,6 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields, bool triggerHook)
|
||||
{
|
||||
sScriptMgr->OnAfterDatabaseLoadCreatureTemplates(_creatureTemplateStoreFast);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadCreatureTemplateModels()
|
||||
|
||||
@@ -838,8 +838,8 @@ namespace Acore
|
||||
FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range)
|
||||
{
|
||||
i_spell = spellid;
|
||||
if( SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellid) )
|
||||
if( SpellInfo const* newSpell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, const_cast<Unit*>(obj)) )
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellid))
|
||||
if (SpellInfo const* newSpell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, const_cast<Unit*>(obj)))
|
||||
i_spell = newSpell->Id;
|
||||
}
|
||||
bool operator()(Unit* u)
|
||||
|
||||
@@ -994,7 +994,7 @@ bool CanRollOnItem(LootItem const& item, Player const* player, Loot* loot)
|
||||
return false;
|
||||
|
||||
uint32 itemCount = player->GetItemCount(item.itemid);
|
||||
if ((proto->MaxCount > 0 && static_cast<int32>(itemCount) >= proto->MaxCount) || (player->CanEquipUniqueItem(proto) != EQUIP_ERR_OK))
|
||||
if ((proto->MaxCount > 0 && static_cast<int32>(itemCount) >= proto->MaxCount))
|
||||
return false;
|
||||
|
||||
if (!item.AllowedForPlayer(player, loot->sourceWorldObjectGUID))
|
||||
@@ -1573,7 +1573,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
|
||||
|
||||
if(msg == EQUIP_ERR_OK)
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPackets::Guild::GuildBankLogQuer
|
||||
bankLogEntry.TimeOffset = int32(GameTime::GetGameTime().count() - m_timestamp);
|
||||
bankLogEntry.EntryType = int8(m_eventType);
|
||||
|
||||
switch(m_eventType)
|
||||
switch (m_eventType)
|
||||
{
|
||||
case GUILD_BANK_LOG_DEPOSIT_ITEM:
|
||||
case GUILD_BANK_LOG_WITHDRAW_ITEM:
|
||||
|
||||
@@ -1160,7 +1160,7 @@ void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket& recv_data)
|
||||
ObjectGuid guid1 = getGuid(playerName1);
|
||||
ObjectGuid guid2 = getGuid(playerName2);
|
||||
|
||||
if(!guid1 || !guid2)
|
||||
if (!guid1 || !guid2)
|
||||
{
|
||||
SendPartyResult(PARTY_OP_SWAP, playerName1, ERR_GROUP_SWAP_FAILED);
|
||||
return;
|
||||
|
||||
@@ -319,7 +319,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
needItemDelay = GetAccountId() != rc_account;
|
||||
}
|
||||
|
||||
if( money >= 10 * GOLD )
|
||||
if (money >= 10 * GOLD)
|
||||
{
|
||||
CleanStringForMysqlQuery(subject);
|
||||
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"{}\", NOW(), {})",
|
||||
@@ -551,7 +551,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData)
|
||||
.AddMoney(m->COD)
|
||||
.SendMailTo(trans, MailReceiver(sender, m->sender), MailSender(MAIL_NORMAL, m->receiver), MAIL_CHECK_MASK_COD_PAYMENT);
|
||||
|
||||
if( m->COD >= 10 * GOLD )
|
||||
if (m->COD >= 10 * GOLD)
|
||||
{
|
||||
std::string senderName;
|
||||
if (!sCharacterCache->GetCharacterNameByGuid(ObjectGuid(HighGuid::Player, m->sender), senderName))
|
||||
|
||||
@@ -1707,7 +1707,7 @@ void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/)
|
||||
if (_player->IsInFlight())
|
||||
return;
|
||||
|
||||
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
|
||||
{
|
||||
bf->PlayerAskToLeave(_player);
|
||||
return;
|
||||
|
||||
@@ -462,7 +462,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
|
||||
spell->SendPetCastResult(SPELL_FAILED_DONT_REPORT);
|
||||
|
||||
if (!pet->HasSpellCooldown(spellId))
|
||||
if(pet->ToPet())
|
||||
if (pet->ToPet())
|
||||
pet->ToPet()->RemoveSpellCooldown(spellId, true);
|
||||
|
||||
spell->finish(false);
|
||||
|
||||
@@ -375,7 +375,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
if (mover->IsPlayer())
|
||||
{
|
||||
// not have spell in spellbook or spell passive and not casted by client
|
||||
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()) )
|
||||
if (!(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()))
|
||||
{
|
||||
bool allow = false;
|
||||
|
||||
@@ -411,7 +411,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
if (seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK || spellInfo->Effects[EFFECT_0].Effect == SPELL_EFFECT_OPEN_LOCK /*allow looting from vehicle, but only if player has required spell (all necessary opening spells are in playercreateinfo_spell)*/)
|
||||
if ((mover->IsCreature() && !mover->ToCreature()->HasSpell(spellId)) || spellInfo->IsPassive()) // the creature can't cast that spell, check player instead
|
||||
{
|
||||
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()) )
|
||||
if (!(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()))
|
||||
{
|
||||
//cheater? kick? ban?
|
||||
recvPacket.rfinish(); // prevent spam at ignore packet
|
||||
|
||||
@@ -462,12 +462,12 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
||||
// execute trade: 2. store
|
||||
moveItems(myItems, hisItems);
|
||||
|
||||
if( my_trade->GetMoney() >= 10 * GOLD )
|
||||
if (my_trade->GetMoney() >= 10 * GOLD )
|
||||
{
|
||||
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"goods\", NOW(), {})",
|
||||
GetAccountId(), _player->GetGUID().GetCounter(), _player->GetName(), GetRemoteAddress(), trader->GetSession()->GetAccountId(), trader->GetName(), my_trade->GetMoney(), 6);
|
||||
}
|
||||
if( his_trade->GetMoney() >= 10 * GOLD )
|
||||
if (his_trade->GetMoney() >= 10 * GOLD )
|
||||
{
|
||||
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"goods\", NOW(), {})",
|
||||
trader->GetSession()->GetAccountId(), trader->GetGUID().GetCounter(), trader->GetName(), trader->GetSession()->GetRemoteAddress(), GetAccountId(), _player->GetName(), his_trade->GetMoney(), 6);
|
||||
|
||||
@@ -301,5 +301,4 @@ namespace Movement
|
||||
|
||||
return str.str();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -205,7 +205,6 @@ namespace Movement
|
||||
void set_length(index_type i, length_type length) { lengths[i] = length;}
|
||||
void clear();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#include "SplineImpl.h"
|
||||
|
||||
@@ -92,5 +92,4 @@ namespace Movement
|
||||
SplineBase::clear();
|
||||
lengths.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -299,7 +299,6 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/)
|
||||
|
||||
void OutdoorPvP::HandlePlayerResurrects(Player* /*player*/, uint32 /*zone*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool OutdoorPvP::Update(uint32 diff)
|
||||
|
||||
@@ -55,7 +55,6 @@ void ScriptMgr::OnBeforeCreatureSelectLevel(const CreatureTemplate* cinfo, Creat
|
||||
{
|
||||
script->OnBeforeCreatureSelectLevel(cinfo, creature, level);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void ScriptMgr::Creature_SelectLevel(const CreatureTemplate* cinfo, Creature* creature)
|
||||
|
||||
@@ -88,10 +88,7 @@ void ScriptMgr::OnCreateMap(Map* map)
|
||||
{
|
||||
ASSERT(map);
|
||||
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
script->OnCreateMap(map);
|
||||
});
|
||||
CALL_ENABLED_HOOKS(AllMapScript, ALLMAPHOOK_ON_CREATE_MAP, script->OnCreateMap(map));
|
||||
|
||||
ForeachMaps<WorldMapScript>(map,
|
||||
[&](WorldMapScript* script)
|
||||
@@ -116,10 +113,7 @@ void ScriptMgr::OnDestroyMap(Map* map)
|
||||
{
|
||||
ASSERT(map);
|
||||
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
script->OnDestroyMap(map);
|
||||
});
|
||||
CALL_ENABLED_HOOKS(AllMapScript, ALLMAPHOOK_ON_DESTROY_MAP, script->OnDestroyMap(map));
|
||||
|
||||
ForeachMaps<WorldMapScript>(map,
|
||||
[&](WorldMapScript* script)
|
||||
@@ -193,10 +187,7 @@ void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player)
|
||||
ASSERT(map);
|
||||
ASSERT(player);
|
||||
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
script->OnPlayerEnterAll(map, player);
|
||||
});
|
||||
CALL_ENABLED_HOOKS(AllMapScript, ALLMAPHOOK_ON_PLAYER_ENTER_ALL, script->OnPlayerEnterAll(map, player));
|
||||
|
||||
ExecuteScript<PlayerScript>([=](PlayerScript* script)
|
||||
{
|
||||
@@ -227,10 +218,7 @@ void ScriptMgr::OnPlayerLeaveMap(Map* map, Player* player)
|
||||
ASSERT(map);
|
||||
ASSERT(player);
|
||||
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
script->OnPlayerLeaveAll(map, player);
|
||||
});
|
||||
CALL_ENABLED_HOOKS(AllMapScript, ALLMAPHOOK_ON_PLAYER_LEAVE_ALL, script->OnPlayerLeaveAll(map, player));
|
||||
|
||||
ForeachMaps<WorldMapScript>(map,
|
||||
[&](WorldMapScript* script)
|
||||
@@ -255,10 +243,7 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff)
|
||||
{
|
||||
ASSERT(map);
|
||||
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
script->OnMapUpdate(map, diff);
|
||||
});
|
||||
CALL_ENABLED_HOOKS(AllMapScript, ALLMAPHOOK_ON_MAP_UPDATE, script->OnMapUpdate(map, diff));
|
||||
|
||||
ForeachMaps<WorldMapScript>(map,
|
||||
[&](WorldMapScript* script)
|
||||
@@ -281,24 +266,22 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff)
|
||||
|
||||
void ScriptMgr::OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript** instanceData, bool load, std::string data, uint32 completedEncounterMask)
|
||||
{
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
script->OnBeforeCreateInstanceScript(instanceMap, instanceData, load, data, completedEncounterMask);
|
||||
});
|
||||
CALL_ENABLED_HOOKS(AllMapScript, ALLMAPHOOK_ON_BEFORE_CREATE_INSTANCE_SCRIPT, script->OnBeforeCreateInstanceScript(instanceMap, instanceData, load, data, completedEncounterMask));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnDestroyInstance(MapInstanced* mapInstanced, Map* map)
|
||||
{
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
script->OnDestroyInstance(mapInstanced, map);
|
||||
});
|
||||
CALL_ENABLED_HOOKS(AllMapScript, ALLMAPHOOK_ON_DESTROY_INSTANCE, script->OnDestroyInstance(mapInstanced, map));
|
||||
}
|
||||
|
||||
AllMapScript::AllMapScript(const char* name) :
|
||||
ScriptObject(name)
|
||||
AllMapScript::AllMapScript(const char* name, std::vector<uint16> enabledHooks) : ScriptObject(name, ALLMAPHOOK_END)
|
||||
{
|
||||
ScriptRegistry<AllMapScript>::AddScript(this);
|
||||
// If empty - enable all available hooks.
|
||||
if (enabledHooks.empty())
|
||||
for (uint16 i = 0; i < ALLMAPHOOK_END; ++i)
|
||||
enabledHooks.emplace_back(i);
|
||||
|
||||
ScriptRegistry<AllMapScript>::AddScript(this, std::move(enabledHooks));
|
||||
}
|
||||
|
||||
template class AC_GAME_API ScriptRegistry<AllMapScript>;
|
||||
|
||||
@@ -19,11 +19,24 @@
|
||||
#define SCRIPT_OBJECT_ALL_MAP_SCRIPT_H_
|
||||
|
||||
#include "ScriptObject.h"
|
||||
#include <vector>
|
||||
|
||||
enum AllMapHook
|
||||
{
|
||||
ALLMAPHOOK_ON_PLAYER_ENTER_ALL,
|
||||
ALLMAPHOOK_ON_PLAYER_LEAVE_ALL,
|
||||
ALLMAPHOOK_ON_BEFORE_CREATE_INSTANCE_SCRIPT,
|
||||
ALLMAPHOOK_ON_DESTROY_INSTANCE,
|
||||
ALLMAPHOOK_ON_CREATE_MAP,
|
||||
ALLMAPHOOK_ON_DESTROY_MAP,
|
||||
ALLMAPHOOK_ON_MAP_UPDATE,
|
||||
ALLMAPHOOK_END
|
||||
};
|
||||
|
||||
class AllMapScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
AllMapScript(const char* name);
|
||||
AllMapScript(const char* name, std::vector<uint16> enabledHooks = std::vector<uint16>());
|
||||
|
||||
public:
|
||||
/**
|
||||
|
||||
@@ -113,6 +113,7 @@ void ScriptMgr::Initialize()
|
||||
ScriptRegistry<UnitScript>::InitEnabledHooksIfNeeded(UNITHOOK_END);
|
||||
ScriptRegistry<WorldObjectScript>::InitEnabledHooksIfNeeded(WORLDOBJECTHOOK_END);
|
||||
ScriptRegistry<WorldScript>::InitEnabledHooksIfNeeded(WORLDHOOK_END);
|
||||
ScriptRegistry<AllMapScript>::InitEnabledHooksIfNeeded(ALLMAPHOOK_END);
|
||||
}
|
||||
|
||||
void ScriptMgr::Unload()
|
||||
|
||||
@@ -1016,7 +1016,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
|
||||
if (mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION))
|
||||
data >> mi->splineElevation;
|
||||
|
||||
//! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview.
|
||||
//! Anti-cheat checks. Please keep them in seperate if () blocks to maintain a clear overview.
|
||||
//! Might be subject to latency, so just remove improper flags.
|
||||
#ifdef ACORE_DEBUG
|
||||
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \
|
||||
|
||||
@@ -1058,7 +1058,7 @@ float AuraEffect::CalcPeriodicCritChance(Unit const* caster, Unit const* target)
|
||||
}
|
||||
}
|
||||
|
||||
switch(GetSpellInfo()->SpellFamilyName)
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
// Rupture - since 3.3.3 can crit
|
||||
case SPELLFAMILY_ROGUE:
|
||||
@@ -5603,7 +5603,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
{
|
||||
if (Battleground* bg = target->ToPlayer()->GetBattleground())
|
||||
bg->RemovePlayerFromResurrectQueue(target->ToPlayer());
|
||||
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
|
||||
bf->RemovePlayerFromResurrectQueue(target->GetGUID());
|
||||
}
|
||||
break;
|
||||
@@ -5623,7 +5623,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
// Halls of Lightning, Arc Lightning
|
||||
case 52921:
|
||||
{
|
||||
if( aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
|
||||
if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
|
||||
return;
|
||||
|
||||
Player* player = nullptr;
|
||||
@@ -5631,7 +5631,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
|
||||
Cell::VisitWorldObjects(target, searcher, 10.0f);
|
||||
|
||||
if( player && player->GetGUID() != target->GetGUID() )
|
||||
if (player && player->GetGUID() != target->GetGUID())
|
||||
target->CastSpell(player, 52921, true);
|
||||
|
||||
return;
|
||||
@@ -6488,7 +6488,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
{
|
||||
if (caster)
|
||||
if (Unit* victim = caster->GetVictim())
|
||||
if(victim->GetDistance(caster) < 45.0f)
|
||||
if (victim->GetDistance(caster) < 45.0f)
|
||||
{
|
||||
target = victim;
|
||||
break;
|
||||
|
||||
@@ -1613,7 +1613,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
case SPELLFAMILY_GENERIC:
|
||||
if (!caster)
|
||||
break;
|
||||
switch(GetId())
|
||||
switch (GetId())
|
||||
{
|
||||
case 61987: // Avenging Wrath
|
||||
// Remove the immunity shield marker on Avenging Wrath removal if Forbearance is not present
|
||||
@@ -2010,7 +2010,7 @@ bool Aura::IsAuraStronger(Aura const* newAura) const
|
||||
return true;
|
||||
|
||||
if (curValue == std::abs(newEffect->GetAmount()))
|
||||
if(!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
|
||||
if (!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2931,7 +2931,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
{
|
||||
if (missInfo != SPELL_MISS_EVADE && !m_caster->IsFriendlyTo(effectUnit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)))
|
||||
{
|
||||
m_caster->CombatStart(effectUnit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_SUPRESS_TARGET_PROCS));
|
||||
if (!m_triggeredByAuraSpell.spellInfo || (!(m_triggeredByAuraSpell.spellInfo->Effects[m_triggeredByAuraSpell.effectIndex].TriggerSpell == m_spellInfo->Id) && !(m_triggeredByAuraSpell.spellInfo->IsAuraEffectEqual(m_spellInfo))))
|
||||
m_caster->CombatStart(effectUnit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_SUPRESS_TARGET_PROCS));
|
||||
|
||||
// Patch 3.0.8: All player spells which cause a creature to become aggressive to you will now also immediately cause the creature to be tapped.
|
||||
if (effectUnit->IsInCombatWith(m_caster))
|
||||
@@ -3068,7 +3069,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
{
|
||||
// for delayed spells ignore negative spells (after duel end) for friendly targets
|
||||
/// @todo: this cause soul transfer bugged
|
||||
if(!IsTriggered() && m_spellInfo->Speed > 0.0f && unit->IsPlayer() && !m_spellInfo->IsPositive())
|
||||
if (!IsTriggered() && m_spellInfo->Speed > 0.0f && unit->IsPlayer() && !m_spellInfo->IsPositive())
|
||||
return SPELL_MISS_EVADE;
|
||||
|
||||
// assisting case, healing and resurrection
|
||||
@@ -3247,7 +3248,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
HandleEffects(unit, nullptr, nullptr, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
}
|
||||
|
||||
if( sanct_effect >= 0 && (effectMask & (1 << sanct_effect)) )
|
||||
if (sanct_effect >= 0 && (effectMask & (1 << sanct_effect)))
|
||||
HandleEffects(unit, nullptr, nullptr, sanct_effect, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
return SPELL_MISS_NONE;
|
||||
@@ -3274,7 +3275,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask)
|
||||
m_caster->CastSpell(unit, 61988, true);
|
||||
|
||||
// Fearie Fire (Feral) - damage
|
||||
if( m_preCastSpell == 60089 )
|
||||
if (m_preCastSpell == 60089)
|
||||
m_caster->CastSpell(unit, m_preCastSpell, true);
|
||||
else if (sSpellMgr->GetSpellInfo(m_preCastSpell))
|
||||
// Blizz seems to just apply aura without bothering to cast
|
||||
@@ -6539,24 +6540,24 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
}
|
||||
case SPELL_EFFECT_STEAL_BENEFICIAL_BUFF:
|
||||
{
|
||||
if( !m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)
|
||||
if (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
bool found = false;
|
||||
Unit::VisibleAuraMap const* visibleAuras = m_targets.GetUnitTarget()->GetVisibleAuras();
|
||||
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
|
||||
{
|
||||
if( itr->second->GetBase()->IsPassive() )
|
||||
if (itr->second->GetBase()->IsPassive())
|
||||
continue;
|
||||
|
||||
if( !itr->second->IsPositive() )
|
||||
if (!itr->second->IsPositive())
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !found )
|
||||
if (!found)
|
||||
return SPELL_FAILED_NOTHING_TO_STEAL;
|
||||
|
||||
break;
|
||||
@@ -8756,17 +8757,17 @@ void Spell::PrepareTriggersExecutedOnHit()
|
||||
{
|
||||
case SPELLFAMILY_PALADIN:
|
||||
{
|
||||
if( m_spellInfo->SpellFamilyFlags[1] & 0x40000000 )
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x40000000)
|
||||
{
|
||||
Unit::AuraEffectList const& mVindication = m_caster->GetAuraEffectsByType(SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
for(Unit::AuraEffectList::const_iterator itr = mVindication.begin(); itr != mVindication.end(); ++itr)
|
||||
{
|
||||
if( (*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 26017 )
|
||||
if ((*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 26017 )
|
||||
{
|
||||
m_preCastSpell = 26017;
|
||||
break;
|
||||
}
|
||||
else if( (*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 67 )
|
||||
else if ((*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 67 )
|
||||
m_preCastSpell = 67;
|
||||
}
|
||||
}
|
||||
@@ -8775,7 +8776,7 @@ void Spell::PrepareTriggersExecutedOnHit()
|
||||
case SPELLFAMILY_DRUID:
|
||||
{
|
||||
// Faerie Fire (Feral)
|
||||
if( m_spellInfo->Id == 16857 && (m_caster->GetShapeshiftForm() == FORM_BEAR || m_caster->GetShapeshiftForm() == FORM_DIREBEAR) )
|
||||
if (m_spellInfo->Id == 16857 && (m_caster->GetShapeshiftForm() == FORM_BEAR || m_caster->GetShapeshiftForm() == FORM_DIREBEAR))
|
||||
m_preCastSpell = 60089;
|
||||
|
||||
break;
|
||||
|
||||
@@ -681,16 +681,16 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
// Trial of the Champion, Trample
|
||||
case 67866:
|
||||
{
|
||||
if( unitTarget && !unitTarget->IsVehicle() && !unitTarget->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) )
|
||||
if (unitTarget && !unitTarget->IsVehicle() && !unitTarget->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID))
|
||||
unitTarget->CastSpell(unitTarget, 67867, false);
|
||||
return;
|
||||
}
|
||||
// Trial of the Champion, Hammer of the Righteous
|
||||
case 66867:
|
||||
{
|
||||
if( !unitTarget )
|
||||
if (!unitTarget)
|
||||
return;
|
||||
if( unitTarget->HasAura(66940) )
|
||||
if (unitTarget->HasAura(66940))
|
||||
m_caster->CastSpell(unitTarget, 66903, true);
|
||||
else
|
||||
m_caster->CastSpell(unitTarget, 66904, true);
|
||||
@@ -699,12 +699,12 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
case 17731:
|
||||
case 69294:
|
||||
{
|
||||
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > GameTime::GetGameTime().count() )
|
||||
if (!gameObjTarget || gameObjTarget->GetRespawnTime() > GameTime::GetGameTime().count())
|
||||
return;
|
||||
|
||||
gameObjTarget->SetRespawnTime(10);
|
||||
gameObjTarget->SendCustomAnim(gameObjTarget->GetGoAnimProgress());
|
||||
if( Creature* trigger = gameObjTarget->SummonCreature(12758, *gameObjTarget, TEMPSUMMON_TIMED_DESPAWN, 1000) )
|
||||
if (Creature* trigger = gameObjTarget->SummonCreature(12758, *gameObjTarget, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
trigger->CastSpell(trigger, 17731, false);
|
||||
|
||||
return;
|
||||
@@ -712,7 +712,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
// HoL, Arc Weld
|
||||
case 59086:
|
||||
{
|
||||
if( m_caster && m_caster->IsPlayer() && m_caster->ToPlayer()->isMoving() )
|
||||
if (m_caster && m_caster->IsPlayer() && m_caster->ToPlayer()->isMoving())
|
||||
m_caster->CastSpell(m_caster, 59097, true);
|
||||
|
||||
return;
|
||||
@@ -753,7 +753,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
// Hunger for Blood
|
||||
if( m_spellInfo->Id == 51662 )
|
||||
if (m_spellInfo->Id == 51662)
|
||||
{
|
||||
m_caster->CastSpell(m_caster, 63848, true);
|
||||
return;
|
||||
@@ -3126,7 +3126,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
|
||||
uint32 petentry = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
int32 duration = m_spellInfo->GetDuration();
|
||||
|
||||
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
|
||||
Player* owner = m_originalCaster->ToPlayer();
|
||||
@@ -3448,7 +3448,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
case SPELLFAMILY_HUNTER:
|
||||
{
|
||||
// Kill Shot
|
||||
if( m_spellInfo->SpellFamilyFlags[1] & 0x800000 )
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x800000)
|
||||
{
|
||||
spell_bonus += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.4f);
|
||||
}
|
||||
@@ -3469,7 +3469,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
{
|
||||
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
|
||||
//Death Knight T8 Melee 4P Bonus
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
|
||||
AddPct(disease_amt, aurEff->GetAmount());
|
||||
|
||||
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f);
|
||||
@@ -3501,7 +3501,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
|
||||
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
|
||||
//Death Knight T8 Melee 4P Bonus
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
|
||||
AddPct(disease_amt, aurEff->GetAmount());
|
||||
|
||||
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f);
|
||||
@@ -3520,7 +3520,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
{
|
||||
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
|
||||
//Death Knight T8 Melee 4P Bonus
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
|
||||
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
|
||||
AddPct(disease_amt, aurEff->GetAmount());
|
||||
|
||||
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()));
|
||||
@@ -3945,7 +3945,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
case 61263: // for item Intravenous Healing Potion (44698)
|
||||
{
|
||||
if( !m_caster || !unitTarget )
|
||||
if (!m_caster || !unitTarget)
|
||||
return;
|
||||
|
||||
m_caster->CastSpell(m_caster, 61267, true);
|
||||
@@ -3957,16 +3957,16 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
case SPELLFAMILY_ROGUE:
|
||||
{
|
||||
switch( m_spellInfo->Id )
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
// Master of Subtlety
|
||||
case 31666:
|
||||
{
|
||||
if( !unitTarget )
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
Aura* mos = unitTarget->GetAura(31665);
|
||||
if( mos )
|
||||
if (mos)
|
||||
{
|
||||
mos->SetMaxDuration(6000);
|
||||
mos->SetDuration(6000, true);
|
||||
@@ -3977,11 +3977,11 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
// Overkill
|
||||
case 58428:
|
||||
{
|
||||
if( !unitTarget )
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
Aura* overkill = unitTarget->GetAura(58427);
|
||||
if( overkill )
|
||||
if (overkill)
|
||||
{
|
||||
overkill->SetMaxDuration(20000);
|
||||
overkill->SetDuration(20000, true);
|
||||
|
||||
@@ -3038,7 +3038,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
|
||||
{
|
||||
if (spellInfo->Effects[j].Effect)
|
||||
{
|
||||
switch(spellInfo->Effects[j].Effect)
|
||||
switch (spellInfo->Effects[j].Effect)
|
||||
{
|
||||
case SPELL_EFFECT_SCHOOL_DAMAGE:
|
||||
case SPELL_EFFECT_WEAPON_DAMAGE:
|
||||
@@ -3503,7 +3503,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
|
||||
{
|
||||
if (spellInfo->Effects[j].ApplyAuraName && spellInfo->Effects[j].TriggerSpell)
|
||||
{
|
||||
switch(spellInfo->Effects[j].ApplyAuraName)
|
||||
switch (spellInfo->Effects[j].ApplyAuraName)
|
||||
{
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT:
|
||||
|
||||
@@ -389,6 +389,7 @@ enum WorldIntConfigs
|
||||
CONFIG_ICC_BUFF_ALLIANCE,
|
||||
CONFIG_ITEMDELETE_QUALITY,
|
||||
CONFIG_ITEMDELETE_ITEM_LEVEL,
|
||||
CONFIG_ITEMDELETE_KEEP_DAYS,
|
||||
CONFIG_BG_REWARD_WINNER_HONOR_FIRST,
|
||||
CONFIG_BG_REWARD_WINNER_ARENA_FIRST,
|
||||
CONFIG_BG_REWARD_WINNER_HONOR_LAST,
|
||||
|
||||
@@ -1266,6 +1266,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
_bool_configs[CONFIG_ITEMDELETE_VENDOR] = sConfigMgr->GetOption<bool>("ItemDelete.Vendor", 0);
|
||||
_int_configs[CONFIG_ITEMDELETE_QUALITY] = sConfigMgr->GetOption<int32>("ItemDelete.Quality", 3);
|
||||
_int_configs[CONFIG_ITEMDELETE_ITEM_LEVEL] = sConfigMgr->GetOption<int32>("ItemDelete.ItemLevel", 80);
|
||||
_int_configs[CONFIG_ITEMDELETE_KEEP_DAYS] = sConfigMgr->GetOption<int32>("ItemDelete.KeepDays", 0);
|
||||
|
||||
_int_configs[CONFIG_FFA_PVP_TIMER] = sConfigMgr->GetOption<int32>("FFAPvPTimer", 30);
|
||||
|
||||
@@ -2092,6 +2093,9 @@ void World::SetInitialWorldSettings()
|
||||
// Delete all characters which have been deleted X days before
|
||||
Player::DeleteOldCharacters();
|
||||
|
||||
// Delete all items which have been deleted X days before
|
||||
Player::DeleteOldRecoveryItems();
|
||||
|
||||
// Delete all custom channels which haven't been used for PreserveCustomChannelDuration days.
|
||||
Channel::CleanOldChannelsInDB();
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
{ "anim", HandleDebugAnimCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "arena", HandleDebugArenaCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "bg", HandleDebugBattlegroundCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "cooldown", HandleDebugCooldownCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "getitemstate", HandleDebugGetItemStateCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "lootrecipient", HandleDebugGetLootRecipientCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "getvalue", HandleDebugGetValueCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
@@ -784,6 +785,33 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugCooldownCommand(ChatHandler* handler, uint32 spell_id, uint32 end_time, Optional<uint32> item_id)
|
||||
{
|
||||
Player* player = handler->GetPlayer();
|
||||
|
||||
if (!player || !spell_id || !end_time)
|
||||
return false;
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(spell_id))
|
||||
return false;
|
||||
|
||||
if (!item_id)
|
||||
item_id = 0;
|
||||
else if (!sItemStore.LookupEntry(*item_id))
|
||||
return false;
|
||||
|
||||
if (end_time < player->GetSpellCooldownDelay(spell_id))
|
||||
player->RemoveSpellCooldown(spell_id, true);
|
||||
|
||||
player->AddSpellCooldown(spell_id, *item_id, end_time, true, false);
|
||||
|
||||
WorldPacket data;
|
||||
player->BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spell_id, end_time);
|
||||
player->SendDirectMessage(&data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugArenaCommand(ChatHandler* /*handler*/)
|
||||
{
|
||||
sBattlegroundMgr->ToggleArenaTesting();
|
||||
|
||||
@@ -123,7 +123,14 @@ public:
|
||||
if (!name.data())
|
||||
return false;
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry FROM creature_template WHERE name = \"{}\" LIMIT 1" , name.data());
|
||||
// Make sure we don't pass double quotes into the SQL query. Otherwise it causes a MySQL error
|
||||
std::string str = name.data(); // Making subtractions to the last character does not with in string_view
|
||||
if (str.front() == '"')
|
||||
str = str.substr(1);
|
||||
if (str.back() == '"')
|
||||
str = str.substr(0, str.size() - 1);
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry FROM creature_template WHERE name = \"{}\" LIMIT 1", str);
|
||||
if (!result)
|
||||
{
|
||||
handler->SendErrorMessage(LANG_COMMAND_GOCREATNOTFOUND);
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ public:
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
switch(_events.ExecuteEvent())
|
||||
switch (_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_FIREBLAST:
|
||||
DoCastVictim(SPELL_FIREBLAST);
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ public:
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
switch(_events.ExecuteEvent())
|
||||
switch (_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOWBOLTVOLLEY:
|
||||
DoCastVictim(SPELL_SHADOWBOLTVOLLEY);
|
||||
|
||||
+1
-1
@@ -456,7 +456,7 @@ public:
|
||||
{
|
||||
case TYPE_RING_OF_LAW:
|
||||
encounter[0] = data;
|
||||
switch(data)
|
||||
switch (data)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
TempSummonGrimstone = instance->SummonCreature(NPC_GRIMSTONE, GrimstonePositon);
|
||||
|
||||
+1
-1
@@ -358,7 +358,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case DATA_SOLAKAR_FLAMEWREATH:
|
||||
switch(data)
|
||||
switch (data)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
if (SolakarState == NOT_STARTED)
|
||||
|
||||
@@ -242,7 +242,7 @@ struct boss_nightbane : public BossAI
|
||||
_skeletonscheduler.Schedule(50ms, [this](TaskContext context)
|
||||
{
|
||||
//spawns skeletons every 2 seconds until skeletonCount is reached
|
||||
if(_skeletonSpawnCounter < _skeletonCount)
|
||||
if (_skeletonSpawnCounter < _skeletonCount)
|
||||
{
|
||||
me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_SUMMON_SKELETON, true);
|
||||
_skeletonSpawnCounter++;
|
||||
|
||||
@@ -941,7 +941,7 @@ struct boss_julianne : public ScriptedAI
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch(action)
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_FAKING_DEATH:
|
||||
isFakingDeath = false;
|
||||
@@ -1138,7 +1138,7 @@ struct boss_romulo : public ScriptedAI
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch(action)
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_FAKING_DEATH:
|
||||
isFakingDeath = false;
|
||||
|
||||
@@ -456,7 +456,7 @@ public:
|
||||
|
||||
uint32 NextStep(uint32 nextStep)
|
||||
{
|
||||
switch(nextStep)
|
||||
switch (nextStep)
|
||||
{
|
||||
case 1:
|
||||
Talk(SAY_DIALOG_MEDIVH_1);
|
||||
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
switch(type)
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_MOGRAINE_AND_WHITE_EVENT:
|
||||
if (data == IN_PROGRESS)
|
||||
@@ -317,7 +317,7 @@ public:
|
||||
mograine->Kill(me, me, true);
|
||||
return 0;
|
||||
default:
|
||||
if(mograine)
|
||||
if (mograine)
|
||||
mograine->DespawnOrUnsummon(0);
|
||||
return 0;
|
||||
}
|
||||
@@ -468,7 +468,7 @@ public:
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch(eventId)
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SPELL_CRUSADER_STRIKE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CRUSADER_STRIKE, true);
|
||||
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
switch(events.ExecuteEvent())
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 1:
|
||||
me->CastSpell(me, BONE_ARMOR_SPELL, false);
|
||||
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch(events.ExecuteEvent())
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_RESTORE_COMBAT:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
{
|
||||
me->RemoveAurasDueToSpell(67541);
|
||||
me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
|
||||
switch(summon->GetEntry())
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
case NPC_SCOURGE_ZOMBIE:
|
||||
events.ScheduleEvent(EVENT_SPAWN_WAVE_2, 3000);
|
||||
|
||||
+1
-1
@@ -517,7 +517,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 uiPointId) override
|
||||
{
|
||||
switch(uiPointId)
|
||||
switch (uiPointId)
|
||||
{
|
||||
// Starting waypoint, After reaching uther and jaina
|
||||
case 0:
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
|
||||
{
|
||||
switch(criteria_id)
|
||||
switch (criteria_id)
|
||||
{
|
||||
case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER:
|
||||
case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER:
|
||||
|
||||
@@ -330,12 +330,12 @@ public:
|
||||
instance->SetData(DATA_PYRAMID, PYRAMID_CAGES_OPEN);
|
||||
|
||||
//setting gossip option as soon as the cages open
|
||||
if(Creature* bly = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BLY)))
|
||||
if (Creature* bly = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BLY)))
|
||||
{
|
||||
bly->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
if(Creature* weegli = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_WEEGLI)))
|
||||
if (Creature* weegli = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_WEEGLI)))
|
||||
{
|
||||
weegli->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
if(summon->GetEntry() != me->GetEntry())
|
||||
if (summon->GetEntry() != me->GetEntry())
|
||||
{
|
||||
summon->GetMotionMaster()->MovePoint(0, *me, false);
|
||||
summon->GetMotionMaster()->MoveFollow(me, 0.1f, 0.0f + M_PI * 0.3f * summons.size());
|
||||
|
||||
+3
-3
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature) override
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case NPC_SARTHARION:
|
||||
m_uiSartharionGUID = pCreature->GetGUID();
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
|
||||
ObjectGuid GetGuidData(uint32 uiData) const override
|
||||
{
|
||||
switch(uiData)
|
||||
switch (uiData)
|
||||
{
|
||||
case DATA_SARTHARION:
|
||||
return m_uiSartharionGUID;
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* /*target*/, uint32 /*miscvalue1*/) override
|
||||
{
|
||||
switch(criteria_id)
|
||||
switch (criteria_id)
|
||||
{
|
||||
// Gonna Go When the Volcano Blows (10 player) (2047)
|
||||
case 7326:
|
||||
|
||||
+66
-66
@@ -104,19 +104,19 @@ public:
|
||||
{
|
||||
events.Reset();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE, NOT_STARTED);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if( type == POINT_MOTION_TYPE && id == 1 )
|
||||
if (type == POINT_MOTION_TYPE && id == 1)
|
||||
me->SetFacingTo(3 * M_PI / 2);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if( who->IsPlayer() )
|
||||
if (who->IsPlayer())
|
||||
{
|
||||
Talk(SAY_EADRIC_KILL_PLAYER);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPELL_HAMMER_RIGHTEOUS, 25000);
|
||||
Talk(SAY_EADRIC_AGGRO);
|
||||
me->CastSpell(me, SPELL_VENGEANCE, false);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE, IN_PROGRESS);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
{
|
||||
if( damage >= me->GetHealth() )
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
damage = me->GetHealth() - 1;
|
||||
if (me->GetFaction() != FACTION_FRIENDLY)
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
_EnterEvadeMode();
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetImmuneToAll(true);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE);
|
||||
}
|
||||
}
|
||||
@@ -164,15 +164,15 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
events.Repeat(16s);
|
||||
break;
|
||||
case EVENT_SPELL_HAMMER_RIGHTEOUS:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true))
|
||||
{
|
||||
Talk(SAY_EADRIC_EMOTE_HAMMER_RIGHTEOUS, target);
|
||||
Talk(SAY_EADRIC_HAMMER_RIGHTEOUS);
|
||||
@@ -224,26 +224,26 @@ public:
|
||||
{
|
||||
events.Reset();
|
||||
summoned = false;
|
||||
if( MemoryGUID )
|
||||
if (MemoryGUID)
|
||||
{
|
||||
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
|
||||
if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
|
||||
memory->DespawnOrUnsummon();
|
||||
MemoryGUID.Clear();
|
||||
}
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE, NOT_STARTED);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if( type == POINT_MOTION_TYPE && id == 1 )
|
||||
if (type == POINT_MOTION_TYPE && id == 1)
|
||||
me->SetFacingTo(3 * M_PI / 2);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if( who->IsPlayer() )
|
||||
if (who->IsPlayer())
|
||||
{
|
||||
Talk(SAY_PALETRESS_KILL_PLAYER);
|
||||
}
|
||||
@@ -256,22 +256,22 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPELL_SMITE, 2s, 3s);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
Talk(SAY_PALETRESS_AGGRO);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
if( param == 1 )
|
||||
if (param == 1)
|
||||
{
|
||||
MemoryGUID.Clear();
|
||||
me->RemoveAura(SPELL_SHIELD);
|
||||
Talk(SAY_PALETRESS_MEMORY_DEATH);
|
||||
}
|
||||
else if( param == (-1) )
|
||||
else if (param == (-1))
|
||||
{
|
||||
if( MemoryGUID )
|
||||
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
|
||||
if (MemoryGUID)
|
||||
if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
|
||||
{
|
||||
memory->DespawnOrUnsummon();
|
||||
MemoryGUID.Clear();
|
||||
@@ -281,10 +281,10 @@ public:
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
{
|
||||
//if( me->HasAura(SPELL_SHIELD) )
|
||||
//if (me->HasAura(SPELL_SHIELD))
|
||||
// return;
|
||||
|
||||
if( damage >= me->GetHealth() )
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
damage = me->GetHealth() - 1;
|
||||
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
_EnterEvadeMode();
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetImmuneToAll(true);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE);
|
||||
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 68206);
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MEMORY_ENTRY, summon->GetEntry());
|
||||
MemoryGUID = summon->GetGUID();
|
||||
}
|
||||
@@ -324,12 +324,12 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( !summoned && HealthBelowPct(25) )
|
||||
if (!summoned && HealthBelowPct(25))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
Talk(SAY_PALETRESS_MEMORY_SUMMON);
|
||||
@@ -343,32 +343,32 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_SPELL_SMITE:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
||||
me->CastSpell(target, SPELL_SMITE, false);
|
||||
events.Repeat(3s, 4s);
|
||||
break;
|
||||
case EVENT_SPELL_HOLY_FIRE:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
|
||||
me->CastSpell(target, SPELL_HOLY_FIRE, false);
|
||||
events.Repeat(9s, 12s);
|
||||
break;
|
||||
case EVENT_SPELL_RENEW:
|
||||
if( !MemoryGUID )
|
||||
if (!MemoryGUID)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if( urand(0, 1) )
|
||||
if (urand(0, 1))
|
||||
me->CastSpell(me, SPELL_RENEW, false);
|
||||
else if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
|
||||
if( memory->IsAlive() )
|
||||
else if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
|
||||
if (memory->IsAlive())
|
||||
me->CastSpell(memory, SPELL_RENEW, false);
|
||||
events.Repeat(15s, 17s);
|
||||
break;
|
||||
@@ -410,8 +410,8 @@ public:
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
me->DespawnOrUnsummon(20000);
|
||||
if( pInstance )
|
||||
if( Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)) )
|
||||
if (pInstance)
|
||||
if (Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)))
|
||||
paletress->AI()->DoAction(1);
|
||||
}
|
||||
|
||||
@@ -421,10 +421,10 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
@@ -436,7 +436,7 @@ public:
|
||||
case EVENT_MEMORY_START_ATTACK:
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetImmuneToAll(false);
|
||||
if( Unit* target = me->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = me->SelectNearestTarget(200.0f))
|
||||
{
|
||||
AttackStart(target);
|
||||
DoZoneInCombat();
|
||||
@@ -447,12 +447,12 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPELL_WAKING_NIGHTMARE, 20s, 30s);
|
||||
break;
|
||||
case EVENT_SPELL_OLD_WOUNDS:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
|
||||
me->CastSpell(target, SPELL_OLD_WOUNDS, true);
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
case EVENT_SPELL_SHADOWS_PAST:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
|
||||
me->CastSpell(target, SPELL_SHADOWS_PAST, false);
|
||||
events.Repeat(15s, 20s);
|
||||
break;
|
||||
@@ -541,9 +541,9 @@ public:
|
||||
|
||||
void WaypointReached(uint32 uiPoint) override
|
||||
{
|
||||
if( uiPoint == 1 )
|
||||
if (uiPoint == 1)
|
||||
{
|
||||
switch( uiWaypoint )
|
||||
switch (uiWaypoint)
|
||||
{
|
||||
case 0:
|
||||
me->SetFacingTo(5.4f);
|
||||
@@ -561,10 +561,10 @@ public:
|
||||
void SetData(uint32 uiType, uint32 /*uiData*/) override
|
||||
{
|
||||
AddWaypoint(0, me->GetPositionX(), 660.0f, 411.80f);
|
||||
switch( me->GetEntry() )
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_ARGENT_LIGHTWIELDER:
|
||||
switch( uiType )
|
||||
switch (uiType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(1, 716.321f, 647.047f, 411.93f);
|
||||
@@ -578,7 +578,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case NPC_ARGENT_MONK:
|
||||
switch( uiType )
|
||||
switch (uiType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(1, 717.86f, 649.0f, 411.923f);
|
||||
@@ -592,7 +592,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case NPC_PRIESTESS:
|
||||
switch( uiType )
|
||||
switch (uiType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(1, 719.872f, 650.94f, 411.93f);
|
||||
@@ -613,7 +613,7 @@ public:
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
{
|
||||
if( bCheck && damage >= me->GetHealth() )
|
||||
if (bCheck && damage >= me->GetHealth())
|
||||
{
|
||||
bCheck = false;
|
||||
damage = me->GetHealth() - 1;
|
||||
@@ -625,25 +625,25 @@ public:
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
switch( me->GetEntry() )
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_ARGENT_MONK:
|
||||
events.RescheduleEvent(EVENT_MONK_SPELL_FLURRY_OF_BLOWS, 5s);
|
||||
events.RescheduleEvent(EVENT_MONK_SPELL_PUMMEL, 7s);
|
||||
if( IsHeroic() )
|
||||
if (IsHeroic())
|
||||
bCheck = true;
|
||||
break;
|
||||
case NPC_PRIESTESS:
|
||||
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_HOLY_SMITE, 5s, 8s);
|
||||
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_SHADOW_WORD_PAIN, 3s, 6s);
|
||||
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_FOUNTAIN_OF_LIGHT, 8s, 15s);
|
||||
if( IsHeroic() )
|
||||
if (IsHeroic())
|
||||
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_MIND_CONTROL_H, 12s);
|
||||
break;
|
||||
case NPC_ARGENT_LIGHTWIELDER:
|
||||
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_BLAZING_LIGHT, 12s, 15s);
|
||||
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_CLEAVE, 3s, 5s);
|
||||
if( IsHeroic() )
|
||||
if (IsHeroic())
|
||||
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_UNBALANCING_STRIKE_H, 8s, 12s);
|
||||
break;
|
||||
}
|
||||
@@ -653,15 +653,15 @@ public:
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
@@ -671,18 +671,18 @@ public:
|
||||
events.Repeat(12s, 18s);
|
||||
break;
|
||||
case EVENT_MONK_SPELL_PUMMEL:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_PUMMEL, false);
|
||||
events.Repeat(8s, 11s);
|
||||
break;
|
||||
|
||||
case EVENT_PRIESTESS_SPELL_HOLY_SMITE:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false);
|
||||
events.Repeat(6s, 8s);
|
||||
break;
|
||||
case EVENT_PRIESTESS_SPELL_SHADOW_WORD_PAIN:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_WORD_PAIN, false);
|
||||
events.Repeat(12s, 15s);
|
||||
break;
|
||||
@@ -691,7 +691,7 @@ public:
|
||||
events.Repeat(35s, 45s);
|
||||
break;
|
||||
case EVENT_PRIESTESS_SPELL_MIND_CONTROL_H:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
|
||||
me->CastSpell(target, SPELL_MIND_CONTROL_H, false);
|
||||
events.Repeat(22s, 30s);
|
||||
break;
|
||||
@@ -699,19 +699,19 @@ public:
|
||||
case EVENT_LIGHTWIELDER_SPELL_BLAZING_LIGHT:
|
||||
{
|
||||
Unit* target = DoSelectLowestHpFriendly(40.0f);
|
||||
if( !target )
|
||||
if (!target)
|
||||
target = me;
|
||||
me->CastSpell(target, SPELL_BLAZING_LIGHT, false);
|
||||
events.Repeat(8s, 12s);
|
||||
}
|
||||
break;
|
||||
case EVENT_LIGHTWIELDER_SPELL_CLEAVE:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
|
||||
events.Repeat(6s, 8s);
|
||||
break;
|
||||
case EVENT_LIGHTWIELDER_SPELL_UNBALANCING_STRIKE_H:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_UNBALANCING_STRIKE_H, false);
|
||||
events.Repeat(12s, 15s);
|
||||
break;
|
||||
@@ -723,7 +723,7 @@ public:
|
||||
void JustDied(Unit* /*pKiller*/) override
|
||||
{
|
||||
me->DespawnOrUnsummon(10000);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, 0);
|
||||
}
|
||||
};
|
||||
@@ -742,7 +742,7 @@ class spell_eadric_radiance : public SpellScript
|
||||
{
|
||||
std::list<WorldObject*> tmplist;
|
||||
for( std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if( (*itr)->ToUnit()->HasInArc(M_PI, GetCaster()) )
|
||||
if ((*itr)->ToUnit()->HasInArc(M_PI, GetCaster()))
|
||||
tmplist.push_back(*itr);
|
||||
|
||||
targets.clear();
|
||||
@@ -798,8 +798,8 @@ class spell_reflective_shield_aura : public AuraScript
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
if( Unit* attacker = dmgInfo.GetAttacker() )
|
||||
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
|
||||
if (Unit* attacker = dmgInfo.GetAttacker())
|
||||
if (GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID())
|
||||
{
|
||||
int32 damage = (int32)(absorbAmount * 0.25f);
|
||||
GetOwner()->ToUnit()->CastCustomSpell(attacker, SPELL_REFLECTIVE_SHIELD_DAMAGE, &damage, nullptr, nullptr, true);
|
||||
|
||||
+30
-30
@@ -123,7 +123,7 @@ public:
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetImmuneToAll(true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_BLACK_KNIGHT, NOT_STARTED);
|
||||
|
||||
//me->SetLootMode(0); // [LOOT]
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if( Phase < 3 && damage >= me->GetHealth() )
|
||||
if (Phase < 3 && damage >= me->GetHealth())
|
||||
{
|
||||
damage = 0;
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
@@ -164,19 +164,19 @@ public:
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
if( param == -1 )
|
||||
if (param == -1)
|
||||
{
|
||||
summons.DespawnAll();
|
||||
}
|
||||
else if( param == 1 )
|
||||
else if (param == 1)
|
||||
{
|
||||
if( !pInstance )
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(BOSS_BLACK_KNIGHT, IN_PROGRESS);
|
||||
Talk(SAY_BK_AGGRO);
|
||||
me->CastSpell((Unit*)nullptr, (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? SPELL_RAISE_DEAD_JAEREN : SPELL_RAISE_DEAD_ARELAS), false);
|
||||
if( Creature* announcer = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ANNOUNCER)) )
|
||||
if (Creature* announcer = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ANNOUNCER)))
|
||||
announcer->DespawnOrUnsummon();
|
||||
|
||||
events.Reset();
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
|
||||
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
|
||||
{
|
||||
switch( spell->Id )
|
||||
switch (spell->Id)
|
||||
{
|
||||
case SPELL_BLACK_KNIGHT_RES:
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
|
||||
++Phase;
|
||||
|
||||
switch( Phase )
|
||||
switch (Phase)
|
||||
{
|
||||
case 2:
|
||||
me->SetDisplayId(MODEL_SKELETON);
|
||||
@@ -236,46 +236,46 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_ANNOUNCER_SAY_ZOMBIE:
|
||||
if( pInstance && !summons.empty() )
|
||||
if( Creature* ghoul = pInstance->instance->GetCreature(*summons.begin()) )
|
||||
if (pInstance && !summons.empty())
|
||||
if (Creature* ghoul = pInstance->instance->GetCreature(*summons.begin()))
|
||||
if (urand(0, 1))
|
||||
ghoul->Yell("[Zombie] .... . Brains ....", LANG_UNIVERSAL); /// @todo: Multiple variations + not always happening, from video sources, needs sniff to transition from DB.
|
||||
break;
|
||||
case EVENT_SPELL_PLAGUE_STRIKE:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_PLAGUE_STRIKE, false);
|
||||
events.Repeat(10s, 12s);
|
||||
break;
|
||||
case EVENT_SPELL_ICY_TOUCH:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_ICY_TOUCH, false);
|
||||
events.Repeat(5s, 6s);
|
||||
break;
|
||||
case EVENT_SPELL_DEATH_RESPITE:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
||||
me->CastSpell(target, SPELL_DEATH_RESPITE, false);
|
||||
events.Repeat(13s, 15s);
|
||||
break;
|
||||
case EVENT_SPELL_OBLITERATE:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_OBLITERATE, false);
|
||||
events.Repeat(15s, 17s);
|
||||
break;
|
||||
case EVENT_SPELL_DESECRATION:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
||||
me->CastSpell(target, SPELL_DESECRATION, false);
|
||||
events.Repeat(14s, 17s);
|
||||
break;
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
events.Repeat(2s, 4s);
|
||||
break;
|
||||
case EVENT_SPELL_MARKED_DEATH:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.000000f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.000000f, true))
|
||||
me->CastSpell(target, SPELL_MARKED_DEATH, false);
|
||||
events.Repeat(9s);
|
||||
break;
|
||||
@@ -296,7 +296,7 @@ public:
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if( Unit* target = summon->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = summon->SelectNearestTarget(200.0f))
|
||||
{
|
||||
summon->AI()->AttackStart(target);
|
||||
DoZoneInCombat(summon);
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if( victim->IsPlayer() )
|
||||
if (victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_BK_KILL_PLAYER);
|
||||
}
|
||||
@@ -315,9 +315,9 @@ public:
|
||||
{
|
||||
me->CastSpell((Unit*)nullptr, SPELL_BK_KILL_CREDIT, true);
|
||||
Talk(SAY_BK_DEATH);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_BLACK_KNIGHT, DONE);
|
||||
if( me->ToTempSummon() )
|
||||
if (me->ToTempSummon())
|
||||
me->ToTempSummon()->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
|
||||
}
|
||||
};
|
||||
@@ -347,7 +347,7 @@ public:
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
if( param == 1 )
|
||||
if (param == 1)
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->DisableRotate(false);
|
||||
@@ -358,7 +358,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 i) override
|
||||
{
|
||||
if( i == 12 )
|
||||
if (i == 12)
|
||||
{
|
||||
SetEscortPaused(true);
|
||||
me->SetOrientation(3.62f);
|
||||
@@ -366,7 +366,7 @@ public:
|
||||
me->DisableRotate(true);
|
||||
me->SetFacingTo(3.62f);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_MOUNT_SPECIAL);
|
||||
if( InstanceScript* pInstance = me->GetInstanceScript() )
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
pInstance->SetData(DATA_SKELETAL_GRYPHON_LANDED, 0);
|
||||
}
|
||||
}
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
|
||||
{
|
||||
switch(spell->Id)
|
||||
switch (spell->Id)
|
||||
{
|
||||
case SPELL_CLAW_N:
|
||||
case SPELL_CLAW_H:
|
||||
@@ -443,15 +443,15 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
||||
+91
-91
@@ -173,7 +173,7 @@ public:
|
||||
if (me->IsDuringRemoveFromWorld())
|
||||
return;
|
||||
|
||||
if( apply )
|
||||
if (apply)
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetSpeed(MOVE_RUN, 2.0f, false);
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
if (me->IsDuringRemoveFromWorld())
|
||||
return;
|
||||
|
||||
if( !apply )
|
||||
if (!apply)
|
||||
{
|
||||
me->RemoveAura(SPELL_PLAYER_VEHICLE_DEFEND);
|
||||
who->RemoveAura(SPELL_PLAYER_VEHICLE_DEFEND);
|
||||
@@ -260,7 +260,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( ShieldTimer <= (int32)diff )
|
||||
if (ShieldTimer <= (int32)diff )
|
||||
{
|
||||
me->CastSpell(me, SPELL_MINIONS_DEFEND, true);
|
||||
ShieldTimer = 5000;
|
||||
@@ -268,15 +268,15 @@ public:
|
||||
else
|
||||
ShieldTimer -= diff;
|
||||
|
||||
if ( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
@@ -285,22 +285,22 @@ public:
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if (Player* plr = itr->GetSource())
|
||||
{
|
||||
if( me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead() )
|
||||
if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
|
||||
continue;
|
||||
if( !plr->GetVehicle() )
|
||||
if (!plr->GetVehicle())
|
||||
LIST.push_back(plr->GetGUID());
|
||||
else if( Vehicle* v = plr->GetVehicle() )
|
||||
else if (Vehicle* v = plr->GetVehicle())
|
||||
{
|
||||
if( Unit* mount = v->GetBase() )
|
||||
if (Unit* mount = v->GetBase())
|
||||
LIST.push_back(mount->GetGUID());
|
||||
}
|
||||
}
|
||||
if( !LIST.empty() )
|
||||
if (!LIST.empty())
|
||||
{
|
||||
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
|
||||
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
|
||||
{
|
||||
me->GetThreatMgr().ResetAllThreat();
|
||||
me->AddThreat(target, 10000.0f);
|
||||
@@ -316,25 +316,25 @@ public:
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if (Player* plr = itr->GetSource())
|
||||
{
|
||||
if( me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
|
||||
if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
|
||||
continue;
|
||||
if( Vehicle* v = plr->GetVehicle() )
|
||||
if( Unit* mount = v->GetBase() )
|
||||
if (Vehicle* v = plr->GetVehicle())
|
||||
if (Unit* mount = v->GetBase())
|
||||
LIST.push_back(mount->GetGUID());
|
||||
}
|
||||
if( !LIST.empty() )
|
||||
if (!LIST.empty())
|
||||
{
|
||||
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
|
||||
if( Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)) )
|
||||
if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
|
||||
me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
|
||||
}
|
||||
events.Repeat(6s, 8s);
|
||||
}
|
||||
break;
|
||||
case EVENT_THRUST:
|
||||
if( me->GetVictim() && me->GetExactDist(me->GetVictim()) <= 5.5f )
|
||||
if (me->GetVictim() && me->GetExactDist(me->GetVictim()) <= 5.5f )
|
||||
me->CastSpell(me->GetVictim(), SPELL_PLAYER_VEHICLE_THRUST, false);
|
||||
events.Repeat(3s, 5s);
|
||||
break;
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
{
|
||||
me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
|
||||
me->DespawnOrUnsummon(10000);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOUNT_DIED, 0);
|
||||
}
|
||||
};
|
||||
@@ -402,7 +402,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if( pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
|
||||
if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
|
||||
{
|
||||
DoAction(1);
|
||||
DoAction(2);
|
||||
@@ -415,7 +415,7 @@ public:
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
if( pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
|
||||
if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
|
||||
me->CallForHelp(100.0f);
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ public:
|
||||
{
|
||||
me->m_spellImmune[IMMUNITY_MECHANIC].clear();
|
||||
events.Reset();
|
||||
switch( me->GetEntry() )
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_AMBROSE: // Ambrose Boltspark
|
||||
case NPC_ERESSEA: // Eressea Dawnsinger
|
||||
@@ -485,7 +485,7 @@ public:
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
if( param == 1 )
|
||||
if (param == 1)
|
||||
{
|
||||
MountPhase = false;
|
||||
NewMountGUID.Clear();
|
||||
@@ -500,16 +500,16 @@ public:
|
||||
AddCreatureAddonAuras();
|
||||
events.Reset();
|
||||
}
|
||||
else if( param == 2 )
|
||||
else if (param == 2)
|
||||
ScheduleAbilitiesEvents();
|
||||
}
|
||||
|
||||
void SetData(uint32 uiType, uint32 uiData) override
|
||||
{
|
||||
BossOrder = uiType;
|
||||
if( uiData > 1 )
|
||||
if (uiData > 1)
|
||||
return;
|
||||
switch( BossOrder )
|
||||
switch (BossOrder)
|
||||
{
|
||||
case 0:
|
||||
if (uiData == 0) // 1 == short version
|
||||
@@ -545,11 +545,11 @@ public:
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
{
|
||||
if( MountPhase )
|
||||
if (MountPhase)
|
||||
{
|
||||
if( me->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) == 0 )
|
||||
if (me->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) == 0 )
|
||||
damage = 0;
|
||||
else if( damage >= me->GetHealth() )
|
||||
else if (damage >= me->GetHealth())
|
||||
{
|
||||
events.Reset();
|
||||
damage = me->GetHealth() - 1;
|
||||
@@ -565,10 +565,10 @@ public:
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetImmuneToAll(true);
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_MOUNT_DIED, BossOrder);
|
||||
if( Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ) )
|
||||
if (Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ))
|
||||
{
|
||||
NewMountGUID = mount->GetGUID();
|
||||
me->GetMotionMaster()->MovePoint(7, *mount);
|
||||
@@ -579,7 +579,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
if( damage >= me->GetHealth() )
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
MountPhase = true;
|
||||
events.Reset();
|
||||
@@ -593,7 +593,7 @@ public:
|
||||
me->SetRegeneratingHealth(false);
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetImmuneToAll(true);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_GRAND_CHAMPION_DIED, BossOrder);
|
||||
}
|
||||
}
|
||||
@@ -603,26 +603,26 @@ public:
|
||||
|
||||
void WaypointReached(uint32 i) override
|
||||
{
|
||||
if( !pInstance )
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if( (i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0) )
|
||||
if ((i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0))
|
||||
pInstance->SetData(DATA_GRAND_CHAMPION_REACHED_DEST, BossOrder);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if( id < 4 )
|
||||
if (id < 4)
|
||||
npc_escortAI::MovementInform(type, id);
|
||||
|
||||
if( type == POINT_MOTION_TYPE )
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
{
|
||||
if( id == 5 )
|
||||
if (id == 5)
|
||||
me->SetFacingTo(3 * M_PI / 2);
|
||||
else if( id == 7 ) // reached new mount!
|
||||
else if (id == 7) // reached new mount!
|
||||
{
|
||||
if( NewMountGUID )
|
||||
if( Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID) )
|
||||
if (NewMountGUID)
|
||||
if (Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID))
|
||||
{
|
||||
mount->DespawnOrUnsummon();
|
||||
me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, mount->GetDisplayId());
|
||||
@@ -637,16 +637,16 @@ public:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetImmuneToAll(false);
|
||||
if( Unit* target = me->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = me->SelectNearestTarget(200.0f))
|
||||
AttackStart(target);
|
||||
DoZoneInCombat();
|
||||
me->CastSpell(me, SPELL_TRAMPLE_AURA, true);
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_REACHED_NEW_MOUNT, 0);
|
||||
NewMountGUID.Clear();
|
||||
}
|
||||
}
|
||||
else if( id == 9 )
|
||||
else if (id == 9)
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
@@ -661,37 +661,37 @@ public:
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if ( !UpdateVictim() && !NewMountGUID )
|
||||
if (!UpdateVictim() && !NewMountGUID )
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) || ((me->GetEntry() == NPC_JACOB || me->GetEntry() == NPC_MOKRA) && me->HasAura(SPELL_BLADESTORM)) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || ((me->GetEntry() == NPC_JACOB || me->GetEntry() == NPC_MOKRA) && me->HasAura(SPELL_BLADESTORM)))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_FIND_NEW_MOUNT:
|
||||
{
|
||||
if( me->HasAura(SPELL_TRAMPLE_STUN) )
|
||||
if (me->HasAura(SPELL_TRAMPLE_STUN))
|
||||
{
|
||||
events.Repeat(200ms);
|
||||
break;
|
||||
}
|
||||
|
||||
// hackfix, trample won't hit grand champions because of UNIT_FLAG_NON_ATTACKABLE
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
{
|
||||
bool trample = false;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if( me->GetExactDist(plr) <= 5.0f )
|
||||
if( Vehicle* v = plr->GetVehicle() )
|
||||
if( Unit* c = v->GetBase() )
|
||||
if( c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE) )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if (me->GetExactDist(plr) <= 5.0f )
|
||||
if (Vehicle* v = plr->GetVehicle())
|
||||
if (Unit* c = v->GetBase())
|
||||
if (c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE))
|
||||
{
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
@@ -701,23 +701,23 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if( trample )
|
||||
if (trample)
|
||||
{
|
||||
events.Repeat(15s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID) )
|
||||
if( mount->IsAlive() )
|
||||
if (Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID))
|
||||
if (mount->IsAlive())
|
||||
{
|
||||
if( me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
|
||||
me->GetMotionMaster()->MovePoint(7, *mount);
|
||||
events.Repeat(200ms);
|
||||
break;
|
||||
}
|
||||
|
||||
if( Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ) )
|
||||
if (Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ))
|
||||
{
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
NewMountGUID = mount->GetGUID();
|
||||
@@ -734,22 +734,22 @@ public:
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if (Player* plr = itr->GetSource())
|
||||
{
|
||||
if( me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead() )
|
||||
if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
|
||||
continue;
|
||||
if( !plr->GetVehicle() )
|
||||
if (!plr->GetVehicle())
|
||||
LIST.push_back(plr->GetGUID());
|
||||
else if( Vehicle* v = plr->GetVehicle() )
|
||||
else if (Vehicle* v = plr->GetVehicle())
|
||||
{
|
||||
if( Unit* mount = v->GetBase() )
|
||||
if (Unit* mount = v->GetBase())
|
||||
LIST.push_back(mount->GetGUID());
|
||||
}
|
||||
}
|
||||
if( !LIST.empty() )
|
||||
if (!LIST.empty())
|
||||
{
|
||||
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
|
||||
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
|
||||
{
|
||||
me->GetThreatMgr().ResetAllThreat();
|
||||
me->AddThreat(target, 10000.0f);
|
||||
@@ -765,33 +765,33 @@ public:
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if (Player* plr = itr->GetSource())
|
||||
{
|
||||
if( me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
|
||||
if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
|
||||
continue;
|
||||
if( Vehicle* v = plr->GetVehicle() )
|
||||
if( Unit* mount = v->GetBase() )
|
||||
if (Vehicle* v = plr->GetVehicle())
|
||||
if (Unit* mount = v->GetBase())
|
||||
LIST.push_back(mount->GetGUID());
|
||||
}
|
||||
if( !LIST.empty() )
|
||||
if (!LIST.empty())
|
||||
{
|
||||
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
|
||||
if( Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)) )
|
||||
if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
|
||||
me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
|
||||
}
|
||||
events.Repeat(6s, 8s);
|
||||
}
|
||||
break;
|
||||
case EVENT_THRUST:
|
||||
if( Unit* victim = me->GetVictim() )
|
||||
if( me->GetExactDist(victim) <= 6.0f )
|
||||
if (Unit* victim = me->GetVictim())
|
||||
if (me->GetExactDist(victim) <= 6.0f )
|
||||
me->CastSpell(victim, SPELL_PLAYER_VEHICLE_THRUST, false);
|
||||
events.Repeat(3s, 5s);
|
||||
break;
|
||||
|
||||
/******************* MAGE *******************/
|
||||
case EVEMT_MAGE_SPELL_FIREBALL:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_FIREBALL, false);
|
||||
events.Repeat(5s);
|
||||
break;
|
||||
@@ -804,7 +804,7 @@ public:
|
||||
events.Repeat(22s);
|
||||
break;
|
||||
case EVEMT_MAGE_SPELL_POLYMORPH:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
|
||||
me->CastSpell(target, SPELL_POLYMORPH, false);
|
||||
events.Repeat(8s);
|
||||
break;
|
||||
@@ -812,7 +812,7 @@ public:
|
||||
|
||||
/****************** SHAMAN ******************/
|
||||
case EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
|
||||
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
|
||||
events.Repeat(16s);
|
||||
break;
|
||||
@@ -823,10 +823,10 @@ public:
|
||||
case EVENT_SHAMAN_SPELL_HEALING_WAVE:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if( urand(0, 1) )
|
||||
if (urand(0, 1))
|
||||
{
|
||||
target = DoSelectLowestHpFriendly(40.0f);
|
||||
if( !target )
|
||||
if (!target)
|
||||
target = me;
|
||||
}
|
||||
else
|
||||
@@ -836,7 +836,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case EVENT_SHAMAN_SPELL_HEX_OF_MENDING:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_HEX_OF_MENDING, false);
|
||||
events.Repeat(20s, 25s);
|
||||
break;
|
||||
@@ -852,9 +852,9 @@ public:
|
||||
break;
|
||||
case EVENT_HUNTER_SPELL_MULTI_SHOT:
|
||||
{
|
||||
if( !UnitTargetGUID )
|
||||
if (!UnitTargetGUID)
|
||||
{
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true))
|
||||
{
|
||||
me->CastSpell(target, SPELL_SHOOT, false);
|
||||
UnitTargetGUID = target->GetGUID();
|
||||
@@ -865,7 +865,7 @@ public:
|
||||
else
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, UnitTargetGUID);
|
||||
if( target && me->IsInRange(target, 5.0f, 30.0f, false) )
|
||||
if (target && me->IsInRange(target, 5.0f, 30.0f, false))
|
||||
me->CastSpell(target, SPELL_MULTI_SHOT, false);
|
||||
else
|
||||
{
|
||||
@@ -873,7 +873,7 @@ public:
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if( player && me->IsInRange(player, 5.0f, 30.0f, false) )
|
||||
if (player && me->IsInRange(player, 5.0f, 30.0f, false))
|
||||
{
|
||||
me->CastSpell(player, SPELL_MULTI_SHOT, false);
|
||||
break;
|
||||
@@ -889,7 +889,7 @@ public:
|
||||
|
||||
/****************** ROGUE *******************/
|
||||
case EVENT_ROGUE_SPELL_EVISCERATE:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_EVISCERATE, false);
|
||||
events.Repeat(8s);
|
||||
break;
|
||||
@@ -898,7 +898,7 @@ public:
|
||||
events.Repeat(14s);
|
||||
break;
|
||||
case EVENT_ROGUE_SPELL_POISON_BOTTLE:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
|
||||
me->CastSpell(target, SPELL_POISON_BOTTLE, false);
|
||||
events.Repeat(19s);
|
||||
break;
|
||||
@@ -906,12 +906,12 @@ public:
|
||||
|
||||
/***************** WARRIOR ******************/
|
||||
case EVENT_WARRIOR_SPELL_MORTAL_STRIKE:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_MORTAL_STRIKE, false);
|
||||
events.Repeat(8s, 12s);
|
||||
break;
|
||||
case EVENT_WARRIOR_SPELL_BLADESTORM:
|
||||
if( me->GetVictim() )
|
||||
if (me->GetVictim())
|
||||
me->CastSpell(me->GetVictim(), SPELL_BLADESTORM, false);
|
||||
events.Repeat(15s, 20s);
|
||||
break;
|
||||
@@ -921,7 +921,7 @@ public:
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if( player && me->IsInRange(player, 8.0f, 25.0f, false) )
|
||||
if (player && me->IsInRange(player, 8.0f, 25.0f, false))
|
||||
{
|
||||
DoResetThreatList();
|
||||
me->AddThreat(player, 5.0f);
|
||||
|
||||
+124
-124
@@ -101,7 +101,7 @@ public:
|
||||
bool IsEncounterInProgress() const override
|
||||
{
|
||||
for( uint8 i = 0; i < MAX_ENCOUNTER; ++i )
|
||||
if( m_auiEncounter[i] == IN_PROGRESS )
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -112,54 +112,54 @@ public:
|
||||
if (TeamIdInInstance == TEAM_NEUTRAL)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if( !players.IsEmpty() )
|
||||
if( Player* pPlayer = players.begin()->GetSource() )
|
||||
if (!players.IsEmpty())
|
||||
if (Player* pPlayer = players.begin()->GetSource())
|
||||
TeamIdInInstance = pPlayer->GetTeamId();
|
||||
}
|
||||
|
||||
switch( creature->GetEntry() )
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
// Grand Champions:
|
||||
case NPC_MOKRA:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_JACOB);
|
||||
break;
|
||||
case NPC_ERESSEA:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_AMBROSE);
|
||||
break;
|
||||
case NPC_RUNOK:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_COLOSOS);
|
||||
break;
|
||||
case NPC_ZULTORE:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_JAELYNE);
|
||||
break;
|
||||
case NPC_VISCERI:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_LANA);
|
||||
break;
|
||||
|
||||
// Grand Champion Minions:
|
||||
case NPC_ORGRIMMAR_MINION:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_STORMWIND_MINION);
|
||||
break;
|
||||
case NPC_SILVERMOON_MINION:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_GNOMEREGAN_MINION);
|
||||
break;
|
||||
case NPC_THUNDER_BLUFF_MINION:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_EXODAR_MINION);
|
||||
break;
|
||||
case NPC_SENJIN_MINION:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_DARNASSUS_MINION);
|
||||
break;
|
||||
case NPC_UNDERCITY_MINION:
|
||||
if( TeamIdInInstance == TEAM_HORDE )
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_IRONFORGE_MINION);
|
||||
break;
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
case NPC_JAEREN:
|
||||
case NPC_ARELAS:
|
||||
NPC_AnnouncerGUID = creature->GetGUID();
|
||||
//if( TeamIdInInstance == TEAM_ALLIANCE )
|
||||
//if (TeamIdInInstance == TEAM_ALLIANCE)
|
||||
// creature->UpdateEntry(NPC_ARELAS);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
break;
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
// Beginning vehicles:
|
||||
case VEHICLE_ARGENT_WARHORSE:
|
||||
case VEHICLE_ARGENT_BATTLEWORG:
|
||||
if( InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED )
|
||||
if (InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED)
|
||||
{
|
||||
creature->DespawnOrUnsummon();
|
||||
creature->SetRespawnTime(3);
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch( go->GetEntry() )
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_MAIN_GATE:
|
||||
GO_MainGateGUID = go->GetGUID();
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
events.Reset();
|
||||
events.RescheduleEvent(EVENT_CHECK_PLAYERS, 0ms);
|
||||
|
||||
if( !in )
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
@@ -250,17 +250,17 @@ public:
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
|
||||
|
||||
if( dataHead1 == 'T' && dataHead2 == 'C' )
|
||||
if (dataHead1 == 'T' && dataHead2 == 'C')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
InstanceProgress = data3;
|
||||
if( InstanceProgress == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
|
||||
if (InstanceProgress == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED)
|
||||
InstanceProgress = INSTANCE_PROGRESS_INITIAL;
|
||||
|
||||
for( uint8 i = 0; i < MAX_ENCOUNTER; ++i )
|
||||
if( m_auiEncounter[i] == IN_PROGRESS )
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
else
|
||||
@@ -306,10 +306,10 @@ public:
|
||||
|
||||
void InstanceCleanup()
|
||||
{
|
||||
if( CLEANED )
|
||||
if (CLEANED)
|
||||
return;
|
||||
|
||||
switch( InstanceProgress )
|
||||
switch (InstanceProgress)
|
||||
{
|
||||
case INSTANCE_PROGRESS_INITIAL:
|
||||
case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST:
|
||||
@@ -328,15 +328,15 @@ public:
|
||||
{
|
||||
for( uint8 j = 0; j < 3; ++j )
|
||||
{
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[i][j]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[i][j]))
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_GrandChampionMinionsGUID[i][j].Clear();
|
||||
}
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_GrandChampionGUID[i].Clear();
|
||||
}
|
||||
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
c->DespawnOrUnsummon();
|
||||
c->SetHomePosition(748.309f, 619.488f, 411.172f, 4.71239f);
|
||||
@@ -349,7 +349,7 @@ public:
|
||||
break;
|
||||
case INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
announcer->DespawnOrUnsummon();
|
||||
announcer->SetHomePosition(735.81f, 661.92f, 412.39f, 4.714f);
|
||||
@@ -358,28 +358,28 @@ public:
|
||||
announcer->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
|
||||
{
|
||||
uint32 entry = c->GetEntry();
|
||||
c->DespawnOrUnsummon();
|
||||
switch( i )
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
if( Creature* pBoss = announcer->SummonCreature(entry, 736.695f, 650.02f, 412.4f, 3 * M_PI / 2) )
|
||||
if (Creature* pBoss = announcer->SummonCreature(entry, 736.695f, 650.02f, 412.4f, 3 * M_PI / 2))
|
||||
{
|
||||
NPC_GrandChampionGUID[0] = pBoss->GetGUID();
|
||||
pBoss->AI()->SetData(0, 2);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if( Creature* pBoss = announcer->SummonCreature(entry, 756.32f, 650.05f, 412.4f, 3 * M_PI / 2) )
|
||||
if (Creature* pBoss = announcer->SummonCreature(entry, 756.32f, 650.05f, 412.4f, 3 * M_PI / 2))
|
||||
{
|
||||
NPC_GrandChampionGUID[1] = pBoss->GetGUID();
|
||||
pBoss->AI()->SetData(1, 2);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if( Creature* pBoss = announcer->SummonCreature(entry, 746.5f, 650.65f, 411.7f, 3 * M_PI / 2) )
|
||||
if (Creature* pBoss = announcer->SummonCreature(entry, 746.5f, 650.65f, 411.7f, 3 * M_PI / 2))
|
||||
{
|
||||
NPC_GrandChampionGUID[2] = pBoss->GetGUID();
|
||||
pBoss->AI()->SetData(2, 2);
|
||||
@@ -397,17 +397,17 @@ public:
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
for( uint8 j = 0; j < 3; ++j )
|
||||
{
|
||||
if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]))
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_ArgentSoldierGUID[i][j].Clear();
|
||||
}
|
||||
if( Creature* c = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
if (Creature* c = instance->GetCreature(NPC_ArgentChampionGUID))
|
||||
{
|
||||
c->AI()->DoAction(-1); // paletress despawn memory
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_ArgentChampionGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
c->DespawnOrUnsummon();
|
||||
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
|
||||
@@ -422,16 +422,16 @@ public:
|
||||
case INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED:
|
||||
// revert to INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED
|
||||
{
|
||||
if( Creature* c = instance->GetCreature(NPC_BlackKnightVehicleGUID) )
|
||||
if (Creature* c = instance->GetCreature(NPC_BlackKnightVehicleGUID))
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_BlackKnightVehicleGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_BlackKnightGUID) )
|
||||
if (Creature* c = instance->GetCreature(NPC_BlackKnightGUID))
|
||||
{
|
||||
c->AI()->DoAction(-1);
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_BlackKnightGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
c->DespawnOrUnsummon();
|
||||
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
|
||||
@@ -443,7 +443,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case INSTANCE_PROGRESS_FINISHED:
|
||||
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
c->DespawnOrUnsummon();
|
||||
break;
|
||||
}
|
||||
@@ -460,7 +460,7 @@ public:
|
||||
|
||||
uint32 GetData(uint32 uiData) const override
|
||||
{
|
||||
switch( uiData )
|
||||
switch (uiData)
|
||||
{
|
||||
case DATA_INSTANCE_PROGRESS:
|
||||
return InstanceProgress;
|
||||
@@ -473,7 +473,7 @@ public:
|
||||
|
||||
ObjectGuid GetGuidData(uint32 uiData) const override
|
||||
{
|
||||
switch( uiData )
|
||||
switch (uiData)
|
||||
{
|
||||
case DATA_ANNOUNCER:
|
||||
return NPC_AnnouncerGUID;
|
||||
@@ -486,21 +486,21 @@ public:
|
||||
|
||||
void SetData(uint32 uiType, uint32 uiData) override
|
||||
{
|
||||
switch( uiType )
|
||||
switch (uiType)
|
||||
{
|
||||
case DATA_ANNOUNCER_GOSSIP_SELECT:
|
||||
switch( InstanceProgress )
|
||||
switch (InstanceProgress)
|
||||
{
|
||||
case INSTANCE_PROGRESS_INITIAL:
|
||||
if (uiData == 0) // normal intro
|
||||
{
|
||||
shortver = false;
|
||||
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
if( GameObject* gate = instance->GetGameObject(GO_MainGateGUID) )
|
||||
if (GameObject* gate = instance->GetGameObject(GO_MainGateGUID))
|
||||
announcer->SetFacingToObject(gate);
|
||||
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
|
||||
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
|
||||
tirion->AI()->Talk(TEXT_WELCOME);
|
||||
}
|
||||
events.RescheduleEvent(EVENT_YELL_WELCOME_2, 8s);
|
||||
@@ -521,7 +521,7 @@ public:
|
||||
|
||||
InstanceProgress = INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST;
|
||||
uiData = DONE; // save to db
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
announcer->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
|
||||
announcer->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
|
||||
@@ -530,10 +530,10 @@ public:
|
||||
}
|
||||
break;
|
||||
case INSTANCE_PROGRESS_CHAMPIONS_DEAD:
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
Counter = urand(0, 1);
|
||||
if( Counter )
|
||||
if (Counter)
|
||||
announcer->AI()->Talk(SAY_EADRIC_INTRO_ANNOUNCER);
|
||||
else
|
||||
announcer->AI()->Talk(SAY_JAEREN_PALETRESS_INTRO);
|
||||
@@ -542,7 +542,7 @@ public:
|
||||
events.RescheduleEvent(EVENT_START_ARGENT_CHALLENGE_INTRO, 0ms);
|
||||
break;
|
||||
case INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED:
|
||||
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
|
||||
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
|
||||
tirion->AI()->Talk(TEXT_BK_INTRO);
|
||||
events.RescheduleEvent(EVENT_SUMMON_BLACK_KNIGHT, 3s);
|
||||
break;
|
||||
@@ -551,7 +551,7 @@ public:
|
||||
case DATA_GRAND_CHAMPION_REACHED_DEST:
|
||||
if (shortver)
|
||||
break;
|
||||
switch( uiData )
|
||||
switch (uiData)
|
||||
{
|
||||
case 0:
|
||||
events.ScheduleEvent(EVENT_SUMMON_GRAND_CHAMPION_2, 0ms);
|
||||
@@ -560,7 +560,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_SUMMON_GRAND_CHAMPION_3, 0ms);
|
||||
break;
|
||||
case 2:
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
InstanceProgress = INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST;
|
||||
uiData = DONE; // save to db
|
||||
@@ -572,10 +572,10 @@ public:
|
||||
}
|
||||
break;
|
||||
case DATA_MOUNT_DIED:
|
||||
switch( InstanceProgress )
|
||||
switch (InstanceProgress)
|
||||
{
|
||||
case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST: // fighting group 1/3
|
||||
if( ++Counter >= 3 )
|
||||
if (++Counter >= 3)
|
||||
{
|
||||
Counter = 0;
|
||||
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1;
|
||||
@@ -584,7 +584,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1: // fighting group 2/3
|
||||
if( ++Counter >= 3 )
|
||||
if (++Counter >= 3)
|
||||
{
|
||||
Counter = 0;
|
||||
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2;
|
||||
@@ -593,7 +593,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2: // fighting group 3/3
|
||||
if( ++Counter >= 3 )
|
||||
if (++Counter >= 3)
|
||||
{
|
||||
Counter = 0;
|
||||
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_3;
|
||||
@@ -602,7 +602,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_3: // fighting grand champions (on vehicles)
|
||||
if( ++Counter >= 3 )
|
||||
if (++Counter >= 3)
|
||||
{
|
||||
Counter = 0;
|
||||
InstanceProgress = INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED;
|
||||
@@ -618,7 +618,7 @@ public:
|
||||
--Counter;
|
||||
break;
|
||||
case DATA_GRAND_CHAMPION_DIED:
|
||||
if( ++Counter >= 3 )
|
||||
if (++Counter >= 3)
|
||||
{
|
||||
Counter = 0;
|
||||
VehicleList.clear();
|
||||
@@ -627,7 +627,7 @@ public:
|
||||
m_auiEncounter[0] = DONE;
|
||||
bool creditCasted = false;
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
|
||||
{
|
||||
c->GetMotionMaster()->MovePoint(9, 747.36f, 670.07f, 411.9f);
|
||||
if (!creditCasted)
|
||||
@@ -636,7 +636,7 @@ public:
|
||||
creditCasted = true;
|
||||
}
|
||||
}
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
announcer->GetMotionMaster()->MovePoint(0, 743.14f, 628.77f, 411.2f);
|
||||
announcer->SummonGameObject(instance->IsHeroic() ? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000); // [LOOT]
|
||||
@@ -645,12 +645,12 @@ public:
|
||||
}
|
||||
|
||||
// bind players to instance
|
||||
if( instance->IsHeroic() )
|
||||
if (instance->IsHeroic())
|
||||
instance->ToInstanceMap()->PermBindAllPlayers();
|
||||
}
|
||||
break;
|
||||
case DATA_ARGENT_SOLDIER_DEFEATED:
|
||||
if( ++Counter >= 9 )
|
||||
if (++Counter >= 9)
|
||||
{
|
||||
Counter = 0;
|
||||
InstanceProgress = INSTANCE_PROGRESS_ARGENT_SOLDIERS_DIED;
|
||||
@@ -661,7 +661,7 @@ public:
|
||||
case BOSS_ARGENT_CHALLENGE:
|
||||
{
|
||||
m_auiEncounter[1] = uiData;
|
||||
if( uiData == DONE )
|
||||
if (uiData == DONE)
|
||||
{
|
||||
HandleGameObject(GO_EnterGateGUID, true);
|
||||
InstanceProgress = INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED;
|
||||
@@ -685,7 +685,7 @@ public:
|
||||
HandleGameObject(GO_EnterGateGUID, false);
|
||||
bAchievIveHadWorse = true;
|
||||
}
|
||||
else if( uiData == DONE )
|
||||
else if (uiData == DONE)
|
||||
{
|
||||
HandleGameObject(GO_EnterGateGUID, true);
|
||||
InstanceProgress = INSTANCE_PROGRESS_FINISHED;
|
||||
@@ -698,7 +698,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if( uiData == DONE )
|
||||
if (uiData == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ public:
|
||||
uint32 MINION_TO_SUMMON = 0;
|
||||
int32 TEXT_ID = 0;
|
||||
|
||||
switch( BossNumber )
|
||||
switch (BossNumber)
|
||||
{
|
||||
case 0:
|
||||
CHAMPION_TO_SUMMON = NPC_MOKRA;
|
||||
@@ -754,7 +754,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if( Creature* pBoss = instance->SummonCreature(CHAMPION_TO_SUMMON, SpawnPos) )
|
||||
if (Creature* pBoss = instance->SummonCreature(CHAMPION_TO_SUMMON, SpawnPos))
|
||||
{
|
||||
NPC_GrandChampionGUID[BossOrder] = pBoss->GetGUID();
|
||||
pBoss->ToCreature()->SetReactState(REACT_PASSIVE);
|
||||
@@ -764,7 +764,7 @@ public:
|
||||
pBoss->AI()->SetData(BossOrder, (shortver ? 1 : 0));
|
||||
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* pAdd = instance->SummonCreature(MINION_TO_SUMMON, SpawnPos) )
|
||||
if (Creature* pAdd = instance->SummonCreature(MINION_TO_SUMMON, SpawnPos))
|
||||
{
|
||||
NPC_GrandChampionMinionsGUID[BossOrder][i] = pAdd->GetGUID();
|
||||
pAdd->SetReactState(REACT_PASSIVE);
|
||||
@@ -776,7 +776,7 @@ public:
|
||||
}
|
||||
|
||||
if (!shortver)
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
announcer->AI()->Talk(TEXT_ID); /// @todo: Missing Argent Raid Spectator cheers.
|
||||
}
|
||||
@@ -785,7 +785,7 @@ public:
|
||||
void Update(uint32 diff) override
|
||||
{
|
||||
events.Update(diff);
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_NULL:
|
||||
break;
|
||||
@@ -842,15 +842,15 @@ public:
|
||||
}
|
||||
case EVENT_GRAND_GROUP_1_MOVE_MIDDLE:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
announcer->SetFacingTo(4.714f);
|
||||
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
|
||||
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
|
||||
tirion->AI()->Talk(TEXT_BEGIN);
|
||||
HandleGameObject(GO_EnterGateGUID, false);
|
||||
}
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]))
|
||||
{
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
|
||||
@@ -862,12 +862,12 @@ public:
|
||||
case EVENT_GRAND_GROUP_1_ATTACK:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]))
|
||||
{
|
||||
c->SetReactState(REACT_AGGRESSIVE);
|
||||
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
c->SetImmuneToAll(false);
|
||||
if( Unit* target = c->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = c->SelectNearestTarget(200.0f))
|
||||
c->AI()->AttackStart(target);
|
||||
c->AI()->DoZoneInCombat();
|
||||
}
|
||||
@@ -877,7 +877,7 @@ public:
|
||||
case EVENT_GRAND_GROUP_2_MOVE_MIDDLE:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]))
|
||||
{
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
|
||||
@@ -889,12 +889,12 @@ public:
|
||||
case EVENT_GRAND_GROUP_2_ATTACK:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]))
|
||||
{
|
||||
c->SetReactState(REACT_AGGRESSIVE);
|
||||
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
c->SetImmuneToAll(false);
|
||||
if( Unit* target = c->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = c->SelectNearestTarget(200.0f))
|
||||
c->AI()->AttackStart(target);
|
||||
c->AI()->DoZoneInCombat();
|
||||
}
|
||||
@@ -903,7 +903,7 @@ public:
|
||||
case EVENT_GRAND_GROUP_3_MOVE_MIDDLE:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]))
|
||||
{
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
|
||||
@@ -915,12 +915,12 @@ public:
|
||||
case EVENT_GRAND_GROUP_3_ATTACK:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]))
|
||||
{
|
||||
c->SetReactState(REACT_AGGRESSIVE);
|
||||
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
c->SetImmuneToAll(false);
|
||||
if( Unit* target = c->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = c->SelectNearestTarget(200.0f))
|
||||
c->AI()->AttackStart(target);
|
||||
c->AI()->DoZoneInCombat();
|
||||
}
|
||||
@@ -929,7 +929,7 @@ public:
|
||||
case EVENT_GRAND_CHAMPIONS_MOVE_MIDDLE:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
|
||||
{
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
c->GetMotionMaster()->MovePoint(4, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
|
||||
@@ -941,12 +941,12 @@ public:
|
||||
case EVENT_GRAND_CHAMPIONS_MOUNTS_ATTACK:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
|
||||
{
|
||||
c->SetReactState(REACT_AGGRESSIVE);
|
||||
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
c->SetImmuneToAll(false);
|
||||
if( Unit* target = c->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = c->SelectNearestTarget(200.0f))
|
||||
c->AI()->AttackStart(target);
|
||||
c->AI()->DoZoneInCombat();
|
||||
c->CastSpell(c, 67865, true); // SPELL_TRAMPLE_AURA
|
||||
@@ -956,10 +956,10 @@ public:
|
||||
case EVENT_GRAND_CHAMPIONS_MOVE_SIDE:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
|
||||
{
|
||||
c->AI()->DoAction(1);
|
||||
switch( i )
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
c->GetMotionMaster()->MovePoint(5, 736.695f, 650.02f, 412.4f);
|
||||
@@ -979,12 +979,12 @@ public:
|
||||
case EVENT_GRAND_CHAMPIONS_ATTACK:
|
||||
{
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
|
||||
{
|
||||
c->SetReactState(REACT_AGGRESSIVE);
|
||||
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
c->SetImmuneToAll(false);
|
||||
if( Unit* target = c->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = c->SelectNearestTarget(200.0f))
|
||||
c->AI()->AttackStart(target);
|
||||
c->AI()->DoZoneInCombat();
|
||||
c->AI()->DoAction(2);
|
||||
@@ -993,7 +993,7 @@ public:
|
||||
break;
|
||||
case EVENT_GRATZ_SLAIN_CHAMPIONS:
|
||||
{
|
||||
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
|
||||
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
|
||||
tirion->AI()->Talk(TEXT_GRATZ_SLAIN_CHAMPIONS);
|
||||
|
||||
HandleGameObject(GO_EnterGateGUID, true);
|
||||
@@ -1001,15 +1001,15 @@ public:
|
||||
break;
|
||||
case EVENT_RESTORE_ANNOUNCER_GOSSIP:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
announcer->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
break;
|
||||
case EVENT_START_ARGENT_CHALLENGE_INTRO:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
if( GameObject* gate = instance->GetGameObject(GO_MainGateGUID) )
|
||||
if (GameObject* gate = instance->GetGameObject(GO_MainGateGUID))
|
||||
{
|
||||
announcer->SetFacingToObject(gate);
|
||||
HandleGameObject(GO_MainGateGUID, true, gate);
|
||||
@@ -1023,19 +1023,19 @@ public:
|
||||
float x = pos.GetPositionX();
|
||||
|
||||
pos.m_positionX = x - 2.0f + (i - 1) * 10.0f;
|
||||
if( Creature* pTrash = instance->SummonCreature(NPC_ARGENT_LIGHTWIELDER, pos) )
|
||||
if (Creature* pTrash = instance->SummonCreature(NPC_ARGENT_LIGHTWIELDER, pos))
|
||||
{
|
||||
pTrash->AI()->SetData(i, 0);
|
||||
NPC_ArgentSoldierGUID[i][0] = pTrash->GetGUID();
|
||||
}
|
||||
pos.m_positionX = x + (i - 1) * 10.0f;
|
||||
if( Creature* pTrash = instance->SummonCreature(NPC_ARGENT_MONK, pos) )
|
||||
if (Creature* pTrash = instance->SummonCreature(NPC_ARGENT_MONK, pos))
|
||||
{
|
||||
pTrash->AI()->SetData(i, 0);
|
||||
NPC_ArgentSoldierGUID[i][1] = pTrash->GetGUID();
|
||||
}
|
||||
pos.m_positionX = x + 2.0f + (i - 1) * 10.0f;
|
||||
if( Creature* pTrash = instance->SummonCreature(NPC_PRIESTESS, pos) )
|
||||
if (Creature* pTrash = instance->SummonCreature(NPC_PRIESTESS, pos))
|
||||
{
|
||||
pTrash->AI()->SetData(i, 0);
|
||||
NPC_ArgentSoldierGUID[i][2] = pTrash->GetGUID();
|
||||
@@ -1046,7 +1046,7 @@ public:
|
||||
break;
|
||||
case EVENT_SUMMON_ARGENT_CHALLENGE:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
announcer->GetMotionMaster()->MovePoint(0, 735.81f, 661.92f, 412.39f);
|
||||
if (Creature* boss = instance->SummonCreature(Counter ? NPC_EADRIC : NPC_PALETRESS, SpawnPosition))
|
||||
boss->GetMotionMaster()->MovePoint(0, 746.881f, 660.263f, 411.7f);
|
||||
@@ -1057,15 +1057,15 @@ public:
|
||||
break;
|
||||
case EVENT_ARGENT_CHALLENGE_SAY_1:
|
||||
{
|
||||
if( Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
if (Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID))
|
||||
ac->AI()->Talk(Counter ? SAY_EADRIC_INTRO : SAY_PALETRESS_INTRO_1);
|
||||
if( !Counter )
|
||||
if (!Counter)
|
||||
events.ScheduleEvent(EVENT_ARGENT_CHALLENGE_SAY_2, 6s);
|
||||
}
|
||||
break;
|
||||
case EVENT_ARGENT_CHALLENGE_SAY_2:
|
||||
{
|
||||
if( Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
if (Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID))
|
||||
ac->AI()->Talk(SAY_PALETRESS_INTRO_2);
|
||||
}
|
||||
break;
|
||||
@@ -1074,14 +1074,14 @@ public:
|
||||
Counter = 0;
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
for( uint8 j = 0; j < 3; ++j )
|
||||
if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) )
|
||||
if (Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]))
|
||||
{
|
||||
c->SetReactState(REACT_AGGRESSIVE);
|
||||
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
c->SetImmuneToAll(false);
|
||||
//c->AI()->DoZoneInCombat();
|
||||
}
|
||||
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
|
||||
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
|
||||
tirion->AI()->Talk(TEXT_YOU_MAY_BEGIN);
|
||||
}
|
||||
break;
|
||||
@@ -1096,12 +1096,12 @@ public:
|
||||
break;
|
||||
case EVENT_ARGENT_CHALLENGE_ATTACK:
|
||||
{
|
||||
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
|
||||
{
|
||||
boss->SetReactState(REACT_AGGRESSIVE);
|
||||
boss->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
boss->SetImmuneToAll(false);
|
||||
if( Unit* target = boss->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = boss->SelectNearestTarget(200.0f))
|
||||
boss->AI()->AttackStart(target);
|
||||
boss->AI()->DoZoneInCombat();
|
||||
}
|
||||
@@ -1109,7 +1109,7 @@ public:
|
||||
break;
|
||||
case EVENT_ARGENT_CHALLENGE_RUN_MIDDLE:
|
||||
{
|
||||
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
|
||||
{
|
||||
boss->GetMotionMaster()->MovePoint(1, 747.13f, 628.037f, 411.2f);
|
||||
events.ScheduleEvent(EVENT_ARGENT_CHALLENGE_LEAVE_CHEST, 6s);
|
||||
@@ -1118,12 +1118,12 @@ public:
|
||||
break;
|
||||
case EVENT_ARGENT_CHALLENGE_LEAVE_CHEST:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
|
||||
{
|
||||
announcer->GetMotionMaster()->MovePoint(0, 743.14f, 628.77f, 411.2f);
|
||||
uint32 chest = 0;
|
||||
if( instance->IsHeroic() )
|
||||
if (instance->IsHeroic())
|
||||
chest = (boss->GetEntry() == NPC_EADRIC || boss->GetEntry() == NPC_EADRIC_H) ? GO_EADRIC_LOOT_H : GO_PALETRESS_LOOT_H;
|
||||
else
|
||||
chest = (boss->GetEntry() == NPC_EADRIC || boss->GetEntry() == NPC_EADRIC_H) ? GO_EADRIC_LOOT : GO_PALETRESS_LOOT;
|
||||
@@ -1136,7 +1136,7 @@ public:
|
||||
break;
|
||||
case EVENT_ARGENT_CHALLENGE_DISAPPEAR:
|
||||
{
|
||||
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
|
||||
{
|
||||
boss->GetMotionMaster()->MovePoint(0, SpawnPosition);
|
||||
boss->DespawnOrUnsummon(3000);
|
||||
@@ -1145,18 +1145,18 @@ public:
|
||||
break;
|
||||
case EVENT_SUMMON_BLACK_KNIGHT:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if( Creature* bk_vehicle = announcer->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0.0f) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
if (Creature* bk_vehicle = announcer->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0.0f))
|
||||
{
|
||||
NPC_BlackKnightVehicleGUID = bk_vehicle->GetGUID();
|
||||
bk_vehicle->SetReactState(REACT_PASSIVE);
|
||||
bk_vehicle->SetFacingTo(M_PI);
|
||||
if( Vehicle* v = bk_vehicle->GetVehicleKit() )
|
||||
if( Unit* bk = v->GetPassenger(0) )
|
||||
if (Vehicle* v = bk_vehicle->GetVehicleKit())
|
||||
if (Unit* bk = v->GetPassenger(0))
|
||||
{
|
||||
NPC_BlackKnightGUID = bk->GetGUID();
|
||||
bk->SendMovementFlagUpdate(); // put him on vehicle visually
|
||||
if( bk->IsCreature() )
|
||||
if (bk->IsCreature())
|
||||
bk->ToCreature()->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
@@ -1167,7 +1167,7 @@ public:
|
||||
break;
|
||||
case EVENT_START_BLACK_KNIGHT_SCENE:
|
||||
{
|
||||
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
|
||||
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
|
||||
{
|
||||
Position exitPos = { 751.003357f, 638.145508f, 411.570129f, M_PI };
|
||||
bk->ExitVehicle(/*&exitPos*/);
|
||||
@@ -1179,9 +1179,9 @@ public:
|
||||
break;
|
||||
case EVENT_BLACK_KNIGHT_CAST_ANNOUNCER:
|
||||
{
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
{
|
||||
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
|
||||
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
|
||||
{
|
||||
bk->SetPosition(745.016f, 631.506f, 411.575f, bk->GetAngle(announcer));
|
||||
bk->SetHomePosition(*bk);
|
||||
@@ -1189,7 +1189,7 @@ public:
|
||||
announcer->SetFacingToObject(bk);
|
||||
announcer->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
bk->AddAura(68306, announcer); // spell has attribute player only
|
||||
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
|
||||
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
|
||||
tirion->AI()->Talk(TEXT_BK_MEANING);
|
||||
}
|
||||
}
|
||||
@@ -1198,7 +1198,7 @@ public:
|
||||
break;
|
||||
case EVENT_BLACK_KNIGHT_KILL_ANNOUNCER:
|
||||
{
|
||||
if( Creature* bk_vehicle = instance->GetCreature(NPC_BlackKnightVehicleGUID) )
|
||||
if (Creature* bk_vehicle = instance->GetCreature(NPC_BlackKnightVehicleGUID))
|
||||
bk_vehicle->AI()->DoAction(1);
|
||||
|
||||
events.ScheduleEvent(EVENT_BLACK_KNIGHT_MOVE_FORWARD, 4s);
|
||||
@@ -1206,13 +1206,13 @@ public:
|
||||
break;
|
||||
case EVENT_BLACK_KNIGHT_MOVE_FORWARD:
|
||||
{
|
||||
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
|
||||
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
|
||||
{
|
||||
bk->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
|
||||
bk->GetMotionMaster()->MovePoint(0, 746.81f, 623.15f, 411.42f);
|
||||
bk->AI()->Talk(SAY_BK_INTRO_2);
|
||||
}
|
||||
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
|
||||
if (announcer->IsAlive())
|
||||
Unit::Kill(announcer, announcer);
|
||||
events.ScheduleEvent(EVENT_BLACK_KNIGHT_SAY_TASK, 14s);
|
||||
@@ -1220,7 +1220,7 @@ public:
|
||||
break;
|
||||
case EVENT_BLACK_KNIGHT_SAY_TASK:
|
||||
{
|
||||
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
|
||||
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
|
||||
{
|
||||
bk->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
bk->AI()->Talk(SAY_BK_INTRO_3);
|
||||
@@ -1230,11 +1230,11 @@ public:
|
||||
break;
|
||||
case EVENT_BLACK_KNIGHT_ATTACK:
|
||||
{
|
||||
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
|
||||
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
|
||||
{
|
||||
bk->SetReactState(REACT_AGGRESSIVE);
|
||||
bk->ReplaceAllUnitFlags(UNIT_FLAG_NONE);
|
||||
if( Unit* target = bk->SelectNearestTarget(200.0f) )
|
||||
if (Unit* target = bk->SelectNearestTarget(200.0f))
|
||||
bk->AI()->AttackStart(target);
|
||||
bk->AI()->DoZoneInCombat();
|
||||
bk->AI()->DoAction(1);
|
||||
@@ -1246,7 +1246,7 @@ public:
|
||||
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
|
||||
{
|
||||
switch(criteria_id)
|
||||
switch (criteria_id)
|
||||
{
|
||||
case 11789: // I've Had Worse criteria id
|
||||
return bAchievIveHadWorse;
|
||||
|
||||
+6
-6
@@ -88,14 +88,14 @@ public:
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
|
||||
{
|
||||
if(!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
|
||||
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
|
||||
return true;
|
||||
|
||||
InstanceScript* pInstance = creature->GetInstanceScript();
|
||||
if(!pInstance)
|
||||
if (!pInstance)
|
||||
return true;
|
||||
|
||||
if(uiAction == GOSSIP_ACTION_INFO_DEF + 1 || uiAction == GOSSIP_ACTION_INFO_DEF + 2 || uiAction == GOSSIP_ACTION_INFO_DEF + 3 || uiAction == GOSSIP_ACTION_INFO_DEF + 4)
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1 || uiAction == GOSSIP_ACTION_INFO_DEF + 2 || uiAction == GOSSIP_ACTION_INFO_DEF + 3 || uiAction == GOSSIP_ACTION_INFO_DEF + 4)
|
||||
{
|
||||
pInstance->SetData(DATA_ANNOUNCER_GOSSIP_SELECT, (uiAction == GOSSIP_ACTION_INFO_DEF + 2 ? 1 : 0));
|
||||
creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
@@ -117,9 +117,9 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if( !pInstance )
|
||||
if (!pInstance)
|
||||
return;
|
||||
if( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_ALLIANCE )
|
||||
if (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_ALLIANCE )
|
||||
me->UpdateEntry(NPC_ARELAS);
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); // removed during black knight scene
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
if (type != EFFECT_MOTION_TYPE)
|
||||
return;
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if( !pInstance )
|
||||
if (!pInstance)
|
||||
return;
|
||||
if (pInstance->GetData(DATA_INSTANCE_PROGRESS) < INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED)
|
||||
return;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user