Merge remote-tracking branch 'upstream/master' into Playerbot

# Conflicts:
#	modules/CMakeLists.txt
This commit is contained in:
bash
2025-10-25 00:48:25 +02:00
90 changed files with 565 additions and 555 deletions
+1
View File
@@ -14,6 +14,7 @@
[![macos-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/macos_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/macos_build.yml?query=branch%3Amaster) [![macos-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/macos_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/macos_build.yml?query=branch%3Amaster)
[![docker-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/docker_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/docker_build.yml?query=branch%3Amaster) [![docker-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/docker_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/docker_build.yml?query=branch%3Amaster)
[![tools-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/tools_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/tools_build.yml?query=branch%3Amaster) [![tools-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/tools_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/tools_build.yml?query=branch%3Amaster)
[![dashboard-ci](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/dashboard-ci.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/dashboard-ci.yml?query=branch%3Amaster)
## Introduction ## Introduction
+4 -4
View File
@@ -36,16 +36,16 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# The containers created in this workflow are used by # The containers created in this workflow are used by
# acore-docker, which has a dependency on mod-eluna. # acore-docker, which has a dependency on mod-ale.
# #
# If you're wanting containers without mod-eluna, the best solution is to # If you're wanting containers without mod-ale, the best solution is to
# build them locally (such as with `docker compose build`) # build them locally (such as with `docker compose build`)
- name: Download Eluna - name: Download Eluna
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
repository: azerothcore/mod-eluna repository: azerothcore/mod-ale
path: modules/mod-eluna path: modules/mod-ale
- name: Login to Docker Hub - name: Login to Docker Hub
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
+1 -1
View File
@@ -35,7 +35,7 @@ git clone --depth=1 --branch=master https://github.com/azerothcore/mod-detailed-
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-dmf-switch modules/mod-dmf-switch git clone --depth=1 --branch=main https://github.com/azerothcore/mod-dmf-switch modules/mod-dmf-switch
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-duel-reset modules/mod-duel-reset git clone --depth=1 --branch=master https://github.com/azerothcore/mod-duel-reset modules/mod-duel-reset
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-dynamic-xp modules/mod-dynamic-xp git clone --depth=1 --branch=master https://github.com/azerothcore/mod-dynamic-xp modules/mod-dynamic-xp
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-eluna modules/mod-eluna git clone --depth=1 --branch=master https://github.com/azerothcore/mod-ale modules/mod-ale
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-emblem-transfer modules/mod-emblem-transfer git clone --depth=1 --branch=master https://github.com/azerothcore/mod-emblem-transfer modules/mod-emblem-transfer
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-fireworks-on-level modules/mod-fireworks-on-level git clone --depth=1 --branch=master https://github.com/azerothcore/mod-fireworks-on-level modules/mod-fireworks-on-level
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-global-chat modules/mod-global-chat git clone --depth=1 --branch=main https://github.com/azerothcore/mod-global-chat modules/mod-global-chat
@@ -63,7 +63,7 @@ repo[:dirname][@branch[:commit]]
./acore.sh module install https://github.com/azerothcore/mod-transmog.git@main ./acore.sh module install https://github.com/azerothcore/mod-transmog.git@main
# Install multiple modules # Install multiple modules
./acore.sh module install mod-transmog mod-eluna:custom-eluna ./acore.sh module install mod-transmog mod-ale:custom-eluna
# Install all modules from list # Install all modules from list
./acore.sh module install --all ./acore.sh module install --all
@@ -92,7 +92,7 @@ repo[:dirname][@branch[:commit]]
./acore.sh module remove https://github.com/azerothcore/mod-transmog.git ./acore.sh module remove https://github.com/azerothcore/mod-transmog.git
# Remove multiple modules # Remove multiple modules
./acore.sh module remove mod-transmog mod-eluna ./acore.sh module remove mod-transmog mod-ale
``` ```
### Searching Modules ### Searching Modules
@@ -232,7 +232,7 @@ repo_reference branch commit
# Examples: # Examples:
azerothcore/mod-transmog master abc123def456 azerothcore/mod-transmog master abc123def456
https://github.com/custom/mod-custom.git develop def456abc789 https://github.com/custom/mod-custom.git develop def456abc789
mod-eluna:custom-eluna-dir main 789abc123def mod-ale:custom-eluna-dir main 789abc123def
``` ```
The list maintains: The list maintains:
@@ -683,7 +683,7 @@ function inst_getVersionBranch() {
res="none" res="none"
# since we've the pair version,branch alternated in not associative and one-dimensional # since we've the pair version,branch alternated in not associative and one-dimensional
# array, we've to simulate the association with length/2 trick # array, we've to simulate the association with length/2 trick
for idx in `seq 0 $((${#vers[*]}/2-1))`; do for idx in $(seq 0 $((${#vers[*]}/2-1))); do
semverParseInto "${vers[idx*2]}" MODULE_MAJOR MODULE_MINOR MODULE_PATCH MODULE_SPECIAL semverParseInto "${vers[idx*2]}" MODULE_MAJOR MODULE_MINOR MODULE_PATCH MODULE_SPECIAL
if [[ $MODULE_MAJOR -eq $ACV_MAJOR && $MODULE_MINOR -le $ACV_MINOR ]]; then if [[ $MODULE_MAJOR -eq $ACV_MAJOR && $MODULE_MINOR -le $ACV_MINOR ]]; then
res="${vers[idx*2+1]}" res="${vers[idx*2+1]}"
+2 -2
View File
@@ -32,7 +32,7 @@ $SUDO apt-get install -y gdbserver gdb unzip curl \
VAR_PATH="$CURRENT_PATH/../../../../var" VAR_PATH="$CURRENT_PATH/../../../../var"
# run noninteractive install for MYSQL 8.4 LTS # run noninteractive install for MYSQL 8.4 LTS
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb -P "$VAR_PATH" wget https://dev.mysql.com/get/mysql-apt-config_0.8.35-1_all.deb -P "$VAR_PATH"
DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.32-1_all.deb" DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.35-1_all.deb"
$SUDO apt-get update $SUDO apt-get update
DEBIAN_FRONTEND="noninteractive" $SUDO apt-get install -y mysql-server libmysqlclient-dev DEBIAN_FRONTEND="noninteractive" $SUDO apt-get install -y mysql-server libmysqlclient-dev
+4 -2
View File
@@ -40,8 +40,10 @@ apt-get -y install ccache clang cmake curl google-perftools libmysqlclient-dev m
# Do not install MySQL if we are in docker (It will be used a docker container instead) or we are explicitly skipping it. # Do not install MySQL if we are in docker (It will be used a docker container instead) or we are explicitly skipping it.
if [[ $DOCKER != 1 && $SKIP_MYSQL_INSTALL != 1 ]]; then if [[ $DOCKER != 1 && $SKIP_MYSQL_INSTALL != 1 ]]; then
# run noninteractive install for MYSQL 8.4 LTS # run noninteractive install for MYSQL 8.4 LTS
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb -P "$VAR_PATH" wget https://dev.mysql.com/get/mysql-apt-config_0.8.35-1_all.deb -P "$VAR_PATH"
DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.32-1_all.deb" # resolve expired key issue
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C
DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.35-1_all.deb"
$SUDO apt-get update $SUDO apt-get update
DEBIAN_FRONTEND="noninteractive" $SUDO apt-get install -y mysql-server DEBIAN_FRONTEND="noninteractive" $SUDO apt-get install -y mysql-server
fi fi
@@ -0,0 +1,7 @@
-- DB update 2025_10_21_00 -> 2025_10_24_00
--
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 29335) AND (`source_type` = 0) AND (`id` IN (0, 1, 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
(29335, 0, 0, 0, 0, 0, 100, 2, 2000, 5000, 6000, 8000, 0, 0, 11, 54290, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Anub\'ar Webspinner - In Combat - Cast \'Web Shot\' (Normal Dungeon)'),
(29335, 0, 1, 0, 0, 0, 100, 4, 2000, 5000, 6000, 8000, 0, 0, 11, 59362, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Anub\'ar Webspinner - In Combat - Cast \'Web Shot\' (Heroic Dungeon)'),
(29335, 0, 2, 0, 0, 0, 100, 6, 5000, 12000, 16000, 21000, 0, 0, 11, 52086, 0, 0, 0, 0, 0, 5, 30, 0, 0, 0, 0, 0, 0, 0, 'Anub\'ar Webspinner - In Combat - Cast \'Web Wrap\' (Dungeon)');
@@ -0,0 +1,3 @@
-- DB update 2025_10_24_00 -> 2025_10_24_01
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|2147483648 WHERE `entry` IN (29306, 31368);
@@ -0,0 +1,34 @@
-- DB update 2025_10_24_01 -> 2025_10_24_02
--
DELETE FROM `smart_scripts` WHERE (`entryorguid` = -114830) AND (`source_type` = 0) AND (`id` IN (0));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `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
(-114830, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 11, 52239, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Drakuramas Teleport Bunny 01 - On Data Set 1 1 - Cast \'Drakuramas Teleport Script 02\'');
DELETE FROM `areatrigger_scripts` WHERE `entry` = 5079;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(5079, 'SmartTrigger');
DELETE FROM `areatrigger_teleport` WHERE `ID` = 5079;
INSERT INTO `areatrigger_teleport` (`ID`, `Name`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES
(5079, 'Zul''drak - Voltarus, middle floor -> top', 571, 6242.67, -1972.10, 484.783, 0.6);
DELETE FROM `spell_target_position` WHERE `ID` = 52240;
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES
(52240, 0, 571, 6242.67, -1972.10, 484.783, 0.6, 0);
DELETE FROM `areatrigger_scripts` WHERE `entry` = 5079;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES (5079, 'SmartTrigger');
DELETE FROM `smart_scripts` WHERE (`source_type` = 2 AND `entryorguid` = 5079);
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
(5079, 2, 0, 0, 46, 0, 100, 0, 5079, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 114830, 28617, 0, 0, 0, 0, 0, 0, 'Areatrigger - On Trigger - Set Data 1 1');
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 52239) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 4) AND (`ConditionValue2` = 0) AND (`ConditionValue3` = 0);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 52239, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Spell only hits player');
UPDATE `creature` SET `Comment` = 'GUID SAI' WHERE (`id1` = 28617) AND (`guid` = 114830);
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 52239;
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(52239, 52240, 1, 'Teleport');
@@ -0,0 +1,30 @@
-- DB update 2025_10_24_02 -> 2025_10_24_03
-- Add Waypoint
DELETE FROM `waypoint_data` WHERE `id` = 2875000;
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
(2875000, 1, 6174.28, -2017.25, 245.116, NULL, 0, 1, 0, 100, 0);
-- Set SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28750;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28750);
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
(28750, 0, 0, 3, 8, 0, 100, 512, 52245, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 20, 190716, 25, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Store Targetlist'),
(28750, 0, 1, 3, 8, 0, 100, 512, 52245, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 20, 190939, 25, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Store Targetlist'),
(28750, 0, 2, 3, 8, 0, 100, 512, 52245, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 20, 190940, 25, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Store Targetlist'),
(28750, 0, 3, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Move To Stored'),
(28750, 0, 4, 0, 34, 0, 100, 512, 8, 1, 0, 0, 0, 0, 80, 2875000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Reached Point 1 - Run Script'),
(28750, 0, 5, 0, 8, 0, 100, 512, 52244, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Spellhit \'Charm Geist\' - Say Line 0'),
(28750, 0, 6, 0, 8, 0, 100, 512, 52252, 0, 0, 0, 0, 0, 11, 52243, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Spellhit \'Charm Channel\' - Cast \'Orange Radiation, Small\''),
(28750, 0, 7, 8, 109, 0, 100, 512, 0, 2875000, 0, 0, 0, 0, 11, 61456, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Path 2875000 Finished - Cast \'Evil Teleport Visual Only\''),
(28750, 0, 8, 9, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 11, 52248, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Path 2875000 Finished - Cast \'Kill Credit - Blighted Geist\''),
(28750, 0, 9, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 41, 2000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Path 2875000 Finished - Despawn In 2000 ms');
-- Set Action List
DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2875000);
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
(2875000, 9, 0, 0, 0, 0, 100, 512, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Set Orientation Stored'),
(2875000, 9, 1, 0, 0, 0, 100, 512, 2000, 2000, 0, 0, 0, 0, 5, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Play Emote 25'),
(2875000, 9, 2, 0, 0, 0, 100, 512, 2000, 2000, 0, 0, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Play Emote 35'),
(2875000, 9, 3, 0, 0, 0, 100, 512, 2000, 2000, 0, 0, 0, 0, 99, 3, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Set Lootstate Deactivated'),
(2875000, 9, 4, 0, 0, 0, 100, 512, 1000, 1000, 0, 0, 0, 0, 232, 2875000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Start Path 2875000');
@@ -0,0 +1,14 @@
-- DB update 2025_10_24_03 -> 2025_10_24_04
DELETE FROM `creature_text` WHERE `CreatureID` = 19738;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(19738, 0, 0, 'Hahaha! We''re coming for you, little goblins!', 14, 0, 100, 0, 0, 0, 17408, 0, 'Doomclaw - On Death'),
(19738, 1, 0, 'Work harder, dogs!', 12, 0, 100, 0, 0, 0, 17953, 0, 'Doomclaw - Random Say 1'),
(19738, 1, 1, 'This is hard work. I feel like I need a vacation. You there, put your back into it!', 12, 0, 100, 0, 0, 0, 17960, 0, 'Doomclaw - Random Say 2'),
(19738, 1, 2, 'Faster, or you will taste The Claw!', 12, 0, 100, 0, 0, 0, 17954, 0, 'Doomclaw - Random Say 3');
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=19738;
DELETE FROM `smart_scripts` WHERE `entryorguid`=19738 AND `source_type`=0 AND `id` IN (4, 5);
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`, `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
(19738, 0, 4, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Doomclaw - On Death - Say Line 0'),
(19738, 0, 5, 0, 1, 0, 100, 0, 10000, 15000, 12000, 25000, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Doomclaw - OOC - Say Random Text');
@@ -0,0 +1,3 @@
-- DB update 2025_10_24_04 -> 2025_10_24_05
--
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 52446) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 3) AND (`ConditionValue2` = 28684) AND (`ConditionValue3` = 0);
+16 -16
View File
@@ -35,8 +35,8 @@ CU_GET_GLOBAL("AC_ADD_SCRIPTS_INCLUDE")
set("AC_SCRIPTS_INCLUDES" "") set("AC_SCRIPTS_INCLUDES" "")
set("AC_MODULE_LIST" "") set("AC_MODULE_LIST" "")
set("AC_SCRIPTS_LIST" "") set("AC_SCRIPTS_LIST" "")
set(MOD_ELUNA_FOUND 0) set(MOD_ALE_FOUND 0)
set(MOD_ELUNA_PATH "") set(MOD_ALE_PATH "")
set(MOD_PLAYERBOTS_FOUND 0) set(MOD_PLAYERBOTS_FOUND 0)
foreach(include ${AC_ADD_SCRIPTS_INCLUDE}) foreach(include ${AC_ADD_SCRIPTS_INCLUDE})
@@ -51,12 +51,12 @@ foreach(scriptName ${AC_ADD_SCRIPTS_LIST})
set("AC_SCRIPTS_LIST" " ${scriptName};\n${AC_SCRIPTS_LIST}") set("AC_SCRIPTS_LIST" " ${scriptName};\n${AC_SCRIPTS_LIST}")
endforeach() endforeach()
function(ConfigureElunaModule moduleName) function(ConfigureALEModule moduleName)
set(MOD_ELUNA_FOUND 1 PARENT_SCOPE) set(MOD_ALE_FOUND 1 PARENT_SCOPE)
GetPathToModuleSource(${SOURCE_MODULE} MODULE_SOURCE_PATH) GetPathToModuleSource(${SOURCE_MODULE} MODULE_SOURCE_PATH)
set(MOD_ELUNA_PATH ${MODULE_SOURCE_PATH} PARENT_SCOPE) set(MOD_ALE_PATH ${MODULE_SOURCE_PATH} PARENT_SCOPE)
# Define eluna compile options # Define ALE compile options
target_compile_options(game-interface target_compile_options(game-interface
INTERFACE INTERFACE
-DAZEROTHCORE -DAZEROTHCORE
@@ -77,9 +77,9 @@ foreach(SOURCE_MODULE ${MODULES_MODULE_LIST})
set(${MODULE_MODULE_VARIABLE} "static") set(${MODULE_MODULE_VARIABLE} "static")
endif() endif()
# Use only static for mod-eluna # Use only static for mod-ALE
if (SOURCE_MODULE MATCHES "mod-eluna") if (SOURCE_MODULE MATCHES "mod-ale")
ConfigureElunaModule(${SOURCE_MODULE}) ConfigureALEModule(${SOURCE_MODULE})
endif() endif()
if (SOURCE_MODULE MATCHES "mod-playerbots") if (SOURCE_MODULE MATCHES "mod-playerbots")
@@ -278,9 +278,9 @@ ConfigureScriptLoader("static" SCRIPT_MODULE_PRIVATE_SCRIPTLOADER OFF ${STATIC_S
list(REMOVE_DUPLICATES SCRIPT_MODULE_PRIVATE_SCRIPTLOADER) list(REMOVE_DUPLICATES SCRIPT_MODULE_PRIVATE_SCRIPTLOADER)
if (MOD_ELUNA_FOUND) if (MOD_ALE_FOUND)
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ELUNA_PATH}/lualib/lua.c) list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ALE_PATH}/lualib/lua.c)
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ELUNA_PATH}/lualib/luac.c) list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ALE_PATH}/lualib/luac.c)
endif() endif()
add_library(modules STATIC add_library(modules STATIC
@@ -288,7 +288,7 @@ add_library(modules STATIC
${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER} ${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER}
${PRIVATE_SOURCES_MODULES}) ${PRIVATE_SOURCES_MODULES})
if (MOD_ELUNA_FOUND) if (MOD_ALE_FOUND)
target_link_libraries(modules PUBLIC lualib) target_link_libraries(modules PUBLIC lualib)
endif() endif()
@@ -376,7 +376,7 @@ if (MOD_PLAYERBOTS_FOUND)
-DMOD_PLAYERBOTS) -DMOD_PLAYERBOTS)
endif() endif()
if (MOD_ELUNA_FOUND) if (MOD_ALE_FOUND)
if (APPLE) if (APPLE)
target_compile_definitions(modules target_compile_definitions(modules
PUBLIC PUBLIC
@@ -395,10 +395,10 @@ if (MOD_ELUNA_FOUND)
add_custom_command(TARGET modules add_custom_command(TARGET modules
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/" COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${MOD_ELUNA_PATH}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/") COMMAND ${CMAKE_COMMAND} -E copy_directory "${MOD_ALE_PATH}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/")
endif() endif()
install(DIRECTORY "${MOD_ELUNA_PATH}/LuaEngine/extensions" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/lua_scripts/") install(DIRECTORY "${MOD_ALE_PATH}/LuaEngine/extensions" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/lua_scripts/")
endif() endif()
message("") message("")
@@ -552,11 +552,6 @@ void ScriptedAI::SetEquipmentSlots(bool loadDefault, int32 mainHand /*= EQUIP_NO
} }
} }
void ScriptedAI::SetRun(bool run)
{
me->SetWalk(!run);
}
enum eNPCs enum eNPCs
{ {
NPC_BROODLORD = 12017, NPC_BROODLORD = 12017,
@@ -227,8 +227,6 @@ struct ScriptedAI : public CreatureAI
// Called when AI is temporarily replaced or put back when possess is applied or removed // Called when AI is temporarily replaced or put back when possess is applied or removed
void OnPossess(bool /*apply*/) {} void OnPossess(bool /*apply*/) {}
void SetRun(bool run);
enum class Axis enum class Axis
{ {
AXIS_X, AXIS_X,
+5 -2
View File
@@ -49,6 +49,8 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mForcedPaused = false; mForcedPaused = false;
mForcedMovement = FORCED_MOVEMENT_NONE;
mEscortQuestID = 0; mEscortQuestID = 0;
mDespawnTime = 0; mDespawnTime = 0;
@@ -205,6 +207,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
{ {
AddEscortState(SMART_ESCORT_ESCORTING); AddEscortState(SMART_ESCORT_ESCORTING);
mCanRepeatPath = repeat; mCanRepeatPath = repeat;
mForcedMovement = forcedMovement;
if (invoker && invoker->IsPlayer()) if (invoker && invoker->IsPlayer())
{ {
@@ -215,7 +218,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
Movement::PointsArray pathPoints; Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints); GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, forcedMovement); me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId()); GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId());
} }
} }
@@ -373,7 +376,7 @@ void SmartAI::ResumePath()
Movement::PointsArray pathPoints; Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints); GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints); me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
} }
} }
@@ -241,6 +241,7 @@ private:
bool mCanAutoAttack; bool mCanAutoAttack;
bool mForcedPaused; bool mForcedPaused;
uint32 mInvincibilityHpLevel; uint32 mInvincibilityHpLevel;
ForcedMovement mForcedMovement;
bool AssistPlayerInCombatAgainst(Unit* who); bool AssistPlayerInCombatAgainst(Unit* who);
+2 -2
View File
@@ -162,7 +162,7 @@ bool ArenaTeam::AddMember(ObjectGuid playerGuid)
// Feed data to the struct // Feed data to the struct
ArenaTeamMember newMember; ArenaTeamMember newMember;
//newMember.Name = playerName; newMember.Name = playerName;
newMember.Guid = playerGuid; newMember.Guid = playerGuid;
newMember.Class = playerClass; newMember.Class = playerClass;
newMember.SeasonGames = 0; newMember.SeasonGames = 0;
@@ -249,7 +249,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
newMember.WeekWins = fields[3].Get<uint16>(); newMember.WeekWins = fields[3].Get<uint16>();
newMember.SeasonGames = fields[4].Get<uint16>(); newMember.SeasonGames = fields[4].Get<uint16>();
newMember.SeasonWins = fields[5].Get<uint16>(); newMember.SeasonWins = fields[5].Get<uint16>();
//newMember.Name = fields[6].Get<std::string>(); newMember.Name = fields[6].Get<std::string>();
newMember.Class = fields[7].Get<uint8>(); newMember.Class = fields[7].Get<uint8>();
newMember.PersonalRating = fields[8].Get<uint16>(); newMember.PersonalRating = fields[8].Get<uint16>();
newMember.MatchMakerRating = fields[9].Get<uint16>() > 0 ? fields[9].Get<uint16>() : sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING); newMember.MatchMakerRating = fields[9].Get<uint16>() > 0 ? fields[9].Get<uint16>() : sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);
+9 -46
View File
@@ -2000,7 +2000,7 @@ void Creature::setDeathState(DeathState state, bool despawn)
bool needsFalling = !despawn && (IsFlying() || IsHovering()) && !IsUnderWater(); bool needsFalling = !despawn && (IsFlying() || IsHovering()) && !IsUnderWater();
SetHover(false); SetHover(false);
SetDisableGravity(false, false, false); SetDisableGravity(false);
if (needsFalling) if (needsFalling)
GetMotionMaster()->MoveFall(0, true); GetMotionMaster()->MoveFall(0, true);
@@ -3231,47 +3231,6 @@ bool Creature::SetWalk(bool enable)
return true; return true;
} }
/**
* @brief Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING. Infom also the client
*/
bool Creature::SetDisableGravity(bool disable, bool packetOnly /*= false*/, bool updateAnimationTier /*= true*/)
{
//! It's possible only a packet is sent but moveflags are not updated
//! Need more research on this
if (!packetOnly && !Unit::SetDisableGravity(disable))
return false;
if (m_movedByPlayer)
{
WorldPacket data(disable ? SMSG_MOVE_GRAVITY_DISABLE : SMSG_MOVE_GRAVITY_ENABLE, 12);
data << GetPackGUID();
data << m_movedByPlayer->ToPlayer()->GetSession()->GetOrderCounter(); // movement counter
m_movedByPlayer->ToPlayer()->SendDirectMessage(&data);
m_movedByPlayer->ToPlayer()->GetSession()->IncrementOrderCounter();
data.Initialize(MSG_MOVE_GRAVITY_CHNG, 64);
data << GetPackGUID();
BuildMovementPacket(&data);
m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
return true;
}
if (updateAnimationTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT) && !IsRooted())
{
if (IsLevitating())
SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_FLY);
else if (IsHovering())
SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_HOVER);
else
SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_GROUND);
}
WorldPacket data(disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9);
data << GetPackGUID();
SendMessageToSet(&data, false);
return true;
}
bool Creature::SetSwim(bool enable) bool Creature::SetSwim(bool enable)
{ {
if (!Unit::SetSwim(enable)) if (!Unit::SetSwim(enable))
@@ -3386,19 +3345,23 @@ void Creature::UpdateMovementFlags()
if (GetMovementTemplate().IsFlightAllowed() && isInAir && !IsFalling()) if (GetMovementTemplate().IsFlightAllowed() && isInAir && !IsFalling())
{ {
if (GetMovementTemplate().Flight == CreatureFlightMovementType::CanFly) if (GetMovementTemplate().Flight == CreatureFlightMovementType::CanFly && !m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY))
SetCanFly(true); SetCanFly(true);
else else if (!IsLevitating())
SetDisableGravity(true); SetDisableGravity(true);
if (!HasHoverAura()) if (!HasHoverAura() && IsHovering())
SetHover(false); SetHover(false);
} }
else else
{ {
if (m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY))
SetCanFly(false); SetCanFly(false);
if (IsLevitating())
SetDisableGravity(false); SetDisableGravity(false);
if (IsAlive() && (CanHover() || HasHoverAura()))
if (IsAlive() && (GetMovementTemplate().Ground == CreatureGroundMovementType::Hover || HasHoverAura()) && !IsHovering())
SetHover(true); SetHover(true);
} }
@@ -145,7 +145,6 @@ public:
[[nodiscard]] CreatureAI* AI() const { return (CreatureAI*)i_AI; } [[nodiscard]] CreatureAI* AI() const { return (CreatureAI*)i_AI; }
bool SetWalk(bool enable) override; bool SetWalk(bool enable) override;
bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true) override;
bool SetSwim(bool enable) override; bool SetSwim(bool enable) override;
bool HasSpellFocus(Spell const* focusSpell = nullptr) const; bool HasSpellFocus(Spell const* focusSpell = nullptr) const;
+2 -2
View File
@@ -41,7 +41,7 @@
#include "UpdateFields.h" #include "UpdateFields.h"
class ElunaEventProcessor; class ALEEventProcessor;
enum TempSummonType enum TempSummonType
{ {
@@ -727,7 +727,7 @@ public:
ObjectVisibilityContainer const& GetObjectVisibilityContainer() const { return _objectVisibilityContainer; } ObjectVisibilityContainer const& GetObjectVisibilityContainer() const { return _objectVisibilityContainer; }
// Event handler // Event handler
ElunaEventProcessor* elunaEvents; ALEEventProcessor* ALEEvents;
EventProcessor m_Events; EventProcessor m_Events;
protected: protected:
+4 -22
View File
@@ -11715,7 +11715,7 @@ void Player::SendInitialPacketsAfterAddToMap()
// manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied. // manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied.
if (IsImmobilizedState()) if (IsImmobilizedState())
{ {
auto const counter = GetSession()->GetOrderCounter(); uint32 const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4); setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_FORCE_MOVE_ROOT); setCompoundState << uint16(SMSG_FORCE_MOVE_ROOT);
setCompoundState << GetPackGUID(); setCompoundState << GetPackGUID();
@@ -11725,7 +11725,7 @@ void Player::SendInitialPacketsAfterAddToMap()
if (HasAuraType(SPELL_AURA_FEATHER_FALL)) if (HasAuraType(SPELL_AURA_FEATHER_FALL))
{ {
auto const counter = GetSession()->GetOrderCounter(); uint32 const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4); setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_MOVE_FEATHER_FALL); setCompoundState << uint16(SMSG_MOVE_FEATHER_FALL);
setCompoundState << GetPackGUID(); setCompoundState << GetPackGUID();
@@ -11735,7 +11735,7 @@ void Player::SendInitialPacketsAfterAddToMap()
if (HasAuraType(SPELL_AURA_WATER_WALK)) if (HasAuraType(SPELL_AURA_WATER_WALK))
{ {
auto const counter = GetSession()->GetOrderCounter(); uint32 const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4); setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_MOVE_WATER_WALK); setCompoundState << uint16(SMSG_MOVE_WATER_WALK);
setCompoundState << GetPackGUID(); setCompoundState << GetPackGUID();
@@ -11745,7 +11745,7 @@ void Player::SendInitialPacketsAfterAddToMap()
if (HasAuraType(SPELL_AURA_HOVER)) if (HasAuraType(SPELL_AURA_HOVER))
{ {
auto const counter = GetSession()->GetOrderCounter(); uint32 const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4); setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_MOVE_SET_HOVER); setCompoundState << uint16(SMSG_MOVE_SET_HOVER);
setCompoundState << GetPackGUID(); setCompoundState << GetPackGUID();
@@ -16045,24 +16045,6 @@ bool Player::IsInWhisperWhiteList(ObjectGuid guid)
return false; return false;
} }
bool Player::SetDisableGravity(bool disable, bool packetOnly /*= false*/, bool /*updateAnimationTier = true*/)
{
if (!packetOnly && !Unit::SetDisableGravity(disable))
return false;
WorldPacket data(disable ? SMSG_MOVE_GRAVITY_DISABLE : SMSG_MOVE_GRAVITY_ENABLE, 12);
data << GetPackGUID();
data << GetSession()->GetOrderCounter(); // movement counter
SendDirectMessage(&data);
GetSession()->IncrementOrderCounter();
data.Initialize(MSG_MOVE_GRAVITY_CHNG, 64);
data << GetPackGUID();
BuildMovementPacket(&data);
SendMessageToSet(&data, false);
return true;
}
Guild* Player::GetGuild() const Guild* Player::GetGuild() const
{ {
uint32 guildId = GetGuildId(); uint32 guildId = GetGuildId();
-2
View File
@@ -2558,8 +2558,6 @@ public:
bool IsInWhisperWhiteList(ObjectGuid guid); bool IsInWhisperWhiteList(ObjectGuid guid);
void RemoveFromWhisperWhiteList(ObjectGuid guid) { WhisperList.remove(guid); } void RemoveFromWhisperWhiteList(ObjectGuid guid) { WhisperList.remove(guid); }
bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true) override;
[[nodiscard]] bool CanFly() const override { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } [[nodiscard]] bool CanFly() const override { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); }
[[nodiscard]] bool CanEnterWater() const override { return true; } [[nodiscard]] bool CanEnterWater() const override { return true; }
bool IsFreeFlying() const { return HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || HasAuraType(SPELL_AURA_FLY); } bool IsFreeFlying() const { return HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || HasAuraType(SPELL_AURA_FLY); }
+57 -101
View File
@@ -14529,56 +14529,37 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
propagateSpeedChange(); propagateSpeedChange();
WorldPacket data; SpeedOpcodePair const& speedOpcodes = SetSpeed2Opc_table[mtype];
if (!forced)
{
switch (mtype)
{
case MOVE_WALK:
data.Initialize(MSG_MOVE_SET_WALK_SPEED, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_RUN:
data.Initialize(MSG_MOVE_SET_RUN_SPEED, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_RUN_BACK:
data.Initialize(MSG_MOVE_SET_RUN_BACK_SPEED, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_SWIM:
data.Initialize(MSG_MOVE_SET_SWIM_SPEED, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_SWIM_BACK:
data.Initialize(MSG_MOVE_SET_SWIM_BACK_SPEED, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_TURN_RATE:
data.Initialize(MSG_MOVE_SET_TURN_RATE, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_FLIGHT:
data.Initialize(MSG_MOVE_SET_FLIGHT_SPEED, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_FLIGHT_BACK:
data.Initialize(MSG_MOVE_SET_FLIGHT_BACK_SPEED, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
case MOVE_PITCH_RATE:
data.Initialize(MSG_MOVE_SET_PITCH_RATE, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
break;
default:
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type ({}), data not sent to client.", mtype);
return;
}
if (forced && IsClientControlled())
{
Player* player = const_cast<Player*>(GetClientControlling());
uint32 const counter = player->GetSession()->GetOrderCounter();
// register forced speed changes for WorldSession::HandleForceSpeedChangeAck
// and do it only for real sent packets and use run for run/mounted as client expected
++player->m_forced_speed_changes[mtype];
WorldPacket data(speedOpcodes[static_cast<size_t>(SpeedOpcodeIndex::PC)], 18);
data << GetPackGUID();
data << counter;
if (mtype == MOVE_RUN)
data << uint8(0); // new 2.1.0
data << GetSpeed(mtype);
player->GetSession()->SendPacket(&data);
player->GetSession()->IncrementOrderCounter();
}
else if (forced)
{
WorldPacket data(speedOpcodes[static_cast<size_t>(SpeedOpcodeIndex::NPC)], 12);
data << GetPackGUID(); data << GetPackGUID();
BuildMovementPacket(&data);
data << float(GetSpeed(mtype)); data << float(GetSpeed(mtype));
SendMessageToSet(&data, true); SendMessageToSet(&data, true);
} }
else
{
if (IsPlayer()) if (IsPlayer())
{ {
// register forced speed changes for WorldSession::HandleForceSpeedChangeAck
// and do it only for real sent packets and use run for run/mounted as client expected
++ToPlayer()->m_forced_speed_changes[mtype];
// Xinef: update speed of pet also // Xinef: update speed of pet also
if (!IsInCombat()) if (!IsInCombat())
{ {
@@ -14592,54 +14573,12 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
if (pet && pet->IsCreature() && !pet->IsInCombat() && pet->GetMotionMaster()->GetCurrentMovementGeneratorType() == FOLLOW_MOTION_TYPE) if (pet && pet->IsCreature() && !pet->IsInCombat() && pet->GetMotionMaster()->GetCurrentMovementGeneratorType() == FOLLOW_MOTION_TYPE)
pet->UpdateSpeed(mtype, forced); pet->UpdateSpeed(mtype, forced);
if (Unit* critter = ObjectAccessor::GetUnit(*this, GetCritterGUID())) if (Unit* critter = ObjectAccessor::GetUnit(*this, GetCritterGUID()))
critter->UpdateSpeed(mtype, forced); critter->UpdateSpeed(mtype, forced);
} }
ToPlayer()->SetCanTeleport(true); ToPlayer()->SetCanTeleport(true);
} }
switch (mtype)
{
case MOVE_WALK:
data.Initialize(SMSG_FORCE_WALK_SPEED_CHANGE, 16);
break;
case MOVE_RUN:
data.Initialize(SMSG_FORCE_RUN_SPEED_CHANGE, 17);
break;
case MOVE_RUN_BACK:
data.Initialize(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, 16);
break;
case MOVE_SWIM:
data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, 16);
break;
case MOVE_SWIM_BACK:
data.Initialize(SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, 16);
break;
case MOVE_TURN_RATE:
data.Initialize(SMSG_FORCE_TURN_RATE_CHANGE, 16);
break;
case MOVE_FLIGHT:
data.Initialize(SMSG_FORCE_FLIGHT_SPEED_CHANGE, 16);
break;
case MOVE_FLIGHT_BACK:
data.Initialize(SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, 16);
break;
case MOVE_PITCH_RATE:
data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16);
break;
default:
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type ({}), data not sent to client.", mtype);
return;
}
data << GetPackGUID();
data << (IsPlayer() ? ToPlayer()->GetSession()->GetOrderCounter() : uint32(0)); // movement counter
if (mtype == MOVE_RUN)
data << uint8(0); // new 2.1.0
data << float(GetSpeed(mtype));
SendMessageToSet(&data, true);
if (IsPlayer()) // TODO: Resolve this mess
ToPlayer()->GetSession()->IncrementOrderCounter();
}
} }
void Unit::setDeathState(DeathState s, bool despawn) void Unit::setDeathState(DeathState s, bool despawn)
@@ -18351,7 +18290,7 @@ void Unit::SendMoveRoot(bool apply)
// Wrath+ force root: when unit is controlled by a player // Wrath+ force root: when unit is controlled by a player
else else
{ {
auto const counter = client->GetSession()->GetOrderCounter(); uint32 const counter = client->GetSession()->GetOrderCounter();
WorldPacket data(apply ? SMSG_FORCE_MOVE_ROOT : SMSG_FORCE_MOVE_UNROOT, guid.size() + 4); WorldPacket data(apply ? SMSG_FORCE_MOVE_ROOT : SMSG_FORCE_MOVE_UNROOT, guid.size() + 4);
data << guid; data << guid;
@@ -20401,22 +20340,39 @@ bool Unit::SetWalk(bool enable)
return true; return true;
} }
bool Unit::SetDisableGravity(bool disable, bool /*packetOnly = false*/, bool /*updateAnimationTier = true*/) void Unit::SetDisableGravity(bool enable)
{ {
if (disable == IsLevitating()) bool isClientControlled = IsClientControlled();
return false;
if (disable) if (!isClientControlled)
{ {
AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); if (enable)
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); m_movementInfo.AddMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
}
else else
{ m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
} }
return true; if (!IsInWorld()) // is sent on add to map
return;
if (isClientControlled)
{
if (Player const* player = GetClientControlling())
{
uint32 const counter = player->GetSession()->GetOrderCounter();
WorldPacket data(enable ? SMSG_MOVE_GRAVITY_DISABLE : SMSG_MOVE_GRAVITY_ENABLE, GetPackGUID().size() + 4);
data << GetPackGUID();
data << counter;
player->GetSession()->SendPacket(&data);
player->GetSession()->IncrementOrderCounter();
return;
}
}
WorldPacket data(enable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9);
data << GetPackGUID();
SendMessageToSet(&data, true);
} }
bool Unit::SetSwim(bool enable) bool Unit::SetSwim(bool enable)
@@ -20463,7 +20419,7 @@ void Unit::SetCanFly(bool enable)
{ {
if (Player const* player = GetClientControlling()) if (Player const* player = GetClientControlling())
{ {
auto const counter = player->GetSession()->GetOrderCounter(); uint32 const counter = player->GetSession()->GetOrderCounter();
WorldPacket data(enable ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, GetPackGUID().size() + 4); WorldPacket data(enable ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, GetPackGUID().size() + 4);
data << GetPackGUID(); data << GetPackGUID();
@@ -20498,7 +20454,7 @@ void Unit::SetFeatherFall(bool enable)
{ {
if (Player const* player = GetClientControlling()) if (Player const* player = GetClientControlling())
{ {
auto const counter = player->GetSession()->GetOrderCounter(); uint32 const counter = player->GetSession()->GetOrderCounter();
WorldPacket data(enable ? SMSG_MOVE_FEATHER_FALL : SMSG_MOVE_NORMAL_FALL, GetPackGUID().size() + 4); WorldPacket data(enable ? SMSG_MOVE_FEATHER_FALL : SMSG_MOVE_NORMAL_FALL, GetPackGUID().size() + 4);
@@ -20558,7 +20514,7 @@ void Unit::SetHover(bool enable)
{ {
WorldPacket data(enable ? SMSG_MOVE_SET_HOVER : SMSG_MOVE_UNSET_HOVER, GetPackGUID().size() + 4); WorldPacket data(enable ? SMSG_MOVE_SET_HOVER : SMSG_MOVE_UNSET_HOVER, GetPackGUID().size() + 4);
auto const counter = player->GetSession()->GetOrderCounter(); uint32 const counter = player->GetSession()->GetOrderCounter();
data << GetPackGUID(); data << GetPackGUID();
data << counter; data << counter;
@@ -20592,7 +20548,7 @@ void Unit::SetWaterWalking(bool enable)
{ {
if (Player const* player = GetClientControlling()) if (Player const* player = GetClientControlling())
{ {
auto const counter = player->GetSession()->GetOrderCounter(); uint32 const counter = player->GetSession()->GetOrderCounter();
WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, GetPackGUID().size() + 4); WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, GetPackGUID().size() + 4);
data << GetPackGUID(); data << GetPackGUID();
+23 -1
View File
@@ -624,6 +624,28 @@ typedef std::unordered_map<uint32, uint32> PacketCooldowns;
struct SpellProcEventEntry; // used only privately struct SpellProcEventEntry; // used only privately
enum class SpeedOpcodeIndex : uint32
{
PC,
NPC,
ACK_RESPONSE,
MAX
};
typedef const Opcodes SpeedOpcodePair[static_cast<size_t>(SpeedOpcodeIndex::MAX)];
SpeedOpcodePair SetSpeed2Opc_table[MAX_MOVE_TYPE] =
{
{SMSG_FORCE_WALK_SPEED_CHANGE, SMSG_SPLINE_SET_WALK_SPEED, MSG_MOVE_SET_WALK_SPEED},
{SMSG_FORCE_RUN_SPEED_CHANGE, SMSG_SPLINE_SET_RUN_SPEED, MSG_MOVE_SET_RUN_SPEED},
{SMSG_FORCE_RUN_BACK_SPEED_CHANGE, SMSG_SPLINE_SET_RUN_BACK_SPEED, MSG_MOVE_SET_RUN_BACK_SPEED},
{SMSG_FORCE_SWIM_SPEED_CHANGE, SMSG_SPLINE_SET_SWIM_SPEED, MSG_MOVE_SET_SWIM_SPEED},
{SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, SMSG_SPLINE_SET_SWIM_BACK_SPEED, MSG_MOVE_SET_SWIM_BACK_SPEED},
{SMSG_FORCE_TURN_RATE_CHANGE, SMSG_SPLINE_SET_TURN_RATE, MSG_MOVE_SET_TURN_RATE},
{SMSG_FORCE_FLIGHT_SPEED_CHANGE, SMSG_SPLINE_SET_FLIGHT_SPEED, MSG_MOVE_SET_FLIGHT_SPEED},
{SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, MSG_MOVE_SET_FLIGHT_BACK_SPEED},
{SMSG_FORCE_PITCH_RATE_CHANGE, SMSG_SPLINE_SET_PITCH_RATE, MSG_MOVE_SET_PITCH_RATE},
};
class Unit : public WorldObject class Unit : public WorldObject
{ {
public: public:
@@ -1681,7 +1703,7 @@ public:
void MonsterMoveWithSpeed(float x, float y, float z, float speed); // Not to be used outside of cinematics void MonsterMoveWithSpeed(float x, float y, float z, float speed); // Not to be used outside of cinematics
virtual bool SetWalk(bool enable); virtual bool SetWalk(bool enable);
virtual bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true); void SetDisableGravity(bool disable);
virtual bool SetSwim(bool enable); virtual bool SetSwim(bool enable);
void SetCanFly(bool enable); void SetCanFly(bool enable);
void SetWaterWalking(bool enable); void SetWaterWalking(bool enable);
+11 -7
View File
@@ -1490,6 +1490,8 @@ void WorldSession::HandleMoveFlagChangeOpcode(WorldPacket& recv_data)
{ {
LOG_DEBUG("network", "WORLD: {}", GetOpcodeNameForLogging((Opcodes)recv_data.GetOpcode())); LOG_DEBUG("network", "WORLD: {}", GetOpcodeNameForLogging((Opcodes)recv_data.GetOpcode()));
Opcodes opcode = (Opcodes)recv_data.GetOpcode();
ObjectGuid guid; ObjectGuid guid;
uint32 counter; uint32 counter;
uint32 isApplied; uint32 isApplied;
@@ -1507,6 +1509,7 @@ void WorldSession::HandleMoveFlagChangeOpcode(WorldPacket& recv_data)
movementInfo.guid = guid; movementInfo.guid = guid;
ReadMovementInfo(recv_data, &movementInfo); ReadMovementInfo(recv_data, &movementInfo);
if (opcode != CMSG_MOVE_GRAVITY_DISABLE_ACK && opcode != CMSG_MOVE_GRAVITY_ENABLE_ACK)
recv_data >> isApplied; recv_data >> isApplied;
sScriptMgr->AnticheatSetCanFlybyServer(_player, movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY)); sScriptMgr->AnticheatSetCanFlybyServer(_player, movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY));
@@ -1516,6 +1519,12 @@ void WorldSession::HandleMoveFlagChangeOpcode(WorldPacket& recv_data)
mover->m_movementInfo.flags = movementInfo.GetMovementFlags(); mover->m_movementInfo.flags = movementInfo.GetMovementFlags();
if (!ProcessMovementInfo(movementInfo, mover, plrMover, recv_data))
{
recv_data.rfinish(); // prevent warnings spam
return;
}
Opcodes response; Opcodes response;
switch (recv_data.GetOpcode()) switch (recv_data.GetOpcode())
@@ -1524,17 +1533,12 @@ void WorldSession::HandleMoveFlagChangeOpcode(WorldPacket& recv_data)
case CMSG_MOVE_FEATHER_FALL_ACK: response = MSG_MOVE_FEATHER_FALL; break; case CMSG_MOVE_FEATHER_FALL_ACK: response = MSG_MOVE_FEATHER_FALL; break;
case CMSG_MOVE_WATER_WALK_ACK: response = MSG_MOVE_WATER_WALK; break; case CMSG_MOVE_WATER_WALK_ACK: response = MSG_MOVE_WATER_WALK; break;
case CMSG_MOVE_SET_CAN_FLY_ACK: response = MSG_MOVE_UPDATE_CAN_FLY; break; case CMSG_MOVE_SET_CAN_FLY_ACK: response = MSG_MOVE_UPDATE_CAN_FLY; break;
case CMSG_MOVE_GRAVITY_DISABLE_ACK: response = MSG_MOVE_GRAVITY_CHNG; break;
case CMSG_MOVE_GRAVITY_ENABLE_ACK: response = MSG_MOVE_GRAVITY_CHNG; break;
default: return; default: return;
} }
if (!ProcessMovementInfo(movementInfo, mover, plrMover, recv_data))
{
recv_data.rfinish(); // prevent warnings spam
return;
}
WorldPacket data(response, 8); WorldPacket data(response, 8);
data << guid.WriteAsPacked();
WriteMovementInfo(&data, &movementInfo); WriteMovementInfo(&data, &movementInfo);
_player->m_mover->SendMessageToSet(&data, _player); _player->m_mover->SendMessageToSet(&data, _player);
} }
+38 -47
View File
@@ -378,7 +378,6 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
/* process position-change */ /* process position-change */
WorldPacket data(opcode, recvData.size()); WorldPacket data(opcode, recvData.size());
movementInfo.guid = mover->GetGUID();
WriteMovementInfo(&data, &movementInfo); WriteMovementInfo(&data, &movementInfo);
mover->SendMessageToSet(&data, _player); mover->SendMessageToSet(&data, _player);
} }
@@ -655,26 +654,39 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
/* extract packet */ /* extract packet */
ObjectGuid guid; ObjectGuid guid;
uint32 unk1; uint32 counter;
MovementInfo movementInfo;
float newspeed; float newspeed;
recvData >> guid.ReadAsPacked(); recvData >> guid.ReadAsPacked();
recvData >> counter; // counter or moveEvent
movementInfo.guid = guid;
ReadMovementInfo(recvData, &movementInfo);
recvData >> newspeed;
Unit* mover = _player->m_mover;
// pussywizard: special check, only player mover allowed here // pussywizard: special check, only player mover allowed here
if (guid != _player->m_mover->GetGUID() || guid != _player->GetGUID()) if (guid != mover->GetGUID() || guid != _player->GetGUID())
{ {
recvData.rfinish(); // prevent warnings spam recvData.rfinish(); // prevent warnings spam
return; return;
} }
// continue parse packet if (!ProcessMovementInfo(movementInfo, mover, _player, recvData))
recvData >> unk1; // counter or moveEvent {
recvData.rfinish(); // prevent warnings spam
return;
}
MovementInfo movementInfo; if (opcode == CMSG_MOVE_SET_COLLISION_HGT_ACK)
movementInfo.guid = guid; {
ReadMovementInfo(recvData, &movementInfo); WorldPacket data(MSG_MOVE_SET_COLLISION_HGT, 18);
WriteMovementInfo(&data, &movementInfo);
recvData >> newspeed; data << newspeed; // new collision height
mover->SendMessageToSet(&data, _player);
return;
}
// client ACK send one packet for mounted/run case and need skip all except last from its // client ACK send one packet for mounted/run case and need skip all except last from its
// in other cases anti-cheat check can be fail in false case // in other cases anti-cheat check can be fail in false case
@@ -685,42 +697,15 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
switch (opcode) switch (opcode)
{ {
case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break;
move_type = MOVE_WALK; case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: move_type = MOVE_RUN; force_move_type = MOVE_RUN; break;
force_move_type = MOVE_WALK; case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: move_type = MOVE_RUN_BACK; force_move_type = MOVE_RUN_BACK; break;
break; case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK: move_type = MOVE_SWIM; force_move_type = MOVE_SWIM; break;
case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: move_type = MOVE_SWIM_BACK; force_move_type = MOVE_SWIM_BACK; break;
move_type = MOVE_RUN; case CMSG_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break;
force_move_type = MOVE_RUN; case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break;
break; case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break;
case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: case CMSG_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break;
move_type = MOVE_RUN_BACK;
force_move_type = MOVE_RUN_BACK;
break;
case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK:
move_type = MOVE_SWIM;
force_move_type = MOVE_SWIM;
break;
case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK:
move_type = MOVE_SWIM_BACK;
force_move_type = MOVE_SWIM_BACK;
break;
case CMSG_FORCE_TURN_RATE_CHANGE_ACK:
move_type = MOVE_TURN_RATE;
force_move_type = MOVE_TURN_RATE;
break;
case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK:
move_type = MOVE_FLIGHT;
force_move_type = MOVE_FLIGHT;
break;
case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK:
move_type = MOVE_FLIGHT_BACK;
force_move_type = MOVE_FLIGHT_BACK;
break;
case CMSG_FORCE_PITCH_RATE_CHANGE_ACK:
move_type = MOVE_PITCH_RATE;
force_move_type = MOVE_PITCH_RATE;
break;
default: default:
LOG_ERROR("network.opcode", "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: {}", opcode); LOG_ERROR("network.opcode", "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: {}", opcode);
return; return;
@@ -728,6 +713,12 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
sScriptMgr->AnticheatSetUnderACKmount(_player); sScriptMgr->AnticheatSetUnderACKmount(_player);
SpeedOpcodePair const& speedOpcodes = SetSpeed2Opc_table[move_type];
WorldPacket data(speedOpcodes[static_cast<size_t>(SpeedOpcodeIndex::ACK_RESPONSE)], 18);
WriteMovementInfo(&data, &movementInfo);
data << newspeed;
mover->SendMessageToSet(&data, _player);
// skip all forced speed changes except last and unexpected // skip all forced speed changes except last and unexpected
// in run/mounted case used one ACK and it must be skipped.m_forced_speed_changes[MOVE_RUN} store both. // in run/mounted case used one ACK and it must be skipped.m_forced_speed_changes[MOVE_RUN} store both.
if (_player->m_forced_speed_changes[force_move_type] > 0) if (_player->m_forced_speed_changes[force_move_type] > 0)
@@ -974,6 +965,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData)
MovementInfo movementInfo; MovementInfo movementInfo;
recvData >> guid.ReadAsPacked(); recvData >> guid.ReadAsPacked();
recvData >> counter; recvData >> counter;
movementInfo.guid = guid;
ReadMovementInfo(recvData, &movementInfo); ReadMovementInfo(recvData, &movementInfo);
Unit* mover = _player->m_mover; Unit* mover = _player->m_mover;
@@ -996,7 +988,6 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData)
return; return;
WorldPacket data(recvData.GetOpcode() == CMSG_FORCE_MOVE_UNROOT_ACK ? MSG_MOVE_UNROOT : MSG_MOVE_ROOT); WorldPacket data(recvData.GetOpcode() == CMSG_FORCE_MOVE_UNROOT_ACK ? MSG_MOVE_UNROOT : MSG_MOVE_ROOT);
data << guid.WriteAsPacked();
WriteMovementInfo(&data, &movementInfo); WriteMovementInfo(&data, &movementInfo);
mover->SendMessageToSet(&data, _player); mover->SendMessageToSet(&data, _player);
} }
+2 -2
View File
@@ -2124,7 +2124,7 @@ void InstanceMap::CreateInstanceScript(bool load, std::string data, uint32 compl
if (instance_data) if (instance_data)
isOtherAI = true; isOtherAI = true;
// if Eluna AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID // if ALE AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID
if (!isOtherAI) if (!isOtherAI)
{ {
InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId()); InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId());
@@ -2138,7 +2138,7 @@ void InstanceMap::CreateInstanceScript(bool load, std::string data, uint32 compl
if (!instance_data) if (!instance_data)
return; return;
// use mangos behavior if we are dealing with Eluna AI // use mangos behavior if we are dealing with ALE AI
// initialize should then be called only if load is false // initialize should then be called only if load is false
if (!isOtherAI || !load) if (!isOtherAI || !load)
{ {
@@ -15,12 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "ElunaScript.h" #include "ALEScript.h"
#include "ScriptMgr.h" #include "ScriptMgr.h"
ElunaScript::ElunaScript(const char* name) : ScriptObject(name) ALEScript::ALEScript(const char* name) : ScriptObject(name)
{ {
ScriptRegistry<ElunaScript>::AddScript(this); ScriptRegistry<ALEScript>::AddScript(this);
} }
template class AC_GAME_API ScriptRegistry<ElunaScript>; template class AC_GAME_API ScriptRegistry<ALEScript>;
@@ -15,15 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef SCRIPT_OBJECT_ELUNA_SCRIPT_H_ #ifndef SCRIPT_OBJECT_ALE_SCRIPT_H_
#define SCRIPT_OBJECT_ELUNA_SCRIPT_H_ #define SCRIPT_OBJECT_ALE_SCRIPT_H_
#include "ScriptObject.h" #include "ScriptObject.h"
class ElunaScript : public ScriptObject class ALEScript : public ScriptObject
{ {
protected: protected:
ElunaScript(const char* name); ALEScript(const char* name);
public: public:
/** /**
@@ -39,7 +39,7 @@
#include "CreatureScript.h" #include "CreatureScript.h"
#include "DatabaseScript.h" #include "DatabaseScript.h"
#include "DynamicObjectScript.h" #include "DynamicObjectScript.h"
#include "ElunaScript.h" #include "ALEScript.h"
#include "FormulaScript.h" #include "FormulaScript.h"
#include "GameEventScript.h" #include "GameEventScript.h"
#include "GameObjectScript.h" #include "GameObjectScript.h"
@@ -16,7 +16,7 @@
*/ */
#include "AreaTriggerScript.h" #include "AreaTriggerScript.h"
#include "ElunaScript.h" #include "ALEScript.h"
#include "Player.h" #include "Player.h"
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "ScriptMgrMacros.h" #include "ScriptMgrMacros.h"
@@ -26,7 +26,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTrigger const* trigger)
ASSERT(player); ASSERT(player);
ASSERT(trigger); ASSERT(trigger);
auto ret = IsValidBoolScript<ElunaScript>([&](ElunaScript* script) auto ret = IsValidBoolScript<ALEScript>([&](ALEScript* script)
{ {
return script->CanAreaTrigger(player, trigger); return script->CanAreaTrigger(player, trigger);
}); });
@@ -16,7 +16,7 @@
*/ */
#include "WeatherScript.h" #include "WeatherScript.h"
#include "ElunaScript.h" #include "ALEScript.h"
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "ScriptMgrMacros.h" #include "ScriptMgrMacros.h"
@@ -24,7 +24,7 @@ void ScriptMgr::OnWeatherChange(Weather* weather, WeatherState state, float grad
{ {
ASSERT(weather); ASSERT(weather);
ExecuteScript<ElunaScript>([&](ElunaScript* script) ExecuteScript<ALEScript>([&](ALEScript* script)
{ {
script->OnWeatherChange(weather, state, grade); script->OnWeatherChange(weather, state, grade);
}); });
+1 -1
View File
@@ -132,7 +132,7 @@ void ScriptMgr::Unload()
SCR_CLEAR<CreatureScript>(); SCR_CLEAR<CreatureScript>();
SCR_CLEAR<DatabaseScript>(); SCR_CLEAR<DatabaseScript>();
SCR_CLEAR<DynamicObjectScript>(); SCR_CLEAR<DynamicObjectScript>();
SCR_CLEAR<ElunaScript>(); SCR_CLEAR<ALEScript>();
SCR_CLEAR<FormulaScript>(); SCR_CLEAR<FormulaScript>();
SCR_CLEAR<GameEventScript>(); SCR_CLEAR<GameEventScript>();
SCR_CLEAR<GameObjectScript>(); SCR_CLEAR<GameObjectScript>();
+4 -4
View File
@@ -1245,7 +1245,7 @@ void OpcodeTable::Initialize()
/*0x45A*/ DEFINE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x45A*/ DEFINE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x45B*/ DEFINE_HANDLER(MSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x45B*/ DEFINE_HANDLER(MSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x45C*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_FORCE_PITCH_RATE_CHANGE, STATUS_NEVER); /*0x45C*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_FORCE_PITCH_RATE_CHANGE, STATUS_NEVER);
/*0x45D*/ DEFINE_HANDLER(CMSG_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x45D*/ DEFINE_HANDLER(CMSG_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleForceSpeedChangeAck );
/*0x45E*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER); /*0x45E*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER);
/*0x45F*/ DEFINE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x45F*/ DEFINE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x460*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER); /*0x460*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER);
@@ -1359,9 +1359,9 @@ void OpcodeTable::Initialize()
/*0x4CC*/ DEFINE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x4CC*/ DEFINE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x4CD*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER); /*0x4CD*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER);
/*0x4CE*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER); /*0x4CE*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER);
/*0x4CF*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x4CF*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x4D0*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER); /*0x4D0*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER);
/*0x4D1*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x4D1*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x4D2*/ DEFINE_SERVER_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER); /*0x4D2*/ DEFINE_SERVER_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER);
/*0x4D3*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER); /*0x4D3*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER);
/*0x4D4*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER); /*0x4D4*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER);
@@ -1431,7 +1431,7 @@ void OpcodeTable::Initialize()
/*0x514*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER); /*0x514*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER);
/*0x515*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER); /*0x515*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER);
/*0x516*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER); /*0x516*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER);
/*0x517*/ DEFINE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x517*/ DEFINE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleForceSpeedChangeAck );
/*0x518*/ DEFINE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x518*/ DEFINE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x519*/ DEFINE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x519*/ DEFINE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x51A*/ DEFINE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); /*0x51A*/ DEFINE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
@@ -5157,6 +5157,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AttributesEx5 |= SPELL_ATTR5_LIMIT_N; spellInfo->AttributesEx5 |= SPELL_ATTR5_LIMIT_N;
}); });
// Acid Splash
ApplySpellFix({ 52446, 59363 }, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{ {
SpellInfo* spellInfo = mSpellInfoMap[i]; SpellInfo* spellInfo = mSpellInfoMap[i];
+6 -6
View File
@@ -51,7 +51,7 @@ public:
{ "rename", HandleArenaRenameCommand, SEC_ADMINISTRATOR, Console::Yes }, { "rename", HandleArenaRenameCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "captain", HandleArenaCaptainCommand, SEC_ADMINISTRATOR, Console::No }, { "captain", HandleArenaCaptainCommand, SEC_ADMINISTRATOR, Console::No },
{ "info", HandleArenaInfoCommand, SEC_GAMEMASTER, Console::Yes }, { "info", HandleArenaInfoCommand, SEC_GAMEMASTER, Console::Yes },
{ "lookup", HandleArenaLookupCommand, SEC_GAMEMASTER, Console::No }, { "lookup", HandleArenaLookupCommand, SEC_GAMEMASTER, Console::Yes },
{ "season", arenaSeasonCommandTable } { "season", arenaSeasonCommandTable }
}; };
@@ -209,7 +209,7 @@ public:
handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, arena->GetName(), arena->GetId(), arena->GetRating(), arena->GetType(), arena->GetType()); handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, arena->GetName(), arena->GetId(), arena->GetRating(), arena->GetType(), arena->GetType());
for (auto const& itr : arena->GetMembers()) for (auto const& itr : arena->GetMembers())
handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr.Name, itr.Guid.ToString(), itr.PersonalRating, (arena->GetCaptain() == itr.Guid ? "- Captain" : "")); handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr.Name, itr.Guid.GetCounter(), itr.PersonalRating, (arena->GetCaptain() == itr.Guid ? "Captain" : ""));
return true; return true;
} }
@@ -223,18 +223,18 @@ public:
for (auto [teamId, team] : sArenaTeamMgr->GetArenaTeams()) for (auto [teamId, team] : sArenaTeamMgr->GetArenaTeams())
{ {
if (StringContainsStringI(team->GetName(), needle)) if (StringContainsStringI(team->GetName(), needle))
{
if (handler->GetSession())
{ {
handler->PSendSysMessage(LANG_ARENA_LOOKUP, team->GetName(), team->GetId(), team->GetType(), team->GetType()); handler->PSendSysMessage(LANG_ARENA_LOOKUP, team->GetName(), team->GetId(), team->GetType(), team->GetType());
found = true; found = true;
continue; continue;
} }
} }
}
if (!found) if (!found)
handler->PSendSysMessage(LANG_ARENA_ERROR_NAME_NOT_FOUND, std::string(needle)); {
handler->SendErrorMessage(LANG_ARENA_ERROR_NAME_NOT_FOUND, std::string(needle));
return false;
}
return true; return true;
} }
+4 -4
View File
@@ -417,10 +417,10 @@ public:
if (CheckModifySpeed(handler, target, allSpeed, 0.1f, 50.0f)) if (CheckModifySpeed(handler, target, allSpeed, 0.1f, 50.0f))
{ {
NotifyModification(handler, target, LANG_YOU_CHANGE_ASPEED, LANG_YOURS_ASPEED_CHANGED, allSpeed); NotifyModification(handler, target, LANG_YOU_CHANGE_ASPEED, LANG_YOURS_ASPEED_CHANGED, allSpeed);
target->SetSpeed(MOVE_WALK, allSpeed); target->SetSpeed(MOVE_WALK, allSpeed, true);
target->SetSpeed(MOVE_RUN, allSpeed); target->SetSpeed(MOVE_RUN, allSpeed, true);
target->SetSpeed(MOVE_SWIM, allSpeed); target->SetSpeed(MOVE_SWIM, allSpeed, true);
target->SetSpeed(MOVE_FLIGHT, allSpeed); target->SetSpeed(MOVE_FLIGHT, allSpeed, true);
return true; return true;
} }
@@ -467,11 +467,17 @@ public:
static bool HandleGMTicketResponseAppendCommand(ChatHandler* handler, uint32 ticketId, Tail res) static bool HandleGMTicketResponseAppendCommand(ChatHandler* handler, uint32 ticketId, Tail res)
{ {
if (res.empty())
return false;
else
return TicketResponseAppend(ticketId, false, handler, res.data()); return TicketResponseAppend(ticketId, false, handler, res.data());
} }
static bool HandleGMTicketResponseAppendLnCommand(ChatHandler* handler, uint32 ticketId, Tail res) static bool HandleGMTicketResponseAppendLnCommand(ChatHandler* handler, uint32 ticketId, Tail res)
{ {
if (res.empty())
return false;
else
return TicketResponseAppend(ticketId, true, handler, res.data()); return TicketResponseAppend(ticketId, true, handler, res.data());
} }
@@ -359,6 +359,7 @@ public:
case 0: case 0:
Talk(SAY_TEXT5); Talk(SAY_TEXT5);
HandleGameObject(DATA_ARENA4, false); HandleGameObject(DATA_ARENA4, false);
me->SetWalk(true);
Start(false); Start(false);
eventTimer = 0; eventTimer = 0;
break; break;
@@ -604,9 +605,12 @@ public:
creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false); creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false);
if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI())) if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI()))
{
creature->SetWalk(true);
escortAI->Start(false); escortAI->Start(false);
} }
} }
}
return true; return true;
} }
@@ -170,6 +170,7 @@ public:
if (m_uiEventId == EVENT_OZ) if (m_uiEventId == EVENT_OZ)
instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS); instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
me->SetWalk(true);
Start(false); Start(false);
} }
@@ -980,6 +980,7 @@ public:
{ {
carGUID = who->GetVehicleBase()->GetGUID(); carGUID = who->GetVehicleBase()->GetGUID();
InitWaypoint(); InitWaypoint();
me->SetWalk(true);
Start(false, who->GetGUID()); Start(false, who->GetGUID());
SetDespawnAtFar(false); SetDespawnAtFar(false);
} }
@@ -998,7 +999,7 @@ public:
car->SetFaction(FACTION_FRIENDLY); car->SetFaction(FACTION_FRIENDLY);
} }
Talk(SAY_SCARLET_MINER_0); Talk(SAY_SCARLET_MINER_0);
SetRun(true); me->SetWalk(false);
IntroTimer = 4000; IntroTimer = 4000;
IntroPhase = 1; IntroPhase = 1;
break; break;
@@ -78,7 +78,7 @@ public:
break; break;
case 11: case 11:
Talk(SAY_PROGRESS_6, player); Talk(SAY_PROGRESS_6, player);
SetRun(true); me->SetWalk(false);
break; break;
case 19: case 19:
Talk(SAY_PROGRESS_7, player); Talk(SAY_PROGRESS_7, player);
@@ -106,7 +106,8 @@ public:
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{ {
Talk(SAY_PROGRESS_1, player); Talk(SAY_PROGRESS_1, player);
npc_escortAI::Start(false, player->GetGUID(), quest); me->SetWalk(true);
Start(false, player->GetGUID(), quest);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
} }
} }
@@ -113,7 +113,8 @@ struct npc_ranger_lilatha : public npc_escortAI
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{ {
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, player->GetGUID()); me->SetWalk(true);
Start(true, player->GetGUID());
} }
} }
}; };
@@ -132,7 +132,8 @@ public:
if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
go->UseDoorOrButton(); go->UseDoorOrButton();
npc_escortAI::Start(false, player->GetGUID(), quest); me->SetWalk(true);
Start(false, player->GetGUID(), quest);
} }
} }
@@ -156,7 +157,7 @@ public:
case 17: case 17:
Talk(SAY_RIN_COMPLETE, player); Talk(SAY_RIN_COMPLETE, player);
player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); player->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
SetRun(true); me->SetWalk(false);
postEventCount = 1; postEventCount = 1;
break; break;
} }
@@ -61,7 +61,8 @@ public:
if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION)
{ {
Talk(SAY_CORPORAL_1, player); Talk(SAY_CORPORAL_1, player);
npc_escortAI::Start(true, player->GetGUID(), quest); me->SetWalk(true);
Start(true, player->GetGUID(), quest);
me->SetImmuneToNPC(false); me->SetImmuneToNPC(false);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
} }
@@ -111,8 +111,11 @@ public:
creature->AI()->Talk(SAY_QUESTACCEPT, player); creature->AI()->Talk(SAY_QUESTACCEPT, player);
if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
} }
}
return true; return true;
} }
@@ -406,6 +406,7 @@ public:
{ {
if (Player* player = GetPlayerForEscort()) if (Player* player = GetPlayerForEscort())
{ {
pLescovar->SetWalk(true);
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, player->GetGUID()); CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, player->GetGUID());
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f); CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f);
} }
@@ -448,6 +449,7 @@ public:
{ {
if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true)) if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
{ {
pSpybot->SetWalk(true);
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, player->GetGUID()); CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, player->GetGUID());
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f); CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f);
} }
@@ -916,7 +916,6 @@ public:
if (auto ai = CAST_AI(npc_varian_wrynn::npc_varian_wrynnAI, creature->AI())) if (auto ai = CAST_AI(npc_varian_wrynn::npc_varian_wrynnAI, creature->AI()))
{ {
creature->SetWalk(false);
ai->Start(true, player->GetGUID()); ai->Start(true, player->GetGUID());
if (Creature* jaina = GetClosestCreatureWithEntry(creature, NPC_JAINA, 50.0f)) if (Creature* jaina = GetClosestCreatureWithEntry(creature, NPC_JAINA, 50.0f))
ai->jainaGUID = jaina->GetGUID(); ai->jainaGUID = jaina->GetGUID();
@@ -56,7 +56,6 @@ public:
if (quest->GetQuestId() == QUEST_TOME_VALOR) if (quest->GetQuestId() == QUEST_TOME_VALOR)
{ {
creature->AI()->Talk(SAY_DS_START); creature->AI()->Talk(SAY_DS_START);
creature->SetWalk(false);
if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI()))
pEscortAI->Start(true, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
} }
@@ -117,7 +116,7 @@ public:
me->SummonCreature(NPC_DEFIAS_RAIDER, -11438.14f, 1607.6f, 70.94f, 4.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_DEFIAS_RAIDER, -11438.14f, 1607.6f, 70.94f, 4.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
break; break;
case 10: case 10:
SetRun(false); me->SetWalk(true);
break; break;
case 11: case 11:
Talk(SAY_DS_PROLOGUE); Talk(SAY_DS_PROLOGUE);
@@ -138,8 +138,11 @@ public:
pSlim->CastSpell(pSlim, SPELL_STEALTH, true); pSlim->CastSpell(pSlim, SPELL_STEALTH, true);
if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI())) if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI()))
{
pSlim->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
}
return false; return false;
} }
}; };
@@ -424,7 +424,7 @@ public:
{ {
Talk(SAY_PHASE201); Talk(SAY_PHASE201);
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2, 12s); actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2, 12s);
SetRun(false); me->SetWalk(true);
eventInRun = true; eventInRun = true;
me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_TOWN_CITYMAN1]); me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_TOWN_CITYMAN1]);
@@ -434,14 +434,14 @@ public:
{ {
waveGroupId = 10; waveGroupId = 10;
eventInRun = true; eventInRun = true;
SetRun(true); me->SetWalk(false);
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2 + 9, 10s); actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2 + 9, 10s);
} }
else if (param == ACTION_START_TOWN_HALL) else if (param == ACTION_START_TOWN_HALL)
{ {
Talk(SAY_PHASE301); Talk(SAY_PHASE301);
SetEscortPaused(false); SetEscortPaused(false);
SetRun(false); me->SetWalk(true);
if (Creature* cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1])) if (Creature* cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1]))
{ {
@@ -460,13 +460,13 @@ public:
{ {
Talk(SAY_PHASE401); Talk(SAY_PHASE401);
SetEscortPaused(false); SetEscortPaused(false);
SetRun(false); me->SetWalk(true);
} }
else if (param == ACTION_START_LAST_CITY) else if (param == ACTION_START_LAST_CITY)
{ {
Talk(SAY_PHASE404); Talk(SAY_PHASE404);
SetEscortPaused(false); SetEscortPaused(false);
SetRun(true); me->SetWalk(false);
} }
else if (param == ACTION_START_MALGANIS) else if (param == ACTION_START_MALGANIS)
{ {
@@ -480,7 +480,7 @@ public:
} }
Talk(SAY_PHASE501); Talk(SAY_PHASE501);
SetEscortPaused(false); SetEscortPaused(false);
SetRun(true); me->SetWalk(false);
} }
else if (param == ACTION_KILLED_MALGANIS) else if (param == ACTION_KILLED_MALGANIS)
{ {
@@ -533,7 +533,7 @@ public:
break; break;
// After intro, in front of bridge // After intro, in front of bridge
case 3: case 3:
SetRun(true); me->SetWalk(false);
Talk(SAY_PHASE118); Talk(SAY_PHASE118);
summons.DespawnAll(); // uther, jaina and horses summons.DespawnAll(); // uther, jaina and horses
break; break;
@@ -574,7 +574,7 @@ public:
if (pInstance) if (pInstance)
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_REACHED_TOWN_HALL); pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_REACHED_TOWN_HALL);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
SetRun(false); me->SetWalk(true);
SetEscortPaused(true); SetEscortPaused(true);
break; break;
// Inside Town Hall first scene pos // Inside Town Hall first scene pos
@@ -600,7 +600,7 @@ public:
break; break;
// Town Hall, upper floor third fight // Town Hall, upper floor third fight
case 31: case 31:
SetRun(false); me->SetWalk(true);
SpawnTimeRift(); SpawnTimeRift();
SpawnTimeRift(); SpawnTimeRift();
Talk(SAY_PHASE312); Talk(SAY_PHASE312);
@@ -616,14 +616,14 @@ public:
break; break;
// Reached book shelf // Reached book shelf
case 36: case 36:
SetRun(true); me->SetWalk(false);
if (pInstance) if (pInstance)
if (GameObject* pGate = pInstance->instance->GetGameObject(pInstance->GetGuidData(DATA_SHKAF_GATE))) if (GameObject* pGate = pInstance->instance->GetGameObject(pInstance->GetGuidData(DATA_SHKAF_GATE)))
pGate->SetGoState(GO_STATE_ACTIVE); pGate->SetGoState(GO_STATE_ACTIVE);
break; break;
// Behind secred passage // Behind secred passage
case 45: case 45:
SetRun(true); me->SetWalk(false);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(true); SetEscortPaused(true);
if (pInstance) if (pInstance)
@@ -631,11 +631,11 @@ public:
break; break;
// Some walk talk // Some walk talk
case 47: case 47:
SetRun(false); me->SetWalk(true);
Talk(SAY_PHASE405); Talk(SAY_PHASE405);
break; break;
case 48: case 48:
SetRun(true); me->SetWalk(false);
Talk(SAY_PHASE406); Talk(SAY_PHASE406);
break; break;
case 53: case 53:
@@ -674,7 +674,7 @@ public:
switch (uint32 currentEvent = actionEvents.ExecuteEvent()) switch (uint32 currentEvent = actionEvents.ExecuteEvent())
{ {
case EVENT_ACTION_PHASE1: case EVENT_ACTION_PHASE1:
SetRun(false); me->SetWalk(true);
me->SummonCreature(NPC_JAINA, EventPos[EVENT_SRC_JAINA], TEMPSUMMON_DEAD_DESPAWN, 180000); me->SummonCreature(NPC_JAINA, EventPos[EVENT_SRC_JAINA], TEMPSUMMON_DEAD_DESPAWN, 180000);
if (Creature* uther = me->SummonCreature(NPC_UTHER, EventPos[EVENT_SRC_UTHER], TEMPSUMMON_DEAD_DESPAWN, 180000)) if (Creature* uther = me->SummonCreature(NPC_UTHER, EventPos[EVENT_SRC_UTHER], TEMPSUMMON_DEAD_DESPAWN, 180000))
{ {
@@ -690,6 +690,7 @@ public:
break; break;
case EVENT_ACTION_PHASE1+1: case EVENT_ACTION_PHASE1+1:
// Start Event // Start Event
me->SetWalk(true);
Start(true); Start(true);
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
SetDespawnAtFar(false); SetDespawnAtFar(false);
@@ -958,7 +959,7 @@ public:
break; break;
// After waypoint 23 // After waypoint 23
case EVENT_ACTION_PHASE3+3: case EVENT_ACTION_PHASE3+3:
SetRun(true); me->SetWalk(false);
if (Creature* cr = GetEventNpc(NPC_CITY_MAN3)) if (Creature* cr = GetEventNpc(NPC_CITY_MAN3))
me->CastSpell(cr, SPELL_ARTHAS_CRUSADER_STRIKE, true); me->CastSpell(cr, SPELL_ARTHAS_CRUSADER_STRIKE, true);
ScheduleNextEvent(currentEvent, 2s); ScheduleNextEvent(currentEvent, 2s);
@@ -316,12 +316,12 @@ public:
events.ScheduleEvent(EVENT_THRALL_EMOTE, 1300ms); events.ScheduleEvent(EVENT_THRALL_EMOTE, 1300ms);
break; break;
case 9: case 9:
SetRun(false); me->SetWalk(true);
events.ScheduleEvent(EVENT_KILL_ARMORER, 500ms); events.ScheduleEvent(EVENT_KILL_ARMORER, 500ms);
events.ScheduleEvent(EVENT_TALK_KILL_ARMORER, 3s); events.ScheduleEvent(EVENT_TALK_KILL_ARMORER, 3s);
break; break;
case 10: case 10:
SetRun(true); me->SetWalk(false);
events.ScheduleEvent(EVENT_DRESSING_KNEEL, 500ms); events.ScheduleEvent(EVENT_DRESSING_KNEEL, 500ms);
events.ScheduleEvent(EVENT_DRESSING_ARMOR, 3s); events.ScheduleEvent(EVENT_DRESSING_ARMOR, 3s);
events.ScheduleEvent(EVENT_DRESSING_STAND, 4s); events.ScheduleEvent(EVENT_DRESSING_STAND, 4s);
@@ -374,7 +374,7 @@ public:
} }
UnMountSelf(); UnMountSelf();
_mounted = false; _mounted = false;
SetRun(false); me->SetWalk(true);
me->SetFacingTo(6.0388f); me->SetFacingTo(6.0388f);
break; break;
case 60: case 60:
@@ -386,12 +386,12 @@ public:
} }
Talk(SAY_EMOTE_HORSE); Talk(SAY_EMOTE_HORSE);
SetEscortPaused(true); SetEscortPaused(true);
SetRun(true); me->SetWalk(false);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
me->SetFacingTo(4.1364f); me->SetFacingTo(4.1364f);
break; break;
case 64: case 64:
SetRun(false); me->SetWalk(true);
break; break;
case 67: case 67:
events.ScheduleEvent(EVENT_LOOK_1, 1200ms); events.ScheduleEvent(EVENT_LOOK_1, 1200ms);
@@ -418,12 +418,12 @@ public:
summon->AI()->Talk(SAY_LOOKOUT_INN); summon->AI()->Talk(SAY_LOOKOUT_INN);
break; break;
case 92: case 92:
SetRun(false); me->SetWalk(true);
break; break;
case 94: case 94:
summons.DespawnAll(); summons.DespawnAll();
SetEscortPaused(true); SetEscortPaused(true);
SetRun(true); me->SetWalk(false);
instance->SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_TARETHA_MEET); instance->SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_TARETHA_MEET);
if (Creature* Taretha = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_TARETHA_GUID))) if (Creature* Taretha = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_TARETHA_GUID)))
{ {
@@ -664,7 +664,7 @@ public:
me->SetFacingTo(2.0071f); me->SetFacingTo(2.0071f);
break; break;
case EVENT_SUMMON_GUARDS: case EVENT_SUMMON_GUARDS:
SetRun(true); me->SetWalk(false);
me->SummonCreature(NPC_TM_PROTECTOR, 2501.5708f, 699.38086f, 55.64138f, 3.8571f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS); me->SummonCreature(NPC_TM_PROTECTOR, 2501.5708f, 699.38086f, 55.64138f, 3.8571f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS);
me->SummonCreature(NPC_TM_LOOKOUT, 2500.7002f, 698.26746f, 55.618248f, 3.7350f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS); me->SummonCreature(NPC_TM_LOOKOUT, 2500.7002f, 698.26746f, 55.618248f, 3.7350f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS);
if (Creature* guardsman = me->SummonCreature(NPC_TM_GUARDSMAN, 2500.0908f, 699.9389f, 55.629555f, 4.2935f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS)) if (Creature* guardsman = me->SummonCreature(NPC_TM_GUARDSMAN, 2500.0908f, 699.9389f, 55.629555f, 4.2935f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS))
@@ -1018,7 +1018,7 @@ public:
{ {
if (waypointId == 7) if (waypointId == 7)
{ {
SetRun(false); me->SetWalk(true);
Talk(SAY_TARETHA_FREE); Talk(SAY_TARETHA_FREE);
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
if (Creature* thrall = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL_GUID))) if (Creature* thrall = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL_GUID)))
@@ -209,7 +209,6 @@ struct npc_general_andorov : public npc_escortAI
_initialAttackTimer = 5 * IN_MILLISECONDS; _initialAttackTimer = 5 * IN_MILLISECONDS;
_paused = false; _paused = false;
me->SetWalk(false);
Start(false); Start(false);
me->SetImmuneToNPC(true); me->SetImmuneToNPC(true);
@@ -121,7 +121,8 @@ public:
{ {
Talk(SAY_MUG_START1); Talk(SAY_MUG_START1);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, player->GetGUID()); me->SetWalk(true);
Start(true, player->GetGUID());
} }
} }
@@ -258,7 +258,7 @@ public:
case 28: case 28:
player->GroupEventHappens(QUEST_A_CRY_FOR_HELP, me); player->GroupEventHappens(QUEST_A_CRY_FOR_HELP, me);
_events.ScheduleEvent(EVENT_TALK_END, 2s); _events.ScheduleEvent(EVENT_TALK_END, 2s);
SetRun(true); me->SetWalk(false);
break; break;
case 29: case 29:
if (Creature* cowlen = me->FindNearestCreature(NPC_COWLEN, 50.0f, true)) if (Creature* cowlen = me->FindNearestCreature(NPC_COWLEN, 50.0f, true))
@@ -289,7 +289,8 @@ public:
case EVENT_START_ESCORT: case EVENT_START_ESCORT:
if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
{ {
npc_escortAI::Start(true, player->GetGUID()); me->SetWalk(true);
Start(true, player->GetGUID());
} }
_events.ScheduleEvent(EVENT_STAND, 2s); _events.ScheduleEvent(EVENT_STAND, 2s);
break; break;
@@ -397,7 +397,10 @@ public:
if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2)
{ {
if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID()); pEscortAI->Start(false, player->GetGUID());
}
creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE);
} }
@@ -396,7 +396,6 @@ public:
case EVENT_RESTART_ESCORT: case EVENT_RESTART_ESCORT:
CheckCaravan(); CheckCaravan();
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
SetRun(true);
Start(true, ObjectGuid::Empty, 0, false, false, true); Start(true, ObjectGuid::Empty, 0, false, false, true);
break; break;
} }
@@ -384,6 +384,7 @@ public:
AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]);
} }
PlayerGUID = player->GetGUID(); PlayerGUID = player->GetGUID();
me->SetWalk(true);
Start(true, PlayerGUID); Start(true, PlayerGUID);
} }
return; return;
@@ -137,7 +137,10 @@ public:
if (quest->GetQuestId() == QUEST_PROTECT_KAYA) if (quest->GetQuestId() == QUEST_PROTECT_KAYA)
{ {
if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
}
creature->AI()->Talk(SAY_START); creature->AI()->Talk(SAY_START);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
@@ -260,6 +260,7 @@ public:
float Radius = 10.0f; float Radius = 10.0f;
if (me->IsWithinDistInMap(who, Radius)) if (me->IsWithinDistInMap(who, Radius))
{ {
me->SetWalk(true);
Start(false, who->GetGUID()); Start(false, who->GetGUID());
} }
} }
@@ -55,8 +55,11 @@ public:
creature->AI()->Talk(SAY_GIL_START, player); creature->AI()->Talk(SAY_GIL_START, player);
if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI())) if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
}
return true; return true;
} }
@@ -499,7 +502,7 @@ public:
Talk(SAY_STARTUP1); Talk(SAY_STARTUP1);
break; break;
case 9: case 9:
SetRun(false); me->SetWalk(true);
break; break;
case 17: case 17:
if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
@@ -528,7 +531,7 @@ public:
break; break;
case 18: case 18:
Talk(SAY_PROGRESS_1, player); Talk(SAY_PROGRESS_1, player);
SetRun(true); me->SetWalk(false);
break; break;
} }
} }
@@ -594,8 +597,11 @@ public:
creature->SetFaction(FACTION_RATCHET); creature->SetFaction(FACTION_RATCHET);
creature->AI()->Talk(SAY_START); creature->AI()->Talk(SAY_START);
if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
} }
}
return true; return true;
} }
@@ -66,8 +66,11 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed
if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI())) if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
}
return true; return true;
} }
@@ -148,8 +151,11 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed
if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI())) if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
}
return true; return true;
} }
@@ -48,6 +48,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_CHASING_AME) if (quest->GetQuestId() == QUEST_CHASING_AME)
{ {
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_READY, player); creature->AI()->Talk(SAY_READY, player);
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
@@ -286,7 +286,10 @@ public:
creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI())) if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI()))
{
creature->SetWalk(true);
escortAI->Start(false, player->GetGUID(), quest); escortAI->Start(false, player->GetGUID(), quest);
}
return true; return true;
} }
@@ -339,7 +339,6 @@ public:
void Reset() override void Reset() override
{ {
me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr); Start(false, ObjectGuid::Empty, nullptr);
SetDespawnAtEnd(true); SetDespawnAtEnd(true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -549,7 +549,6 @@ public:
return; return;
} }
me->SetWalk(false);
Start(false); Start(false);
} }
@@ -49,69 +49,81 @@ enum Yells
enum Events enum Events
{ {
EVENT_STAMPEDE = 1, EVENT_KILL_TALK = 1
EVENT_WHIRLING_SLASH = 2,
EVENT_PUNCTURE = 3,
EVENT_ENRAGE = 4,
EVENT_IMPALING_CHARGE = 5,
EVENT_UNSUMMON_RHINO = 6,
EVENT_STOMP = 7,
EVENT_KILL_TALK = 8
}; };
class boss_gal_darah : public CreatureScript struct boss_gal_darah : public BossAI
{ {
public: boss_gal_darah(Creature* creature) : BossAI(creature, DATA_GAL_DARAH) { }
boss_gal_darah() : CreatureScript("boss_gal_darah") { }
CreatureAI* GetAI(Creature* creature) const override
{
return GetGundrakAI<boss_gal_darahAI>(creature);
}
struct boss_gal_darahAI : public BossAI
{
boss_gal_darahAI(Creature* creature) : BossAI(creature, DATA_GAL_DARAH)
{
}
uint8 phaseCounter;
GuidSet impaledList;
void Reset() override void Reset() override
{ {
BossAI::Reset(); BossAI::Reset();
DoCastSelf(SPELL_START_VISUAL);
impaledList.clear(); impaledList.clear();
phaseCounter = 0; _stampedeVictim.Clear();
}
void InitializeAI() override
{
BossAI::InitializeAI();
me->CastSpell(me, SPELL_START_VISUAL, false);
} }
void JustReachedHome() override void JustReachedHome() override
{ {
BossAI::JustReachedHome(); BossAI::JustReachedHome();
me->CastSpell(me, SPELL_START_VISUAL, false); DoCastSelf(SPELL_START_VISUAL);
} }
void ScheduleEvents(bool troll) void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{ {
events.Reset(); if (spellInfo->Id == SPELL_TRANSFORM_TO_RHINO)
if (troll)
{ {
events.RescheduleEvent(EVENT_STAMPEDE, 10s); ScheduleTimedEvent(8s, 11s, [&] {
events.RescheduleEvent(EVENT_WHIRLING_SLASH, 21s); if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true))
{
DoCast(target, SPELL_IMPALING_CHARGE);
impaledList.insert(target->GetGUID());
} }
else }, 16s, 17s);
{
events.RescheduleEvent(EVENT_PUNCTURE, 10s); ScheduleTimedEvent(6s, 8s, [&] {
events.RescheduleEvent(EVENT_ENRAGE, 15s); DoCastSelf(SPELL_ENRAGE);
events.RescheduleEvent(EVENT_IMPALING_CHARGE, 21s); }, 16s, 17s);
events.RescheduleEvent(EVENT_STOMP, 5s);
ScheduleTimedEvent(7s, 10s, [&] {
DoCastAOE(SPELL_STOMP);
}, 10s, 12s);
me->m_Events.AddEventAtOffset([&] {
scheduler.CancelAll();
DoCastSelf(SPELL_TRANSFORM_TO_TROLL);
}, 32s);
} }
else if (spellInfo->Id == SPELL_TRANSFORM_TO_TROLL)
{
ScheduleEvents();
}
}
void ScheduleEvents()
{
ScheduleTimedEvent(10s, [&] {
Talk(SAY_SUMMON_RHINO);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
{
_stampedeVictim = target->GetGUID();
DoCast(target, SPELL_STAMPEDE);
}
}, 15s);
ScheduleTimedEvent(10s, 16s, [&] {
DoCastVictim(SPELL_PUNCTURE);
}, 15s, 18s);
ScheduleTimedEvent(11s, 19s, [&] {
DoCastAOE(SPELL_WHIRLING_SLASH);
}, 17s, 19s);
me->m_Events.AddEventAtOffset([&] {
scheduler.CancelAll();
DoCastSelf(SPELL_TRANSFORM_TO_RHINO);
}, 32s);
} }
void JustEngagedWith(Unit* who) override void JustEngagedWith(Unit* who) override
@@ -119,21 +131,17 @@ public:
Talk(SAY_AGGRO); Talk(SAY_AGGRO);
BossAI::JustEngagedWith(who); BossAI::JustEngagedWith(who);
ScheduleEvents(true); ScheduleEvents();
me->RemoveAurasDueToSpell(SPELL_START_VISUAL); me->RemoveAurasDueToSpell(SPELL_START_VISUAL);
me->InterruptNonMeleeSpells(true); me->InterruptNonMeleeSpells(true);
} }
void JustSummoned(Creature* summon) override void JustSummoned(Creature* summon) override
{ {
uint32 despawnTime = 0; if (Unit* target = ObjectAccessor::GetUnit(*me, _stampedeVictim))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
{
summon->CastSpell(target, SPELL_STAMPEDE_DMG, true); summon->CastSpell(target, SPELL_STAMPEDE_DMG, true);
despawnTime = (summon->GetDistance(target) / 40.0f * 1000) + 500;
}
summon->DespawnOrUnsummon(Milliseconds(despawnTime)); summons.Summon(summon);
} }
uint32 GetData(uint32 /*type*/) const override uint32 GetData(uint32 /*type*/) const override
@@ -156,68 +164,9 @@ public:
} }
} }
void UpdateAI(uint32 diff) override private:
{ GuidSet impaledList;
if (!UpdateVictim()) ObjectGuid _stampedeVictim;
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_CHARGING))
return;
switch (events.ExecuteEvent())
{
case EVENT_STAMPEDE:
Talk(SAY_SUMMON_RHINO);
me->CastSpell(me->GetVictim(), SPELL_STAMPEDE, false);
events.ScheduleEvent(EVENT_STAMPEDE, 15s);
break;
case EVENT_WHIRLING_SLASH:
if (++phaseCounter >= 3)
{
ScheduleEvents(false);
me->CastSpell(me, SPELL_TRANSFORM_TO_RHINO, false);
Talk(SAY_TRANSFORM_1);
phaseCounter = 0;
return;
}
events.ScheduleEvent(EVENT_WHIRLING_SLASH, 21s);
me->CastSpell(me, SPELL_WHIRLING_SLASH, false);
break;
case EVENT_PUNCTURE:
me->CastSpell(me->GetVictim(), SPELL_PUNCTURE, false);
events.ScheduleEvent(EVENT_PUNCTURE, 8s);
break;
case EVENT_ENRAGE:
me->CastSpell(me, SPELL_ENRAGE, false);
events.ScheduleEvent(EVENT_ENRAGE, 20s);
break;
case EVENT_STOMP:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_STOMP, false);
events.ScheduleEvent(EVENT_STOMP, 20s);
break;
case EVENT_IMPALING_CHARGE:
if (++phaseCounter >= 3)
{
ScheduleEvents(true);
me->CastSpell(me, SPELL_TRANSFORM_TO_TROLL, false);
Talk(SAY_TRANSFORM_2);
phaseCounter = 0;
return;
}
events.ScheduleEvent(EVENT_IMPALING_CHARGE, 21s);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false))
{
me->CastSpell(target, SPELL_IMPALING_CHARGE, false);
impaledList.insert(target->GetGUID());
}
break;
}
DoMeleeAttackIfReady();
}
};
}; };
class spell_galdarah_impaling_charge : public SpellScript class spell_galdarah_impaling_charge : public SpellScript
@@ -265,9 +214,7 @@ class spell_galdarah_transform : public SpellScript
class achievement_share_the_love : public AchievementCriteriaScript class achievement_share_the_love : public AchievementCriteriaScript
{ {
public: public:
achievement_share_the_love() : AchievementCriteriaScript("achievement_share_the_love") achievement_share_the_love() : AchievementCriteriaScript("achievement_share_the_love") { }
{
}
bool OnCheck(Player* /*player*/, Unit* target, uint32 /*criteria_id*/) override bool OnCheck(Player* /*player*/, Unit* target, uint32 /*criteria_id*/) override
{ {
@@ -280,7 +227,7 @@ public:
void AddSC_boss_gal_darah() void AddSC_boss_gal_darah()
{ {
new boss_gal_darah(); RegisterGundrakCreatureAI(boss_gal_darah);
RegisterSpellScript(spell_galdarah_impaling_charge); RegisterSpellScript(spell_galdarah_impaling_charge);
RegisterSpellScript(spell_galdarah_transform); RegisterSpellScript(spell_galdarah_transform);
new achievement_share_the_love(); new achievement_share_the_love();
@@ -71,4 +71,6 @@ inline AI* GetGundrakAI(T* obj)
return GetInstanceAI<AI>(obj, GundrakScriptName); return GetInstanceAI<AI>(obj, GundrakScriptName);
} }
#define RegisterGundrakCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetGundrakAI)
#endif #endif
@@ -2566,7 +2566,7 @@ public:
me->SetCanFly(false); me->SetCanFly(false);
me->SetDisableGravity(false); me->SetDisableGravity(false);
me->GetMotionMaster()->MovePoint(POINT_DROP_PLAYER, _destPoint, FORCED_MOVEMENT_NONE, 0.f, false); me->GetMotionMaster()->MovePoint(POINT_DROP_PLAYER, _destPoint, FORCED_MOVEMENT_NONE, 0.f, false);
me->SetDisableGravity(true, true); me->SetDisableGravity(true);
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
break; break;
case EVENT_MOVE_TO_SIPHON_POS: case EVENT_MOVE_TO_SIPHON_POS:
@@ -2732,7 +2732,7 @@ class spell_the_lich_king_valkyr_target_search : public SpellScript
if (Unit* target = GetHitUnit()) if (Unit* target = GetHitUnit())
{ {
GetCaster()->GetMotionMaster()->MoveCharge(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 4.0f, 42.0f, EVENT_CHARGE); GetCaster()->GetMotionMaster()->MoveCharge(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 4.0f, 42.0f, EVENT_CHARGE);
GetCaster()->SetDisableGravity(true, true); GetCaster()->SetDisableGravity(true);
} }
} }
@@ -934,7 +934,6 @@ public:
case EVENT_START_PATHING: case EVENT_START_PATHING:
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false); me->SetImmuneToAll(false);
me->SetWalk(false);
Start(true); Start(true);
break; break;
case EVENT_SCOURGE_STRIKE: case EVENT_SCOURGE_STRIKE:
@@ -528,9 +528,7 @@ public:
init.Launch(); init.Launch();
pPlayer->SetUnitMovementFlags(MOVEMENTFLAG_NONE); pPlayer->SetUnitMovementFlags(MOVEMENTFLAG_NONE);
pPlayer->SetDisableGravity(true, true); pPlayer->SetDisableGravity(true);
sScriptMgr->AnticheatSetCanFlybyServer(pPlayer, true);
WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8);
data << pPlayer->GetPackGUID(); data << pPlayer->GetPackGUID();
@@ -941,10 +939,7 @@ public:
if (!bUpdatedFlying && timer) if (!bUpdatedFlying && timer)
{ {
bUpdatedFlying = true; bUpdatedFlying = true;
plr->SetDisableGravity(true, true); plr->SetDisableGravity(true);
sScriptMgr->AnticheatSetCanFlybyServer(plr, true);
sScriptMgr->AnticheatSetUnderACKmount(plr);
} }
plr->SendMonsterMove(me->GetPositionX() + dist * cos(arcangle), me->GetPositionY() + dist * std::sin(arcangle), me->GetPositionZ(), VORTEX_DEFAULT_DIFF * 2, SPLINEFLAG_FLYING); plr->SendMonsterMove(me->GetPositionX() + dist * cos(arcangle), me->GetPositionY() + dist * std::sin(arcangle), me->GetPositionZ(), VORTEX_DEFAULT_DIFF * 2, SPLINEFLAG_FLYING);
@@ -128,6 +128,7 @@ struct boss_bjarngrim : public npc_escortAI
AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0); AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0);
AddWaypoint(14, 1262, -26.9f, 33.5f, 0); AddWaypoint(14, 1262, -26.9f, 33.5f, 0);
me->SetWalk(true);
Start(true, ObjectGuid::Empty, nullptr, false, true); Start(true, ObjectGuid::Empty, nullptr, false, true);
} }
@@ -391,7 +391,6 @@ public:
switch (action) switch (action)
{ {
case ACTION_START_ESCORT_EVENT: case ACTION_START_ESCORT_EVENT:
me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false); Start(false, ObjectGuid::Empty, 0, true, false);
Talk(SAY_BRANN_ESCORT_START); Talk(SAY_BRANN_ESCORT_START);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
@@ -457,7 +456,6 @@ public:
door->SetGoState(GO_STATE_READY); door->SetGoState(GO_STATE_READY);
break; break;
case ACTION_OPEN_DOOR: case ACTION_OPEN_DOOR:
me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false); Start(false, ObjectGuid::Empty, 0, true, false);
SetNextWaypoint(34, false); SetNextWaypoint(34, false);
SetEscortPaused(false); SetEscortPaused(false);
@@ -1089,6 +1089,7 @@ public:
{ {
summons.DespawnAll(); summons.DespawnAll();
_spellTimer = 0; _spellTimer = 0;
me->SetWalk(true);
Start(false, ObjectGuid::Empty, nullptr, false, true); Start(false, ObjectGuid::Empty, nullptr, false, true);
if (Aura* aur = me->AddAura(SPELL_FREYA_DUMMY_YELLOW, me)) if (Aura* aur = me->AddAura(SPELL_FREYA_DUMMY_YELLOW, me))
{ {
@@ -934,7 +934,6 @@ public:
{ {
InitWaypoint(); InitWaypoint();
Reset(); Reset();
me->SetWalk(false);
Start(false); Start(false);
} }
@@ -1021,7 +1020,6 @@ public:
{ {
InitWaypoint(); InitWaypoint();
Reset(); Reset();
me->SetWalk(false);
Start(false); Start(false);
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
} }
@@ -937,7 +937,6 @@ public:
{ {
InitWaypoint(); InitWaypoint();
Reset(); Reset();
me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr, false, true); Start(false, ObjectGuid::Empty, nullptr, false, true);
} }
@@ -372,7 +372,6 @@ struct violet_hold_trashAI : public npc_escortAI
break; break;
} }
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
me->SetWalk(false);
Start(true); Start(true);
} }
@@ -1112,7 +1111,6 @@ public:
break; break;
} }
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
me->SetWalk(false);
Start(true); Start(true);
} }
@@ -464,7 +464,10 @@ public:
go->UseDoorOrButton(); go->UseDoorOrButton();
if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
}
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
return true; return true;
@@ -914,6 +917,7 @@ public:
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetStandState(UNIT_STAND_STATE_STAND); creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_1, player); creature->AI()->Talk(SAY_1, player);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
@@ -959,7 +963,7 @@ public:
Talk(SAY_5); Talk(SAY_5);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me); player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
SetRun(true); me->SetWalk(false);
break; break;
} }
} }
@@ -995,7 +999,6 @@ public:
{ {
creature->SetStandState(UNIT_STAND_STATE_STAND); creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_BONKER_2, player); creature->AI()->Talk(SAY_BONKER_2, player);
creature->SetWalk(false);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
@@ -191,6 +191,7 @@ public:
if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE) if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE)
{ {
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
@@ -238,7 +239,7 @@ public:
{ {
case 1: case 1:
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
SetRun(true); me->SetWalk(false);
break; break;
case 23: case 23:
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me); player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
@@ -247,32 +248,32 @@ public:
case 5: case 5:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false); me->SetWalk(true);
break; break;
case 6: case 6:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true); me->SetWalk(false);
break; break;
case 8: case 8:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false); me->SetWalk(true);
break; break;
case 9: case 9:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
break; break;
case 10: case 10:
SetRun(true); me->SetWalk(false);
break; break;
case 13: case 13:
SetRun(false); me->SetWalk(true);
break; break;
case 14: case 14:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true); me->SetWalk(false);
break; break;
} }
} }
@@ -715,6 +715,7 @@ public:
Talk(0); Talk(0);
events.Reset(); events.Reset();
summons.DespawnAll(); summons.DespawnAll();
me->SetWalk(true);
Start(false); Start(false);
int8 i = -1; int8 i = -1;
@@ -605,6 +605,7 @@ public:
creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f); creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID()); pEscortAI->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_WP_1); creature->AI()->Talk(SAY_WP_1);
} }
@@ -57,7 +57,6 @@ struct npc_frosthound : public npc_escortAI
{ {
me->SetFaction(who->GetFaction()); me->SetFaction(who->GetFaction());
me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true); me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true);
me->SetWalk(false);
Start(false, who->GetGUID()); Start(false, who->GetGUID());
Talk(TALK_EMOTE_FROSTHOUND_SNIFF, me); Talk(TALK_EMOTE_FROSTHOUND_SNIFF, me);
} }
@@ -247,7 +246,6 @@ public:
void RollPath() void RollPath()
{ {
me->SetEntry(NPC_TIME_LOST_PROTO_DRAKE); me->SetEntry(NPC_TIME_LOST_PROTO_DRAKE);
me->SetWalk(false);
Start(true, ObjectGuid::Empty, 0, false, true, true); Start(true, ObjectGuid::Empty, 0, false, true, true);
SetNextWaypoint(urand(0, 250), true); SetNextWaypoint(urand(0, 250), true);
me->UpdateEntry(roll_chance_i(25) ? NPC_TIME_LOST_PROTO_DRAKE : NPC_VYRAGOSA, 0, false); me->UpdateEntry(roll_chance_i(25) ? NPC_TIME_LOST_PROTO_DRAKE : NPC_VYRAGOSA, 0, false);
@@ -347,7 +347,7 @@ struct boss_kaelthas : public BossAI
} }
else if (point == POINT_AIR) else if (point == POINT_AIR)
{ {
me->SetDisableGravity(true, false, false); // updating AnimationTier will break drowning animation later me->SetDisableGravity(true); // updating AnimationTier will break drowning animation later
} }
else if (point == POINT_START_LAST_PHASE) else if (point == POINT_START_LAST_PHASE)
{ {
@@ -171,7 +171,10 @@ public:
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature) npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
{ {
if (creature->GetOwner() && creature->GetOwner()->IsPlayer()) if (creature->GetOwner() && creature->GetOwner()->IsPlayer())
{
creature->SetWalk(true);
Start(false, creature->GetOwner()->GetGUID()); Start(false, creature->GetOwner()->GetGUID());
}
creature->SetSpeed(MOVE_WALK, 1.5f); creature->SetSpeed(MOVE_WALK, 1.5f);
DoCast(SPELL_GUIDED_BY_THE_SPIRITS); DoCast(SPELL_GUIDED_BY_THE_SPIRITS);
Reset(); Reset();
@@ -312,7 +315,8 @@ public:
{ {
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
me->SetFaction(FACTION_ESCORTEE_H_PASSIVE); me->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
npc_escortAI::Start(true, player->GetGUID()); me->SetWalk(true);
Start(true, player->GetGUID());
} }
} }
+4 -2
View File
@@ -65,6 +65,7 @@ public:
{ {
creature->SetStandState(UNIT_STAND_STATE_STAND); creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE);
creature->SetWalk(true);
EscortAI->Start(true, player->GetGUID(), quest); EscortAI->Start(true, player->GetGUID(), quest);
creature->AI()->Talk(SAY_MAG_START); creature->AI()->Talk(SAY_MAG_START);
@@ -133,7 +134,7 @@ public:
if (Player* player = GetPlayerForEscort()) if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me); player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
SetRun(true); me->SetWalk(false);
break; break;
} }
} }
@@ -306,6 +307,7 @@ public:
void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override
{ {
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetWalk(true);
Start(true, guid); Start(true, guid);
Talk(SAY_KUR_START); Talk(SAY_KUR_START);
@@ -361,7 +363,7 @@ public:
if (Player* player = GetPlayerForEscort()) if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me); player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
SetRun(true); me->SetWalk(false);
break; break;
} }
} }
@@ -103,7 +103,6 @@ public:
{ {
if (type == DATA_START_ENCOUNTER) if (type == DATA_START_ENCOUNTER)
{ {
me->SetWalk(false);
Start(true, playerGUID); Start(true, playerGUID);
SetEscortPaused(true); SetEscortPaused(true);
started = true; started = true;
@@ -606,6 +605,7 @@ public:
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->AI()->Talk(SAY_BESSY_0); creature->AI()->Talk(SAY_BESSY_0);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
@@ -772,6 +772,7 @@ public:
if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI())) if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI()))
{ {
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID()); pEscortAI->Start(false, player->GetGUID());
} }
} }
@@ -246,8 +246,11 @@ public:
Player* player = summoner->ToPlayer(); Player* player = summoner->ToPlayer();
if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
{
me->SetWalk(true);
Start(false, summoner->GetGUID()); Start(false, summoner->GetGUID());
} }
}
void Reset() override { } void Reset() override { }
}; };
@@ -473,6 +473,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
{ {
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
} }