Skip to content

Commit

Permalink
Merge branch '3.3.5' into npcbots_3.3.5
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/server/game/AI/CoreAI/UnitAI.h
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Entities/Vehicle/Vehicle.cpp
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/Auras/SpellAuras.cpp
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
#	src/server/scripts/Spells/spell_generic.cpp
#	src/server/scripts/Spells/spell_paladin.cpp
  • Loading branch information
trickerer committed Sep 7, 2024
2 parents ee76ff6 + 632d7f5 commit 8f8b4b1
Show file tree
Hide file tree
Showing 274 changed files with 2,864 additions and 2,075 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: AzerothCore codestyle
Expand Down
20 changes: 10 additions & 10 deletions apps/Fmt/FormatReplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def isPAppend(line):
else :
return False

# def isStringFormat(line):
# substring = 'StringFormat'
# if substring in line:
# return True
# else :
# return False
def isStringFormat(line):
substring = 'StringFormat'
if substring in line:
return True
else :
return False

def haveDelimeter(line):
if ';' in line:
Expand Down Expand Up @@ -96,8 +96,8 @@ def checkSoloLine(line):
# return handleCleanup(line), False
# elif isPSendSysMessage(line):
# return handleCleanup(line), False
# elif isStringFormat(line):
# return handleCleanup(line), False
elif isStringFormat(line):
return handleCleanup(line), False
else:
return line, False

Expand All @@ -122,8 +122,8 @@ def startMultiLine(line):
elif isPAppend(line):
line = line.replace("PAppend", "Append");
return handleCleanup(line), True
# elif isStringFormat(line):
# return handleCleanup(line), True
elif isStringFormat(line):
return handleCleanup(line), True
else :
return line, False

Expand Down
98 changes: 91 additions & 7 deletions apps/codestyle/codestyle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import io
import os
import sys
import re

# Get the src directory of the project
src_directory = os.path.join(os.getcwd(), 'src')
Expand All @@ -11,8 +12,11 @@
"Multiple blank lines check": "Passed",
"Trailing whitespace check": "Passed",
"GetCounter() check": "Passed",
"Misc codestyle check": "Passed",
"GetTypeId() check": "Passed",
"NpcFlagHelpers check": "Passed"
"NpcFlagHelpers check": "Passed",
"ItemFlagHelpers check": "Passed",
"ItemTemplateFlagHelpers check": "Passed"
}

# Main function to parse all the files of the project
Expand All @@ -27,10 +31,15 @@ def parsing_file(directory: str) -> None:
multiple_blank_lines_check(file, file_path)
trailing_whitespace_check(file, file_path)
get_counter_check(file, file_path)
misc_codestyle_check(file, file_path)
if file_name != 'Object.h':
get_typeid_check(file, file_path)
if file_name != 'Unit.h':
npcflags_helpers_check(file, file_path)
if file_name != 'Item.h':
itemflag_helpers_check(file, file_path)
if file_name != 'ItemTemplate.h':
itemtemplateflag_helpers_check(file, file_path)
except UnicodeDecodeError:
print(f"\nCould not decode file {file_path}")
sys.exit(1)
Expand Down Expand Up @@ -99,14 +108,20 @@ def get_typeid_check(file: io, file_path: str) -> None:
check_failed = False
# Parse all the file
for line_number, line in enumerate(file, start = 1):
if 'GetTypeId() == TYPEID_PLAYER' in line:
print(f"Please use IsPlayer() instead GetTypeId(): {file_path} at line {line_number}")
if 'GetTypeId() == TYPEID_ITEM' in line or 'GetTypeId() != TYPEID_ITEM' in line:
print(f"Please use IsItem() instead of GetTypeId(): {file_path} at line {line_number}")
check_failed = True
if 'GetTypeId() == TYPEID_ITEM' in line:
print(f"Please use IsItem() instead GetTypeId(): {file_path} at line {line_number}")
if 'GetTypeId() == TYPEID_UNIT' in line or 'GetTypeId() != TYPEID_UNIT' in line:
print(f"Please use IsCreature() instead of GetTypeId(): {file_path} at line {line_number}")
check_failed = True
if 'GetTypeId() == TYPEID_DYNOBJECT' in line:
print(f"Please use IsDynamicObject() instead GetTypeId(): {file_path} at line {line_number}")
if 'GetTypeId() == TYPEID_PLAYER' in line or 'GetTypeId() != TYPEID_PLAYER' in line:
print(f"Please use IsPlayer() instead of GetTypeId(): {file_path} at line {line_number}")
check_failed = True
if 'GetTypeId() == TYPEID_GAMEOBJECT' in line or 'GetTypeId() != TYPEID_GAMEOBJECT' in line:
print(f"Please use IsGameObject() instead of GetTypeId(): {file_path} at line {line_number}")
check_failed = True
if 'GetTypeId() == TYPEID_DYNOBJECT' in line or 'GetTypeId() != TYPEID_DYNOBJECT' in line:
print(f"Please use IsDynamicObject() instead of GetTypeId(): {file_path} at line {line_number}")
check_failed = True
# Handle the script error and update the result output
if check_failed:
Expand Down Expand Up @@ -139,10 +154,79 @@ def npcflags_helpers_check(file: io, file_path: str) -> None:
if 'RemoveFlag(UNIT_NPC_FLAGS,' in line:
print(
f"Please use RemoveNpcFlag() instead RemoveFlag(UNIT_NPC_FLAGS, ...): {file_path} at line {line_number}")
check_failed = True
# Handle the script error and update the result output
if check_failed:
error_handler = True
results["NpcFlagHelpers check"] = "Failed"

# Codestyle patterns checking for ItemFlag helpers
def itemflag_helpers_check(file: io, file_path: str) -> None:
global error_handler, results
file.seek(0) # Reset file pointer to the beginning
check_failed = False
# Parse all the file
for line_number, line in enumerate(file, start = 1):
if 'HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE)' in line:
print(
f"Please use IsRefundable() instead of HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE): {file_path} at line {line_number}")
check_failed = True
if 'HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE)' in line:
print(
f"Please use IsBOPTradable() instead of HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE): {file_path} at line {line_number}")
check_failed = True
if 'HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED)' in line:
print(
f"Please use IsWrapped() instead of HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED): {file_path} at line {line_number}")
check_failed = True
# Handle the script error and update the result output
if check_failed:
error_handler = True
results["ItemFlagHelpers check"] = "Failed"

# Codestyle patterns checking for ItemTemplate helpers
def itemtemplateflag_helpers_check(file: io, file_path: str) -> None:
global error_handler, results
file.seek(0) # Reset file pointer to the beginning
check_failed = False
# Parse all the file
for line_number, line in enumerate(file, start = 1):
if 'Flags & ITEM_FLAG' in line:
print(
f"Please use HasFlag(ItemFlag) instead of 'Flags & ITEM_FLAG_': {file_path} at line {line_number}")
check_failed = True
if 'Flags2 & ITEM_FLAG2' in line:
print(
f"Please use HasFlag2(ItemFlag2) instead of 'Flags2 & ITEM_FLAG2_': {file_path} at line {line_number}")
check_failed = True
if 'FlagsCu & ITEM_FLAGS_CU' in line:
print(
f"Please use HasFlagCu(ItemFlagsCustom) instead of 'FlagsCu & ITEM_FLAGS_CU_': {file_path} at line {line_number}")
check_failed = True
# Handle the script error and update the result output
if check_failed:
error_handler = True
results["ItemTemplateFlagHelpers check"] = "Failed"

# Codestyle patterns checking for various codestyle issues
def misc_codestyle_check(file: io, file_path: str) -> None:
global error_handler, results
file.seek(0) # Reset file pointer to the beginning
check_failed = False
# Parse all the file
for line_number, line in enumerate(file, start = 1):
if 'const auto&' in line:
print(
f"Please use 'auto const&' syntax instead of 'const auto&': {file_path} at line {line_number}")
check_failed = True
if re.search(r'\bconst\s+\w+\s*\*\b', line):
print(
f"Please use the syntax 'Class/ObjectType const*' instead of 'const Class/ObjectType*': {file_path} at line {line_number}")
check_failed = True
# Handle the script error and update the result output
if check_failed:
error_handler = True
results["Misc codestyle check"] = "Failed"

# Main function
parsing_file(src_directory)
3 changes: 3 additions & 0 deletions apps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ ENV ACORE_COMPONENT=dbimport
COPY --chown=$DOCKER_USER:$DOCKER_USER \
data data

COPY --chown=$DOCKER_USER:$DOCKER_USER \
modules modules

COPY --chown=$DOCKER_USER:$DOCKER_USER\
--from=build \
/azerothcore/env/dist/bin/dbimport /azerothcore/env/dist/bin/dbimport
Expand Down
11 changes: 11 additions & 0 deletions data/sql/updates/db_characters/2024_09_03_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- DB update 2024_07_05_00 -> 2024_09_03_00
DROP TABLE IF EXISTS `character_achievement_offline_updates`;
CREATE TABLE `character_achievement_offline_updates` (
`guid` BIGINT UNSIGNED NOT NULL COMMENT 'Character\'s GUID',
`update_type` TINYINT UNSIGNED NOT NULL COMMENT 'Supported types: 1 - COMPLETE_ACHIEVEMENT; 2 - UPDATE_CRITERIA',
`arg1` INT UNSIGNED NOT NULL COMMENT 'For type 1: achievement ID; for type 2: ACHIEVEMENT_CRITERIA_TYPE',
`arg2` INT UNSIGNED DEFAULT NULL COMMENT 'For type 2: miscValue1 for updating achievement criteria',
`arg3` INT UNSIGNED DEFAULT NULL COMMENT 'For type 2: miscValue2 for updating achievement criteria',
INDEX `idx_guid` (`guid`)
)
COMMENT = 'Stores updates to character achievements when the character was offline';
6 changes: 6 additions & 0 deletions data/sql/updates/db_world/2024_08_31_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- DB update 2024_08_30_02 -> 2024_08_31_00
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 21806;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 21806) AND (`source_type` = 0) AND (`id` IN (5));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `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
(21806, 0, 5, 0, 0, 0, 23, 0, 10000, 30000, 10000, 30000, 0, 0, 11, 37527, 0, 0, 0, 0, 0, 5, 40, 0, 0, 0, 0, 0, 0, 0, 'Greyheart Spellbinder - In Combat - Cast Banish');
10 changes: 10 additions & 0 deletions data/sql/updates/db_world/2024_08_31_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- DB update 2024_08_31_00 -> 2024_08_31_01
UPDATE `item_template`
SET `stat_type1` = 5,
`stat_value1` = 20,
`stat_type2` = 7,
`stat_value2` = 13,
`stat_type3` = 42,
`stat_value3` = 25,
`StatsCount` = 3
WHERE (`entry` = 13113);
3 changes: 3 additions & 0 deletions data/sql/updates/db_world/2024_09_01_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- DB update 2024_08_31_01 -> 2024_09_01_00
--
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 23429;
2 changes: 2 additions & 0 deletions data/sql/updates/db_world/2024_09_02_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- DB update 2024_09_01_00 -> 2024_09_02_00
UPDATE `creature_template` SET `speed_run` = 0.785714 WHERE `entry` = 23111;
3 changes: 3 additions & 0 deletions data/sql/updates/db_world/2024_09_02_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- DB update 2024_09_02_00 -> 2024_09_02_01
DELETE FROM `spell_custom_attr` WHERE `spell_id` = 40253;
INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (40253, 536870912);
4 changes: 4 additions & 0 deletions data/sql/updates/db_world/2024_09_03_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- DB update 2024_09_02_01 -> 2024_09_03_00
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 22960) AND (`source_type` = 0) AND (`id` IN (0));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(22960, 0, 0, 0, 0, 0, 40, 0, 0, 10000, 0, 10000, 0, 0, 11, 40895, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Dragonmaw Wyrmcaller - In Combat - Cast \'Jab\'');
7 changes: 7 additions & 0 deletions data/sql/updates/db_world/2024_09_03_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- DB update 2024_09_03_00 -> 2024_09_03_01
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17803;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 17803) AND (`source_type` = 0) AND (`id` IN (0, 1));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `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
(17803, 0, 0, 0, 0, 0, 100, 2, 5000, 8000, 13000, 16000, 0, 0, 11, 22582, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Oracle - In Combat - Cast \'Frost Shock\' (Normal Dungeon)'),
(17803, 0, 1, 0, 0, 0, 100, 4, 5000, 8000, 13000, 16000, 0, 0, 11, 37865, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Oracle - In Combat - Cast \'Frost Shock\' (Heroic Dungeon)');
Loading

0 comments on commit 8f8b4b1

Please sign in to comment.