mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-07 21:01:37 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Bug report
|
||||
name: Game issues
|
||||
description: Create a bug report to help us improve.
|
||||
body:
|
||||
- type: markdown
|
||||
@@ -14,14 +14,13 @@ body:
|
||||
description: |
|
||||
Description of the problem or issue here.
|
||||
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!
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected Blizzlike Behaviour
|
||||
label: Expected Behaviour
|
||||
description: |
|
||||
Tell us what should happen instead.
|
||||
validations:
|
||||
86
.github/ISSUE_TEMPLATE/bb_crash_issues.yml
vendored
Normal file
86
.github/ISSUE_TEMPLATE/bb_crash_issues.yml
vendored
Normal file
@@ -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
.github/ISSUE_TEMPLATE/cc_bta_issues.yml
vendored
Normal file
75
.github/ISSUE_TEMPLATE/cc_bta_issues.yml
vendored
Normal 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!
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,4 +1,4 @@
|
||||
blank_issues_enabled: true
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Website
|
||||
url: https://www.azerothcore.org
|
||||
@@ -6,9 +6,6 @@ contact_links:
|
||||
- name: Wiki
|
||||
url: https://www.azerothcore.org/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
|
||||
url: https://www.azerothcore.org/wiki/faq
|
||||
about: Frequently asked questions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Feature request
|
||||
description: Suggest an idea for this project
|
||||
title: "Feature: "
|
||||
type: "Feature"
|
||||
labels: "Feature"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
12
.github/ISSUE_TEMPLATE/ee_cc.yml
vendored
Normal file
12
.github/ISSUE_TEMPLATE/ee_cc.yml
vendored
Normal 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
|
||||
2
.github/README.md
vendored
2
.github/README.md
vendored
@@ -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.
|
||||
|
||||
[](https://www.jetbrains.com/?from=AzerothCore)
|
||||
[](https://jb.gg/OpenSourceSupport)
|
||||
|
||||
9
.github/actions/linux-build/action.yml
vendored
9
.github/actions/linux-build/action.yml
vendored
@@ -31,6 +31,11 @@ inputs:
|
||||
description: Max allowed error count before compilation stops
|
||||
required: false
|
||||
type: number
|
||||
keepgoing:
|
||||
default: false
|
||||
description: Flag to continue build after errors
|
||||
required: false
|
||||
type: boolean
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
@@ -121,7 +126,9 @@ runs:
|
||||
- name: build
|
||||
shell: bash
|
||||
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
|
||||
shell: bash
|
||||
|
||||
1
.github/workflows/core_modules_build.yml
vendored
1
.github/workflows/core_modules_build.yml
vendored
@@ -50,3 +50,4 @@ jobs:
|
||||
modules: true
|
||||
pch: false
|
||||
maxerrors: 0
|
||||
keepgoing: true
|
||||
|
||||
@@ -27,3 +27,4 @@ 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-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=master https://github.com/azerothcore/mod-arena-3v3-solo-queue.git modules/mod-arena-3v3-solo-queue
|
||||
|
||||
@@ -148,7 +148,7 @@ def insert_delete_safety_check(file: io, file_path: str) -> None:
|
||||
if line.startswith("--"):
|
||||
continue
|
||||
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
|
||||
previous_line = line
|
||||
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 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 mysql --force --version=8.4.4
|
||||
|
||||
|
||||
5
data/sql/updates/db_auth/2025_02_16_00.sql
Normal file
5
data/sql/updates/db_auth/2025_02_16_00.sql
Normal file
@@ -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`);
|
||||
11
data/sql/updates/db_auth/2025_02_16_01.sql
Normal file
11
data/sql/updates/db_auth/2025_02_16_01.sql
Normal file
@@ -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');
|
||||
11
data/sql/updates/db_characters/2025_02_12_00.sql
Normal file
11
data/sql/updates/db_characters/2025_02_12_00.sql
Normal file
@@ -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);
|
||||
11
data/sql/updates/db_characters/2025_02_16_00.sql
Normal file
11
data/sql/updates/db_characters/2025_02_16_00.sql
Normal file
@@ -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');
|
||||
96
data/sql/updates/db_world/2025_02_12_00.sql
Normal file
96
data/sql/updates/db_world/2025_02_12_00.sql
Normal file
@@ -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);
|
||||
3
data/sql/updates/db_world/2025_02_12_01.sql
Normal file
3
data/sql/updates/db_world/2025_02_12_01.sql
Normal file
@@ -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);
|
||||
7
data/sql/updates/db_world/2025_02_13_00.sql
Normal file
7
data/sql/updates/db_world/2025_02_13_00.sql
Normal file
@@ -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);
|
||||
25
data/sql/updates/db_world/2025_02_13_01.sql
Normal file
25
data/sql/updates/db_world/2025_02_13_01.sql
Normal file
@@ -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');
|
||||
23
data/sql/updates/db_world/2025_02_14_00.sql
Normal file
23
data/sql/updates/db_world/2025_02_14_00.sql
Normal file
@@ -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
data/sql/updates/db_world/2025_02_15_00.sql
Normal file
239
data/sql/updates/db_world/2025_02_15_00.sql
Normal 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)');
|
||||
10
data/sql/updates/db_world/2025_02_15_01.sql
Normal file
10
data/sql/updates/db_world/2025_02_15_01.sql
Normal file
@@ -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)');
|
||||
17
data/sql/updates/db_world/2025_02_15_02.sql
Normal file
17
data/sql/updates/db_world/2025_02_15_02.sql
Normal file
@@ -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');
|
||||
77
data/sql/updates/db_world/2025_02_16_00.sql
Normal file
77
data/sql/updates/db_world/2025_02_16_00.sql
Normal file
@@ -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\'');
|
||||
11
data/sql/updates/db_world/2025_02_16_01.sql
Normal file
11
data/sql/updates/db_world/2025_02_16_01.sql
Normal file
@@ -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');
|
||||
2
data/sql/updates/db_world/2025_02_16_02.sql
Normal file
2
data/sql/updates/db_world/2025_02_16_02.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- DB update 2025_02_16_01 -> 2025_02_16_02
|
||||
UPDATE `quest_template` SET `AllowableRaces` = 0 WHERE (`ID` = 11880);
|
||||
14
data/sql/updates/db_world/2025_02_16_03.sql
Normal file
14
data/sql/updates/db_world/2025_02_16_03.sql
Normal file
@@ -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);
|
||||
21
data/sql/updates/db_world/2025_02_18_00.sql
Normal file
21
data/sql/updates/db_world/2025_02_18_00.sql
Normal file
@@ -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');
|
||||
7
data/sql/updates/db_world/2025_02_19_00.sql
Normal file
7
data/sql/updates/db_world/2025_02_19_00.sql
Normal file
@@ -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);
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "DetourNavMesh.h"
|
||||
|
||||
#define MAX_NUMBER_OF_GRIDS 64
|
||||
#define MAX_NUMBER_OF_CELLS 8
|
||||
#define SIZE_OF_GRIDS 533.3333f
|
||||
|
||||
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
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::copy_if(std::begin(container), std::end(container), std::inserter(containerCopy, std::end(containerCopy)), predicate);
|
||||
auto it = std::begin(containerCopy);
|
||||
std::advance(it, urand(0, uint32(std::size(containerCopy)) - 1));
|
||||
return *it;
|
||||
std::vector<decltype(std::begin(container))> matchingElements;
|
||||
|
||||
for (auto it = std::begin(container); it != std::end(container); ++it)
|
||||
if (predicate(*it))
|
||||
matchingElements.push_back(it);
|
||||
|
||||
if (matchingElements.empty())
|
||||
return std::end(container);
|
||||
|
||||
auto randomIt = matchingElements[urand(0, matchingElements.size() - 1)];
|
||||
return randomIt;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
|
||||
#ifndef Random_h__
|
||||
#define Random_h__
|
||||
|
||||
#undef max
|
||||
#undef min
|
||||
#include "Define.h"
|
||||
#include "Duration.h"
|
||||
#include <limits>
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "SharedDefines.h"
|
||||
#include "SteadyTimer.h"
|
||||
#include "World.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
#include "WorldSocket.h"
|
||||
#include "WorldSocketMgr.h"
|
||||
#include <boost/asio/signal_set.hpp>
|
||||
@@ -285,11 +286,10 @@ int main(int argc, char** argv)
|
||||
|
||||
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_character", uint64(CharacterDatabase.QueueSize()));
|
||||
METRIC_VALUE("db_queue_world", uint64(WorldDatabase.QueueSize()));
|
||||
sScriptMgr->OnMetricLogging();
|
||||
});
|
||||
|
||||
METRIC_EVENT("events", "Worldserver started", "");
|
||||
@@ -358,8 +358,8 @@ int main(int argc, char** argv)
|
||||
|
||||
std::shared_ptr<void> sWorldSocketMgrHandle(nullptr, [](void*)
|
||||
{
|
||||
sWorld->KickAll(); // save and kick all players
|
||||
sWorld->UpdateSessions(1); // real players unload required UpdateSessions call
|
||||
sWorldSessionMgr->KickAll(); // save and kick all players
|
||||
sWorldSessionMgr->UpdateSessions(1); // real players unload required UpdateSessions call
|
||||
|
||||
sWorldSocketMgr.StopNetwork();
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
# PLAYER DUMP
|
||||
# CUSTOM
|
||||
# DEBUG
|
||||
# DYNAMIC RESPAWN SETTINGS
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
@@ -290,7 +291,7 @@ FlashAtStart = 1
|
||||
# DATABASE_CHARACTER = 2, // Character database
|
||||
# DATABASE_WORLD = 4, // World database
|
||||
#
|
||||
# Default: 7 - (All enabled)
|
||||
# Default: 7 - (All enabled)
|
||||
# 4 - (Enable world only)
|
||||
# 0 - (All disabled)
|
||||
|
||||
@@ -3791,21 +3792,6 @@ Arena.QueueAnnouncer.PlayerOnly = 0
|
||||
|
||||
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
|
||||
# Description: Start rating for new arena teams.
|
||||
@@ -4484,6 +4470,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 #
|
||||
|
||||
@@ -212,7 +212,7 @@ T Field::GetData() const
|
||||
if (data.raw)
|
||||
result = *reinterpret_cast<T const*>(data.value);
|
||||
else
|
||||
result = Acore::StringTo<T>(data.value);
|
||||
result = Acore::StringTo<T>(std::string_view(data.value, data.length));
|
||||
|
||||
// Correct double fields... this undefined behavior :/
|
||||
if constexpr (std::is_same_v<T, double>)
|
||||
@@ -220,7 +220,7 @@ T Field::GetData() const
|
||||
if (data.raw && !IsType(DatabaseFieldTypes::Decimal))
|
||||
result = *reinterpret_cast<double const*>(data.value);
|
||||
else
|
||||
result = Acore::StringTo<float>(data.value);
|
||||
result = Acore::StringTo<float>(std::string_view(data.value, data.length));
|
||||
}
|
||||
|
||||
// Check -1 for *_dbc db tables
|
||||
@@ -230,7 +230,7 @@ T Field::GetData() const
|
||||
|
||||
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")
|
||||
{
|
||||
|
||||
@@ -157,9 +157,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
|
||||
std::vector<std::string> moduleList;
|
||||
|
||||
for (auto const& itr : Acore::Tokenize(_modulesList, ',', true))
|
||||
{
|
||||
moduleList.emplace_back(itr);
|
||||
}
|
||||
|
||||
// data/sql
|
||||
for (auto const& itr : moduleList)
|
||||
@@ -168,9 +166,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
|
||||
|
||||
Path const p(path);
|
||||
if (!is_directory(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
DirectoryEntry const entry = { p, AppliedFileEntry::StateConvert("MODULE") };
|
||||
directories.push_back(entry);
|
||||
@@ -386,14 +382,14 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
|
||||
// Apply default updates
|
||||
for (auto const& availableQuery : available)
|
||||
{
|
||||
if (availableQuery.second != CUSTOM && availableQuery.second != MODULE)
|
||||
if (availableQuery.second != PENDING && availableQuery.second != CUSTOM && availableQuery.second != MODULE)
|
||||
ApplyUpdateFile(availableQuery);
|
||||
}
|
||||
|
||||
// Apply only custom/module updates
|
||||
// Apply only pending/custom/module updates
|
||||
for (auto const& availableQuery : available)
|
||||
{
|
||||
if (availableQuery.second == CUSTOM || availableQuery.second == MODULE)
|
||||
if (availableQuery.second == PENDING || availableQuery.second == CUSTOM || availableQuery.second == MODULE)
|
||||
ApplyUpdateFile(availableQuery);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ private:
|
||||
{
|
||||
RELEASED,
|
||||
CUSTOM,
|
||||
PENDING,
|
||||
MODULE,
|
||||
ARCHIVED
|
||||
};
|
||||
@@ -92,6 +93,8 @@ private:
|
||||
return RELEASED;
|
||||
else if (state == "CUSTOM")
|
||||
return CUSTOM;
|
||||
else if (state == "PENDING")
|
||||
return PENDING;
|
||||
else if (state == "MODULE")
|
||||
return MODULE;
|
||||
|
||||
@@ -106,6 +109,8 @@ private:
|
||||
return "RELEASED";
|
||||
case CUSTOM:
|
||||
return "CUSTOM";
|
||||
case PENDING:
|
||||
return "PENDING";
|
||||
case MODULE:
|
||||
return "MODULE";
|
||||
case ARCHIVED:
|
||||
|
||||
@@ -359,7 +359,7 @@ public:
|
||||
virtual void JustExitedCombat() { }
|
||||
|
||||
/// @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)
|
||||
*
|
||||
|
||||
@@ -893,7 +893,7 @@ void SmartAI::IsSummonedBy(WorldObject* summoner)
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
void IsSummonedBy(WorldObject* summoner) override;
|
||||
|
||||
// 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)
|
||||
void SummonedCreatureDespawn(Creature* unit) override;
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "SpellMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
|
||||
bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
{
|
||||
@@ -580,7 +581,7 @@ void AchievementMgr::SaveToDB(CharacterDatabaseTransaction trans)
|
||||
|
||||
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;
|
||||
|
||||
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 << uint32(achievement->ID);
|
||||
data << uint32(0); // display name as plain string in chat (always 0 for guild)
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
sWorldSessionMgr->SendGlobalMessage(&data);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -741,20 +742,15 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
||||
data << uint32(achievement->ID);
|
||||
std::size_t linkTypePos = data.wpos();
|
||||
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
|
||||
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
|
||||
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::LocalizedPacketDo<Acore::BroadcastTextBuilder> _localizer(_builder);
|
||||
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())
|
||||
return;
|
||||
|
||||
if (!sScriptMgr->OnBeforeCriteriaProgress(GetPlayer(), entry))
|
||||
if (!sScriptMgr->OnPlayerBeforeCriteriaProgress(GetPlayer(), entry))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2169,7 +2165,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
|
||||
|
||||
SendCriteriaUpdate(entry, progress, timeElapsed, true);
|
||||
|
||||
sScriptMgr->OnCriteriaProgress(GetPlayer(), entry);
|
||||
sScriptMgr->OnPlayerCriteriaProgress(GetPlayer(), entry);
|
||||
}
|
||||
|
||||
void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry)
|
||||
@@ -2277,7 +2273,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sScriptMgr->OnBeforeAchievementComplete(GetPlayer(), achievement))
|
||||
if (!sScriptMgr->OnPlayerBeforeAchievementComplete(GetPlayer(), achievement))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2292,7 +2288,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
ca.date = GameTime::GetGameTime().count();
|
||||
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
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
|
||||
/// @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
|
||||
@@ -143,7 +144,7 @@ bool Battlefield::Update(uint32 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;
|
||||
EndBattle(false);
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
|
||||
virtual ~BfCapturePoint() { }
|
||||
|
||||
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
|
||||
virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { }
|
||||
|
||||
// Send world state update to all players present
|
||||
void SendUpdateWorldState(uint32 field, uint32 value);
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
|
||||
/// Send all worldstate data to all player in zone.
|
||||
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
|
||||
bool CanFlyIn() { return !m_isActive; }
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
BattlefieldWG::~BattlefieldWG()
|
||||
{
|
||||
@@ -74,7 +75,7 @@ bool BattlefieldWG::SetupBattlefield()
|
||||
|
||||
m_saveTimer = 60000;
|
||||
|
||||
// Init GraveYards
|
||||
// Init Graveyards
|
||||
SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX);
|
||||
|
||||
// Load from db
|
||||
@@ -102,12 +103,12 @@ bool BattlefieldWG::SetupBattlefield()
|
||||
BfGraveyardWG* graveyard = new BfGraveyardWG(this);
|
||||
|
||||
// When between games, the graveyard is controlled by the defending team
|
||||
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);
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -933,46 +934,46 @@ uint32 BattlefieldWG::GetData(uint32 data) const
|
||||
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());
|
||||
data << uint32(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) << uint32(GetDefenderTeam());
|
||||
data << uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) << uint32(IsWarTime() ? 0 : 1); // Note: cleanup these two, their names look awkward
|
||||
data << uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE) << uint32(IsWarTime() ? 1 : 0);
|
||||
packet.Worldstates.reserve(4+2+WG_MAX_OBJ+WG_MAX_WORKSHOP);
|
||||
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ATTACKER, GetAttackerTeam());
|
||||
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, GetDefenderTeam());
|
||||
|
||||
// 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)
|
||||
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));
|
||||
data << uint32(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));
|
||||
data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A);
|
||||
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
|
||||
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H));
|
||||
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_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));
|
||||
data << uint32(WORLDSTATE_HORDE_KEEP_DEFENDED) << uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_DEFENDED));
|
||||
data << uint32(WORLDSTATE_ALLIANCE_KEEP_CAPTURED) << uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_CAPTURED));
|
||||
data << uint32(WORLDSTATE_ALLIANCE_KEEP_DEFENDED) << uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_DEFENDED));
|
||||
packet.Worldstates.emplace_back(WORLDSTATE_ALLIANCE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_DEFENDED)));
|
||||
packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_CAPTURED)));
|
||||
packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_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)
|
||||
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)
|
||||
if (*itr)
|
||||
data << WorkshopsData[(*itr)->workshopId].worldstate << (*itr)->state;
|
||||
packet.Worldstates.emplace_back(WorkshopsData[(*itr)->workshopId].worldstate, (*itr)->state);
|
||||
}
|
||||
|
||||
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);
|
||||
data << uint32(m_ZoneId);
|
||||
data << uint32(0);
|
||||
data << uint16(14 + BuildingsInZone.size() + WorkshopsList.size()); // Number of fields
|
||||
|
||||
FillInitialWorldStates(data);
|
||||
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
void BattlefieldWG::SendInitWorldStatesToAll()
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "Battlefield.h"
|
||||
#include "Log.h"
|
||||
#include "World.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
class Group;
|
||||
class BattlefieldWG;
|
||||
@@ -238,7 +239,7 @@ const uint32 WGQuest[2][6] =
|
||||
{ 13185, 13183, 13223, 13539, 13178, 13180 },
|
||||
};
|
||||
// 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 },
|
||||
{ 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 SendInitWorldStatesToAll() override;
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
|
||||
void HandleKill(Player* killer, Unit* victim) override;
|
||||
void OnUnitDeath(Unit* unit) override;
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
//#include "WorldStatePackets.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
void ArenaScore::AppendToPacket(WorldPacket& data)
|
||||
{
|
||||
@@ -146,10 +147,11 @@ void Arena::RemovePlayer(Player* /*player*/)
|
||||
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));
|
||||
data << uint32(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD) << uint32(GetAlivePlayersCountByTeam(TEAM_ALLIANCE));
|
||||
packet.Worldstates.reserve(2);
|
||||
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()
|
||||
@@ -224,7 +226,7 @@ void Arena::EndBattleground(TeamId winnerTeamId)
|
||||
{
|
||||
// pussywizard: arena logs in database
|
||||
uint32 fightId = sArenaTeamMgr->GetNextArenaLogId();
|
||||
uint32 currOnline = sWorld->GetActiveSessionCount();
|
||||
uint32 currOnline = sWorldSessionMgr->GetActiveSessionCount();
|
||||
|
||||
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_LOG_FIGHT);
|
||||
|
||||
@@ -52,7 +52,7 @@ protected:
|
||||
void AddPlayer(Player* player) override;
|
||||
void RemovePlayer(Player* /*player*/) override;
|
||||
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
void UpdateArenaWorldState();
|
||||
|
||||
void HandleKillPlayer(Player* player, Player* killer) override;
|
||||
|
||||
224
src/server/game/Battlegrounds/ArenaSeason/ArenaSeasonMgr.cpp
Normal file
224
src/server/game/Battlegrounds/ArenaSeason/ArenaSeasonMgr.cpp
Normal file
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
126
src/server/game/Battlegrounds/ArenaSeason/ArenaSeasonMgr.h
Normal file
126
src/server/game/Battlegrounds/ArenaSeason/ArenaSeasonMgr.h
Normal file
@@ -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
|
||||
113
src/server/game/Battlegrounds/ArenaSeason/ArenaTeamFilter.h
Normal file
113
src/server/game/Battlegrounds/ArenaSeason/ArenaTeamFilter.h
Normal file
@@ -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
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "ArenaTeam.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "ArenaSeasonMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Group.h"
|
||||
@@ -658,7 +659,7 @@ uint32 ArenaTeam::GetPoints(uint32 memberRating)
|
||||
|
||||
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;
|
||||
else
|
||||
points = 344;
|
||||
|
||||
@@ -125,6 +125,27 @@ void ArenaTeamMgr::RemoveArenaTeam(uint32 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()
|
||||
{
|
||||
if (NextArenaTeamId >= MAX_ARENA_TEAM_ID)
|
||||
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
void AddArenaTeam(ArenaTeam* arenaTeam);
|
||||
void RemoveArenaTeam(uint32 Id);
|
||||
|
||||
void DeleteAllArenaTeams();
|
||||
|
||||
ArenaTeamContainer::iterator GetArenaTeamMapBegin() { return ArenaTeamStore.begin(); }
|
||||
ArenaTeamContainer::iterator GetArenaTeamMapEnd() { return ArenaTeamStore.end(); }
|
||||
ArenaTeamContainer& GetArenaTeams() { return ArenaTeamStore; }
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "GameObject.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "World.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
class Creature;
|
||||
class GameObject;
|
||||
@@ -458,7 +459,7 @@ public:
|
||||
|
||||
// Packet Transfer
|
||||
// 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 SendPacketToAll(WorldPacket const* packet);
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (IsArenaType(bgTypeId))
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
Battleground* GetBattleground(uint32 instanceID, BattlegroundTypeId bgTypeId);
|
||||
Battleground* GetBattlegroundTemplate(BattlegroundTypeId bgTypeId);
|
||||
Battleground* CreateNewBattleground(BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated);
|
||||
std::vector<Battleground const*> GetActiveBattlegrounds();
|
||||
|
||||
void AddBattleground(Battleground* bg);
|
||||
void RemoveBattleground(BattlegroundTypeId bgTypeId, uint32 instanceId);
|
||||
|
||||
@@ -1355,11 +1355,11 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
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))
|
||||
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);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "Util.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
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]);
|
||||
data << uint32(BG_AB_OP_OCCUPIED_BASES_HORDE) << uint32(_controlledPoints[TEAM_HORDE]);
|
||||
data << uint32(BG_AB_OP_RESOURCES_MAX) << uint32(BG_AB_MAX_TEAM_SCORE);
|
||||
data << uint32(BG_AB_OP_RESOURCES_WARNING) << uint32(BG_AB_WARNING_NEAR_VICTORY_SCORE);
|
||||
data << uint32(BG_AB_OP_RESOURCES_ALLY) << uint32(m_TeamScores[TEAM_ALLIANCE]);
|
||||
data << uint32(BG_AB_OP_RESOURCES_HORDE) << uint32(m_TeamScores[TEAM_HORDE]);
|
||||
data << uint32(0x745) << uint32(0x2); // 37 1861 unk
|
||||
packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_ALLY, _controlledPoints[TEAM_ALLIANCE]);
|
||||
packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]);
|
||||
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_MAX, BG_AB_MAX_TEAM_SCORE);
|
||||
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE);
|
||||
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[TEAM_ALLIANCE]);
|
||||
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[TEAM_HORDE]);
|
||||
packet.Worldstates.emplace_back(0x745, 2);
|
||||
}
|
||||
|
||||
void BattlegroundAB::SendNodeUpdate(uint8 node)
|
||||
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player) 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;
|
||||
|
||||
bool AllNodesConrolledByTeam(TeamId teamId) const override;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "Player.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void BattlegroundAV::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundAV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
|
||||
{
|
||||
bool stateok;
|
||||
packet.Worldstates.reserve(7*2*2 + 8*2*2 + 5);
|
||||
//graveyards
|
||||
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
|
||||
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);
|
||||
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_ALLIANCE)], (m_Nodes[i].OwnerId == TEAM_ALLIANCE && 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
|
||||
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);
|
||||
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_ALLIANCE)], (m_Nodes[i].OwnerId == TEAM_ALLIANCE && 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
|
||||
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);
|
||||
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_SNOWFALL_N, 1);
|
||||
}
|
||||
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_SOUTH_MINE);
|
||||
}
|
||||
|
||||
@@ -1940,7 +1940,7 @@ private:
|
||||
void ChangeMineOwner(uint8 mine, TeamId teamId, bool initial = false);
|
||||
|
||||
/*worldstates*/
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
uint8 GetWorldStateType(uint8 state, TeamId teamId);
|
||||
void SendMineWorldStates(uint32 mine);
|
||||
void UpdateNodeWorldState(BG_AV_Nodes node);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "Log.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
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
|
||||
Arena::FillInitialWorldStates(data);
|
||||
packet.Worldstates.emplace_back(0x9f3, 1); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW
|
||||
Arena::FillInitialWorldStates(packet);
|
||||
}
|
||||
|
||||
bool BattlegroundBE::SetupBattleground()
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger) override;
|
||||
bool SetupBattleground() override;
|
||||
void FillInitialWorldStates(WorldPacket& d) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
bool HandlePlayerUnderMap(Player* player) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
BattlegroundDS::BattlegroundDS()
|
||||
{
|
||||
@@ -173,10 +174,10 @@ bool BattlegroundDS::HandlePlayerUnderMap(Player* player)
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundDS::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundDS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
|
||||
{
|
||||
data << uint32(3610) << uint32(1); // 9 show
|
||||
Arena::FillInitialWorldStates(data);
|
||||
packet.Worldstates.emplace_back(0xe1a, 1); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW
|
||||
Arena::FillInitialWorldStates(packet);
|
||||
}
|
||||
|
||||
bool BattlegroundDS::SetupBattleground()
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger) override;
|
||||
bool SetupBattleground() override;
|
||||
void FillInitialWorldStates(WorldPacket& d) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
bool HandlePlayerUnderMap(Player* player) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
void BattlegroundEYScore::BuildObjectivesBlock(WorldPacket& data)
|
||||
{
|
||||
@@ -506,7 +507,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, TeamId teamId, uint3
|
||||
|
||||
_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);
|
||||
|
||||
UpdatePointsIcons(point);
|
||||
@@ -568,30 +569,31 @@ bool BattlegroundEY::UpdatePlayerScore(Player* player, uint32 type, uint32 value
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundEY::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundEY::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
|
||||
{
|
||||
data << uint32(EY_HORDE_BASE) << uint32(_ownedPointsCount[TEAM_HORDE]);
|
||||
data << uint32(EY_ALLIANCE_BASE) << uint32(_ownedPointsCount[TEAM_ALLIANCE]);
|
||||
data << uint32(DRAENEI_RUINS_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE));
|
||||
data << uint32(DRAENEI_RUINS_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE));
|
||||
data << uint32(DRAENEI_RUINS_UNCONTROL) << uint32(_capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled());
|
||||
data << uint32(MAGE_TOWER_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE));
|
||||
data << uint32(MAGE_TOWER_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE));
|
||||
data << uint32(MAGE_TOWER_UNCONTROL) << uint32(_capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled());
|
||||
data << uint32(FEL_REAVER_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE));
|
||||
data << uint32(FEL_REAVER_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE));
|
||||
data << uint32(FEL_REAVER_UNCONTROL) << uint32(_capturePointInfo[POINT_FEL_REAVER].IsUncontrolled());
|
||||
data << uint32(BLOOD_ELF_HORDE_CONTROL) << uint32(_capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE));
|
||||
data << uint32(BLOOD_ELF_ALLIANCE_CONTROL) << uint32(_capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE));
|
||||
data << uint32(BLOOD_ELF_UNCONTROL) << uint32(_capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled());
|
||||
data << uint32(NETHERSTORM_FLAG) << uint32(_flagState == BG_EY_FLAG_STATE_ON_BASE);
|
||||
data << uint32(NETHERSTORM_FLAG_STATE_HORDE) << uint32(1);
|
||||
data << uint32(NETHERSTORM_FLAG_STATE_ALLIANCE) << uint32(1);
|
||||
data << uint32(EY_HORDE_RESOURCES) << uint32(GetTeamScore(TEAM_HORDE));
|
||||
data << uint32(EY_ALLIANCE_RESOURCES) << uint32(GetTeamScore(TEAM_ALLIANCE));
|
||||
data << uint32(PROGRESS_BAR_SHOW) << uint32(0);
|
||||
data << uint32(PROGRESS_BAR_PERCENT_GREY) << uint32(0);
|
||||
data << uint32(PROGRESS_BAR_STATUS) << uint32(0);
|
||||
packet.Worldstates.reserve(22);
|
||||
packet.Worldstates.emplace_back(EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]);
|
||||
packet.Worldstates.emplace_back(EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]);
|
||||
packet.Worldstates.emplace_back(DRAENEI_RUINS_HORDE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE));
|
||||
packet.Worldstates.emplace_back(DRAENEI_RUINS_ALLIANCE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE));
|
||||
packet.Worldstates.emplace_back(DRAENEI_RUINS_UNCONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled());
|
||||
packet.Worldstates.emplace_back(MAGE_TOWER_ALLIANCE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE));
|
||||
packet.Worldstates.emplace_back(MAGE_TOWER_HORDE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE));
|
||||
packet.Worldstates.emplace_back(MAGE_TOWER_UNCONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled());
|
||||
packet.Worldstates.emplace_back(FEL_REAVER_HORDE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE));
|
||||
packet.Worldstates.emplace_back(FEL_REAVER_ALLIANCE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE));
|
||||
packet.Worldstates.emplace_back(FEL_REAVER_UNCONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUncontrolled());
|
||||
packet.Worldstates.emplace_back(BLOOD_ELF_HORDE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE));
|
||||
packet.Worldstates.emplace_back(BLOOD_ELF_ALLIANCE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE));
|
||||
packet.Worldstates.emplace_back(BLOOD_ELF_UNCONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled());
|
||||
packet.Worldstates.emplace_back(NETHERSTORM_FLAG, _flagState == BG_EY_FLAG_STATE_ON_BASE);
|
||||
packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_HORDE, 1);
|
||||
packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_ALLIANCE, 1);
|
||||
packet.Worldstates.emplace_back(EY_HORDE_RESOURCES, GetTeamScore(TEAM_HORDE));
|
||||
packet.Worldstates.emplace_back(EY_ALLIANCE_RESOURCES, GetTeamScore(TEAM_ALLIANCE));
|
||||
packet.Worldstates.emplace_back(PROGRESS_BAR_SHOW, 0);
|
||||
packet.Worldstates.emplace_back(PROGRESS_BAR_PERCENT_GREY, 0);
|
||||
packet.Worldstates.emplace_back(PROGRESS_BAR_STATUS, 0);
|
||||
}
|
||||
|
||||
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)
|
||||
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);
|
||||
if (dist < minDist)
|
||||
{
|
||||
|
||||
@@ -305,11 +305,11 @@ struct BattlegroundEYLosingPointStruct
|
||||
|
||||
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),
|
||||
SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
|
||||
SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde),
|
||||
GraveYardId(_GraveYardId)
|
||||
GraveyardId(_GraveyardId)
|
||||
{}
|
||||
|
||||
uint32 DespawnNeutralObjectType;
|
||||
@@ -317,7 +317,7 @@ struct BattlegroundEYCapturingPointStruct
|
||||
uint32 MessageIdAlliance;
|
||||
uint32 SpawnObjectTypeHorde;
|
||||
uint32 MessageIdHorde;
|
||||
uint32 GraveYardId;
|
||||
uint32 GraveyardId;
|
||||
};
|
||||
|
||||
const uint32 BG_EY_TickPoints[EY_POINTS_MAX] = {1, 2, 5, 10};
|
||||
@@ -421,7 +421,7 @@ public:
|
||||
void Init() override;
|
||||
void EndBattleground(TeamId winnerTeamId) 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; }
|
||||
ObjectGuid GetDroppedFlagGUID() const { return _droppedFlagGUID; }
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
void BattlegroundICScore::BuildObjectivesBlock(WorldPacket& data)
|
||||
{
|
||||
@@ -381,21 +382,24 @@ bool BattlegroundIC::UpdatePlayerScore(Player* player, uint32 type, uint32 value
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundIC::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundIC::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
|
||||
{
|
||||
data << uint32(BG_IC_ALLIANCE_RENFORT_SET) << uint32(1);
|
||||
data << uint32(BG_IC_HORDE_RENFORT_SET) << uint32(1);
|
||||
data << uint32(BG_IC_ALLIANCE_RENFORT) << uint32(factionReinforcements[TEAM_ALLIANCE]);
|
||||
data << uint32(BG_IC_HORDE_RENFORT) << uint32(factionReinforcements[TEAM_HORDE]);
|
||||
packet.Worldstates.reserve(4+MAX_FORTRESS_GATES_SPAWNS+MAX_NODE_TYPES+1);
|
||||
packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT_SET, 1);
|
||||
packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1);
|
||||
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)
|
||||
{
|
||||
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)
|
||||
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()
|
||||
|
||||
@@ -974,7 +974,7 @@ public:
|
||||
/* Scorekeeping */
|
||||
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;
|
||||
|
||||
|
||||
@@ -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
|
||||
Arena::FillInitialWorldStates(data);
|
||||
packet.Worldstates.emplace_back(0xa11, 1); // BATTLEGROUND_NAGRAND_ARENA_SHOW
|
||||
Arena::FillInitialWorldStates(packet);
|
||||
}
|
||||
|
||||
bool BattlegroundNA::SetupBattleground()
|
||||
|
||||
@@ -54,7 +54,8 @@ public:
|
||||
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger) override;
|
||||
bool SetupBattleground() override;
|
||||
void FillInitialWorldStates(WorldPacket& d) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) 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
|
||||
Arena::FillInitialWorldStates(data);
|
||||
packet.Worldstates.emplace_back(0xbba, 1); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW
|
||||
Arena::FillInitialWorldStates(packet);
|
||||
}
|
||||
|
||||
bool BattlegroundRL::SetupBattleground()
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
BattlegroundRL();
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
void FillInitialWorldStates(WorldPacket& d) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
void StartingEventCloseDoors() 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);
|
||||
Arena::FillInitialWorldStates(data);
|
||||
packet.Worldstates.emplace_back(BG_RV_WORLD_STATE, 1);
|
||||
Arena::FillInitialWorldStates(packet);
|
||||
}
|
||||
|
||||
void BattlegroundRV::Init()
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
/* inherited from BattlegroundClass */
|
||||
void StartingEventOpenDoors() override;
|
||||
void Init() override;
|
||||
void FillInitialWorldStates(WorldPacket& d) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger) override;
|
||||
bool SetupBattleground() 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);
|
||||
uint32 horde_attacks = uint32(Attackers == TEAM_HORDE ? 1 : 0);
|
||||
bool const ally_attacks = Attackers == TEAM_ALLIANCE;
|
||||
bool const horde_attacks = Attackers == TEAM_HORDE;
|
||||
|
||||
data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]);
|
||||
data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]);
|
||||
data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]);
|
||||
data << uint32(BG_SA_BLUE_GATEWS) << uint32(GateStatus[BG_SA_BLUE_GATE]);
|
||||
data << uint32(BG_SA_RED_GATEWS) << uint32(GateStatus[BG_SA_RED_GATE]);
|
||||
data << uint32(BG_SA_PURPLE_GATEWS) << uint32(GateStatus[BG_SA_PURPLE_GATE]);
|
||||
packet.Worldstates.reserve(25);
|
||||
packet.Worldstates.emplace_back(BG_SA_ANCIENT_GATEWS, GateStatus[BG_SA_ANCIENT_GATE]);
|
||||
packet.Worldstates.emplace_back(BG_SA_YELLOW_GATEWS, GateStatus[BG_SA_YELLOW_GATE]);
|
||||
packet.Worldstates.emplace_back(BG_SA_GREEN_GATEWS, GateStatus[BG_SA_GREEN_GATE]);
|
||||
packet.Worldstates.emplace_back(BG_SA_BLUE_GATEWS, GateStatus[BG_SA_BLUE_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;
|
||||
data << uint32(BG_SA_ALLY_ATTACKS) << ally_attacks;
|
||||
packet.Worldstates.emplace_back(BG_SA_HORDE_ATTACKS, horde_attacks);
|
||||
packet.Worldstates.emplace_back(BG_SA_ALLY_ATTACKS, ally_attacks);
|
||||
|
||||
//Time will be sent on first update...
|
||||
data << uint32(BG_SA_ENABLE_TIMER) << ((TimerEnabled) ? uint32(1) : uint32(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);
|
||||
packet.Worldstates.emplace_back(BG_SA_ENABLE_TIMER, TimerEnabled ? 1 : 0);
|
||||
|
||||
data << uint32(BG_SA_RIGHT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
|
||||
data << uint32(BG_SA_LEFT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 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_MINS, 0);
|
||||
packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_TENS, 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);
|
||||
data << uint32(BG_SA_LEFT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 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_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
|
||||
packet.Worldstates.emplace_back(BG_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 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;
|
||||
data << uint32(BG_SA_ALLIANCE_DEFENCE_TOKEN) << horde_attacks;
|
||||
packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
|
||||
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;
|
||||
data << uint32(BG_SA_RIGHT_ATT_TOKEN_HRD) << 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_HORDE_DEFENCE_TOKEN, ally_attacks);
|
||||
packet.Worldstates.emplace_back(BG_SA_ALLIANCE_DEFENCE_TOKEN, horde_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)
|
||||
|
||||
@@ -475,7 +475,7 @@ public:
|
||||
bool SetupBattleground() override;
|
||||
void Init() override;
|
||||
/// 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)
|
||||
void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType) override;
|
||||
/// 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);
|
||||
}
|
||||
|
||||
void BattlegroundWS::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundWS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
|
||||
{
|
||||
data << uint32(BG_WS_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(TEAM_ALLIANCE));
|
||||
data << uint32(BG_WS_FLAG_CAPTURES_HORDE) << uint32(GetTeamScore(TEAM_HORDE));
|
||||
data << uint32(BG_WS_FLAG_CAPTURES_MAX) << uint32(BG_WS_MAX_TEAM_SCORE);
|
||||
packet.Worldstates.reserve(7);
|
||||
packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE));
|
||||
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);
|
||||
data << uint32(BG_WS_STATE_TIMER) << uint32(GetMatchTime());
|
||||
packet.Worldstates.emplace_back(BG_WS_STATE_TIMER_ACTIVE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0);
|
||||
packet.Worldstates.emplace_back(BG_WS_STATE_TIMER, GetMatchTime());
|
||||
|
||||
data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(GetFlagState(TEAM_HORDE));
|
||||
data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(GetFlagState(TEAM_ALLIANCE));
|
||||
packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_HORDE, GetFlagState(TEAM_HORDE));
|
||||
packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_ALLIANCE, GetFlagState(TEAM_ALLIANCE));
|
||||
}
|
||||
|
||||
TeamId BattlegroundWS::GetPrematureWinner()
|
||||
|
||||
@@ -252,7 +252,7 @@ public:
|
||||
bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override;
|
||||
void SetDroppedFlagGUID(ObjectGuid guid, TeamId teamId) override { _droppedFlagGUID[teamId] = guid; }
|
||||
ObjectGuid GetDroppedFlagGUID(TeamId teamId) const { return _droppedFlagGUID[teamId];}
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
|
||||
|
||||
/* Scorekeeping */
|
||||
void AddPoints(TeamId teamId, uint32 points) { m_TeamScores[teamId] += points; }
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "GuildMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "World.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
|
||||
WhoListCacheMgr* WhoListCacheMgr::instance()
|
||||
{
|
||||
@@ -30,7 +31,7 @@ void WhoListCacheMgr::Update()
|
||||
{
|
||||
// clear current list
|
||||
_whoListStorage.clear();
|
||||
_whoListStorage.reserve(sWorld->GetPlayerCount() + 1);
|
||||
_whoListStorage.reserve(sWorldSessionMgr->GetPlayerCount() + 1);
|
||||
|
||||
for (auto const& [guid, player] : ObjectAccessor::GetPlayers())
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
Player* ChatHandler::GetPlayer() const
|
||||
@@ -81,7 +82,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
||||
return false;
|
||||
|
||||
// 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;
|
||||
|
||||
if (target)
|
||||
@@ -188,7 +189,7 @@ void ChatHandler::SendGlobalSysMessage(const char* str)
|
||||
for (std::string_view line : Acore::Tokenize(str, '\n', true))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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)
|
||||
{
|
||||
SessionMap::const_iterator itr;
|
||||
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
|
||||
WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
|
||||
for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
|
||||
if (Player* player = itr->second->GetPlayer())
|
||||
if (player->IsInWorld())
|
||||
exec(player);
|
||||
|
||||
@@ -328,7 +328,7 @@ HostileReference* ThreatContainer::SelectNextVictim(Creature* attacker, HostileR
|
||||
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
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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: 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)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "VMapMgr2.h"
|
||||
#include "World.h"
|
||||
|
||||
std::map<DisableType, std::map<uint32, DisableData>> DisableMgr::m_DisableMap;
|
||||
DisableMgr::DisableMap DisableMgr::m_DisableMap;
|
||||
|
||||
DisableMgr::DisableMgr() {}
|
||||
DisableMgr::~DisableMgr() {}
|
||||
@@ -44,10 +44,8 @@ void DisableMgr::LoadDisables()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// reload case
|
||||
for (DisableMap::iterator itr = m_DisableMap.begin(); itr != m_DisableMap.end(); ++itr)
|
||||
itr->second.clear();
|
||||
|
||||
m_DisableMap.clear();
|
||||
for (DisableTypeMap& disableTypeMap : m_DisableMap)
|
||||
disableTypeMap.clear();
|
||||
|
||||
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 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)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "Define.h"
|
||||
#include "Map.h"
|
||||
|
||||
class Unit;
|
||||
|
||||
enum DisableType
|
||||
@@ -68,19 +69,19 @@ public:
|
||||
static DisableMgr* instance();
|
||||
|
||||
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);
|
||||
static bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags = 0);
|
||||
void CheckQuestDisables();
|
||||
static bool IsVMAPDisabledFor(uint32 entry, uint8 flags);
|
||||
static bool IsPathfindingEnabled(Map const* map);
|
||||
|
||||
private:
|
||||
// single disables here with optional data
|
||||
typedef std::map<uint32, DisableData> DisableTypeMap;
|
||||
typedef std::unordered_map<uint32, DisableData> DisableTypeMap;
|
||||
// global disable map by source
|
||||
typedef std::map<DisableType, DisableTypeMap> DisableMap;
|
||||
typedef std::array<DisableTypeMap, MAX_DISABLE_TYPES> DisableMap;
|
||||
|
||||
private:
|
||||
static DisableMap m_DisableMap;
|
||||
};
|
||||
|
||||
|
||||
@@ -523,7 +523,7 @@ namespace lfg
|
||||
if (grp && (grp->isBGGroup() || grp->isBFGroup()))
|
||||
return;
|
||||
|
||||
if (!sScriptMgr->CanJoinLfg(player, roles, dungeons, comment))
|
||||
if (!sScriptMgr->OnPlayerCanJoinLfg(player, roles, dungeons, comment))
|
||||
return;
|
||||
|
||||
// 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))
|
||||
return;
|
||||
@@ -49,7 +49,7 @@ namespace lfg
|
||||
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))
|
||||
return;
|
||||
@@ -69,7 +69,7 @@ namespace lfg
|
||||
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))
|
||||
return;
|
||||
@@ -93,14 +93,14 @@ namespace lfg
|
||||
/// @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);
|
||||
if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL)
|
||||
sLFGMgr->InitializeLockedDungeons(player, player->GetGroup());
|
||||
}
|
||||
|
||||
void LFGPlayerScript::OnMapChanged(Player* player)
|
||||
void LFGPlayerScript::OnPlayerMapChanged(Player* player)
|
||||
{
|
||||
Map const* map = player->GetMap();
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ namespace lfg
|
||||
LFGPlayerScript();
|
||||
|
||||
// Player Hooks
|
||||
void OnLevelChanged(Player* player, uint8 oldLevel) override;
|
||||
void OnLogout(Player* player) override;
|
||||
void OnLogin(Player* player) override;
|
||||
void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent) override;
|
||||
void OnMapChanged(Player* player) override;
|
||||
void OnPlayerLevelChanged(Player* player, uint8 oldLevel) override;
|
||||
void OnPlayerLogout(Player* player) override;
|
||||
void OnPlayerLogin(Player* player) override;
|
||||
void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent) override;
|
||||
void OnPlayerMapChanged(Player* player) override;
|
||||
};
|
||||
|
||||
class LFGGroupScript : public GroupScript
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSessionMgr.h"
|
||||
|
||||
/// @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
|
||||
@@ -1975,7 +1976,8 @@ void Creature::setDeathState(DeathState state, bool despawn)
|
||||
if (state == DeathState::JustDied)
|
||||
{
|
||||
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
|
||||
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);
|
||||
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())
|
||||
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
|
||||
@@ -3188,7 +3191,8 @@ bool Creature::IsImmuneToKnockback() const
|
||||
if (GetOwnerGUID().IsPlayer())
|
||||
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
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "QueryResult.h"
|
||||
#include "Timer.h"
|
||||
#include "WaypointMgr.h"
|
||||
|
||||
FormationMgr::~FormationMgr()
|
||||
|
||||
@@ -455,14 +455,14 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
|
||||
uint32 moneyRew = 0;
|
||||
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->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
|
||||
data << moneyRew;
|
||||
uint32 questXp;
|
||||
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))
|
||||
if (player && !sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player))
|
||||
{
|
||||
questXp = player->CalculateQuestRewardXP(quest);
|
||||
}
|
||||
@@ -470,7 +470,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
{
|
||||
questXp = 0;
|
||||
}
|
||||
sScriptMgr->OnQuestComputeXP(player, quest, questXp);
|
||||
sScriptMgr->OnPlayerQuestComputeXP(player, quest, questXp);
|
||||
data << questXp;
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
{
|
||||
uint32 moneyRew = 0;
|
||||
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();
|
||||
}
|
||||
@@ -707,14 +707,14 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
|
||||
uint32 moneyRew = 0;
|
||||
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->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
|
||||
data << moneyRew;
|
||||
uint32 questXp;
|
||||
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))
|
||||
if (player && !sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player))
|
||||
{
|
||||
questXp = player->CalculateQuestRewardXP(quest);
|
||||
}
|
||||
@@ -722,7 +722,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
{
|
||||
questXp = 0;
|
||||
}
|
||||
sScriptMgr->OnQuestComputeXP(player, quest, questXp);
|
||||
sScriptMgr->OnPlayerQuestComputeXP(player, quest, questXp);
|
||||
data << questXp;
|
||||
|
||||
// rewarded honor points. Multiply with 10 to satisfy client
|
||||
|
||||
@@ -204,7 +204,7 @@ void TempSummon::InitStats(uint32 duration)
|
||||
Unit* owner = GetSummonerUnit();
|
||||
if (owner)
|
||||
if (Player* player = owner->ToPlayer())
|
||||
sScriptMgr->OnBeforeTempSummonInitStats(player, this, duration);
|
||||
sScriptMgr->OnPlayerBeforeTempSummonInitStats(player, this, duration);
|
||||
|
||||
m_timer = duration;
|
||||
m_lifetime = duration;
|
||||
|
||||
@@ -897,7 +897,8 @@ void GameObject::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
|
||||
m_respawnTime = GameTime::GetGameTime().count() + m_respawnDelayTime;
|
||||
uint32 dynamicRespawnDelay = GetMap()->ApplyDynamicModeRespawnScaling(this, m_respawnDelayTime);
|
||||
m_respawnTime = GameTime::GetGameTime().count() + dynamicRespawnDelay;
|
||||
|
||||
// if option not set then object will be saved at grid unload
|
||||
if (GetMap()->IsDungeon())
|
||||
@@ -1758,7 +1759,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
LOG_DEBUG("entities.gameobject", "Fishing check (skill: {} zone min skill: {} chance {} roll: {}", skill, zone_skill, chance, roll);
|
||||
|
||||
if (sScriptMgr->OnUpdateFishingSkill(player, skill, zone_skill, chance, roll))
|
||||
if (sScriptMgr->OnPlayerUpdateFishingSkill(player, skill, zone_skill, chance, roll))
|
||||
{
|
||||
player->UpdateFishingSkill();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "QueryResult.h"
|
||||
#include "Timer.h"
|
||||
#include "Util.h"
|
||||
#include <cmath>
|
||||
#include <functional>
|
||||
|
||||
@@ -3098,18 +3098,9 @@ void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& play
|
||||
|
||||
void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry)
|
||||
{
|
||||
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
cell.Visit(pair, world_visitor, *(this->GetMap()), *this, radius);
|
||||
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
cell.Visit(pair, grid_visitor, *(this->GetMap()), *this, radius);
|
||||
Cell::VisitAllObjects(this, searcher, radius);
|
||||
}
|
||||
|
||||
void WorldObject::AddToObjectUpdate()
|
||||
|
||||
@@ -64,6 +64,11 @@ struct Position
|
||||
return !(operator==(a));
|
||||
}
|
||||
|
||||
inline bool operator!=(Position const& a) const
|
||||
{
|
||||
return !(operator==(a));
|
||||
}
|
||||
|
||||
operator G3D::Vector3() const
|
||||
{
|
||||
return { m_positionX, m_positionY, m_positionZ };
|
||||
|
||||
@@ -47,7 +47,7 @@ Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID
|
||||
m_auraRaidUpdateMask(0),
|
||||
m_loading(false),
|
||||
m_petRegenTimer(PET_FOCUS_REGEN_INTERVAL),
|
||||
m_tempspellTarget(nullptr),
|
||||
m_tempspellTarget(),
|
||||
m_tempoldTarget(),
|
||||
m_tempspellIsPositive(false),
|
||||
m_tempspell(0)
|
||||
@@ -237,7 +237,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
return false;
|
||||
|
||||
bool forceLoadFromDB = false;
|
||||
sScriptMgr->OnBeforeLoadPetFromDB(owner, petEntry, petnumber, current, forceLoadFromDB);
|
||||
sScriptMgr->OnPlayerBeforeLoadPetFromDB(owner, petEntry, petnumber, current, forceLoadFromDB);
|
||||
|
||||
if (!forceLoadFromDB && (owner->IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_PET) && !owner->CanSeeDKPet())) // DK Pet exception
|
||||
return false;
|
||||
@@ -716,9 +716,11 @@ void Pet::Update(uint32 diff)
|
||||
|
||||
if (m_tempspell)
|
||||
{
|
||||
Unit* tempspellTarget = m_tempspellTarget;
|
||||
Unit* tempoldTarget = nullptr;
|
||||
Unit* tempspellTarget = nullptr;
|
||||
if (!m_tempspellTarget.IsEmpty())
|
||||
tempspellTarget = ObjectAccessor::GetUnit(*this, m_tempspellTarget);
|
||||
|
||||
Unit* tempoldTarget = nullptr;
|
||||
if (!m_tempoldTarget.IsEmpty())
|
||||
tempoldTarget = ObjectAccessor::GetUnit(*this, m_tempoldTarget);
|
||||
|
||||
@@ -758,7 +760,7 @@ void Pet::Update(uint32 diff)
|
||||
|
||||
CastSpell(tempspellTarget, tempspell, false);
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = nullptr;
|
||||
m_tempspellTarget = ObjectGuid::Empty;
|
||||
|
||||
if (tempspellIsPositive)
|
||||
{
|
||||
@@ -798,7 +800,7 @@ void Pet::Update(uint32 diff)
|
||||
else
|
||||
{
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = nullptr;
|
||||
m_tempspellTarget = ObjectGuid::Empty;
|
||||
m_tempoldTarget = ObjectGuid::Empty;
|
||||
m_tempspellIsPositive = false;
|
||||
|
||||
@@ -1031,7 +1033,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
PetType petType = MAX_PET_TYPE;
|
||||
if (owner->IsPlayer())
|
||||
{
|
||||
sScriptMgr->OnBeforeGuardianInitStatsForLevel(owner->ToPlayer(), this, cinfo, petType);
|
||||
sScriptMgr->OnPlayerBeforeGuardianInitStatsForLevel(owner->ToPlayer(), this, cinfo, petType);
|
||||
|
||||
if (IsPet())
|
||||
{
|
||||
@@ -1425,7 +1427,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||
|
||||
if (owner->IsPlayer())
|
||||
sScriptMgr->OnAfterGuardianInitStatsForLevel(owner->ToPlayer(), this);
|
||||
sScriptMgr->OnPlayerAfterGuardianInitStatsForLevel(owner->ToPlayer(), this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2433,7 +2435,7 @@ void Pet::CastWhenWillAvailable(uint32 spellid, Unit* spellTarget, ObjectGuid ol
|
||||
if (!spellTarget)
|
||||
return;
|
||||
|
||||
m_tempspellTarget = spellTarget;
|
||||
m_tempspellTarget = spellTarget->GetGUID();
|
||||
m_tempspell = spellid;
|
||||
m_tempspellIsPositive = spellIsPositive;
|
||||
|
||||
@@ -2445,7 +2447,7 @@ void Pet::ClearCastWhenWillAvailable()
|
||||
{
|
||||
m_tempspellIsPositive = false;
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = nullptr;
|
||||
m_tempspellTarget = ObjectGuid::Empty;
|
||||
m_tempoldTarget = ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ protected:
|
||||
|
||||
std::unique_ptr<DeclinedName> m_declinedname;
|
||||
|
||||
Unit* m_tempspellTarget;
|
||||
ObjectGuid m_tempspellTarget;
|
||||
ObjectGuid m_tempoldTarget;
|
||||
bool m_tempspellIsPositive;
|
||||
uint32 m_tempspell;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user