Merge pull request #40 from liyunfan1223/Playerbot_20250219

Merge branch 'master' into Playerbot
This commit is contained in:
Yunfan Li
2025-02-22 12:08:24 +08:00
committed by GitHub
292 changed files with 7673 additions and 5554 deletions
@@ -1,4 +1,4 @@
name: Bug report name: Game issues
description: Create a bug report to help us improve. description: Create a bug report to help us improve.
body: body:
- type: markdown - type: markdown
@@ -14,14 +14,13 @@ body:
description: | description: |
Description of the problem or issue here. Description of the problem or issue here.
Include entries of affected creatures / items / quests / spells etc. Include entries of affected creatures / items / quests / spells etc.
If this is a crash, post the crashlog (upload to https://gist.github.com/) and include the link here.
Never upload files! Use GIST for text and YouTube for videos! Never upload files! Use GIST for text and YouTube for videos!
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: expected id: expected
attributes: attributes:
label: Expected Blizzlike Behaviour label: Expected Behaviour
description: | description: |
Tell us what should happen instead. Tell us what should happen instead.
validations: validations:
@@ -0,0 +1,86 @@
name: Crash / Server Crash issues
description: Did your server crash? Post an issue here!
title: "Crash: "
labels: ["Priority-Critical", "HasBacktrace"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out a bug report. Remember to fill out all fields including the title above.
An issue that is not properly filled out will be closed.
- type: textarea
id: current
attributes:
label: Steps to Reproduce
description: |
If possible provide detailed steps to reproduce the crash.
placeholder: |
1. Provide the exact steps to trigger the crash.
2. Include any relevant configurations or commands.
3. Mention if the crash is consistent or intermittent.
validations:
required: false
- type: markdown
attributes:
value: |
NOTE: Make sure your server was compiled in RelWithDebug or Debug mode as crashlogs from Release do not contain enough information.
- type: textarea
id: logs
attributes:
label: Logs and Screenshots
description: |
Do you have any logs or screenshots that can be useful?
Crash logs in text are preffered over screenshots.
If you have logs in text form please upload them to [Gist](https://gist.github.com/) or PasteBin and upload the link.
validations:
required: false
- type: input
id: os
attributes:
label: Operating System
description: |
The Operating System you are having issues on.
i.e. Windows 11 x64, Debian 10 x64, macOS 12, Ubuntu 20.04
validations:
required: true
- type: textarea
id: deps
attributes:
label: Dependencies & versions
description: |
Relevant information about dependencies and their versions that can be useful to debug the issue.
Example:
- OpenSSL ver ...
- Boost ver ...
- MySQL ver ...
- Visual Studio ver ...
- GCC ver ...
- Clang ver ...
- CMake ver ...
validations:
required: true
- type: input
id: commit
attributes:
label: Commit
description: |
Which commit hash are you using.
validations:
required: true
- type: textarea
id: extra
attributes:
label: Additional Context
description: |
Do you have any other relevant information about the issue?
validations:
required: false
- type: markdown
attributes:
value: |
Thank you for your contribution.
If you use AzerothCore regularly, we really NEED your help to:
- Test our fixes: https://www.azerothcore.org/wiki/How-to-test-a-PR
- Report issues or suggestions: https://github.com/azerothcore/azerothcore-wotlk/issues/new/choose
- Improve the documentation/wiki: https://www.azerothcore.org/wiki/home
With your help, the project can evolve much quicker!
+75
View File
@@ -0,0 +1,75 @@
name: Build/Tools/Apps issues
description: Got an issue with build, tools or apps? Create an issue to let us know!
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out a bug report. Remember to fill out all fields including the title above.
An issue that is not properly filled out will be closed.
- type: textarea
id: current
attributes:
label: Current Behaviour
description: |
What actually happens and how do we reproduce it?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs and Screenshots
description: |
Do you have any logs or screenshots that can be useful?
If you have logs in text form please upload them to [Gist](https://gist.github.com/) or PasteBin and upload the link.
validations:
required: false
- type: input
id: os
attributes:
label: Operating System
description: |
The Operating System you are having issues on.
i.e. Windows 11 x64, Debian 10 x64, macOS 12, Ubuntu 20.04
validations:
required: true
- type: textarea
id: deps
attributes:
label: Dependencies & versions
description: |
Relevant information about dependencies and their versions that can be useful to debug the issue.
Example:
- OpenSSL ver ...
- Boost ver ...
- MySQL ver ...
- Visual Studio ver ...
- GCC ver ...
- Clang ver ...
- CMake ver ...
validations:
required: true
- type: input
id: commit
attributes:
label: Commit
description: |
Which commit hash are you using.
validations:
required: true
- type: textarea
id: extra
attributes:
label: Additional Context
description: |
Do you have any other relevant information about the issue?
validations:
required: false
- type: markdown
attributes:
value: |
Thank you for your contribution.
If you use AzerothCore regularly, we really NEED your help to:
- Test our fixes: https://www.azerothcore.org/wiki/How-to-test-a-PR
- Report issues or suggestions: https://github.com/azerothcore/azerothcore-wotlk/issues/new/choose
- Improve the documentation/wiki: https://www.azerothcore.org/wiki/home
With your help, the project can evolve much quicker!
+1 -4
View File
@@ -1,4 +1,4 @@
blank_issues_enabled: true blank_issues_enabled: false
contact_links: contact_links:
- name: Website - name: Website
url: https://www.azerothcore.org url: https://www.azerothcore.org
@@ -6,9 +6,6 @@ contact_links:
- name: Wiki - name: Wiki
url: https://www.azerothcore.org/wiki url: https://www.azerothcore.org/wiki
about: You can find plenty of information on our Wiki. about: You can find plenty of information on our Wiki.
- name: How to ask for help
url: https://www.azerothcore.org/wiki/How-to-ask-for-help
about: Before submitting an issue we'd love if you take a minute to read this.
- name: FAQ - name: FAQ
url: https://www.azerothcore.org/wiki/faq url: https://www.azerothcore.org/wiki/faq
about: Frequently asked questions. about: Frequently asked questions.
@@ -1,7 +1,7 @@
name: Feature request name: Feature request
description: Suggest an idea for this project description: Suggest an idea for this project
title: "Feature: " title: "Feature: "
type: "Feature" labels: "Feature"
body: body:
- type: markdown - type: markdown
attributes: attributes:
+12
View File
@@ -0,0 +1,12 @@
name: CC Triage
description: This template is only used for ChromieCraft
labels: ["ChromieCraft Generic"]
body:
- type: textarea
id: current
attributes:
label: Triage
description: |
Paste the issue from ChromieCraft here.
validations:
required: true
+1 -1
View File
@@ -89,4 +89,4 @@ It's important to note that AzerothCore is not an official Blizzard Entertainmen
[JetBrains](https://www.jetbrains.com/?from=AzerothCore) is providing free [open-source licenses](https://www.jetbrains.com/community/opensource/) to the AzerothCore developers. [JetBrains](https://www.jetbrains.com/?from=AzerothCore) is providing free [open-source licenses](https://www.jetbrains.com/community/opensource/) to the AzerothCore developers.
[![JetBrains](https://user-images.githubusercontent.com/75517/51205146-7f225c80-1905-11e9-82e0-835627be170d.png)](https://www.jetbrains.com/?from=AzerothCore) [![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSourceSupport)
+8 -1
View File
@@ -31,6 +31,11 @@ inputs:
description: Max allowed error count before compilation stops description: Max allowed error count before compilation stops
required: false required: false
type: number type: number
keepgoing:
default: false
description: Flag to continue build after errors
required: false
type: boolean
runs: runs:
using: composite using: composite
steps: steps:
@@ -121,7 +126,9 @@ runs:
- name: build - name: build
shell: bash shell: bash
working-directory: "${{ github.workspace }}/build" working-directory: "${{ github.workspace }}/build"
run: cmake --build . --config "Release" -j "$(($(nproc) + 2))" run: |
# '--' passes '--keep-going' to the underlying build system (make)
cmake --build . --config "Release" -j "$(($(nproc) + 2))" ${{ inputs.keepgoing == 'true' && '-- --keep-going' || '' }}
- name: install - name: install
shell: bash shell: bash
+1
View File
@@ -50,3 +50,4 @@ jobs:
modules: true modules: true
pch: false pch: false
maxerrors: 0 maxerrors: 0
keepgoing: true
+2
View File
@@ -27,3 +27,5 @@ git clone --depth=1 --branch=main https://github.com/azerothcore/mod-queue-lis
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-server-auto-shutdown.git modules/mod-server-auto-shutdown git clone --depth=1 --branch=master https://github.com/azerothcore/mod-server-auto-shutdown.git modules/mod-server-auto-shutdown
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-transmog.git modules/mod-transmog git clone --depth=1 --branch=master https://github.com/azerothcore/mod-transmog.git modules/mod-transmog
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-progression-system.git modules/mod-progression-system git clone --depth=1 --branch=main https://github.com/azerothcore/mod-progression-system.git modules/mod-progression-system
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-arena-3v3-solo-queue.git modules/mod-arena-3v3-solo-queue
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-costumes.git modules/mod-costumes
+1 -1
View File
@@ -148,7 +148,7 @@ def insert_delete_safety_check(file: io, file_path: str) -> None:
if line.startswith("--"): if line.startswith("--"):
continue continue
if "INSERT" in line and "DELETE" not in previous_line: if "INSERT" in line and "DELETE" not in previous_line:
print(f"No DELETE keyword found after the INSERT in {file_path} at line {line_number}\nIf this error is intended, please advert a maintainer") print(f"No DELETE keyword found before the INSERT in {file_path} at line {line_number}\nIf this error is intended, please advert a maintainer")
check_failed = True check_failed = True
previous_line = line previous_line = line
match = re.match(r"DELETE FROM\s+`([^`]+)`", line, re.IGNORECASE) match = re.match(r"DELETE FROM\s+`([^`]+)`", line, re.IGNORECASE)
@@ -24,7 +24,7 @@ fi
choco install -y --skip-checksums $INSTALL_ARGS cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=System' choco install -y --skip-checksums $INSTALL_ARGS cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=System'
choco install -y --skip-checksums $INSTALL_ARGS visualstudio2022-workload-nativedesktop choco install -y --skip-checksums $INSTALL_ARGS visualstudio2022-workload-nativedesktop
choco install -y --skip-checksums $INSTALL_ARGS openssl --force --version=3.3.2 choco install -y --skip-checksums $INSTALL_ARGS openssl --force --version=3.4.1
choco install -y --skip-checksums $INSTALL_ARGS boost-msvc-14.3 --force --version=1.87.0 choco install -y --skip-checksums $INSTALL_ARGS boost-msvc-14.3 --force --version=1.87.0
choco install -y --skip-checksums $INSTALL_ARGS mysql --force --version=8.4.4 choco install -y --skip-checksums $INSTALL_ARGS mysql --force --version=8.4.4
@@ -0,0 +1,5 @@
-- DB update 2025_01_26_00 -> 2025_02_16_00
--
ALTER TABLE `autobroadcast_locale`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`realmid`, `id`, `locale`);
@@ -0,0 +1,11 @@
-- DB update 2025_02_16_00 -> 2025_02_16_01
--
ALTER TABLE `updates`
CHANGE COLUMN `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.' COLLATE 'utf8mb4_unicode_ci' AFTER `hash`;
ALTER TABLE `updates_include`
CHANGE COLUMN `state` `state` ENUM('RELEASED','ARCHIVED','CUSTOM','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.' COLLATE 'utf8mb4_unicode_ci' AFTER `path`;
DELETE FROM `updates_include` WHERE `path` = '$/data/sql/updates/pending_db_auth';
INSERT INTO `updates_include` (`path`, `state`) VALUES
('$/data/sql/updates/pending_db_auth', 'PENDING');
@@ -0,0 +1,11 @@
-- DB update 2025_01_31_00 -> 2025_02_12_00
DROP TABLE IF EXISTS `active_arena_season`;
CREATE TABLE `active_arena_season` (
`season_id` TINYINT UNSIGNED NOT NULL,
`season_state` TINYINT UNSIGNED NOT NULL COMMENT 'Supported 2 states: 0 - disabled; 1 - in progress.'
)
CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci
ENGINE = InnoDB;
INSERT INTO `active_arena_season` (`season_id`, `season_state`) VALUES (8, 1);
@@ -0,0 +1,11 @@
-- DB update 2025_02_12_00 -> 2025_02_16_00
--
ALTER TABLE `updates`
CHANGE COLUMN `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.' COLLATE 'utf8mb4_unicode_ci' AFTER `hash`;
ALTER TABLE `updates_include`
CHANGE COLUMN `state` `state` ENUM('RELEASED','ARCHIVED','CUSTOM','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.' COLLATE 'utf8mb4_unicode_ci' AFTER `path`;
DELETE FROM `updates_include` WHERE `path` = '$/data/sql/updates/pending_db_characters';
INSERT INTO `updates_include` (`path`, `state`) VALUES
('$/data/sql/updates/pending_db_characters', 'PENDING');
@@ -0,0 +1,96 @@
-- DB update 2025_02_10_01 -> 2025_02_12_00
DROP TABLE IF EXISTS `arena_season_reward_group`;
CREATE TABLE `arena_season_reward_group` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`arena_season` TINYINT UNSIGNED NOT NULL,
`criteria_type` ENUM('pct', 'abs') NOT NULL DEFAULT 'pct' COMMENT 'Determines how rankings are evaluated: "pct" - percentage-based (e.g., top 20% of the ladder), "abs" - absolute position-based (e.g., top 10 players).',
`min_criteria` FLOAT NOT NULL,
`max_criteria` FLOAT NOT NULL,
`reward_mail_template_id` INT UNSIGNED,
`reward_mail_subject` VARCHAR(255),
`reward_mail_body` TEXT,
`gold_reward` INT UNSIGNED
)
CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci
ENGINE = InnoDB;
-- Season 8
INSERT INTO `arena_season_reward_group` (`id`, `arena_season`, `criteria_type`, `min_criteria`, `max_criteria`, `reward_mail_template_id`, `reward_mail_subject`, `reward_mail_body`, `gold_reward`) VALUES
(1, 8, 'abs', 1, 1, 0, '', '', 0),
(2, 8, 'pct', 0, 0.5, 287, '', '', 0),
(3, 8, 'pct', 0.5, 3, 0, '', '', 0),
(4, 8, 'pct', 3, 10, 0, '', '', 0),
(5, 8, 'pct', 10, 35, 0, '', '', 0),
-- Season 7
(6, 7, 'abs', 1, 1, 0, '', '', 0),
(7, 7, 'pct', 0, 0.5, 286, '', '', 0),
(8, 7, 'pct', 0.5, 3, 0, '', '', 0),
(9, 7, 'pct', 3, 10, 0, '', '', 0),
(10, 7, 'pct', 10, 35, 0, '', '', 0),
-- Season 6
(11, 6, 'abs', 1, 1, 0, '', '', 0),
(12, 6, 'pct', 0, 0.5, 267, '', '', 0),
(13, 6, 'pct', 0.5, 3, 0, '', '', 0),
(14, 6, 'pct', 3, 10, 0, '', '', 0),
(15, 6, 'pct', 10, 35, 0, '', '', 0),
-- Season 5
(16, 5, 'abs', 1, 1, 0, '', '', 0),
(17, 5, 'pct', 0, 0.5, 266, '', '', 0),
(18, 5, 'pct', 0.5, 3, 0, '', '', 0),
(19, 5, 'pct', 3, 10, 0, '', '', 0),
(20, 5, 'pct', 10, 35, 0, '', '', 0);
DROP TABLE IF EXISTS `arena_season_reward`;
CREATE TABLE `arena_season_reward` (
`group_id` INT NOT NULL COMMENT 'id from arena_season_reward_group table',
`type` ENUM('achievement', 'item') NOT NULL DEFAULT 'achievement',
`entry` INT UNSIGNED NOT NULL COMMENT 'For item type - item entry, for achievement - achevement id.',
PRIMARY KEY (`group_id`, `type`, `entry`)
)
CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci
ENGINE = InnoDB;
-- Season 8
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (1, 'achievement', 3336);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (2, 'item', 50435);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (2, 'achievement', 2091);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (3, 'achievement', 2092);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (4, 'achievement', 2093);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (5, 'achievement', 2090);
-- Season 7
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (6, 'achievement', 3336);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (7, 'item', 47840);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (7, 'achievement', 2091);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (8, 'achievement', 2092);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (9, 'achievement', 2093);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (10, 'achievement', 2090);
-- Season 6
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (11, 'achievement', 3336);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (12, 'item', 46171);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (12, 'achievement', 2091);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (13, 'achievement', 2092);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (14, 'achievement', 2093);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (15, 'achievement', 2090);
-- Season 5
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (16, 'achievement', 3336);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (17, 'item', 46708);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (17, 'achievement', 2091);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (18, 'achievement', 2092);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (19, 'achievement', 2093);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES (20, 'achievement', 2090);
DELETE FROM `command` WHERE `name` IN ('arena season start', 'arena season reward', 'arena season set state', 'arena season deleteteams');
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('arena season start', 3, 'Syntax: .arena season start $season_id\nStarts a new arena season, places the correct vendors, and sets the new season state to IN PROGRESS.');
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('arena season reward', 3, 'Syntax: .arena season reward $brackets\nBuilds a ladder by combining team brackets and provides rewards from the arena_season_reward table.\nExample usage:\n \n# Combine all brackets, build a ladder, and distribute rewards among them\n.arena season reward all\n \n# Build ladders separately for 2v2, 3v3, and 5v5 brackets so each bracket receives its own rewards\n.arena season reward 2\n.arena season reward 3\n.arena season reward 5\n \n# Combine 2v2 and 3v3 brackets and distribute rewards\n.arena season reward 2,3');
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('arena season deleteteams', 3, 'Syntax: .arena season deleteteams\nDeletes ALL arena teams.');
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('arena season set state', 3, 'Syntax: .arena season set state $state\nChanges the state for the current season.\nAvailable states:\n 0 - disabled. Players can\'t queue for the arena.\n 1 - in progress. Players can use arena-related functionality.');
DELETE FROM `achievement_reward` WHERE `ID` IN (3336, 2091, 2092, 2093, 2090);
INSERT INTO `achievement_reward` (`ID`, `TitleA`, `TitleH`, `ItemID`, `Sender`, `Subject`, `Body`, `MailTemplateID`) VALUES
(3336, 157, 157, 0, 0, '', '', 0),
(2091, 42, 42, 0, 0, '', '', 0),
(2092, 43, 43, 0, 0, '', '', 0),
(2093, 44, 44, 0, 0, '', '', 0),
(2090, 45, 45, 0, 0, '', '', 0);
@@ -0,0 +1,3 @@
-- DB update 2025_02_12_00 -> 2025_02_12_01
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|2147483648 WHERE `entry` IN (25166, 25165);
@@ -0,0 +1,7 @@
-- DB update 2025_02_12_01 -> 2025_02_13_00
--
DELETE FROM `spelldifficulty_dbc` WHERE `ID` IN (28796, 28794, 28798);
INSERT INTO `spelldifficulty_dbc` (`ID`, `DifficultySpellID_1`, `DifficultySpellID_2`, `DifficultySpellID_3`, `DifficultySpellID_4`) VALUES
(28796, 28796, 54098, 0, 0),
(28794, 28794, 54099, 0, 0),
(28798, 28798, 54100, 0, 0);
@@ -0,0 +1,25 @@
-- DB update 2025_02_13_00 -> 2025_02_13_01
--
DELETE FROM `creature_text` WHERE `CreatureID` = 24844 AND `GroupID` = 1;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(24844, 1, 0, 'Madrigosa deserved a far better fate. You did what had to be done, but this battle is far from over!', 14, 0, 100, 25261, 3, 'Kalecgos (SWP) - SAY_KALECGOS_MADRIGOSA');
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24844);
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
(24844, 0, 0, 1, 34, 0, 100, 0, 0, 6, 0, 0, 0, 0, 5, 293, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 6 - Play Emote 293'),
(24844, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 6 - Set hover 0'),
(24844, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 67, 0, 2000, 2000, 0, 0, 100, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 6 - Create Timed Event'),
(24844, 0, 3, 4, 59, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 44762, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Timed Event 0 Triggered - Cast \'Camera Shake - Med\''),
(24844, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 227, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Timed Event 0 Triggered - Set Scale to 1%'),
(24844, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 67, 1, 1000, 1000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Timed Event 0 Triggered - Create Timed Event'),
(24844, 0, 6, 7, 59, 0, 100, 0, 1, 0, 0, 0, 0, 0, 11, 46307, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Timed Event 1 Triggered - Cast \'Scrying Orb Kill Credit\''),
(24844, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 24085, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Timed Event 1 Triggered - Cast \'Transform Visual\''),
(24844, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 44670, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Timed Event 1 Triggered - Cast \'KalecgosTransform into Kalec\''),
(24844, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 36, 24848, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Timed Event 1 Triggered - Update Template To \'Kalecgos\''),
(24844, 0, 10, 11, 34, 0, 100, 0, 8, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 1 - Say Line 1'),
(24844, 0, 11, 0, 61, 0, 100, 1, 0, 0, 0, 0, 0, 0, 67, 2, 4000, 4000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 1 - Create Timed Event'),
(24844, 0, 12, 0, 59, 0, 100, 0, 2, 0, 0, 0, 0, 0, 69, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1511.65, 550.702, 25.5101, 0, 'Kalecgos - On Timed Event 2 Triggered - Move To Self'),
(24844, 0, 13, 14, 34, 0, 100, 0, 8, 2, 0, 0, 0, 0, 11, 46650, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 2 - Cast \'Open Brutallus Back Door\''),
(24844, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 67, 3, 4000, 4000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 2 - Create Timed Event'),
(24844, 0, 15, 0, 59, 0, 100, 0, 3, 0, 0, 0, 0, 0, 69, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1648.26, 519.377, 165.848, 0, 'Kalecgos - On Timed Event 3 Triggered - Move To Self'),
(24844, 0, 16, 0, 34, 0, 100, 0, 8, 3, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kalecgos - On Reached Point 3 - Despawn Instant');
@@ -0,0 +1,23 @@
-- DB update 2025_02_13_01 -> 2025_02_14_00
-- Update creature 'Chemical Wagon' with sniffed values
-- updated spawns
DELETE FROM `creature` WHERE (`id1` IN (38035))
AND (`guid` IN (244545, 244546, 244547, 244563, 244606, 244607, 244608, 244609, 244610, 244626, 244627, 244628));
INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
(244545, 38035, 571, 1, 1, 0, 5576.52001953125, 124.3194427490234375, 150.7883148193359375, 0, 60, 0, 0, 0, 0, 0, "", 47966, 1, NULL),
(244546, 38035, 571, 1, 1, 0, 5579.13623046875, 179.282989501953125, 149.988311767578125, 0, 60, 0, 0, 0, 0, 0, "", 47966, 1, NULL),
(244547, 38035, 571, 1, 1, 0, 5592.712890625, 68.626739501953125, 148.6106414794921875, 0, 60, 0, 0, 0, 0, 0, "", 47966, 1, NULL),
(244563, 38035, 0, 1, 1, 0, -50.1857643127441406, 1150.40283203125, 66.0908966064453125, 0, 60, 0, 0, 0, 0, 0, "", 48120, 1, NULL),
(244606, 38035, 0, 1, 1, 0, -9454.0869140625, 522.810791015625, 55.90142440795898437, 0, 60, 0, 0, 0, 0, 0, "", 47966, 1, NULL),
(244607, 38035, 1, 1, 1, 0, 1264.05908203125, -4084.616455078125, 25.5284423828125, 6.091198921203613281, 60, 0, 0, 0, 0, 0, "", 52237, 1, NULL),
(244608, 38035, 530, 1, 1, 0, -1808.5399169921875, 4844.61279296875, 1.952302336692810058, 0, 60, 0, 0, 0, 0, 0, "", 52237, 1, NULL),
(244609, 38035, 1, 1, 1, 0, 6764.822265625, -4905.1337890625, 774.3394775390625, 0, 60, 0, 0, 0, 0, 0, "", 52237, 1, NULL),
(244610, 38035, 571, 1, 1, 0, 5638.01904296875, 107.0156326293945312, 154.995635986328125, 1.099557399749755859, 60, 0, 0, 0, 0, 0, "", 47966, 1, NULL),
(244626, 38035, 0, 1, 1, 0, 88.58333587646484375, -2477.989501953125, 124.8402938842773437, 0, 60, 0, 0, 0, 0, 0, "", 52237, 1, NULL),
(244627, 38035, 1, 1, 1, 0, -3370.935791015625, -4168.5537109375, 17.8669586181640625, 0, 60, 0, 0, 0, 0, 0, "", 52237, 1, NULL),
(244628, 38035, 0, 1, 1, 0, -406.282989501953125, 163.5868072509765625, 75.5319976806640625, 0, 60, 0, 0, 0, 0, 0, "", 52237, 1, NULL);
-- enable all spawns for eventEntry 8
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 8)
AND (`guid` IN (SELECT `guid` FROM `creature` WHERE `id1` IN (38035)));
INSERT INTO `game_event_creature` (SELECT 8, `guid` FROM `creature` WHERE `id1` IN (38035));
+239
View File
@@ -0,0 +1,239 @@
-- DB update 2025_02_14_00 -> 2025_02_15_00
-- Dragonflayer Invader - Set detection_range
UPDATE `creature_template` SET `detection_range` = 25 WHERE (`entry` = 24051);
-- Dragonflayer Invader - Set position, spawntimesecs, MovementType
UPDATE `creature` SET `position_x` = 762.207, `position_y` = -4894.027, `position_z` = 2.9162, `orientation` = 4.143, `spawntimesecs` = 15, `MovementType` = 2 WHERE (`guid` = 118766 AND `id1` = 24051);
UPDATE `creature` SET `position_x` = 762.207, `position_y` = -4894.027, `position_z` = 2.9162, `orientation` = 4.143, `spawntimesecs` = 37, `MovementType` = 2 WHERE (`guid` = 118770 AND `id1` = 24051);
UPDATE `creature` SET `position_x` = 766.356, `position_y` = -4971.977, `position_z` = 2.2148, `orientation` = 2.621, `spawntimesecs` = 20, `MovementType` = 2 WHERE (`guid` = 118767 AND `id1` = 24051);
UPDATE `creature` SET `position_x` = 766.356, `position_y` = -4971.977, `position_z` = 2.2148, `orientation` = 2.621, `spawntimesecs` = 24, `MovementType` = 2 WHERE (`guid` = 118771 AND `id1` = 24051);
UPDATE `creature` SET `position_x` = 803.852, `position_y` = -4963.192, `position_z` = 0.5461, `orientation` = 3.055, `spawntimesecs` = 28, `MovementType` = 2 WHERE (`guid` = 118768 AND `id1` = 24051);
UPDATE `creature` SET `position_x` = 803.852, `position_y` = -4963.192, `position_z` = 0.5461, `orientation` = 3.055, `spawntimesecs` = 32, `MovementType` = 2 WHERE (`guid` = 118772 AND `id1` = 24051);
UPDATE `creature` SET `position_x` = 789.250, `position_y` = -4909.428, `position_z` = 0.1650, `orientation` = 3.562, `spawntimesecs` = 18, `MovementType` = 2 WHERE (`guid` = 118769 AND `id1` = 24051);
UPDATE `creature` SET `position_x` = 789.250, `position_y` = -4909.428, `position_z` = 0.1650, `orientation` = 3.562, `spawntimesecs` = 44, `MovementType` = 2 WHERE (`guid` = 118773 AND `id1` = 24051);
-- Dragonflayer Invader - SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE (`entry` = 24051);
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24051);
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
(24051, 0, 0, 0, 9, 0, 100, 0, 5700, 11700, 5700, 11700, 8, 25, 11, 27577, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Invader - In Combat - Cast Intercept'),
(24051, 0, 1, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Invader - Corpse removed after 5s'),
(24051, 0, 2, 0, 9, 0, 100, 0, 8700, 14700, 8700, 14700, 10, 25, 11, 42870, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Invader - In Combat - Throw Dragonflayer Harpoon'),
(24051, 0, 3, 0, 4, 0, 25, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Invader - When AGRO - Talk');
-- Dragonflayer Invader - Set PathID and Waypoints
DELETE FROM `creature_addon` WHERE (`guid` = 118766 AND `path_id` = 1187660);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118766, 1187660, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 118770 AND `path_id` = 1187700);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118770, 1187700, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 118769 AND `path_id` = 1187690);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118769, 1187690, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 118773 AND `path_id` = 1187730);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118773, 1187730, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 118767 AND `path_id` = 1187670);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118767, 1187670, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 118771 AND `path_id` = 1187710);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118771, 1187710, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 118768 AND `path_id` = 1187680);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118768, 1187680, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 118772 AND `path_id` = 1187720);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (118772, 1187720, 0, 0, 1, 0, 0, NULL);
DELETE FROM `waypoint_data` WHERE (`id` = 1187660);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187660, 1, 751.2, -4911.4, 2.8, NULL, 0, 1, 0, 100, 0),
(1187660, 2, 738.44, -4927.28, 5.868, NULL, 0, 1, 0, 100, 0),
(1187660, 3, 714.15, -4936.8, 6.437, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1187700);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187700, 1, 751.2, -4911.4, 2.8, NULL, 0, 1, 0, 100, 0),
(1187700, 2, 738.44, -4927.28, 5.868, NULL, 0, 1, 0, 100, 0),
(1187700, 3, 714.15, -4936.8, 6.437, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1187690);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187690, 1, 742.35, -4934.59, 5.643, NULL, 0, 1, 0, 100, 0),
(1187690, 2, 713.52, -4951.19, 4.560, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1187730);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187730, 1, 742.35, -4934.59, 5.643, NULL, 0, 1, 0, 100, 0),
(1187730, 2, 713.52, -4951.19, 4.560, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1187670);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187670, 1, 747.06, -4958.82, 2.191, NULL, 0, 1, 0, 100, 0),
(1187670, 2, 732.09, -4983.97, 4.683, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1187710);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187710, 1, 747.06, -4958.82, 2.191, NULL, 0, 1, 0, 100, 0),
(1187710, 2, 732.09, -4983.97, 4.683, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1187680);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187680, 1, 747.06, -4958.82, 2.191, NULL, 0, 1, 0, 100, 0),
(1187680, 2, 732.09, -4983.97, 4.683, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1187720);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1187720, 1, 747.06, -4958.82, 2.191, NULL, 0, 1, 0, 100, 0),
(1187720, 2, 732.09, -4983.97, 4.683, NULL, 0, 1, 0, 100, 0);
-- Dragonflayer Worg - Set detection_range, skinloot
UPDATE `creature_template` SET `detection_range` = 25, `skinloot` = 0 WHERE (`entry` = 24063);
-- Dragonflayer Worg - Set position, spawntimesecs, MovementType
UPDATE `creature` SET `position_x` = 765.90, `position_y` = -4908.08, `position_z` = 1.91220, `orientation` = 4.45437, `spawntimesecs` = 12, `MovementType` = 2 WHERE (`guid` = 120557 AND `id1` = 24063);
UPDATE `creature` SET `position_x` = 769.99, `position_y` = -4892.57, `position_z` = 2.75514, `orientation` = 3.57080, `spawntimesecs` = 25, `MovementType` = 2 WHERE (`guid` = 120558 AND `id1` = 24063);
UPDATE `creature` SET `position_x` = 764.44, `position_y` = -4947.20, `position_z` = 2.50482, `orientation` = 1.99215, `spawntimesecs` = 15, `MovementType` = 2 WHERE (`guid` = 120559 AND `id1` = 24063);
UPDATE `creature` SET `position_x` = 779.27, `position_y` = -4960.70, `position_z` = 1.67408, `orientation` = 3.18596, `spawntimesecs` = 28, `MovementType` = 2 WHERE (`guid` = 120560 AND `id1` = 24063);
UPDATE `creature` SET `position_x` = 809.12, `position_y` = -4942.37, `position_z` = 0.99842, `orientation` = 3.28884, `spawntimesecs` = 23, `MovementType` = 2 WHERE (`guid` = 120561 AND `id1` = 24063);
-- Dragonflayer Worg - SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE (`entry` = 24063);
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24063);
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
(24063, 0, 1, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Worg - Corpse removed after 5s'),
(24063, 0, 2, 0, 0, 0, 70, 0, 5000, 10000, 5000, 10000, 0, 0, 11, 7367, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Worg - Cast Infected Bite');
-- Dragonflayer Worg - Set PathID
DELETE FROM `creature_addon` WHERE (`guid` = 120557 AND `path_id` = 1205570);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (120557, 1205570, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 120558 AND `path_id` = 1205580);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (120558, 1205580, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 120559 AND `path_id` = 1205590);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (120559, 1205590, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 120560 AND `path_id` = 1205600);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (120560, 1205600, 0, 0, 1, 0, 0, NULL);
DELETE FROM `creature_addon` WHERE (`guid` = 120561 AND `path_id` = 1205610);
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`)
VALUES (120561, 1205610, 0, 0, 1, 0, 0, NULL);
-- Dragonflayer Worg - Set Waypoints
DELETE FROM `waypoint_data` WHERE (`id` = 1205570);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1205570, 1, 761.489, -4920.273, 2.7210, NULL, 0, 1, 0, 100, 0),
(1205570, 2, 734.507, -4943.745, 5.4293, NULL, 0, 1, 0, 100, 0),
(1205570, 3, 720.222, -4967.502, 5.9298, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1205580);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1205580, 1, 742.317, -4907.741, 3.3050, NULL, 0, 1, 0, 100, 0),
(1205580, 2, 735.411, -4925.406, 6.1833, NULL, 0, 1, 0, 100, 0),
(1205580, 3, 716.655, -4939.511, 5.9821, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1205590);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1205590, 1, 757.529, -4931.115, 4.1180, NULL, 0, 1, 0, 100, 0),
(1205590, 2, 733.010, -4944.042, 5.4884, NULL, 0, 1, 0, 100, 0),
(1205590, 3, 716.655, -4939.511, 5.9821, NULL, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1205600);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1205600, 1, 718.531, -4963.948, 5.33493, 4.47765, 0, 1, 0, 100, 0),
(1205600, 2, 718.978, -4979.252, 6.09930, 4.61902, 0, 1, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE (`id` = 1205610);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`)
VALUES
(1205610, 1, 809.12, -4942.37, 0.99842, NULL, 0, 1, 0, 100, 0),
(1205610, 2, 749.53, -4933.65, 5.18420, NULL, 0, 1, 0, 100, 0),
(1205610, 3, 734.90, -4979.91, 4.04356, NULL, 0, 1, 0, 100, 0),
(1205610, 4, 722.70, -4987.73, 6.33793, NULL, 0, 1, 0, 100, 0);
-- Valgarde Defender - Set Comment
UPDATE `creature` SET `Comment` = "has guid specific SAI" WHERE (`id1` = 23739) AND (`guid` IN (113665, 113664, 113644, 113663));
-- Valgarde Defender - Add 'DONT_OVERRIDE_SAI_ENTRY' Flag
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|134217728 WHERE (`entry` = 23739);
-- Valgarde Defender - Set position and spawntimesecs for Defenders outside the gate
UPDATE `creature` SET `position_x` = 717.426, `position_y` = -4977.064, `position_z` = 6.1085, `orientation` = 0.9687, `spawntimesecs` = 45, `MovementType` = 0 WHERE (`guid` = 113665 AND `id1` = 23739);
UPDATE `creature` SET `position_x` = 717.615, `position_y` = -4991.929, `position_z` = 6.7516, `orientation` = 0.1786, `spawntimesecs` = 45, `MovementType` = 0 WHERE (`guid` = 113664 AND `id1` = 23739);
UPDATE `creature` SET `position_x` = 705.699, `position_y` = -4934.567, `position_z` = 6.4967, `orientation` = 0.3325, `spawntimesecs` = 45, `MovementType` = 0 WHERE (`guid` = 113644 AND `id1` = 23739);
UPDATE `creature` SET `position_x` = 709.157, `position_y` = -4947.396, `position_z` = 4.4368, `orientation` = 0.4260, `spawntimesecs` = 45, `MovementType` = 0 WHERE (`guid` = 113663 AND `id1` = 23739);
-- Valgarde Defender - SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE (`entry` = 23739);
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 23739);
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
(23739, 0, 0, 0, 0, 0, 100, 0, 0, 0, 2300, 3900, 0, 0, 11, 6660, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - In Combat - Cast Shoot'),
(23739, 0, 1, 0, 0, 0, 100, 0, 5000, 10000, 3000, 5000, 0, 0, 11, 31827, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - In Combat - Cast Heroic Strike');
-- Valgarde Defender - Set Guid SmartAI for Defenders outside the gate
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = -113665);
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
(-113665, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - Corpse removed after 5s'),
(-113665, 0, 3, 0, 4, 0, 15, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - When AGRO - Talk'),
(-113665, 0, 4, 0, 0, 0, 100, 0, 1000, 2000, 1000, 2000, 0, 0, 39, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - In Combat - Call HELP');
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = -113664);
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
(-113664, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - Corpse removed after 5s'),
(-113664, 0, 3, 0, 4, 0, 15, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - When AGRO - Talk'),
(-113664, 0, 4, 0, 0, 0, 100, 0, 1000, 2000, 1000, 2000, 0, 0, 39, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - In Combat - Call HELP');
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = -113644);
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
(-113644, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - Corpse removed after 5s'),
(-113644, 0, 3, 0, 4, 0, 15, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - When AGRO - Talk'),
(-113644, 0, 4, 0, 0, 0, 100, 0, 1000, 2000, 1000, 2000, 0, 0, 39, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - In Combat - Call HELP');
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = -113663);
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
(-113663, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - Corpse removed after 5s'),
(-113663, 0, 3, 0, 4, 0, 15, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - When AGRO - Talk'),
(-113663, 0, 4, 0, 0, 0, 100, 0, 1000, 2000, 1000, 2000, 0, 0, 39, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Defender - In Combat - Call HELP');
-- Valgarde Defender - Text speach
DELETE FROM `creature_text` WHERE `CreatureID` = 23739;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`)
VALUES
(23739, 0, 0, 'Don\'t let those monsters through the gate! Stand firm, soldiers!', 12, 0, 100, 0, 0, 0, 22692, 0, 'Valgarde Defender'),
(23739, 0, 1, 'FIRE! FIRE!', 12, 0, 100, 0, 0, 0, 22689, 0, 'Valgarde Defender'),
(23739, 0, 2, 'Shoot it between the eyes! Those beasts are vulnerable there!', 12, 0, 100, 0, 0, 0, 22690, 0, 'Valgarde Defender'),
(23739, 0, 3, 'Invader incoming!', 12, 0, 100, 0, 0, 0, 22691, 0, 'Valgarde Defender'),
(23739, 0, 4, 'It\'s coming right for us!', 12, 0, 100, 0, 0, 0, 22688, 0, 'Valgarde Defender');
-- Valgarde Harpoon Target - SmartAI and Template Movement (Movement values Sniffed).
DELETE FROM `creature_template_movement` WHERE (`CreatureId` = 23821);
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES
(23821, 0, 0, 1, 1, 0, 0, 0);
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 23821;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 23821);
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
(23821, 0, 0, 0, 8, 0, 100, 512, 61588, 0, 0, 0, 0, 0, 11, 52955, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Harpoon Target - On Spellhit \'Blazing Harpoon\' - Cast \'Torch\''),
(23821, 0, 1, 1, 1, 0, 100, 513, 1000, 1000, 1000, 1000, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Harpoon Target - Out of Combat - Disable Combat Movement (No Repeat)'),
(23821, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Harpoon Target - Out of Combat - Set Reactstate Passive (No Repeat)');
@@ -0,0 +1,10 @@
-- DB update 2025_02_15_00 -> 2025_02_15_01
-- Fix Missing Link
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 23821;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 23821);
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
(23821, 0, 0, 0, 8, 0, 100, 512, 61588, 0, 0, 0, 0, 0, 11, 52955, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Harpoon Target - On Spellhit \'Blazing Harpoon\' - Cast \'Torch\''),
(23821, 0, 1, 2, 1, 0, 100, 513, 1000, 1000, 1000, 1000, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Harpoon Target - Out of Combat - Disable Combat Movement (No Repeat)'),
(23821, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Valgarde Harpoon Target - Out of Combat - Set Reactstate Passive (No Repeat)');
@@ -0,0 +1,17 @@
-- DB update 2025_02_15_01 -> 2025_02_15_02
UPDATE `creature_template` SET `ScriptName`='', `AIName` = 'SmartAI' WHERE (`entry` = 28591);
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28591) AND (`source_type` = 0);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `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
(28591, 0, 0, 1, 11, 0, 100, 512, 0, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Ghoul Feeding KC Bunny - On Respawn - Store Targetlist'),
(28591, 0, 1, 2, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 0, 19, 28565, 30, 0, 0, 0, 0, 0, 0, 'Ghoul Feeding KC Bunny - On Respawn - Send Target 1'),
(28591, 0, 2, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 45, 28591, 0, 0, 0, 0, 0, 19, 28565, 30, 0, 0, 0, 0, 0, 0, 'Ghoul Feeding KC Bunny - On Respawn - Set Data 28591 0'),
(28591, 0, 3, 4, 38, 0, 100, 1, 28565, 0, 0, 0, 0, 0, 11, 52030, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Ghoul Feeding KC Bunny - On Data Set 28565 0 - Cast \'Kill Credit\' (No Repeat)'),
(28591, 0, 4, 5, 61, 0, 100, 513, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Ghoul Feeding KC Bunny - On Data Set 28565 0 - Despawn Instant (No Repeat)'),
(28591, 0, 5, 0, 61, 0, 100, 513, 0, 0, 0, 0, 0, 0, 41, 3000, 0, 0, 0, 0, 0, 20, 190656, 5, 0, 0, 0, 0, 0, 0, 'Ghoul Feeding KC Bunny - On Data Set 28565 0 - Despawn In 3000 ms (No Repeat)');
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28565) AND (`source_type` = 0);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `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
(28565, 0, 0, 0, 38, 0, 100, 0, 28591, 0, 40000, 40000, 0, 0, 69, 1, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 'Decaying Ghoul - On Data Set 28591 0 - Move To Stored'),
(28565, 0, 1, 2, 34, 0, 100, 512, 8, 1, 0, 0, 0, 0, 45, 28565, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 'Decaying Ghoul - On Reached Point 1 - Set Data 28565 0'),
(28565, 0, 2, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 5, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Decaying Ghoul - On Reached Point 1 - Play Emote 7');
@@ -0,0 +1,77 @@
-- DB update 2025_02_15_02 -> 2025_02_16_00
-- Chillmere Tidehunter
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24460;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24460);
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
(24460, 0, 0, 0, 9, 0, 100, 0, 5000, 10000, 10000, 15000, 0, 5, 11, 6533, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Chillmere Tidehunter - Within 0-5 Range - Cast \'Net\''),
(24460, 0, 2, 0, 9, 0, 100, 0, 1000, 2000, 1000, 2000, 5, 30, 11, 38556, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Chillmere Tidehunter - Within 5-30 Range - Cast \'Throw\'');
-- Chillmere Coastrunner
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24459;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24459);
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
(24459, 0, 0, 0, 0, 0, 100, 0, 6000, 12000, 12000, 18000, 0, 0, 11, 14874, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Chillmere Coastrunner - In Combat - Cast \'Rupture\''),
(24459, 0, 1, 0, 0, 0, 100, 0, 12000, 18000, 8000, 16000, 0, 0, 11, 28428, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Chillmere Coastrunner - In Combat - Cast \'Instant Poison\'');
-- Chillmere Oracle
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24461;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24461);
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
(24461, 0, 0, 0, 9, 0, 100, 0, 1000, 2000, 8000, 45000, 0, 5, 11, 11831, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Chillmere Oracle - Within 0-5 Range - Cast \'Frost Nova\''),
(24461, 0, 1, 0, 0, 0, 100, 0, 4000, 8000, 12000, 18000, 0, 0, 11, 49935, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Chillmere Oracle - In Combat - Cast \'Hex of the Murloc\''),
(24461, 0, 2, 0, 0, 0, 100, 0, 8000, 12000, 8000, 12000, 0, 0, 11, 49906, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Chillmere Oracle - In Combat - Cast \'Ice Lance\'');
-- Rotgill
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24546;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24546);
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
(24546, 0, 0, 0, 0, 0, 100, 0, 2000, 4000, 2000, 12000, 0, 0, 11, 49956, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Rotgill - In Combat - Cast \'Searing Wound\''),
(24546, 0, 1, 0, 2, 0, 100, 0, 0, 25, 0, 0, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Rotgill - Between 0-25% Health - Cast \'Enrage\'');
-- Reef Cow
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24797;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24797);
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
(24797, 0, 0, 0, 0, 0, 100, 0, 4000, 6000, 6000, 16000, 0, 0, 11, 50169, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Reef Cow - In Combat - Cast \'Flipper Thwack\'');
-- Blood Shade
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24872;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24872);
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
(24872, 0, 0, 0, 0, 0, 100, 0, 4000, 12000, 4000, 12000, 0, 0, 11, 49843, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Blood Shade - In Combat - Cast \'Vexed Blood of the Ancestors\'');
-- Risen Vrykul Ancestor
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24871;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24871);
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
(24871, 0, 0, 0, 0, 0, 100, 0, 10000, 30000, 30000, 60000, 0, 0, 11, 49841, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Risen Vrykul Ancestor - In Combat - Cast \'Perturbing Strike\'');
-- Onslaught Infantry
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27330;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27330);
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
(27330, 0, 0, 0, 0, 0, 100, 0, 2000, 4000, 2000, 4000, 0, 0, 11, 50713, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Infantry - In Combat - Cast \'Unrelenting Onslaught\'');
-- Forgotten Captain
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27220;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27220);
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
(27220, 0, 0, 0, 0, 0, 100, 0, 6000, 9000, 8000, 12000, 0, 0, 11, 51591, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Captain - In Combat - Cast \'Stormhammer\'');
-- Old Crystalbark
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 32357;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 32357);
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
(32357, 0, 0, 0, 0, 0, 100, 0, 3700, 16200, 19200, 28000, 0, 0, 11, 50506, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Old Crystalbark - In Combat - Cast \'Mark of Detonation\''),
(32357, 0, 1, 0, 0, 0, 100, 0, 1625, 8100, 9600, 14000, 0, 0, 11, 60903, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Old Crystalbark - In Combat - Cast \'Arcane Breath\'');
@@ -0,0 +1,11 @@
-- DB update 2025_02_16_00 -> 2025_02_16_01
--
ALTER TABLE `updates`
CHANGE COLUMN `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.' COLLATE 'utf8mb4_unicode_ci' AFTER `hash`;
ALTER TABLE `updates_include`
CHANGE COLUMN `state` `state` ENUM('RELEASED','ARCHIVED','CUSTOM','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.' COLLATE 'utf8mb4_unicode_ci' AFTER `path`;
DELETE FROM `updates_include` WHERE `path` = '$/data/sql/updates/pending_db_world';
INSERT INTO `updates_include` (`path`, `state`) VALUES
('$/data/sql/updates/pending_db_world', 'PENDING');
@@ -0,0 +1,2 @@
-- DB update 2025_02_16_01 -> 2025_02_16_02
UPDATE `quest_template` SET `AllowableRaces` = 0 WHERE (`ID` = 11880);
@@ -0,0 +1,14 @@
-- DB update 2025_02_16_02 -> 2025_02_16_03
--
SET @ZELIEK = 16063;
UPDATE `creature_text` SET `Comment` = 'zeliek SAY_ZELI_DIALOG1' WHERE (`CreatureID` = @ZELIEK) AND (`GroupID` = 5);
UPDATE `creature_text` SET `Comment` = 'zeliek SAY_ZELI_DIALOG2' WHERE (`CreatureID` = @ZELIEK) AND (`GroupID` = 6);
SET @KORTHAZZ = 16064;
UPDATE `creature_text` SET `Comment` = 'korthazz SAY_KORT_DIALOG1' WHERE (`CreatureID` = @KORTHAZZ) AND (`GroupID` = 5);
UPDATE `creature_text` SET `Comment` = 'korthazz SAY_KORT_DIALOG2' WHERE (`CreatureID` = @KORTHAZZ) AND (`GroupID` = 6);
SET @BLAUMEUX = 16065;
UPDATE `creature_text` SET `Comment` = 'blaumeux SAY_BLAU_DIALOG1' WHERE (`CreatureID` = @BLAUMEUX) AND (`GroupID` = 5);
UPDATE `creature_text` SET `Comment` = 'blaumeux SAY_BLAU_DIALOG2' WHERE (`CreatureID` = @BLAUMEUX) AND (`GroupID` = 6);
SET @RIVENDARE = 30549;
UPDATE `creature_text` SET `Comment` = 'rivendare SAY_RIVE_DIALOG1' WHERE (`CreatureID` = @RIVENDARE) AND (`GroupID` = 5);
UPDATE `creature_text` SET `Comment` = 'rivendare SAY_RIVE_DIALOG2' WHERE (`CreatureID` = @RIVENDARE) AND (`GroupID` = 6);
@@ -0,0 +1,21 @@
-- DB update 2025_02_16_03 -> 2025_02_18_00
-- Remove Wrong Spawns
DELETE FROM `creature` WHERE `id1` = 28745;
-- Blight Cauldron Bunny 00 SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28739;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28739);
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
(28739, 0, 0, 1, 8, 0, 100, 0, 52227, 0, 0, 0, 0, 0, 11, 52228, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Kill Credit\''),
(28739, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Cauldron Diluted Effect\''),
(28739, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 12, 28745, 4, 30000, 0, 0, 0, 202, 20, 3, 1, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Summon Creature \'Alarmed Blightguard\''),
(28739, 0, 3, 0, 1, 0, 100, 512, 30000, 30000, 30000, 30000, 0, 0, 28, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - Out of Combat - Remove Aura \'Cauldron Diluted Effect\'');
-- Set Random Movement for Alarmed Blightguard
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28745;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28745);
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
(28745, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 89, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Alarmed Blightguard - On Reset - Start Random Movement');
@@ -0,0 +1,7 @@
-- DB update 2025_02_18_00 -> 2025_02_19_00
--
UPDATE `creature_template_addon` SET `auras` = '28305 8273 57989' WHERE (`entry` = 19668);
DELETE FROM `spell_script_names` WHERE `spell_id` = 57989 AND `ScriptName` = 'spell_pri_shadowfiend_death';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(57989, 'spell_pri_shadowfiend_death');
UPDATE `creature_template` SET `ScriptName` = '' WHERE (`entry` = 19668);
@@ -0,0 +1,36 @@
-- DB update 2025_02_19_00 -> 2025_02_19_01
-- Bjorn Halgurdsson - Set position
UPDATE `creature` SET `position_x` = 1518.61, `position_y` = -5249.85, `position_z` = 215.38, `orientation` = 5.41052, `VerifiedBuild` = 59069 WHERE `guid` = 112513 AND `id1` = 24238;
-- Bjorn Halgurdsson - Set speed_run
UPDATE `creature_template` SET `speed_run` = 1.7435 WHERE (`entry` = 24238);
-- Bjorn Halgurdsson - Set mount
DELETE FROM `creature_addon` WHERE (`guid` IN (112513));
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES
(112513, 0, 22657, 0, 0, 0, 0, NULL);
-- Bjorn Halgurdsson - Set movement
UPDATE `creature_template_movement` SET `Swim` = 0, `Flight` = 0 WHERE (`CreatureId` = 24238);
-- Bjorn Halgurdsson - SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24238;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24238);
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
(24238, 0, 0, 0, 1, 0, 100, 0, 10000, 15000, 45000, 60000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - Out of Combat - Say Line 2'),
(24238, 0, 1, 2, 8, 0, 100, 0, 43315, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Say Line 0'),
(24238, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Say Line 1'),
(24238, 0, 3, 4, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Dismount'),
(24238, 0, 4, 5, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Set hover 0'),
(24238, 0, 5, 6, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Set Fly Off'),
(24238, 0, 6, 7, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Set Reactstate Aggressive'),
(24238, 0, 7, 8, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 19, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Remove Flags Not Attackable'),
(24238, 0, 8, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Spellhit \'Vrykul Insult\' - Start Attacking'),
(24238, 0, 9, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 43371, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Just Died - Cast \'Bjorn Kill Credit\''),
(24238, 0, 10, 0, 0, 0, 100, 0, 5000, 10000, 10000, 15000, 0, 0, 11, 32736, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - In Combat - Cast \'Mortal Strike\''),
(24238, 0, 11, 0, 0, 0, 100, 0, 0, 5000, 10000, 15000, 0, 0, 11, 33661, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - In Combat - Cast \'Crush Armor\''),
(24238, 0, 12, 13, 25, 0, 100, 512, 0, 0, 0, 0, 0, 0, 60, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Reset - Set Fly On'),
(24238, 0, 13, 14, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 207, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Reset - Set hover 1'),
(24238, 0, 14, 15, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Reset - Set Reactstate Passive'),
(24238, 0, 15, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 18, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bjorn Halgurdsson - On Reset - Set Flags Not Attackable');
+112
View File
@@ -0,0 +1,112 @@
-- DB update 2025_02_19_01 -> 2025_02_21_00
DROP TABLE IF EXISTS `antidos_opcode_policies`;
CREATE TABLE `antidos_opcode_policies` (
`Opcode` smallint unsigned NOT NULL,
`Policy` tinyint unsigned NOT NULL,
`MaxAllowedCount` smallint unsigned NOT NULL,
PRIMARY KEY (`Opcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `antidos_opcode_policies` (`Opcode`, `Policy`, `MaxAllowedCount`) VALUES
(393, 1, 200),
(404, 1, 200),
(398, 1, 200),
(102, 1, 200),
(1217, 1, 200),
(643, 1, 200),
(642, 1, 200),
(98, 1, 200),
(1192, 1, 200),
(1218, 1, 200),
(238, 1, 200),
(564, 1, 50),
(565, 1, 50),
(107, 1, 50),
(1065, 1, 50),
(999, 1, 50),
(1131, 1, 50),
(1153, 1, 50),
(177, 1, 50),
(450, 1, 50),
(483, 1, 25),
(1282, 1, 20),
(1016, 1, 20),
(1162, 1, 20),
(1133, 1, 20),
(448, 1, 10),
(452, 1, 10),
(638, 1, 10),
(454, 1, 10),
(1272, 1, 10),
(1139, 1, 10),
(1241, 1, 10),
(56, 1, 10),
(106, 1, 10),
(105, 1, 10),
(711, 1, 10),
(810, 1, 10),
(458, 1, 10),
(120, 1, 10),
(654, 1, 10),
(655, 1, 10),
(445, 1, 10),
(1179, 1, 10),
(1143, 1, 10),
(1144, 1, 10),
(1145, 1, 10),
(1142, 1, 10),
(1193, 1, 10),
(1204, 1, 10),
(839, 1, 10),
(467, 1, 10),
(996, 1, 10),
(600, 4, 5),
(612, 4, 5),
(601, 4, 5),
(54, 1, 3),
(55, 1, 3),
(517, 1, 3),
(519, 1, 3),
(535, 1, 3),
(1264, 1, 3),
(1069, 1, 3),
(1070, 1, 3),
(1071, 1, 3),
(1072, 1, 3),
(1073, 1, 3),
(1210, 1, 3),
(1074, 1, 3),
(1075, 1, 3),
(1077, 1, 3),
(847, 1, 3),
(849, 1, 3),
(850, 1, 3),
(851, 1, 3),
(853, 1, 3),
(852, 1, 3),
(854, 1, 3),
(122, 1, 3),
(130, 1, 3),
(132, 1, 3),
(133, 1, 3),
(141, 1, 3),
(143, 1, 3),
(144, 1, 3),
(145, 1, 3),
(561, 1, 3),
(562, 1, 3),
(563, 1, 3),
(764, 1, 3),
(1004, 1, 3),
(1005, 1, 3),
(1002, 1, 3),
(1003, 1, 3),
(1035, 1, 3),
(497, 1, 3),
(705, 1, 3),
(682, 1, 3),
(809, 1, 3),
(1259, 1, 3),
(910, 1, 3),
(802, 1, 3),
(1203, 1, 150);
@@ -0,0 +1,8 @@
-- DB update 2025_02_21_00 -> 2025_02_21_01
--
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
('spell_eredar_twins_handle_dark_touched_periodic', 'spell_eredar_twins_handle_flame_touched_periodic', 'spell_eredar_twins_handle_flame_touched_flame_sear');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(45342, 'spell_eredar_twins_handle_flame_touched_periodic'),
(45271, 'spell_eredar_twins_handle_dark_touched_periodic'),
(46771, 'spell_eredar_twins_handle_flame_touched_flame_sear');
@@ -0,0 +1,5 @@
-- DB update 2025_02_21_01 -> 2025_02_21_02
--
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24666) AND (`source_type` = 0) AND (`id` IN (4));
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
(24666, 0, 4, 0, 37, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Flame Strike Trigger (Kael - 5Man) - On Initialize - Set Reactstate Passive');
@@ -0,0 +1,4 @@
-- DB update 2025_02_21_02 -> 2025_02_21_03
--
UPDATE `creature_onkill_reputation` SET `RewOnKillRepValue1` = 120 WHERE (`creature_id` = 24664);
UPDATE `creature_onkill_reputation` SET `MaxStanding1` = 7 WHERE `creature_id` IN (24723, 24560, 24664, 24744);
@@ -0,0 +1,3 @@
-- DB update 2025_02_21_03 -> 2025_02_22_00
--
UPDATE `creature_template_movement` SET `Flight` = 2 WHERE `CreatureId` = 24418;
+1
View File
@@ -22,6 +22,7 @@
#include "DetourNavMesh.h" #include "DetourNavMesh.h"
#define MAX_NUMBER_OF_GRIDS 64 #define MAX_NUMBER_OF_GRIDS 64
#define MAX_NUMBER_OF_CELLS 8
#define SIZE_OF_GRIDS 533.3333f #define SIZE_OF_GRIDS 533.3333f
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP' #define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
+17 -7
View File
@@ -138,18 +138,28 @@ namespace Acore::Containers
} }
/* /*
* Select a random element from a container. * @brief Selects a random element from a container that matches the given predicate
*
* @param container Source container to select from
* @param predicate Unary predicate to filter elements
* @return Iterator to the randomly selected element, or end iterator if no elements match the predicate
* *
* Note: container cannot be empty * Note: container cannot be empty
*/ */
template<class C, class Predicate> template<class C, class Predicate>
inline auto SelectRandomContainerElementIf(C const& container, Predicate&& predicate) -> typename std::add_const<decltype(*std::begin(container))>::type& inline auto SelectRandomContainerElementIf(C const& container, Predicate&& predicate) -> decltype(std::begin(container))
{ {
C containerCopy; std::vector<decltype(std::begin(container))> matchingElements;
std::copy_if(std::begin(container), std::end(container), std::inserter(containerCopy, std::end(containerCopy)), predicate);
auto it = std::begin(containerCopy); for (auto it = std::begin(container); it != std::end(container); ++it)
std::advance(it, urand(0, uint32(std::size(containerCopy)) - 1)); if (predicate(*it))
return *it; matchingElements.push_back(it);
if (matchingElements.empty())
return std::end(container);
auto randomIt = matchingElements[urand(0, matchingElements.size() - 1)];
return randomIt;
} }
/* /*
+2 -1
View File
@@ -17,7 +17,8 @@
#ifndef Random_h__ #ifndef Random_h__
#define Random_h__ #define Random_h__
#undef max
#undef min
#include "Define.h" #include "Define.h"
#include "Duration.h" #include "Duration.h"
#include <limits> #include <limits>
+4 -4
View File
@@ -49,6 +49,7 @@
#include "SharedDefines.h" #include "SharedDefines.h"
#include "SteadyTimer.h" #include "SteadyTimer.h"
#include "World.h" #include "World.h"
#include "WorldSessionMgr.h"
#include "WorldSocket.h" #include "WorldSocket.h"
#include "WorldSocketMgr.h" #include "WorldSocketMgr.h"
#include <boost/asio/signal_set.hpp> #include <boost/asio/signal_set.hpp>
@@ -285,11 +286,10 @@ int main(int argc, char** argv)
sMetric->Initialize(realm.Name, *ioContext, []() sMetric->Initialize(realm.Name, *ioContext, []()
{ {
METRIC_VALUE("online_players", sWorld->GetPlayerCount()); METRIC_VALUE("online_players", sWorldSessionMgr->GetPlayerCount());
METRIC_VALUE("db_queue_login", uint64(LoginDatabase.QueueSize())); METRIC_VALUE("db_queue_login", uint64(LoginDatabase.QueueSize()));
METRIC_VALUE("db_queue_character", uint64(CharacterDatabase.QueueSize())); METRIC_VALUE("db_queue_character", uint64(CharacterDatabase.QueueSize()));
METRIC_VALUE("db_queue_world", uint64(WorldDatabase.QueueSize())); METRIC_VALUE("db_queue_world", uint64(WorldDatabase.QueueSize()));
sScriptMgr->OnMetricLogging();
}); });
METRIC_EVENT("events", "Worldserver started", ""); METRIC_EVENT("events", "Worldserver started", "");
@@ -358,8 +358,8 @@ int main(int argc, char** argv)
std::shared_ptr<void> sWorldSocketMgrHandle(nullptr, [](void*) std::shared_ptr<void> sWorldSocketMgrHandle(nullptr, [](void*)
{ {
sWorld->KickAll(); // save and kick all players sWorldSessionMgr->KickAll(); // save and kick all players
sWorld->UpdateSessions(1); // real players unload required UpdateSessions call sWorldSessionMgr->UpdateSessions(1); // real players unload required UpdateSessions call
sWorldSocketMgr.StopNetwork(); sWorldSocketMgr.StopNetwork();
@@ -67,6 +67,7 @@
# PLAYER DUMP # PLAYER DUMP
# CUSTOM # CUSTOM
# DEBUG # DEBUG
# DYNAMIC RESPAWN SETTINGS
# #
################################################################################################### ###################################################################################################
@@ -290,7 +291,7 @@ FlashAtStart = 1
# DATABASE_CHARACTER = 2, // Character database # DATABASE_CHARACTER = 2, // Character database
# DATABASE_WORLD = 4, // World database # DATABASE_WORLD = 4, // World database
# #
# Default: 7 - (All enabled) # Default: 7 - (All enabled)
# 4 - (Enable world only) # 4 - (Enable world only)
# 0 - (All disabled) # 0 - (All disabled)
@@ -1119,17 +1120,6 @@ PreventAFKLogout = 0
################################################################################################### ###################################################################################################
# PACKET SPOOF PROTECTION SETTINGS # PACKET SPOOF PROTECTION SETTINGS
#
# These settings determine which action to take when harmful packet spoofing is detected.
#
# PacketSpoof.Policy
# Description: Determines the course of action when packet spoofing is detected.
# Values: 0 - Log only
# 1 - Log + kick
# 2 - Log + kick + ban
PacketSpoof.Policy = 1
# #
# PacketSpoof.BanMode # PacketSpoof.BanMode
# Description: If PacketSpoof.Policy equals 2, this will determine the ban mode. # Description: If PacketSpoof.Policy equals 2, this will determine the ban mode.
@@ -3791,21 +3781,6 @@ Arena.QueueAnnouncer.PlayerOnly = 0
Arena.QueueAnnouncer.Detail = 3 Arena.QueueAnnouncer.Detail = 3
#
# Arena.ArenaSeason.ID
# Description: Current arena season id shown in clients.
# Default: 8
Arena.ArenaSeason.ID = 8
#
# Arena.ArenaSeason.InProgress
# Description: State of current arena season.
# Default: 1 - (Active)
# 0 - (Finished)
Arena.ArenaSeason.InProgress = 1
# #
# Arena.ArenaStartRating # Arena.ArenaStartRating
# Description: Start rating for new arena teams. # Description: Start rating for new arena teams.
@@ -4484,6 +4459,52 @@ Debug.Arena = 0
# #
################################################################################################### ###################################################################################################
###################################################################################################
# DYNAMIC RESPAWN SETTINGS
#
#
# Respawn.DynamicRateCreature
# Description: Controls how creature respawn times adjust based on player count in a zone.
# The respawn time is unchanged up to the configured number of players.
# As player count exceeds this value, respawn times decrease proportionally
# (e.g., at double the player count, respawn times are halved; at triple the player count, respawns happen three times as fast).
# Does not affect instanced creatures, bosses, or quest givers.
# Formula: adjustFactor = rate / playerCount
# RespawnTime = RespawnTime * adjustFactor
# Default: 1 (Disabled)
Respawn.DynamicRateCreature = 1
#
# Respawn.DynamicMinimumCreature
# Description: The minimum respawn time for a creature under dynamic scaling.
# Default: 10 - (10 seconds)
Respawn.DynamicMinimumCreature = 10
#
# Respawn.DynamicRateGameObject
# Description: Controls how gameobject respawn times adjust based on player count in a zone.
# The respawn time is unchanged up to the configured number of players.
# As player count exceeds this value, respawn times decrease proportionally
# (e.g., at double the player count, respawn times are halved; at triple the player count, respawns happen three times as fast).
# Does not affect instanced objects or quest givers.
# Formula: adjustFactor = rate / playerCount
# RespawnTime = RespawnTime * adjustFactor
# Default: 1 (Disabled)
Respawn.DynamicRateGameObject = 1
#
# Respawn.DynamicMinimumGameObject
# Description: The minimum respawn time for a gameobject under dynamic scaling.
# Default: 10 - (10 seconds)
Respawn.DynamicMinimumGameObject = 10
#
###################################################################################################
################################################################################################### ###################################################################################################
# # # #
# GAME SETTINGS END # # GAME SETTINGS END #
+3 -3
View File
@@ -212,7 +212,7 @@ T Field::GetData() const
if (data.raw) if (data.raw)
result = *reinterpret_cast<T const*>(data.value); result = *reinterpret_cast<T const*>(data.value);
else else
result = Acore::StringTo<T>(data.value); result = Acore::StringTo<T>(std::string_view(data.value, data.length));
// Correct double fields... this undefined behavior :/ // Correct double fields... this undefined behavior :/
if constexpr (std::is_same_v<T, double>) if constexpr (std::is_same_v<T, double>)
@@ -220,7 +220,7 @@ T Field::GetData() const
if (data.raw && !IsType(DatabaseFieldTypes::Decimal)) if (data.raw && !IsType(DatabaseFieldTypes::Decimal))
result = *reinterpret_cast<double const*>(data.value); result = *reinterpret_cast<double const*>(data.value);
else else
result = Acore::StringTo<float>(data.value); result = Acore::StringTo<float>(std::string_view(data.value, data.length));
} }
// Check -1 for *_dbc db tables // Check -1 for *_dbc db tables
@@ -230,7 +230,7 @@ T Field::GetData() const
if (!tableName.empty() && tableName.size() > 4) if (!tableName.empty() && tableName.size() > 4)
{ {
auto signedResult = Acore::StringTo<int32>(data.value); auto signedResult = Acore::StringTo<int32>(std::string_view(data.value, data.length));
if (signedResult && !result && tableName.substr(tableName.length() - 4) == "_dbc") if (signedResult && !result && tableName.substr(tableName.length() - 4) == "_dbc")
{ {
@@ -157,9 +157,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
std::vector<std::string> moduleList; std::vector<std::string> moduleList;
for (auto const& itr : Acore::Tokenize(_modulesList, ',', true)) for (auto const& itr : Acore::Tokenize(_modulesList, ',', true))
{
moduleList.emplace_back(itr); moduleList.emplace_back(itr);
}
// data/sql // data/sql
for (auto const& itr : moduleList) for (auto const& itr : moduleList)
@@ -168,9 +166,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
Path const p(path); Path const p(path);
if (!is_directory(p)) if (!is_directory(p))
{
continue; continue;
}
DirectoryEntry const entry = { p, AppliedFileEntry::StateConvert("MODULE") }; DirectoryEntry const entry = { p, AppliedFileEntry::StateConvert("MODULE") };
directories.push_back(entry); directories.push_back(entry);
@@ -386,14 +382,14 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
// Apply default updates // Apply default updates
for (auto const& availableQuery : available) for (auto const& availableQuery : available)
{ {
if (availableQuery.second != CUSTOM && availableQuery.second != MODULE) if (availableQuery.second != PENDING && availableQuery.second != CUSTOM && availableQuery.second != MODULE)
ApplyUpdateFile(availableQuery); ApplyUpdateFile(availableQuery);
} }
// Apply only custom/module updates // Apply only pending/custom/module updates
for (auto const& availableQuery : available) for (auto const& availableQuery : available)
{ {
if (availableQuery.second == CUSTOM || availableQuery.second == MODULE) if (availableQuery.second == PENDING || availableQuery.second == CUSTOM || availableQuery.second == MODULE)
ApplyUpdateFile(availableQuery); ApplyUpdateFile(availableQuery);
} }
@@ -72,6 +72,7 @@ private:
{ {
RELEASED, RELEASED,
CUSTOM, CUSTOM,
PENDING,
MODULE, MODULE,
ARCHIVED ARCHIVED
}; };
@@ -92,6 +93,8 @@ private:
return RELEASED; return RELEASED;
else if (state == "CUSTOM") else if (state == "CUSTOM")
return CUSTOM; return CUSTOM;
else if (state == "PENDING")
return PENDING;
else if (state == "MODULE") else if (state == "MODULE")
return MODULE; return MODULE;
@@ -106,6 +109,8 @@ private:
return "RELEASED"; return "RELEASED";
case CUSTOM: case CUSTOM:
return "CUSTOM"; return "CUSTOM";
case PENDING:
return "PENDING";
case MODULE: case MODULE:
return "MODULE"; return "MODULE";
case ARCHIVED: case ARCHIVED:
+1 -1
View File
@@ -359,7 +359,7 @@ public:
virtual void JustExitedCombat() { } virtual void JustExitedCombat() { }
/// @brief Called at any Damage to any victim (before damage apply) /// @brief Called at any Damage to any victim (before damage apply)
virtual void DamageDealt(Unit* /*victim*/, uint32& /*damage*/, DamageEffectType /*damageType*/) { } virtual void DamageDealt(Unit* /*victim*/, uint32& /*damage*/, DamageEffectType /*damageType*/, SpellSchoolMask /*damageSchoolMask*/) {}
/** @brief Called at any Damage from any attacker (before damage apply) /** @brief Called at any Damage from any attacker (before damage apply)
* *
+1 -1
View File
@@ -893,7 +893,7 @@ void SmartAI::IsSummonedBy(WorldObject* summoner)
GetScript()->ProcessEventsFor(SMART_EVENT_JUST_SUMMONED, summoner->ToUnit(), 0, 0, false, nullptr, summoner->ToGameObject()); GetScript()->ProcessEventsFor(SMART_EVENT_JUST_SUMMONED, summoner->ToUnit(), 0, 0, false, nullptr, summoner->ToGameObject());
} }
void SmartAI::DamageDealt(Unit* doneTo, uint32& damage, DamageEffectType /*damagetype*/) void SmartAI::DamageDealt(Unit* doneTo, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/)
{ {
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED_TARGET, doneTo, damage); GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED_TARGET, doneTo, damage);
} }
+1 -1
View File
@@ -131,7 +131,7 @@ public:
void IsSummonedBy(WorldObject* summoner) override; void IsSummonedBy(WorldObject* summoner) override;
// Called at any Damage to any victim (before damage apply) // Called at any Damage to any victim (before damage apply)
void DamageDealt(Unit* doneTo, uint32& damage, DamageEffectType damagetyp) override; void DamageDealt(Unit* doneTo, uint32& damage, DamageEffectType damagetyp, SpellSchoolMask damageSchoolMask) override;
// Called when a summoned creature dissapears (UnSommoned) // Called when a summoned creature dissapears (UnSommoned)
void SummonedCreatureDespawn(Creature* unit) override; void SummonedCreatureDespawn(Creature* unit) override;
+10 -14
View File
@@ -44,6 +44,7 @@
#include "SpellMgr.h" #include "SpellMgr.h"
#include "World.h" #include "World.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldSessionMgr.h"
bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
{ {
@@ -580,7 +581,7 @@ void AchievementMgr::SaveToDB(CharacterDatabaseTransaction trans)
iter->second.changed = false; iter->second.changed = false;
sScriptMgr->OnAchievementSave(trans, GetPlayer(), iter->first, iter->second); sScriptMgr->OnPlayerAchievementSave(trans, GetPlayer(), iter->first, iter->second);
} }
} }
@@ -609,7 +610,7 @@ void AchievementMgr::SaveToDB(CharacterDatabaseTransaction trans)
iter->second.changed = false; iter->second.changed = false;
sScriptMgr->OnCriteriaSave(trans, GetPlayer(), iter->first, iter->second); sScriptMgr->OnPlayerCriteriaSave(trans, GetPlayer(), iter->first, iter->second);
} }
} }
} }
@@ -728,7 +729,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
data << GetPlayer()->GetGUID(); data << GetPlayer()->GetGUID();
data << uint32(achievement->ID); data << uint32(achievement->ID);
data << uint32(0); // display name as plain string in chat (always 0 for guild) data << uint32(0); // display name as plain string in chat (always 0 for guild)
sWorld->SendGlobalMessage(&data); sWorldSessionMgr->SendGlobalMessage(&data);
} }
else else
{ {
@@ -741,20 +742,15 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
data << uint32(achievement->ID); data << uint32(achievement->ID);
std::size_t linkTypePos = data.wpos(); std::size_t linkTypePos = data.wpos();
data << uint32(1); // display name as clickable link in chat data << uint32(1); // display name as clickable link in chat
sWorld->SendGlobalMessage(&data, nullptr, teamId); sWorldSessionMgr->SendGlobalMessage(&data, nullptr, teamId);
data.put<uint32>(linkTypePos, 0); // display name as plain string in chat data.put<uint32>(linkTypePos, 0); // display name as plain string in chat
sWorld->SendGlobalMessage(&data, nullptr, teamId == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE); sWorldSessionMgr->SendGlobalMessage(&data, nullptr, teamId == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE);
} }
} }
// if player is in world he can tell his friends about new achievement // if player is in world he can tell his friends about new achievement
else if (GetPlayer()->IsInWorld()) else if (GetPlayer()->IsInWorld())
{ {
CellCoord p = Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
Cell cell(p);
cell.SetNoCreate();
Acore::BroadcastTextBuilder _builder(GetPlayer(), CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetPlayer()->getGender(), GetPlayer(), achievement->ID); Acore::BroadcastTextBuilder _builder(GetPlayer(), CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetPlayer()->getGender(), GetPlayer(), achievement->ID);
Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> _localizer(_builder); Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> _localizer(_builder);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder>> _worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), _localizer); Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder>> _worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), _localizer);
@@ -2103,7 +2099,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
if (entry->timeLimit && timedIter == _timedAchievements.end()) if (entry->timeLimit && timedIter == _timedAchievements.end())
return; return;
if (!sScriptMgr->OnBeforeCriteriaProgress(GetPlayer(), entry)) if (!sScriptMgr->OnPlayerBeforeCriteriaProgress(GetPlayer(), entry))
{ {
return; return;
} }
@@ -2169,7 +2165,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
SendCriteriaUpdate(entry, progress, timeElapsed, true); SendCriteriaUpdate(entry, progress, timeElapsed, true);
sScriptMgr->OnCriteriaProgress(GetPlayer(), entry); sScriptMgr->OnPlayerCriteriaProgress(GetPlayer(), entry);
} }
void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry) void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry)
@@ -2277,7 +2273,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
return; return;
} }
if (!sScriptMgr->OnBeforeAchievementComplete(GetPlayer(), achievement)) if (!sScriptMgr->OnPlayerBeforeAchievementComplete(GetPlayer(), achievement))
{ {
return; return;
} }
@@ -2292,7 +2288,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
ca.date = GameTime::GetGameTime().count(); ca.date = GameTime::GetGameTime().count();
ca.changed = true; ca.changed = true;
sScriptMgr->OnAchievementComplete(GetPlayer(), achievement); sScriptMgr->OnPlayerAchievementComplete(GetPlayer(), achievement);
// pussywizard: set all progress counters to 0, so progress will be deleted from db during save // pussywizard: set all progress counters to 0, so progress will be deleted from db during save
{ {
+2 -1
View File
@@ -31,6 +31,7 @@
#include "ObjectMgr.h" #include "ObjectMgr.h"
#include "Transport.h" #include "Transport.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldSessionMgr.h"
/// @todo: this import is not necessary for compilation and marked as unused by the IDE /// @todo: this import is not necessary for compilation and marked as unused by the IDE
// however, for some reasons removing it would cause a damn linking issue // however, for some reasons removing it would cause a damn linking issue
@@ -143,7 +144,7 @@ bool Battlefield::Update(uint32 diff)
{ {
if (m_Timer <= diff) if (m_Timer <= diff)
{ {
if (!IsEnabled() || (!IsWarTime() && sWorld->GetActiveSessionCount() > 3500)) // if WG is disabled or there is more than 3500 connections, switch automaticly if (!IsEnabled() || (!IsWarTime() && sWorldSessionMgr->GetActiveSessionCount() > 3500)) // if WG is disabled or there is more than 3500 connections, switch automaticly
{ {
m_isActive = true; m_isActive = true;
EndBattle(false); EndBattle(false);
+2 -2
View File
@@ -81,7 +81,7 @@ public:
virtual ~BfCapturePoint() { } virtual ~BfCapturePoint() { }
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {} virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { }
// Send world state update to all players present // Send world state update to all players present
void SendUpdateWorldState(uint32 field, uint32 value); void SendUpdateWorldState(uint32 field, uint32 value);
@@ -334,7 +334,7 @@ public:
/// Send all worldstate data to all player in zone. /// Send all worldstate data to all player in zone.
virtual void SendInitWorldStatesToAll() = 0; virtual void SendInitWorldStatesToAll() = 0;
virtual void FillInitialWorldStates(WorldPacket& /*data*/) = 0; virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) = 0;
/// Return if we can use mount in battlefield /// Return if we can use mount in battlefield
bool CanFlyIn() { return !m_isActive; } bool CanFlyIn() { return !m_isActive; }
@@ -29,6 +29,7 @@
#include "TemporarySummon.h" #include "TemporarySummon.h"
#include "Vehicle.h" #include "Vehicle.h"
#include "WorldSession.h" #include "WorldSession.h"
#include "WorldStatePackets.h"
BattlefieldWG::~BattlefieldWG() BattlefieldWG::~BattlefieldWG()
{ {
@@ -74,7 +75,7 @@ bool BattlefieldWG::SetupBattlefield()
m_saveTimer = 60000; m_saveTimer = 60000;
// Init GraveYards // Init Graveyards
SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX); SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX);
// Load from db // Load from db
@@ -102,12 +103,12 @@ bool BattlefieldWG::SetupBattlefield()
BfGraveyardWG* graveyard = new BfGraveyardWG(this); BfGraveyardWG* graveyard = new BfGraveyardWG(this);
// When between games, the graveyard is controlled by the defending team // When between games, the graveyard is controlled by the defending team
if (WGGraveYard[i].startcontrol == TEAM_NEUTRAL) if (WGGraveyard[i].startcontrol == TEAM_NEUTRAL)
graveyard->Initialize(WGGraveYard[i].gyid == BATTLEFIELD_WG_GY_WORKSHOP_SE || WGGraveYard[i].gyid == BATTLEFIELD_WG_GY_WORKSHOP_SW ? GetAttackerTeam() : m_DefenderTeam, WGGraveYard[i].gyid); graveyard->Initialize(WGGraveyard[i].gyid == BATTLEFIELD_WG_GY_WORKSHOP_SE || WGGraveyard[i].gyid == BATTLEFIELD_WG_GY_WORKSHOP_SW ? GetAttackerTeam() : m_DefenderTeam, WGGraveyard[i].gyid);
else else
graveyard->Initialize(WGGraveYard[i].startcontrol, WGGraveYard[i].gyid); graveyard->Initialize(WGGraveyard[i].startcontrol, WGGraveyard[i].gyid);
graveyard->SetTextId(WGGraveYard[i].textid); graveyard->SetTextId(WGGraveyard[i].textid);
m_GraveyardList[i] = graveyard; m_GraveyardList[i] = graveyard;
} }
@@ -933,46 +934,46 @@ uint32 BattlefieldWG::GetData(uint32 data) const
return Battlefield::GetData(data); return Battlefield::GetData(data);
} }
void BattlefieldWG::FillInitialWorldStates(WorldPacket& data) void BattlefieldWG::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(BATTLEFIELD_WG_WORLD_STATE_ATTACKER) << uint32(GetAttackerTeam()); packet.Worldstates.reserve(4+2+WG_MAX_OBJ+WG_MAX_WORKSHOP);
data << uint32(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) << uint32(GetDefenderTeam()); packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ATTACKER, GetAttackerTeam());
data << uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) << uint32(IsWarTime() ? 0 : 1); // Note: cleanup these two, their names look awkward packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, GetDefenderTeam());
data << uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE) << uint32(IsWarTime() ? 1 : 0);
// Note: cleanup these two, their names look awkward
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, IsWarTime() ? 0 : 1);
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE, IsWarTime() ? 1 : 0);
for (uint32 i = 0; i < 2; ++i) for (uint32 i = 0; i < 2; ++i)
data << ClockWorldState[i] << uint32(GameTime::GetGameTime().count() + (m_Timer / 1000)); packet.Worldstates.emplace_back(ClockWorldState[i], GameTime::GetGameTime().count() + (m_Timer / 1000));
data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_H)); packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H); packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H));
data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_A)); packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A); packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A));
data << uint32(WORLDSTATE_HORDE_KEEP_CAPTURED) << uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_CAPTURED)); packet.Worldstates.emplace_back(WORLDSTATE_ALLIANCE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_DEFENDED)));
data << uint32(WORLDSTATE_HORDE_KEEP_DEFENDED) << uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_DEFENDED)); packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_CAPTURED)));
data << uint32(WORLDSTATE_ALLIANCE_KEEP_CAPTURED) << uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_CAPTURED)); packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_DEFENDED)));
data << uint32(WORLDSTATE_ALLIANCE_KEEP_DEFENDED) << uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_DEFENDED)); packet.Worldstates.emplace_back(WORLDSTATE_ALLIANCE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_CAPTURED)));
for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr) for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
data << (*itr)->m_WorldState << (*itr)->m_State; packet.Worldstates.emplace_back((*itr)->m_WorldState, (*itr)->m_State);
for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr) for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
if (*itr) if (*itr)
data << WorkshopsData[(*itr)->workshopId].worldstate << (*itr)->state; packet.Worldstates.emplace_back(WorkshopsData[(*itr)->workshopId].worldstate, (*itr)->state);
} }
void BattlefieldWG::SendInitWorldStatesTo(Player* player) void BattlefieldWG::SendInitWorldStatesTo(Player* player)
{ {
WorldPacket data(SMSG_INIT_WORLD_STATES, (4 + 4 + 4 + 2 + (BuildingsInZone.size() * 8) + (WorkshopsList.size() * 8))); WorldPackets::WorldState::InitWorldStates packet;
packet.MapID = m_MapId;
packet.ZoneID = m_ZoneId;
packet.AreaID = player->GetAreaId();
FillInitialWorldStates(packet);
data << uint32(m_MapId); player->SendDirectMessage(packet.Write());
data << uint32(m_ZoneId);
data << uint32(0);
data << uint16(14 + BuildingsInZone.size() + WorkshopsList.size()); // Number of fields
FillInitialWorldStates(data);
player->GetSession()->SendPacket(&data);
} }
void BattlefieldWG::SendInitWorldStatesToAll() void BattlefieldWG::SendInitWorldStatesToAll()
@@ -21,6 +21,7 @@
#include "Battlefield.h" #include "Battlefield.h"
#include "Log.h" #include "Log.h"
#include "World.h" #include "World.h"
#include "WorldStatePackets.h"
class Group; class Group;
class BattlefieldWG; class BattlefieldWG;
@@ -238,7 +239,7 @@ const uint32 WGQuest[2][6] =
{ 13185, 13183, 13223, 13539, 13178, 13180 }, { 13185, 13183, 13223, 13539, 13178, 13180 },
}; };
// 7 in sql, 7 in header // 7 in sql, 7 in header
const BfWGCoordGY WGGraveYard[BATTLEFIELD_WG_GRAVEYARD_MAX] = const BfWGCoordGY WGGraveyard[BATTLEFIELD_WG_GRAVEYARD_MAX] =
{ {
{ 5104.750f, 2300.940f, 368.579f, 0.733038f, 1329, BATTLEFIELD_WG_GY_WORKSHOP_NE, BATTLEFIELD_WG_GOSSIPTEXT_GY_NE, TEAM_NEUTRAL }, { 5104.750f, 2300.940f, 368.579f, 0.733038f, 1329, BATTLEFIELD_WG_GY_WORKSHOP_NE, BATTLEFIELD_WG_GOSSIPTEXT_GY_NE, TEAM_NEUTRAL },
{ 5099.120f, 3466.036f, 368.484f, 5.317802f, 1330, BATTLEFIELD_WG_GY_WORKSHOP_NW, BATTLEFIELD_WG_GOSSIPTEXT_GY_NW, TEAM_NEUTRAL }, { 5099.120f, 3466.036f, 368.484f, 5.317802f, 1330, BATTLEFIELD_WG_GY_WORKSHOP_NW, BATTLEFIELD_WG_GOSSIPTEXT_GY_NW, TEAM_NEUTRAL },
@@ -403,7 +404,7 @@ public:
void SendInitWorldStatesTo(Player* player); void SendInitWorldStatesTo(Player* player);
void SendInitWorldStatesToAll() override; void SendInitWorldStatesToAll() override;
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
void HandleKill(Player* killer, Unit* victim) override; void HandleKill(Player* killer, Unit* victim) override;
void OnUnitDeath(Unit* unit) override; void OnUnitDeath(Unit* unit) override;
+7 -5
View File
@@ -25,7 +25,8 @@
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "World.h" #include "World.h"
#include "WorldSession.h" #include "WorldSession.h"
//#include "WorldStatePackets.h" #include "WorldSessionMgr.h"
#include "WorldStatePackets.h"
void ArenaScore::AppendToPacket(WorldPacket& data) void ArenaScore::AppendToPacket(WorldPacket& data)
{ {
@@ -146,10 +147,11 @@ void Arena::RemovePlayer(Player* /*player*/)
CheckWinConditions(); CheckWinConditions();
} }
void Arena::FillInitialWorldStates(WorldPacket& data) void Arena::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN) << uint32(GetAlivePlayersCountByTeam(TEAM_HORDE)); packet.Worldstates.reserve(2);
data << uint32(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD) << uint32(GetAlivePlayersCountByTeam(TEAM_ALLIANCE)); packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE));
packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE));
} }
void Arena::UpdateArenaWorldState() void Arena::UpdateArenaWorldState()
@@ -224,7 +226,7 @@ void Arena::EndBattleground(TeamId winnerTeamId)
{ {
// pussywizard: arena logs in database // pussywizard: arena logs in database
uint32 fightId = sArenaTeamMgr->GetNextArenaLogId(); uint32 fightId = sArenaTeamMgr->GetNextArenaLogId();
uint32 currOnline = sWorld->GetActiveSessionCount(); uint32 currOnline = sWorldSessionMgr->GetActiveSessionCount();
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction(); CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_LOG_FIGHT); CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_LOG_FIGHT);
+1 -1
View File
@@ -52,7 +52,7 @@ protected:
void AddPlayer(Player* player) override; void AddPlayer(Player* player) override;
void RemovePlayer(Player* /*player*/) override; void RemovePlayer(Player* /*player*/) override;
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
void UpdateArenaWorldState(); void UpdateArenaWorldState();
void HandleKillPlayer(Player* player, Player* killer) override; void HandleKillPlayer(Player* player, Player* killer) override;
@@ -0,0 +1,224 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ArenaSeasonMgr.h"
#include "ArenaTeamMgr.h"
#include "ArenaSeasonRewardsDistributor.h"
#include "BattlegroundMgr.h"
#include "GameEventMgr.h"
#include "MapMgr.h"
#include "Player.h"
ArenaSeasonMgr* ArenaSeasonMgr::instance()
{
static ArenaSeasonMgr instance;
return &instance;
}
void ArenaSeasonMgr::LoadRewards()
{
uint32 oldMSTime = getMSTime();
std::unordered_map<std::string, ArenaSeasonRewardGroupCriteriaType> stringToArenaSeasonRewardGroupCriteriaType = {
{"pct", ArenaSeasonRewardGroupCriteriaType::ARENA_SEASON_REWARD_CRITERIA_TYPE_PERCENT_VALUE},
{"abs", ArenaSeasonRewardGroupCriteriaType::ARENA_SEASON_REWARD_CRITERIA_TYPE_ABSOLUTE_VALUE}
};
QueryResult result = WorldDatabase.Query("SELECT id, arena_season, criteria_type, min_criteria, max_criteria, reward_mail_template_id, reward_mail_subject, reward_mail_body, gold_reward FROM arena_season_reward_group");
if (!result)
{
LOG_WARN("server.loading", ">> Loaded 0 arena season rewards. DB table `arena_season_reward_group` is empty.");
LOG_INFO("server.loading", " ");
return;
}
std::unordered_map<uint32, ArenaSeasonRewardGroup> groupsMap;
do
{
Field* fields = result->Fetch();
uint32 id = fields[0].Get<uint32>();
ArenaSeasonRewardGroup group;
group.season = fields[1].Get<uint8>();
group.criteriaType = stringToArenaSeasonRewardGroupCriteriaType[fields[2].Get<std::string>()];
group.minCriteria = fields[3].Get<float>();
group.maxCriteria = fields[4].Get<float>();
group.rewardMailTemplateID = fields[5].Get<uint32>();
group.rewardMailSubject = fields[6].Get<std::string>();
group.rewardMailBody = fields[7].Get<std::string>();
group.goldReward = fields[8].Get<uint32>();
groupsMap[id] = group;
} while (result->NextRow());
std::unordered_map<std::string, ArenaSeasonRewardType> stringToArenaSeasonRewardType = {
{"achievement", ArenaSeasonRewardType::ARENA_SEASON_REWARD_TYPE_ACHIEVEMENT},
{"item", ArenaSeasonRewardType::ARENA_SEASON_REWARD_TYPE_ITEM}
};
result = WorldDatabase.Query("SELECT group_id, type, entry FROM arena_season_reward");
if (!result)
{
LOG_WARN("server.loading", ">> Loaded 0 arena season rewards. DB table `arena_season_reward` is empty.");
LOG_INFO("server.loading", " ");
return;
}
do
{
Field* fields = result->Fetch();
uint32 groupId = fields[0].Get<uint32>();
ArenaSeasonReward reward;
reward.type = stringToArenaSeasonRewardType[fields[1].Get<std::string>()];
reward.entry = fields[2].Get<uint32>();
auto itr = groupsMap.find(groupId);
ASSERT(itr != groupsMap.end(), "Unknown arena_season_reward_group ({}) in arena_season_reward", groupId);
(reward.type == ARENA_SEASON_REWARD_TYPE_ITEM) ?
groupsMap[groupId].itemRewards.push_back(reward) :
groupsMap[groupId].achievementRewards.push_back(reward);
} while (result->NextRow());
for (auto const& itr : groupsMap)
_arenaSeasonRewardGroupsStore[itr.second.season].push_back(itr.second);
LOG_INFO("server.loading", ">> Loaded {} arena season rewards in {} ms", (uint32)groupsMap.size(), GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", " ");
}
void ArenaSeasonMgr::LoadActiveSeason()
{
QueryResult result = CharacterDatabase.Query("SELECT season_id, season_state FROM active_arena_season");
ASSERT(result, "active_arena_season can't be empty");
Field* fields = result->Fetch();
_currentSeason = fields[0].Get<uint8>();
_currentSeasonState = static_cast<ArenaSeasonState>(fields[1].Get<uint8>());
uint16 eventID = GameEventForArenaSeason(_currentSeason);
sGameEventMgr->StartEvent(eventID, true);
LOG_INFO("server.loading", "Arena Season {} loaded...", _currentSeason);
LOG_INFO("server.loading", " ");
}
void ArenaSeasonMgr::RewardTeamsForTheSeason(std::shared_ptr<ArenaTeamFilter> teamsFilter)
{
ArenaSeasonTeamRewarderImpl rewarder = ArenaSeasonTeamRewarderImpl();
ArenaSeasonRewardDistributor distributor = ArenaSeasonRewardDistributor(&rewarder);
std::vector<ArenaSeasonRewardGroup> rewards = _arenaSeasonRewardGroupsStore[GetCurrentSeason()];
ArenaTeamMgr::ArenaTeamContainer filteredTeams = teamsFilter->Filter(sArenaTeamMgr->GetArenaTeams());
distributor.DistributeRewards(filteredTeams, rewards);
}
bool ArenaSeasonMgr::CanDeleteArenaTeams()
{
std::vector<ArenaSeasonRewardGroup> rewards = _arenaSeasonRewardGroupsStore[GetCurrentSeason()];
if (rewards.empty())
return false;
for (auto const& bg : sBattlegroundMgr->GetActiveBattlegrounds())
if (bg->isRated())
return false;
return true;
}
void ArenaSeasonMgr::DeleteArenaTeams()
{
if (!CanDeleteArenaTeams())
return;
// Cleanup queue first.
std::vector<BattlegroundQueueTypeId> arenasQueueTypes = {BATTLEGROUND_QUEUE_2v2, BATTLEGROUND_QUEUE_3v3, BATTLEGROUND_QUEUE_5v5};
for (BattlegroundQueueTypeId queueType : arenasQueueTypes)
{
auto queue = sBattlegroundMgr->GetBattlegroundQueue(queueType);
for (auto const& [playerGUID, other] : queue.m_QueuedPlayers)
queue.RemovePlayer(playerGUID, true);
}
sArenaTeamMgr->DeleteAllArenaTeams();
}
void ArenaSeasonMgr::ChangeCurrentSeason(uint8 season)
{
if (_currentSeason == season)
return;
uint16 currentEventID = GameEventForArenaSeason(_currentSeason);
sGameEventMgr->StopEvent(currentEventID, true);
uint16 newEventID = GameEventForArenaSeason(season);
sGameEventMgr->StartEvent(newEventID, true);
_currentSeason = season;
_currentSeasonState = ARENA_SEASON_STATE_IN_PROGRESS;
CharacterDatabase.Execute("UPDATE active_arena_season SET season_id = {}, season_state = {}", _currentSeason, _currentSeasonState);
BroadcastUpdatedWorldState();
}
void ArenaSeasonMgr::SetSeasonState(ArenaSeasonState state)
{
if (_currentSeasonState == state)
return;
_currentSeasonState = state;
CharacterDatabase.Execute("UPDATE active_arena_season SET season_state = {}", _currentSeasonState);
BroadcastUpdatedWorldState();
}
uint16 ArenaSeasonMgr::GameEventForArenaSeason(uint8 season)
{
QueryResult result = WorldDatabase.Query("SELECT eventEntry FROM game_event_arena_seasons WHERE season = '{}'", season);
if (!result)
{
LOG_ERROR("arenaseasonmgr", "ArenaSeason ({}) must be an existant Arena Season", season);
return 0;
}
Field* fields = result->Fetch();
return fields[0].Get<uint16>();
}
void ArenaSeasonMgr::BroadcastUpdatedWorldState()
{
sMapMgr->DoForAllMaps([](Map* map)
{
// Ignore instanceable maps, players will get a fresh state once they change the map.
if (map->Instanceable())
return;
map->DoForAllPlayers([&](Player* player)
{
uint32 currZone, currArea;
player->GetZoneAndAreaId(currZone, currArea);
player->SendInitWorldStates(currZone, currArea);
});
});
}
@@ -0,0 +1,126 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ARENASEASONMGR_H
#define _ARENASEASONMGR_H
#include "Common.h"
#include "ArenaTeamFilter.h"
#include <vector>
#include <unordered_map>
enum ArenaSeasonState
{
ARENA_SEASON_STATE_DISABLED = 0,
ARENA_SEASON_STATE_IN_PROGRESS = 1
};
enum ArenaSeasonRewardType
{
ARENA_SEASON_REWARD_TYPE_ITEM,
ARENA_SEASON_REWARD_TYPE_ACHIEVEMENT
};
enum ArenaSeasonRewardGroupCriteriaType
{
ARENA_SEASON_REWARD_CRITERIA_TYPE_PERCENT_VALUE,
ARENA_SEASON_REWARD_CRITERIA_TYPE_ABSOLUTE_VALUE
};
// ArenaSeasonReward represents one reward, it can be an item or achievement.
struct ArenaSeasonReward
{
ArenaSeasonReward() = default;
// Item or acheivement entry.
uint32 entry{};
ArenaSeasonRewardType type{ARENA_SEASON_REWARD_TYPE_ITEM};
// Used in unit tests.
bool operator==(const ArenaSeasonReward& other) const
{
return entry == other.entry && type == other.type;
}
};
struct ArenaSeasonRewardGroup
{
ArenaSeasonRewardGroup() = default;
uint8 season{};
ArenaSeasonRewardGroupCriteriaType criteriaType;
float minCriteria{};
float maxCriteria{};
uint32 rewardMailTemplateID{};
std::string rewardMailSubject{};
std::string rewardMailBody{};
uint32 goldReward{};
std::vector<ArenaSeasonReward> itemRewards;
std::vector<ArenaSeasonReward> achievementRewards;
// Used in unit tests.
bool operator==(const ArenaSeasonRewardGroup& other) const
{
return minCriteria == other.minCriteria &&
maxCriteria == other.maxCriteria &&
criteriaType == other.criteriaType &&
itemRewards == other.itemRewards &&
achievementRewards == other.achievementRewards;
}
};
class ArenaSeasonMgr
{
public:
static ArenaSeasonMgr* instance();
using ArenaSeasonRewardGroupsBySeasonContainer = std::unordered_map<uint8, std::vector<ArenaSeasonRewardGroup>>;
// Loading functions
void LoadRewards();
void LoadActiveSeason();
// Season management functions
void ChangeCurrentSeason(uint8 season);
uint8 GetCurrentSeason() { return _currentSeason; }
void SetSeasonState(ArenaSeasonState state);
ArenaSeasonState GetSeasonState() { return _currentSeasonState; }
// Season completion functions
void RewardTeamsForTheSeason(std::shared_ptr<ArenaTeamFilter> teamsFilter);
bool CanDeleteArenaTeams();
void DeleteArenaTeams();
private:
uint16 GameEventForArenaSeason(uint8 season);
void BroadcastUpdatedWorldState();
ArenaSeasonRewardGroupsBySeasonContainer _arenaSeasonRewardGroupsStore;
uint8 _currentSeason{};
ArenaSeasonState _currentSeasonState{};
};
#define sArenaSeasonMgr ArenaSeasonMgr::instance()
#endif // _ARENASEASONMGR_H
@@ -0,0 +1,166 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ArenaSeasonRewardsDistributor.h"
#include "AchievementMgr.h"
#include "CharacterDatabase.h"
#include "Mail.h"
#include "Player.h"
#include <algorithm>
constexpr float minPctTeamGamesForMemberToGetReward = 30;
void ArenaSeasonTeamRewarderImpl::RewardTeamWithRewardGroup(ArenaTeam *arenaTeam, const ArenaSeasonRewardGroup &rewardGroup)
{
RewardWithMail(arenaTeam, rewardGroup);
RewardWithAchievements(arenaTeam, rewardGroup);
}
void ArenaSeasonTeamRewarderImpl::RewardWithMail(ArenaTeam* arenaTeam, ArenaSeasonRewardGroup const & rewardGroup)
{
if (rewardGroup.itemRewards.empty() && rewardGroup.goldReward == 0)
return;
const uint32 npcKingDondSender = 18897;
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
for (auto const& member : arenaTeam->GetMembers())
{
uint32 teamSeasonGames = arenaTeam->GetStats().SeasonGames;
// Avoid division by zero.
if (teamSeasonGames == 0)
continue;
float memberParticipationPercentage = (static_cast<float>(member.SeasonGames) / teamSeasonGames) * 100;
if (memberParticipationPercentage < minPctTeamGamesForMemberToGetReward)
continue;
Player* player = ObjectAccessor::FindPlayer(member.Guid);
auto draft = rewardGroup.rewardMailTemplateID > 0 ?
MailDraft(rewardGroup.rewardMailTemplateID, false) :
MailDraft(rewardGroup.rewardMailSubject, rewardGroup.rewardMailBody);
if (rewardGroup.goldReward > 0)
draft.AddMoney(rewardGroup.goldReward);
for (auto const& reward : rewardGroup.itemRewards)
if (Item* item = Item::CreateItem(reward.entry, 1))
{
item->SaveToDB(trans);
draft.AddItem(item);
}
draft.SendMailTo(trans, MailReceiver(player, member.Guid.GetCounter()), MailSender(npcKingDondSender));
}
CharacterDatabase.CommitTransaction(trans);
}
void ArenaSeasonTeamRewarderImpl::RewardWithAchievements(ArenaTeam* arenaTeam, ArenaSeasonRewardGroup const & rewardGroup)
{
if (rewardGroup.achievementRewards.empty())
return;
for (auto const& member : arenaTeam->GetMembers())
{
uint32 teamSeasonGames = arenaTeam->GetStats().SeasonGames;
// Avoid division by zero.
if (teamSeasonGames == 0)
continue;
float memberParticipationPercentage = (static_cast<float>(member.SeasonGames) / teamSeasonGames) * 100;
if (memberParticipationPercentage < minPctTeamGamesForMemberToGetReward)
continue;
Player* player = ObjectAccessor::FindPlayer(member.Guid);
for (auto const& reward : rewardGroup.achievementRewards)
{
AchievementEntry const* achievement = sAchievementStore.LookupEntry(reward.entry);
if (!achievement)
continue;
if (player)
player->CompletedAchievement(achievement);
else
sAchievementMgr->CompletedAchievementForOfflinePlayer(member.Guid.GetCounter(), achievement);
}
}
}
ArenaSeasonRewardDistributor::ArenaSeasonRewardDistributor(ArenaSeasonTeamRewarder* rewarder)
: _rewarder(rewarder)
{
}
void ArenaSeasonRewardDistributor::DistributeRewards(ArenaTeamMgr::ArenaTeamContainer &arenaTeams, std::vector<ArenaSeasonRewardGroup> &rewardGroups)
{
std::vector<ArenaTeam*> sortedTeams;
sortedTeams.reserve(arenaTeams.size());
static constexpr uint16 minRequiredGames = 30;
for (auto const& [id, team] : arenaTeams)
if (team->GetStats().SeasonGames >= minRequiredGames)
sortedTeams.push_back(team);
std::sort(sortedTeams.begin(), sortedTeams.end(), [](ArenaTeam* a, ArenaTeam* b) {
return a->GetRating() > b->GetRating();
});
std::vector<ArenaSeasonRewardGroup> pctRewardGroup;
std::vector<ArenaSeasonRewardGroup> absRewardGroup;
for (auto const& reward : rewardGroups)
{
if (reward.criteriaType == ARENA_SEASON_REWARD_CRITERIA_TYPE_PERCENT_VALUE)
pctRewardGroup.push_back(reward);
else
absRewardGroup.push_back(reward);
}
size_t totalTeams = sortedTeams.size();
for (auto const& rewardGroup : pctRewardGroup)
{
size_t minIndex = static_cast<size_t>(rewardGroup.minCriteria * totalTeams / 100);
size_t maxIndex = static_cast<size_t>(rewardGroup.maxCriteria * totalTeams / 100);
minIndex = std::min(minIndex, totalTeams);
maxIndex = std::min(maxIndex, totalTeams);
for (size_t i = minIndex; i < maxIndex; ++i)
{
ArenaTeam* team = sortedTeams[i];
_rewarder->RewardTeamWithRewardGroup(team, rewardGroup);
}
}
for (auto const& rewardGroup : absRewardGroup)
{
size_t minIndex = rewardGroup.minCriteria-1; // Top 1 team is the team with index 0, so we need make -1.
size_t maxIndex = rewardGroup.maxCriteria;
minIndex = std::max(minIndex, size_t(0));
minIndex = std::min(minIndex, totalTeams);
maxIndex = std::min(maxIndex, totalTeams);
for (size_t i = minIndex; i < maxIndex; ++i)
{
ArenaTeam* team = sortedTeams[i];
_rewarder->RewardTeamWithRewardGroup(team, rewardGroup);
}
}
}
@@ -0,0 +1,54 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ARENASEASONREWARDDISTRIBUTOR_H
#define _ARENASEASONREWARDDISTRIBUTOR_H
#include "ArenaSeasonMgr.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
class ArenaSeasonTeamRewarder
{
public:
virtual ~ArenaSeasonTeamRewarder() = default;
virtual void RewardTeamWithRewardGroup(ArenaTeam* arenaTeam, ArenaSeasonRewardGroup const & rewardGroup) = 0;
};
class ArenaSeasonTeamRewarderImpl: public ArenaSeasonTeamRewarder
{
public:
void RewardTeamWithRewardGroup(ArenaTeam* arenaTeam, ArenaSeasonRewardGroup const & rewardGroup) override;
private:
void RewardWithMail(ArenaTeam* arenaTeam, ArenaSeasonRewardGroup const & rewardGroup);
void RewardWithAchievements(ArenaTeam* arenaTeam, ArenaSeasonRewardGroup const & rewardGroup);
};
class ArenaSeasonRewardDistributor
{
public:
ArenaSeasonRewardDistributor(ArenaSeasonTeamRewarder* rewarder);
void DistributeRewards(ArenaTeamMgr::ArenaTeamContainer& arenaTeams, std::vector<ArenaSeasonRewardGroup>& rewardGroups);
private:
ArenaSeasonTeamRewarder* _rewarder;
};
#endif // _ARENASEASONREWARDDISTRIBUTOR_H
@@ -0,0 +1,113 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ARENATEAMFILTER_H
#define _ARENATEAMFILTER_H
#include "Common.h"
#include "ArenaTeamMgr.h"
#include "ArenaTeam.h"
#include "Tokenize.h"
#include "StringConvert.h"
#include <sstream>
#include <string>
#include <memory>
#include <unordered_map>
#include <algorithm>
#include <cctype>
class ArenaTeamFilter
{
public:
virtual ~ArenaTeamFilter() = default;
virtual ArenaTeamMgr::ArenaTeamContainer Filter(ArenaTeamMgr::ArenaTeamContainer teams) = 0;
};
class ArenaTeamFilterByTypes : public ArenaTeamFilter
{
public:
ArenaTeamFilterByTypes(std::vector<uint8> validTypes) : _validTypes(validTypes) {}
ArenaTeamMgr::ArenaTeamContainer Filter(ArenaTeamMgr::ArenaTeamContainer teams) override
{
ArenaTeamMgr::ArenaTeamContainer result;
for (auto const& pair : teams)
{
ArenaTeam* team = pair.second;
for (uint8 arenaType : _validTypes)
{
if (team->GetType() == arenaType)
{
result[pair.first] = team;
break;
}
}
}
return result;
}
private:
std::vector<uint8> _validTypes;
};
class ArenaTeamFilterAllTeams : public ArenaTeamFilter
{
public:
ArenaTeamMgr::ArenaTeamContainer Filter(ArenaTeamMgr::ArenaTeamContainer teams) override
{
return teams;
}
};
class ArenaTeamFilterFactoryByUserInput
{
public:
std::unique_ptr<ArenaTeamFilter> CreateFilterByUserInput(std::string userInput)
{
std::transform(userInput.begin(), userInput.end(), userInput.begin(),
[](unsigned char c) { return std::tolower(c); });
if (userInput == "all")
return std::make_unique<ArenaTeamFilterAllTeams>();
// Parse the input string (e.g., "2,3") into valid types
std::vector<uint8> validTypes = ParseTypes(userInput);
if (!validTypes.empty())
return std::make_unique<ArenaTeamFilterByTypes>(validTypes);
return nullptr;
}
private:
std::vector<uint8> ParseTypes(std::string_view userInput)
{
std::vector<uint8> validTypes;
auto tokens = Acore::Tokenize(userInput, ',', false);
for (auto const& token : tokens)
if (auto typeOpt = Acore::StringTo<uint8>(token))
validTypes.push_back(*typeOpt);
return validTypes;
}
};
#endif // _ARENATEAMFILTER_H
+2 -1
View File
@@ -17,6 +17,7 @@
#include "ArenaTeam.h" #include "ArenaTeam.h"
#include "ArenaTeamMgr.h" #include "ArenaTeamMgr.h"
#include "ArenaSeasonMgr.h"
#include "BattlegroundMgr.h" #include "BattlegroundMgr.h"
#include "CharacterCache.h" #include "CharacterCache.h"
#include "Group.h" #include "Group.h"
@@ -658,7 +659,7 @@ uint32 ArenaTeam::GetPoints(uint32 memberRating)
if (rating <= 1500) if (rating <= 1500)
{ {
if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) < 6 && !sWorld->getIntConfig(CONFIG_LEGACY_ARENA_POINTS_CALC)) if (sArenaSeasonMgr->GetCurrentSeason() < 6 && !sWorld->getIntConfig(CONFIG_LEGACY_ARENA_POINTS_CALC))
points = (float)rating * 0.22f + 14.0f; points = (float)rating * 0.22f + 14.0f;
else else
points = 344; points = 344;
@@ -125,6 +125,27 @@ void ArenaTeamMgr::RemoveArenaTeam(uint32 arenaTeamId)
ArenaTeamStore.erase(arenaTeamId); ArenaTeamStore.erase(arenaTeamId);
} }
void ArenaTeamMgr::DeleteAllArenaTeams()
{
for (auto const& [id, team] : ArenaTeamStore)
{
while (team->GetMembersSize() > 0)
team->DelMember(team->GetMembers().front().Guid, false);
delete team;
}
ArenaTeamStore.clear();
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
trans->Append("DELETE FROM arena_team_member");
trans->Append("DELETE FROM arena_team");
trans->Append("DELETE FROM character_arena_stats");
CharacterDatabase.CommitTransaction(trans);
NextArenaTeamId = 1;
}
uint32 ArenaTeamMgr::GenerateArenaTeamId() uint32 ArenaTeamMgr::GenerateArenaTeamId()
{ {
if (NextArenaTeamId >= MAX_ARENA_TEAM_ID) if (NextArenaTeamId >= MAX_ARENA_TEAM_ID)
@@ -43,6 +43,8 @@ public:
void AddArenaTeam(ArenaTeam* arenaTeam); void AddArenaTeam(ArenaTeam* arenaTeam);
void RemoveArenaTeam(uint32 Id); void RemoveArenaTeam(uint32 Id);
void DeleteAllArenaTeams();
ArenaTeamContainer::iterator GetArenaTeamMapBegin() { return ArenaTeamStore.begin(); } ArenaTeamContainer::iterator GetArenaTeamMapBegin() { return ArenaTeamStore.begin(); }
ArenaTeamContainer::iterator GetArenaTeamMapEnd() { return ArenaTeamStore.end(); } ArenaTeamContainer::iterator GetArenaTeamMapEnd() { return ArenaTeamStore.end(); }
ArenaTeamContainer& GetArenaTeams() { return ArenaTeamStore; } ArenaTeamContainer& GetArenaTeams() { return ArenaTeamStore; }
+2 -1
View File
@@ -24,6 +24,7 @@
#include "GameObject.h" #include "GameObject.h"
#include "SharedDefines.h" #include "SharedDefines.h"
#include "World.h" #include "World.h"
#include "WorldStatePackets.h"
class Creature; class Creature;
class GameObject; class GameObject;
@@ -458,7 +459,7 @@ public:
// Packet Transfer // Packet Transfer
// method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!) // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
virtual void FillInitialWorldStates(WorldPacket& /*data*/) { } virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { }
void SendPacketToTeam(TeamId teamId, WorldPacket const* packet, Player* sender = nullptr, bool self = true); void SendPacketToTeam(TeamId teamId, WorldPacket const* packet, Player* sender = nullptr, bool self = true);
void SendPacketToAll(WorldPacket const* packet); void SendPacketToAll(WorldPacket const* packet);
void YellToAll(Creature* creature, const char* text, uint32 language); void YellToAll(Creature* creature, const char* text, uint32 language);
@@ -334,6 +334,18 @@ Battleground* BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgType
return bgs.empty() ? nullptr : bgs.begin()->second; return bgs.empty() ? nullptr : bgs.begin()->second;
} }
std::vector<Battleground const*> BattlegroundMgr::GetActiveBattlegrounds()
{
std::vector<Battleground const*> result;
for (auto const& [bgType, bgData] : bgDataStore)
for (auto const& [id, bg] : bgData._Battlegrounds)
if (bg->GetStatus() == STATUS_WAIT_JOIN || bg->GetStatus() == STATUS_IN_PROGRESS)
result.push_back(static_cast<const Battleground*>(bg));
return result;
}
uint32 BattlegroundMgr::CreateClientVisibleInstanceId(BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id) uint32 BattlegroundMgr::CreateClientVisibleInstanceId(BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id)
{ {
if (IsArenaType(bgTypeId)) if (IsArenaType(bgTypeId))
@@ -82,6 +82,7 @@ public:
Battleground* GetBattleground(uint32 instanceID, BattlegroundTypeId bgTypeId); Battleground* GetBattleground(uint32 instanceID, BattlegroundTypeId bgTypeId);
Battleground* GetBattlegroundTemplate(BattlegroundTypeId bgTypeId); Battleground* GetBattlegroundTemplate(BattlegroundTypeId bgTypeId);
Battleground* CreateNewBattleground(BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated); Battleground* CreateNewBattleground(BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated);
std::vector<Battleground const*> GetActiveBattlegrounds();
void AddBattleground(Battleground* bg); void AddBattleground(Battleground* bg);
void RemoveBattleground(BattlegroundTypeId bgTypeId, uint32 instanceId); void RemoveBattleground(BattlegroundTypeId bgTypeId, uint32 instanceId);
@@ -1355,11 +1355,11 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
CharacterDatabase.Execute(stmt); CharacterDatabase.Execute(stmt);
} }
sScriptMgr->OnBattlegroundDesertion(player, BG_DESERTION_TYPE_NO_ENTER_BUTTON); sScriptMgr->OnPlayerBattlegroundDesertion(player, BG_DESERTION_TYPE_NO_ENTER_BUTTON);
} }
if (bg && bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)) if (bg && bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN))
sScriptMgr->OnBattlegroundDesertion(player, ARENA_DESERTION_TYPE_NO_ENTER_BUTTON); sScriptMgr->OnPlayerBattlegroundDesertion(player, ARENA_DESERTION_TYPE_NO_ENTER_BUTTON);
LOG_DEBUG("bg.battleground", "Battleground: removing player {} from bg queue for instance {} because of not pressing enter battle in time.", player->GetGUID().ToString(), m_BgInstanceGUID); LOG_DEBUG("bg.battleground", "Battleground: removing player {} from bg queue for instance {} because of not pressing enter battle in time.", player->GetGUID().ToString(), m_BgInstanceGUID);
@@ -23,6 +23,7 @@
#include "Util.h" #include "Util.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldSession.h" #include "WorldSession.h"
#include "WorldStatePackets.h"
void BattlegroundABScore::BuildObjectivesBlock(WorldPacket& data) void BattlegroundABScore::BuildObjectivesBlock(WorldPacket& data)
{ {
@@ -234,24 +235,26 @@ void BattlegroundAB::DeleteBanner(uint8 node)
SpawnBGObject(node * BG_AB_OBJECTS_PER_NODE + BG_AB_OBJECT_AURA_ALLY + _capturePointInfo[node]._ownerTeamId, RESPAWN_ONE_DAY); SpawnBGObject(node * BG_AB_OBJECTS_PER_NODE + BG_AB_OBJECT_AURA_ALLY + _capturePointInfo[node]._ownerTeamId, RESPAWN_ONE_DAY);
} }
void BattlegroundAB::FillInitialWorldStates(WorldPacket& data) void BattlegroundAB::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
packet.Worldstates.reserve(BG_AB_DYNAMIC_NODES_COUNT+7);
for (auto& node : _capturePointInfo) for (auto& node : _capturePointInfo)
{ {
if (node._state == BG_AB_NODE_STATE_NEUTRAL) if (node._state == BG_AB_NODE_STATE_NEUTRAL)
data << uint32(node._iconNone) << uint32(1); packet.Worldstates.emplace_back(node._iconNone, 1);
for (uint8 i = BG_AB_NODE_STATE_ALLY_OCCUPIED; i <= BG_AB_NODE_STATE_HORDE_CONTESTED; ++i) for (uint8 i = BG_AB_NODE_STATE_ALLY_OCCUPIED; i <= BG_AB_NODE_STATE_HORDE_CONTESTED; ++i)
data << uint32(node._iconCapture + i - 1) << uint32(node._state == i); packet.Worldstates.emplace_back(node._iconCapture + i - 1, node._state == i ? 1 : 0);
} }
data << uint32(BG_AB_OP_OCCUPIED_BASES_ALLY) << uint32(_controlledPoints[TEAM_ALLIANCE]); packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_ALLY, _controlledPoints[TEAM_ALLIANCE]);
data << uint32(BG_AB_OP_OCCUPIED_BASES_HORDE) << uint32(_controlledPoints[TEAM_HORDE]); packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]);
data << uint32(BG_AB_OP_RESOURCES_MAX) << uint32(BG_AB_MAX_TEAM_SCORE); packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_MAX, BG_AB_MAX_TEAM_SCORE);
data << uint32(BG_AB_OP_RESOURCES_WARNING) << uint32(BG_AB_WARNING_NEAR_VICTORY_SCORE); packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE);
data << uint32(BG_AB_OP_RESOURCES_ALLY) << uint32(m_TeamScores[TEAM_ALLIANCE]); packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[TEAM_ALLIANCE]);
data << uint32(BG_AB_OP_RESOURCES_HORDE) << uint32(m_TeamScores[TEAM_HORDE]); packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[TEAM_HORDE]);
data << uint32(0x745) << uint32(0x2); // 37 1861 unk packet.Worldstates.emplace_back(0x745, 2);
} }
void BattlegroundAB::SendNodeUpdate(uint8 node) void BattlegroundAB::SendNodeUpdate(uint8 node)
@@ -316,7 +316,7 @@ public:
GraveyardStruct const* GetClosestGraveyard(Player* player) override; GraveyardStruct const* GetClosestGraveyard(Player* player) override;
bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override; bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override;
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
void EventPlayerClickedOnFlag(Player* source, GameObject* gameObject) override; void EventPlayerClickedOnFlag(Player* source, GameObject* gameObject) override;
bool AllNodesConrolledByTeam(TeamId teamId) const override; bool AllNodesConrolledByTeam(TeamId teamId) const override;
@@ -25,6 +25,7 @@
#include "Player.h" #include "Player.h"
#include "SpellAuras.h" #include "SpellAuras.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldStatePackets.h"
void BattlegroundAVScore::BuildObjectivesBlock(WorldPacket& data) void BattlegroundAVScore::BuildObjectivesBlock(WorldPacket& data)
{ {
@@ -1084,9 +1085,10 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
player->KilledMonsterCredit((IsTower(node)) ? BG_AV_QUEST_CREDIT_TOWER : BG_AV_QUEST_CREDIT_GRAVEYARD); player->KilledMonsterCredit((IsTower(node)) ? BG_AV_QUEST_CREDIT_TOWER : BG_AV_QUEST_CREDIT_GRAVEYARD);
} }
void BattlegroundAV::FillInitialWorldStates(WorldPacket& data) void BattlegroundAV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
bool stateok; bool stateok;
packet.Worldstates.reserve(7*2*2 + 8*2*2 + 5);
//graveyards //graveyards
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; i++) for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; i++)
{ {
@@ -1094,8 +1096,8 @@ void BattlegroundAV::FillInitialWorldStates(WorldPacket& data)
{ {
//j=1=assaulted j=3=controled //j=1=assaulted j=3=controled
stateok = (m_Nodes[i].State == j); stateok = (m_Nodes[i].State == j);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_ALLIANCE)]) << uint32((m_Nodes[i].OwnerId == TEAM_ALLIANCE && stateok) ? 1 : 0); packet.Worldstates.emplace_back(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_ALLIANCE)], (m_Nodes[i].OwnerId == TEAM_ALLIANCE && stateok) ? 1 : 0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_HORDE)]) << uint32((m_Nodes[i].OwnerId == TEAM_HORDE && stateok) ? 1 : 0); packet.Worldstates.emplace_back(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_HORDE)], (m_Nodes[i].OwnerId == TEAM_HORDE && stateok) ? 1 : 0);
} }
} }
@@ -1105,23 +1107,19 @@ void BattlegroundAV::FillInitialWorldStates(WorldPacket& data)
{ {
//j=1=assaulted j=3=controled //i dont have j=2=destroyed cause destroyed is the same like enemy-team controll //j=1=assaulted j=3=controled //i dont have j=2=destroyed cause destroyed is the same like enemy-team controll
stateok = (m_Nodes[i].State == j || (m_Nodes[i].State == POINT_DESTROYED && j == 3)); stateok = (m_Nodes[i].State == j || (m_Nodes[i].State == POINT_DESTROYED && j == 3));
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_ALLIANCE)]) << uint32((m_Nodes[i].OwnerId == TEAM_ALLIANCE && stateok) ? 1 : 0); packet.Worldstates.emplace_back(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_ALLIANCE)], (m_Nodes[i].OwnerId == TEAM_ALLIANCE && stateok) ? 1 : 0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_HORDE)]) << uint32((m_Nodes[i].OwnerId == TEAM_HORDE && stateok) ? 1 : 0); packet.Worldstates.emplace_back(BG_AV_NodeWorldStates[i][GetWorldStateType(j, TEAM_HORDE)], (m_Nodes[i].OwnerId == TEAM_HORDE && stateok) ? 1 : 0);
} }
if (m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].OwnerId == TEAM_NEUTRAL) //cause neutral teams aren't handled generic if (m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].OwnerId == TEAM_NEUTRAL) //cause neutral teams aren't handled generic
data << uint32(AV_SNOWFALL_N) << uint32(1);
data << uint32(AV_Alliance_Score) << uint32(m_Team_Scores[0]);
data << uint32(AV_Horde_Score) << uint32(m_Team_Scores[1]);
if (GetStatus() == STATUS_IN_PROGRESS) //only if game started the teamscores are displayed
{ {
data << uint32(AV_SHOW_A_SCORE) << uint32(1); packet.Worldstates.emplace_back(AV_SNOWFALL_N, 1);
data << uint32(AV_SHOW_H_SCORE) << uint32(1);
}
else
{
data << uint32(AV_SHOW_A_SCORE) << uint32(0);
data << uint32(AV_SHOW_H_SCORE) << uint32(0);
} }
packet.Worldstates.emplace_back(AV_Alliance_Score, m_Team_Scores[0]);
packet.Worldstates.emplace_back(AV_Horde_Score, m_Team_Scores[1]);
packet.Worldstates.emplace_back(AV_SHOW_A_SCORE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0);
packet.Worldstates.emplace_back(AV_SHOW_H_SCORE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0);
SendMineWorldStates(AV_NORTH_MINE); SendMineWorldStates(AV_NORTH_MINE);
SendMineWorldStates(AV_SOUTH_MINE); SendMineWorldStates(AV_SOUTH_MINE);
} }
@@ -1940,7 +1940,7 @@ private:
void ChangeMineOwner(uint8 mine, TeamId teamId, bool initial = false); void ChangeMineOwner(uint8 mine, TeamId teamId, bool initial = false);
/*worldstates*/ /*worldstates*/
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
uint8 GetWorldStateType(uint8 state, TeamId teamId); uint8 GetWorldStateType(uint8 state, TeamId teamId);
void SendMineWorldStates(uint32 mine); void SendMineWorldStates(uint32 mine);
void UpdateNodeWorldState(BG_AV_Nodes node); void UpdateNodeWorldState(BG_AV_Nodes node);
@@ -19,6 +19,7 @@
#include "Log.h" #include "Log.h"
#include "Player.h" #include "Player.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldStatePackets.h"
BattlegroundBE::BattlegroundBE() BattlegroundBE::BattlegroundBE()
{ {
@@ -87,10 +88,10 @@ void BattlegroundBE::HandleAreaTrigger(Player* player, uint32 trigger)
} }
} }
void BattlegroundBE::FillInitialWorldStates(WorldPacket& data) void BattlegroundBE::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(0x9f3) << uint32(1); // 9 packet.Worldstates.emplace_back(0x9f3, 1); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW
Arena::FillInitialWorldStates(data); Arena::FillInitialWorldStates(packet);
} }
bool BattlegroundBE::SetupBattleground() bool BattlegroundBE::SetupBattleground()
@@ -54,7 +54,7 @@ public:
void HandleAreaTrigger(Player* player, uint32 trigger) override; void HandleAreaTrigger(Player* player, uint32 trigger) override;
bool SetupBattleground() override; bool SetupBattleground() override;
void FillInitialWorldStates(WorldPacket& d) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
bool HandlePlayerUnderMap(Player* player) override; bool HandlePlayerUnderMap(Player* player) override;
}; };
@@ -22,6 +22,7 @@
#include "ObjectAccessor.h" #include "ObjectAccessor.h"
#include "Player.h" #include "Player.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldStatePackets.h"
BattlegroundDS::BattlegroundDS() BattlegroundDS::BattlegroundDS()
{ {
@@ -173,10 +174,10 @@ bool BattlegroundDS::HandlePlayerUnderMap(Player* player)
return true; return true;
} }
void BattlegroundDS::FillInitialWorldStates(WorldPacket& data) void BattlegroundDS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(3610) << uint32(1); // 9 show packet.Worldstates.emplace_back(0xe1a, 1); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW
Arena::FillInitialWorldStates(data); Arena::FillInitialWorldStates(packet);
} }
bool BattlegroundDS::SetupBattleground() bool BattlegroundDS::SetupBattleground()
@@ -101,7 +101,7 @@ public:
void HandleAreaTrigger(Player* player, uint32 trigger) override; void HandleAreaTrigger(Player* player, uint32 trigger) override;
bool SetupBattleground() override; bool SetupBattleground() override;
void FillInitialWorldStates(WorldPacket& d) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
bool HandlePlayerUnderMap(Player* player) override; bool HandlePlayerUnderMap(Player* player) override;
private: private:
@@ -26,6 +26,7 @@
#include "World.h" #include "World.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldSession.h" #include "WorldSession.h"
#include "WorldStatePackets.h"
void BattlegroundEYScore::BuildObjectivesBlock(WorldPacket& data) void BattlegroundEYScore::BuildObjectivesBlock(WorldPacket& data)
{ {
@@ -506,7 +507,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, TeamId teamId, uint3
_capturePointInfo[point]._ownerTeamId = teamId; _capturePointInfo[point]._ownerTeamId = teamId;
GraveyardStruct const* sg = sGraveyard->GetGraveyard(m_CapturingPointTypes[point].GraveYardId); GraveyardStruct const* sg = sGraveyard->GetGraveyard(m_CapturingPointTypes[point].GraveyardId);
AddSpiritGuide(point, sg->x, sg->y, sg->z, 3.124139f, teamId); AddSpiritGuide(point, sg->x, sg->y, sg->z, 3.124139f, teamId);
UpdatePointsIcons(point); UpdatePointsIcons(point);
@@ -568,30 +569,31 @@ bool BattlegroundEY::UpdatePlayerScore(Player* player, uint32 type, uint32 value
return true; return true;
} }
void BattlegroundEY::FillInitialWorldStates(WorldPacket& data) void BattlegroundEY::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(EY_HORDE_BASE) << uint32(_ownedPointsCount[TEAM_HORDE]); packet.Worldstates.reserve(22);
data << uint32(EY_ALLIANCE_BASE) << uint32(_ownedPointsCount[TEAM_ALLIANCE]); packet.Worldstates.emplace_back(EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]);
data << uint32(DRAENEI_RUINS_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE)); packet.Worldstates.emplace_back(EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]);
data << uint32(DRAENEI_RUINS_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE)); packet.Worldstates.emplace_back(DRAENEI_RUINS_HORDE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE));
data << uint32(DRAENEI_RUINS_UNCONTROL) << uint32(_capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled()); packet.Worldstates.emplace_back(DRAENEI_RUINS_ALLIANCE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE));
data << uint32(MAGE_TOWER_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE)); packet.Worldstates.emplace_back(DRAENEI_RUINS_UNCONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled());
data << uint32(MAGE_TOWER_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE)); packet.Worldstates.emplace_back(MAGE_TOWER_ALLIANCE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE));
data << uint32(MAGE_TOWER_UNCONTROL) << uint32(_capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled()); packet.Worldstates.emplace_back(MAGE_TOWER_HORDE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE));
data << uint32(FEL_REAVER_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE)); packet.Worldstates.emplace_back(MAGE_TOWER_UNCONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled());
data << uint32(FEL_REAVER_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE)); packet.Worldstates.emplace_back(FEL_REAVER_HORDE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE));
data << uint32(FEL_REAVER_UNCONTROL) << uint32(_capturePointInfo[POINT_FEL_REAVER].IsUncontrolled()); packet.Worldstates.emplace_back(FEL_REAVER_ALLIANCE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE));
data << uint32(BLOOD_ELF_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE)); packet.Worldstates.emplace_back(FEL_REAVER_UNCONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUncontrolled());
data << uint32(BLOOD_ELF_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE)); packet.Worldstates.emplace_back(BLOOD_ELF_HORDE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE));
data << uint32(BLOOD_ELF_UNCONTROL) << uint32(_capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled()); packet.Worldstates.emplace_back(BLOOD_ELF_ALLIANCE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE));
data << uint32(NETHERSTORM_FLAG) << uint32(_flagState == BG_EY_FLAG_STATE_ON_BASE); packet.Worldstates.emplace_back(BLOOD_ELF_UNCONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled());
data << uint32(NETHERSTORM_FLAG_STATE_HORDE) << uint32(1); packet.Worldstates.emplace_back(NETHERSTORM_FLAG, _flagState == BG_EY_FLAG_STATE_ON_BASE);
data << uint32(NETHERSTORM_FLAG_STATE_ALLIANCE) << uint32(1); packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_HORDE, 1);
data << uint32(EY_HORDE_RESOURCES) << uint32(GetTeamScore(TEAM_HORDE)); packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_ALLIANCE, 1);
data << uint32(EY_ALLIANCE_RESOURCES) << uint32(GetTeamScore(TEAM_ALLIANCE)); packet.Worldstates.emplace_back(EY_HORDE_RESOURCES, GetTeamScore(TEAM_HORDE));
data << uint32(PROGRESS_BAR_SHOW) << uint32(0); packet.Worldstates.emplace_back(EY_ALLIANCE_RESOURCES, GetTeamScore(TEAM_ALLIANCE));
data << uint32(PROGRESS_BAR_PERCENT_GREY) << uint32(0); packet.Worldstates.emplace_back(PROGRESS_BAR_SHOW, 0);
data << uint32(PROGRESS_BAR_STATUS) << uint32(0); packet.Worldstates.emplace_back(PROGRESS_BAR_PERCENT_GREY, 0);
packet.Worldstates.emplace_back(PROGRESS_BAR_STATUS, 0);
} }
GraveyardStruct const* BattlegroundEY::GetClosestGraveyard(Player* player) GraveyardStruct const* BattlegroundEY::GetClosestGraveyard(Player* player)
@@ -608,7 +610,7 @@ GraveyardStruct const* BattlegroundEY::GetClosestGraveyard(Player* player)
for (uint8 i = 0; i < EY_POINTS_MAX; ++i) for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
if (_capturePointInfo[i].IsUnderControl(player->GetTeamId())) if (_capturePointInfo[i].IsUnderControl(player->GetTeamId()))
{ {
entry = sGraveyard->GetGraveyard(m_CapturingPointTypes[i].GraveYardId); entry = sGraveyard->GetGraveyard(m_CapturingPointTypes[i].GraveyardId);
dist = (entry->x - pX) * (entry->x - pX) + (entry->y - pY) * (entry->y - pY) + (entry->z - pZ) * (entry->z - pZ); dist = (entry->x - pX) * (entry->x - pX) + (entry->y - pY) * (entry->y - pY) + (entry->z - pZ) * (entry->z - pZ);
if (dist < minDist) if (dist < minDist)
{ {
@@ -305,11 +305,11 @@ struct BattlegroundEYLosingPointStruct
struct BattlegroundEYCapturingPointStruct struct BattlegroundEYCapturingPointStruct
{ {
BattlegroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId) BattlegroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveyardId)
: DespawnNeutralObjectType(_DespawnNeutralObjectType), : DespawnNeutralObjectType(_DespawnNeutralObjectType),
SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance), SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde), SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde),
GraveYardId(_GraveYardId) GraveyardId(_GraveyardId)
{} {}
uint32 DespawnNeutralObjectType; uint32 DespawnNeutralObjectType;
@@ -317,7 +317,7 @@ struct BattlegroundEYCapturingPointStruct
uint32 MessageIdAlliance; uint32 MessageIdAlliance;
uint32 SpawnObjectTypeHorde; uint32 SpawnObjectTypeHorde;
uint32 MessageIdHorde; uint32 MessageIdHorde;
uint32 GraveYardId; uint32 GraveyardId;
}; };
const uint32 BG_EY_TickPoints[EY_POINTS_MAX] = {1, 2, 5, 10}; const uint32 BG_EY_TickPoints[EY_POINTS_MAX] = {1, 2, 5, 10};
@@ -421,7 +421,7 @@ public:
void Init() override; void Init() override;
void EndBattleground(TeamId winnerTeamId) override; void EndBattleground(TeamId winnerTeamId) override;
bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override; bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override;
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
void SetDroppedFlagGUID(ObjectGuid guid, TeamId /*teamId*/ = TEAM_NEUTRAL) override { _droppedFlagGUID = guid; } void SetDroppedFlagGUID(ObjectGuid guid, TeamId /*teamId*/ = TEAM_NEUTRAL) override { _droppedFlagGUID = guid; }
ObjectGuid GetDroppedFlagGUID() const { return _droppedFlagGUID; } ObjectGuid GetDroppedFlagGUID() const { return _droppedFlagGUID; }
@@ -26,6 +26,7 @@
#include "Transport.h" #include "Transport.h"
#include "Vehicle.h" #include "Vehicle.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldStatePackets.h"
void BattlegroundICScore::BuildObjectivesBlock(WorldPacket& data) void BattlegroundICScore::BuildObjectivesBlock(WorldPacket& data)
{ {
@@ -381,21 +382,24 @@ bool BattlegroundIC::UpdatePlayerScore(Player* player, uint32 type, uint32 value
return true; return true;
} }
void BattlegroundIC::FillInitialWorldStates(WorldPacket& data) void BattlegroundIC::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(BG_IC_ALLIANCE_RENFORT_SET) << uint32(1); packet.Worldstates.reserve(4+MAX_FORTRESS_GATES_SPAWNS+MAX_NODE_TYPES+1);
data << uint32(BG_IC_HORDE_RENFORT_SET) << uint32(1); packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT_SET, 1);
data << uint32(BG_IC_ALLIANCE_RENFORT) << uint32(factionReinforcements[TEAM_ALLIANCE]); packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1);
data << uint32(BG_IC_HORDE_RENFORT) << uint32(factionReinforcements[TEAM_HORDE]); packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT, factionReinforcements[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT, factionReinforcements[TEAM_HORDE]);
for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; ++i) for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; ++i)
{ {
uint32 uws = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[i].entry, (GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[i].entry)] == BG_IC_GATE_DESTROYED)); uint32 uws = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[i].entry, (GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[i].entry)] == BG_IC_GATE_DESTROYED));
data << uint32(uws) << uint32(1); packet.Worldstates.emplace_back(uws, 1);
} }
for (uint8 i = 0; i < MAX_NODE_TYPES; ++i) for (uint8 i = 0; i < MAX_NODE_TYPES; ++i)
data << uint32(nodePoint[i].worldStates[nodePoint[i].nodeState]) << uint32(1); packet.Worldstates.emplace_back(nodePoint[i].worldStates[nodePoint[i].nodeState], 1);
packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1);
} }
bool BattlegroundIC::SetupBattleground() bool BattlegroundIC::SetupBattleground()
@@ -974,7 +974,7 @@ public:
/* Scorekeeping */ /* Scorekeeping */
bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override; bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override;
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
void HandlePlayerResurrect(Player* player) override; void HandlePlayerResurrect(Player* player) override;
@@ -64,10 +64,10 @@ void BattlegroundNA::HandleAreaTrigger(Player* player, uint32 trigger)
} }
} }
void BattlegroundNA::FillInitialWorldStates(WorldPacket& data) void BattlegroundNA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(0xa11) << uint32(1); // 9 packet.Worldstates.emplace_back(0xa11, 1); // BATTLEGROUND_NAGRAND_ARENA_SHOW
Arena::FillInitialWorldStates(data); Arena::FillInitialWorldStates(packet);
} }
bool BattlegroundNA::SetupBattleground() bool BattlegroundNA::SetupBattleground()
@@ -54,7 +54,8 @@ public:
void HandleAreaTrigger(Player* player, uint32 trigger) override; void HandleAreaTrigger(Player* player, uint32 trigger) override;
bool SetupBattleground() override; bool SetupBattleground() override;
void FillInitialWorldStates(WorldPacket& d) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
bool HandlePlayerUnderMap(Player* player) override; bool HandlePlayerUnderMap(Player* player) override;
}; };
@@ -91,10 +91,10 @@ void BattlegroundRL::HandleAreaTrigger(Player* player, uint32 trigger)
} }
} }
void BattlegroundRL::FillInitialWorldStates(WorldPacket& data) void BattlegroundRL::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(0xbba) << uint32(1); // 9 packet.Worldstates.emplace_back(0xbba, 1); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW
Arena::FillInitialWorldStates(data); Arena::FillInitialWorldStates(packet);
} }
bool BattlegroundRL::SetupBattleground() bool BattlegroundRL::SetupBattleground()
@@ -45,7 +45,7 @@ public:
BattlegroundRL(); BattlegroundRL();
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
void FillInitialWorldStates(WorldPacket& d) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
void StartingEventCloseDoors() override; void StartingEventCloseDoors() override;
void StartingEventOpenDoors() override; void StartingEventOpenDoors() override;
@@ -204,10 +204,10 @@ void BattlegroundRV::HandleAreaTrigger(Player* player, uint32 trigger)
} }
} }
void BattlegroundRV::FillInitialWorldStates(WorldPacket& data) void BattlegroundRV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(BG_RV_WORLD_STATE) << uint32(1); packet.Worldstates.emplace_back(BG_RV_WORLD_STATE, 1);
Arena::FillInitialWorldStates(data); Arena::FillInitialWorldStates(packet);
} }
void BattlegroundRV::Init() void BattlegroundRV::Init()
@@ -90,7 +90,7 @@ public:
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
void StartingEventOpenDoors() override; void StartingEventOpenDoors() override;
void Init() override; void Init() override;
void FillInitialWorldStates(WorldPacket& d) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
void HandleAreaTrigger(Player* player, uint32 trigger) override; void HandleAreaTrigger(Player* player, uint32 trigger) override;
bool SetupBattleground() override; bool SetupBattleground() override;
bool HandlePlayerUnderMap(Player* player) override; bool HandlePlayerUnderMap(Player* player) override;
@@ -467,44 +467,46 @@ void BattlegroundSA::StartingEventOpenDoors()
{ {
} }
void BattlegroundSA::FillInitialWorldStates(WorldPacket& data) void BattlegroundSA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
uint32 ally_attacks = uint32(Attackers == TEAM_ALLIANCE ? 1 : 0); bool const ally_attacks = Attackers == TEAM_ALLIANCE;
uint32 horde_attacks = uint32(Attackers == TEAM_HORDE ? 1 : 0); bool const horde_attacks = Attackers == TEAM_HORDE;
data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]); packet.Worldstates.reserve(25);
data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]); packet.Worldstates.emplace_back(BG_SA_ANCIENT_GATEWS, GateStatus[BG_SA_ANCIENT_GATE]);
data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]); packet.Worldstates.emplace_back(BG_SA_YELLOW_GATEWS, GateStatus[BG_SA_YELLOW_GATE]);
data << uint32(BG_SA_BLUE_GATEWS) << uint32(GateStatus[BG_SA_BLUE_GATE]); packet.Worldstates.emplace_back(BG_SA_GREEN_GATEWS, GateStatus[BG_SA_GREEN_GATE]);
data << uint32(BG_SA_RED_GATEWS) << uint32(GateStatus[BG_SA_RED_GATE]); packet.Worldstates.emplace_back(BG_SA_BLUE_GATEWS, GateStatus[BG_SA_BLUE_GATE]);
data << uint32(BG_SA_PURPLE_GATEWS) << uint32(GateStatus[BG_SA_PURPLE_GATE]); packet.Worldstates.emplace_back(BG_SA_RED_GATEWS, GateStatus[BG_SA_RED_GATE]);
packet.Worldstates.emplace_back(BG_SA_PURPLE_GATEWS, GateStatus[BG_SA_PURPLE_GATE]);
data << uint32(BG_SA_BONUS_TIMER) << uint32(0); packet.Worldstates.emplace_back(BG_SA_BONUS_TIMER, 0);
data << uint32(BG_SA_HORDE_ATTACKS) << horde_attacks; packet.Worldstates.emplace_back(BG_SA_HORDE_ATTACKS, horde_attacks);
data << uint32(BG_SA_ALLY_ATTACKS) << ally_attacks; packet.Worldstates.emplace_back(BG_SA_ALLY_ATTACKS, ally_attacks);
//Time will be sent on first update... //Time will be sent on first update...
data << uint32(BG_SA_ENABLE_TIMER) << ((TimerEnabled) ? uint32(1) : uint32(0)); packet.Worldstates.emplace_back(BG_SA_ENABLE_TIMER, TimerEnabled ? 1 : 0);
data << uint32(BG_SA_TIMER_MINS) << uint32(0);
data << uint32(BG_SA_TIMER_SEC_TENS) << uint32(0);
data << uint32(BG_SA_TIMER_SEC_DECS) << uint32(0);
data << uint32(BG_SA_RIGHT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); packet.Worldstates.emplace_back(BG_SA_TIMER_MINS, 0);
data << uint32(BG_SA_LEFT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_TENS, 0);
data << uint32(BG_SA_CENTER_GY_HORDE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_DECS, 0);
data << uint32(BG_SA_RIGHT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
data << uint32(BG_SA_LEFT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); packet.Worldstates.emplace_back(BG_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
data << uint32(BG_SA_CENTER_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); packet.Worldstates.emplace_back(BG_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
data << uint32(BG_SA_HORDE_DEFENCE_TOKEN) << ally_attacks; packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
data << uint32(BG_SA_ALLIANCE_DEFENCE_TOKEN) << horde_attacks; packet.Worldstates.emplace_back(BG_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
data << uint32(BG_SA_LEFT_ATT_TOKEN_HRD) << horde_attacks; packet.Worldstates.emplace_back(BG_SA_HORDE_DEFENCE_TOKEN, ally_attacks);
data << uint32(BG_SA_RIGHT_ATT_TOKEN_HRD) << horde_attacks; packet.Worldstates.emplace_back(BG_SA_ALLIANCE_DEFENCE_TOKEN, horde_attacks);
data << uint32(BG_SA_RIGHT_ATT_TOKEN_ALL) << ally_attacks;
data << uint32(BG_SA_LEFT_ATT_TOKEN_ALL) << ally_attacks; packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_HRD, horde_attacks);
packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_HRD, horde_attacks);
packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_ALL, ally_attacks);
packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_ALL, ally_attacks);
} }
void BattlegroundSA::AddPlayer(Player* player) void BattlegroundSA::AddPlayer(Player* player)
@@ -475,7 +475,7 @@ public:
bool SetupBattleground() override; bool SetupBattleground() override;
void Init() override; void Init() override;
/// Called for generate packet contain worldstate data /// Called for generate packet contain worldstate data
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
/// Called when a player deal damage to building (door) /// Called when a player deal damage to building (door)
void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType) override; void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType) override;
/// Called when a player kill a unit in bg /// Called when a player kill a unit in bg
@@ -546,17 +546,18 @@ GraveyardStruct const* BattlegroundWS::GetClosestGraveyard(Player* player)
return sGraveyard->GetGraveyard(player->GetTeamId() == TEAM_ALLIANCE ? WS_GRAVEYARD_FLAGROOM_ALLIANCE : WS_GRAVEYARD_FLAGROOM_HORDE); return sGraveyard->GetGraveyard(player->GetTeamId() == TEAM_ALLIANCE ? WS_GRAVEYARD_FLAGROOM_ALLIANCE : WS_GRAVEYARD_FLAGROOM_HORDE);
} }
void BattlegroundWS::FillInitialWorldStates(WorldPacket& data) void BattlegroundWS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{ {
data << uint32(BG_WS_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(TEAM_ALLIANCE)); packet.Worldstates.reserve(7);
data << uint32(BG_WS_FLAG_CAPTURES_HORDE) << uint32(GetTeamScore(TEAM_HORDE)); packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE));
data << uint32(BG_WS_FLAG_CAPTURES_MAX) << uint32(BG_WS_MAX_TEAM_SCORE); packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(TEAM_HORDE));
packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_MAX, BG_WS_MAX_TEAM_SCORE);
data << uint32(BG_WS_STATE_TIMER_ACTIVE) << uint32(GetStatus() == STATUS_IN_PROGRESS); packet.Worldstates.emplace_back(BG_WS_STATE_TIMER_ACTIVE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0);
data << uint32(BG_WS_STATE_TIMER) << uint32(GetMatchTime()); packet.Worldstates.emplace_back(BG_WS_STATE_TIMER, GetMatchTime());
data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(GetFlagState(TEAM_HORDE)); packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_HORDE, GetFlagState(TEAM_HORDE));
data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(GetFlagState(TEAM_ALLIANCE)); packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_ALLIANCE, GetFlagState(TEAM_ALLIANCE));
} }
TeamId BattlegroundWS::GetPrematureWinner() TeamId BattlegroundWS::GetPrematureWinner()
@@ -252,7 +252,7 @@ public:
bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override; bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override;
void SetDroppedFlagGUID(ObjectGuid guid, TeamId teamId) override { _droppedFlagGUID[teamId] = guid; } void SetDroppedFlagGUID(ObjectGuid guid, TeamId teamId) override { _droppedFlagGUID[teamId] = guid; }
ObjectGuid GetDroppedFlagGUID(TeamId teamId) const { return _droppedFlagGUID[teamId];} ObjectGuid GetDroppedFlagGUID(TeamId teamId) const { return _droppedFlagGUID[teamId];}
void FillInitialWorldStates(WorldPacket& data) override; void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
/* Scorekeeping */ /* Scorekeeping */
void AddPoints(TeamId teamId, uint32 points) { m_TeamScores[teamId] += points; } void AddPoints(TeamId teamId, uint32 points) { m_TeamScores[teamId] += points; }
+2 -1
View File
@@ -19,6 +19,7 @@
#include "GuildMgr.h" #include "GuildMgr.h"
#include "ObjectAccessor.h" #include "ObjectAccessor.h"
#include "World.h" #include "World.h"
#include "WorldSessionMgr.h"
WhoListCacheMgr* WhoListCacheMgr::instance() WhoListCacheMgr* WhoListCacheMgr::instance()
{ {
@@ -30,7 +31,7 @@ void WhoListCacheMgr::Update()
{ {
// clear current list // clear current list
_whoListStorage.clear(); _whoListStorage.clear();
_whoListStorage.reserve(sWorld->GetPlayerCount() + 1); _whoListStorage.reserve(sWorldSessionMgr->GetPlayerCount() + 1);
for (auto const& [guid, player] : ObjectAccessor::GetPlayers()) for (auto const& [guid, player] : ObjectAccessor::GetPlayers())
{ {
+6 -5
View File
@@ -30,6 +30,7 @@
#include "World.h" #include "World.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldSession.h" #include "WorldSession.h"
#include "WorldSessionMgr.h"
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
Player* ChatHandler::GetPlayer() const Player* ChatHandler::GetPlayer() const
@@ -81,7 +82,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
return false; return false;
// ignore only for non-players for non strong checks (when allow apply command at least to same sec level) // ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY)) if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !strong && sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
return false; return false;
if (target) if (target)
@@ -188,7 +189,7 @@ void ChatHandler::SendGlobalSysMessage(const char* str)
for (std::string_view line : Acore::Tokenize(str, '\n', true)) for (std::string_view line : Acore::Tokenize(str, '\n', true))
{ {
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line); BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
sWorld->SendGlobalMessage(&data); sWorldSessionMgr->SendGlobalMessage(&data);
} }
} }
@@ -198,7 +199,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char* str)
for (std::string_view line : Acore::Tokenize(str, '\n', true)) for (std::string_view line : Acore::Tokenize(str, '\n', true))
{ {
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line); BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
sWorld->SendGlobalGMMessage(&data); sWorldSessionMgr->SendGlobalGMMessage(&data);
} }
} }
@@ -514,8 +515,8 @@ bool ChatHandler::HasSession() const
void ChatHandler::DoForAllValidSessions(std::function<void(Player*)> exec) void ChatHandler::DoForAllValidSessions(std::function<void(Player*)> exec)
{ {
SessionMap::const_iterator itr; WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr) for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
if (Player* player = itr->second->GetPlayer()) if (Player* player = itr->second->GetPlayer())
if (player->IsInWorld()) if (player->IsInWorld())
exec(player); exec(player);
+2 -2
View File
@@ -328,7 +328,7 @@ HostileReference* ThreatContainer::SelectNextVictim(Creature* attacker, HostileR
Unit* cvUnit = currentVictim->getTarget(); Unit* cvUnit = currentVictim->getTarget();
if (!attacker->CanCreatureAttack(cvUnit)) // pussywizard: if currentVictim is not valid => don't compare the threat with it, just take the highest threat valid target if (!attacker->CanCreatureAttack(cvUnit)) // pussywizard: if currentVictim is not valid => don't compare the threat with it, just take the highest threat valid target
currentVictim = nullptr; currentVictim = nullptr;
else if (cvUnit->IsImmunedToDamageOrSchool(attacker->GetMeleeDamageSchoolMask()) || cvUnit->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE)) // pussywizard: no 10%/30% if currentVictim is immune to damage or has auras breakable by damage else if (cvUnit->IsImmunedToDamageOrSchool(attacker->GetMeleeDamageSchoolMask()) || cvUnit->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE) || cvUnit->HasUnitState(UNIT_STATE_CONFUSED)) // pussywizard: no 10%/30% if currentVictim is immune to damage or has auras breakable by damage
currentVictim = nullptr; currentVictim = nullptr;
} }
@@ -345,7 +345,7 @@ HostileReference* ThreatContainer::SelectNextVictim(Creature* attacker, HostileR
// pussywizard: don't go to threat comparison if this ref is immune to damage or has aura breakable on damage (second choice target) // pussywizard: don't go to threat comparison if this ref is immune to damage or has aura breakable on damage (second choice target)
// pussywizard: if this is the last entry on the threat list, then all targets are second choice, set bool to true and loop threat list again, ignoring this section // pussywizard: if this is the last entry on the threat list, then all targets are second choice, set bool to true and loop threat list again, ignoring this section
if (!noPriorityTargetFound && (target->IsImmunedToDamageOrSchool(attacker->GetMeleeDamageSchoolMask()) || target->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE) || target->HasAuraTypeWithCaster(SPELL_AURA_IGNORED, attacker->GetGUID()))) if (!noPriorityTargetFound && (target->IsImmunedToDamageOrSchool(attacker->GetMeleeDamageSchoolMask()) || target->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE) || target->HasUnitState(UNIT_STATE_CONFUSED) || target->HasAuraTypeWithCaster(SPELL_AURA_IGNORED, attacker->GetGUID())))
{ {
if (iter != lastRef) if (iter != lastRef)
{ {
+4 -6
View File
@@ -28,7 +28,7 @@
#include "VMapMgr2.h" #include "VMapMgr2.h"
#include "World.h" #include "World.h"
std::map<DisableType, std::map<uint32, DisableData>> DisableMgr::m_DisableMap; DisableMgr::DisableMap DisableMgr::m_DisableMap;
DisableMgr::DisableMgr() {} DisableMgr::DisableMgr() {}
DisableMgr::~DisableMgr() {} DisableMgr::~DisableMgr() {}
@@ -44,10 +44,8 @@ void DisableMgr::LoadDisables()
uint32 oldMSTime = getMSTime(); uint32 oldMSTime = getMSTime();
// reload case // reload case
for (DisableMap::iterator itr = m_DisableMap.begin(); itr != m_DisableMap.end(); ++itr) for (DisableTypeMap& disableTypeMap : m_DisableMap)
itr->second.clear(); disableTypeMap.clear();
m_DisableMap.clear();
QueryResult result = WorldDatabase.Query("SELECT sourceType, entry, flags, params_0, params_1 FROM disables"); QueryResult result = WorldDatabase.Query("SELECT sourceType, entry, flags, params_0, params_1 FROM disables");
@@ -99,7 +97,7 @@ void DisableMgr::LoadDisables()
* @param param0 MapId if DISABLE_TYPE_SPELL used, 0 for all maps. * @param param0 MapId if DISABLE_TYPE_SPELL used, 0 for all maps.
* @param param1 AreaId if DISABLE_TYPE_SPELL used, 0 for all areas. * @param param1 AreaId if DISABLE_TYPE_SPELL used, 0 for all areas.
*/ */
void DisableMgr::AddDisable(DisableType type, uint32 entry, uint8 flags, std::string param0, std::string param1) void DisableMgr::AddDisable(DisableType type, uint32 entry, uint8 flags, std::string const& param0, std::string const& param1)
{ {
if (type >= MAX_DISABLE_TYPES) if (type >= MAX_DISABLE_TYPES)
{ {
+5 -4
View File
@@ -20,6 +20,7 @@
#include "Define.h" #include "Define.h"
#include "Map.h" #include "Map.h"
class Unit; class Unit;
enum DisableType enum DisableType
@@ -68,19 +69,19 @@ public:
static DisableMgr* instance(); static DisableMgr* instance();
void LoadDisables(); void LoadDisables();
void AddDisable(DisableType type, uint32 entry, uint8 flags, std::string param0, std::string param1); void AddDisable(DisableType type, uint32 entry, uint8 flags, std::string const& param0, std::string const& param1);
bool HandleDisableType(DisableType type, uint32 entry, uint8 flags, std::string const& params_0, std::string const& params_1, DisableData& data); bool HandleDisableType(DisableType type, uint32 entry, uint8 flags, std::string const& params_0, std::string const& params_1, DisableData& data);
static bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags = 0); static bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags = 0);
void CheckQuestDisables(); void CheckQuestDisables();
static bool IsVMAPDisabledFor(uint32 entry, uint8 flags); static bool IsVMAPDisabledFor(uint32 entry, uint8 flags);
static bool IsPathfindingEnabled(Map const* map); static bool IsPathfindingEnabled(Map const* map);
private:
// single disables here with optional data // single disables here with optional data
typedef std::map<uint32, DisableData> DisableTypeMap; typedef std::unordered_map<uint32, DisableData> DisableTypeMap;
// global disable map by source // global disable map by source
typedef std::map<DisableType, DisableTypeMap> DisableMap; typedef std::array<DisableTypeMap, MAX_DISABLE_TYPES> DisableMap;
private:
static DisableMap m_DisableMap; static DisableMap m_DisableMap;
}; };
+1 -1
View File
@@ -523,7 +523,7 @@ namespace lfg
if (grp && (grp->isBGGroup() || grp->isBFGroup())) if (grp && (grp->isBGGroup() || grp->isBFGroup()))
return; return;
if (!sScriptMgr->CanJoinLfg(player, roles, dungeons, comment)) if (!sScriptMgr->OnPlayerCanJoinLfg(player, roles, dungeons, comment))
return; return;
// pussywizard: can't join LFG/LFR while using LFR // pussywizard: can't join LFG/LFR while using LFR
@@ -41,7 +41,7 @@ namespace lfg
{ {
} }
void LFGPlayerScript::OnLevelChanged(Player* player, uint8 /*oldLevel*/) void LFGPlayerScript::OnPlayerLevelChanged(Player* player, uint8 /*oldLevel*/)
{ {
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES)) if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES))
return; return;
@@ -49,7 +49,7 @@ namespace lfg
sLFGMgr->InitializeLockedDungeons(player, player->GetGroup()); sLFGMgr->InitializeLockedDungeons(player, player->GetGroup());
} }
void LFGPlayerScript::OnLogout(Player* player) void LFGPlayerScript::OnPlayerLogout(Player* player)
{ {
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES)) if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES))
return; return;
@@ -69,7 +69,7 @@ namespace lfg
sLFGMgr->LfrSearchRemove(player); sLFGMgr->LfrSearchRemove(player);
} }
void LFGPlayerScript::OnLogin(Player* player) void LFGPlayerScript::OnPlayerLogin(Player* player)
{ {
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES)) if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES))
return; return;
@@ -93,14 +93,14 @@ namespace lfg
/// @todo - Restore LfgPlayerData and send proper status to player if it was in a group /// @todo - Restore LfgPlayerData and send proper status to player if it was in a group
} }
void LFGPlayerScript::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/) void LFGPlayerScript::OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/)
{ {
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL) if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL)
sLFGMgr->InitializeLockedDungeons(player, player->GetGroup()); sLFGMgr->InitializeLockedDungeons(player, player->GetGroup());
} }
void LFGPlayerScript::OnMapChanged(Player* player) void LFGPlayerScript::OnPlayerMapChanged(Player* player)
{ {
Map const* map = player->GetMap(); Map const* map = player->GetMap();
+5 -5
View File
@@ -34,11 +34,11 @@ namespace lfg
LFGPlayerScript(); LFGPlayerScript();
// Player Hooks // Player Hooks
void OnLevelChanged(Player* player, uint8 oldLevel) override; void OnPlayerLevelChanged(Player* player, uint8 oldLevel) override;
void OnLogout(Player* player) override; void OnPlayerLogout(Player* player) override;
void OnLogin(Player* player) override; void OnPlayerLogin(Player* player) override;
void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent) override; void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent) override;
void OnMapChanged(Player* player) override; void OnPlayerMapChanged(Player* player) override;
}; };
class LFGGroupScript : public GroupScript class LFGGroupScript : public GroupScript
@@ -47,6 +47,7 @@
#include "WaypointMovementGenerator.h" #include "WaypointMovementGenerator.h"
#include "World.h" #include "World.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "WorldSessionMgr.h"
/// @todo: this import is not necessary for compilation and marked as unused by the IDE /// @todo: this import is not necessary for compilation and marked as unused by the IDE
// however, for some reasons removing it would cause a damn linking issue // however, for some reasons removing it would cause a damn linking issue
@@ -1975,7 +1976,8 @@ void Creature::setDeathState(DeathState state, bool despawn)
if (state == DeathState::JustDied) if (state == DeathState::JustDied)
{ {
m_corpseRemoveTime = GameTime::GetGameTime().count() + m_corpseDelay; m_corpseRemoveTime = GameTime::GetGameTime().count() + m_corpseDelay;
m_respawnTime = GameTime::GetGameTime().count() + m_respawnDelay + m_corpseDelay; uint32 dynamicRespawnDelay = GetMap()->ApplyDynamicModeRespawnScaling(this, m_respawnDelay);
m_respawnTime = GameTime::GetGameTime().count() + dynamicRespawnDelay + m_corpseDelay;
// always save boss respawn time at death to prevent crash cheating // always save boss respawn time at death to prevent crash cheating
if (GetMap()->IsDungeon() || isWorldBoss() || GetCreatureTemplate()->rank >= CREATURE_ELITE_ELITE) if (GetMap()->IsDungeon() || isWorldBoss() || GetCreatureTemplate()->rank >= CREATURE_ELITE_ELITE)
@@ -2818,7 +2820,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
{ {
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4); WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
data << (uint32)GetAreaId(); data << (uint32)GetAreaId();
sWorld->SendGlobalMessage(&data, nullptr, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE)); sWorldSessionMgr->SendGlobalMessage(&data, nullptr, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
} }
/** /**
@@ -3180,7 +3182,8 @@ bool Creature::IsDungeonBoss() const
if (GetOwnerGUID().IsPlayer()) if (GetOwnerGUID().IsPlayer())
return false; return false;
return HasFlagsExtra(CREATURE_FLAG_EXTRA_DUNGEON_BOSS); CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
return cinfo && cinfo->HasFlagsExtra(CREATURE_FLAG_EXTRA_DUNGEON_BOSS);
} }
bool Creature::IsImmuneToKnockback() const bool Creature::IsImmuneToKnockback() const
@@ -3188,7 +3191,8 @@ bool Creature::IsImmuneToKnockback() const
if (GetOwnerGUID().IsPlayer()) if (GetOwnerGUID().IsPlayer())
return false; return false;
return HasFlagsExtra(CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK); CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
return cinfo && cinfo->HasFlagsExtra(CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK);
} }
bool Creature::HasWeapon(WeaponAttackType type) const bool Creature::HasWeapon(WeaponAttackType type) const
@@ -22,6 +22,7 @@
#include "MoveSplineInit.h" #include "MoveSplineInit.h"
#include "ObjectMgr.h" #include "ObjectMgr.h"
#include "QueryResult.h" #include "QueryResult.h"
#include "Timer.h"
#include "WaypointMgr.h" #include "WaypointMgr.h"
FormationMgr::~FormationMgr() FormationMgr::~FormationMgr()
@@ -455,14 +455,14 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
uint32 moneyRew = 0; uint32 moneyRew = 0;
Player* player = _session->GetPlayer(); Player* player = _session->GetPlayer();
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))) if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player)))
{ {
moneyRew = quest->GetRewMoneyMaxLevel(); moneyRew = quest->GetRewMoneyMaxLevel();
} }
moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl) moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
data << moneyRew; data << moneyRew;
uint32 questXp; uint32 questXp;
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)) if (player && !sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player))
{ {
questXp = player->CalculateQuestRewardXP(quest); questXp = player->CalculateQuestRewardXP(quest);
} }
@@ -470,7 +470,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
{ {
questXp = 0; questXp = 0;
} }
sScriptMgr->OnQuestComputeXP(player, quest, questXp); sScriptMgr->OnPlayerQuestComputeXP(player, quest, questXp);
data << questXp; data << questXp;
} }
@@ -555,7 +555,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
{ {
uint32 moneyRew = 0; uint32 moneyRew = 0;
Player* player = _session->GetPlayer(); Player* player = _session->GetPlayer();
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))) if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player)))
{ {
moneyRew = quest->GetRewMoneyMaxLevel(); moneyRew = quest->GetRewMoneyMaxLevel();
} }
@@ -707,14 +707,14 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
uint32 moneyRew = 0; uint32 moneyRew = 0;
Player* player = _session->GetPlayer(); Player* player = _session->GetPlayer();
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))) if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player)))
{ {
moneyRew = quest->GetRewMoneyMaxLevel(); moneyRew = quest->GetRewMoneyMaxLevel();
} }
moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl) moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
data << moneyRew; data << moneyRew;
uint32 questXp; uint32 questXp;
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)) if (player && !sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player))
{ {
questXp = player->CalculateQuestRewardXP(quest); questXp = player->CalculateQuestRewardXP(quest);
} }
@@ -722,7 +722,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
{ {
questXp = 0; questXp = 0;
} }
sScriptMgr->OnQuestComputeXP(player, quest, questXp); sScriptMgr->OnPlayerQuestComputeXP(player, quest, questXp);
data << questXp; data << questXp;
// rewarded honor points. Multiply with 10 to satisfy client // rewarded honor points. Multiply with 10 to satisfy client
@@ -204,7 +204,7 @@ void TempSummon::InitStats(uint32 duration)
Unit* owner = GetSummonerUnit(); Unit* owner = GetSummonerUnit();
if (owner) if (owner)
if (Player* player = owner->ToPlayer()) if (Player* player = owner->ToPlayer())
sScriptMgr->OnBeforeTempSummonInitStats(player, this, duration); sScriptMgr->OnPlayerBeforeTempSummonInitStats(player, this, duration);
m_timer = duration; m_timer = duration;
m_lifetime = duration; m_lifetime = duration;

Some files were not shown because too many files have changed in this diff Show More