Skip to content

Commit

Permalink
chore. Compatibility with the latest version (azerothcore#24)
Browse files Browse the repository at this point in the history
* chore. Compatibility with the latest version

* ci: add apps/ directory for ci scripts

* Update SQL files

* Update workflow and upload template

* rewrite getf method

* Revert "Update workflow and upload template"

This reverts commit 7951bea.

* Pointer to local variable

* update workflow

* Revert "Pointer to local variable"

This reverts commit 22a6667.

* Change const char for std::string

* AzthLanguage in modules

* fix build error

* fix build

* fix. sql

* fix sql

---------

Co-authored-by: Helias <[email protected]>
  • Loading branch information
pangolp and Helias authored Mar 20, 2024
1 parent cb0b2ad commit 9c25df7
Show file tree
Hide file tree
Showing 50 changed files with 25,394 additions and 25,352 deletions.
44 changes: 4 additions & 40 deletions .github/workflows/core-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,10 @@ name: core-build
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
compiler: [clang]
runs-on: ubuntu-20.04
name: ${{ matrix.compiler }}
env:
COMPILER: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v2
with:
repository: 'azerothcore/azerothcore-wotlk'
ref: 'master'
submodules: 'recursive'
- uses: actions/checkout@v2
with:
submodules: 'recursive'
path: 'modules/mod-azerothshard'
- name: Download mod-autobalance # TODO: remove mod-autobalance as a dependency of mod-azerothshard
run: git clone --depth=1 --branch=master https://github.com/azerothcore/mod-autobalance.git modules/mod-autobalance
- name: Cache
uses: actions/[email protected]
with:
path: /home/runner/.ccache
key: ccache:${{ matrix.compiler }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.compiler }}:${{ github.ref }}
ccache:${{ matrix.compiler }}
- name: Configure OS
run: source ./apps/ci/ci-install.sh
env:
CONTINUOUS_INTEGRATION: true
- name: Import db
run: source ./apps/ci/ci-import-db.sh
- name: Build
run: source ./apps/ci/ci-compile.sh
- name: Dry run
run: source ./apps/ci/ci-worldserver-dry-run.sh
# - name: Check startup errors
# run: source ./apps/ci/ci-error-check.sh
uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main
with:
module_repo: ${{ github.event.repository.name }}
Empty file added apps/.gitkeep
Empty file.
Empty file added apps/ci/.gitkeep
Empty file.
40 changes: 40 additions & 0 deletions apps/ci/ci-codestyle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

echo "Codestyle check script:"
echo

declare -A singleLineRegexChecks=(
["LOG_.+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above"
["[[:blank:]]$"]="Remove whitespace at the end of the lines above"
["\t"]="Replace tabs with 4 spaces in the lines above"
)

for check in ${!singleLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"

if grep -P -r -I -n ${check} src; then
echo
echo "${singleLineRegexChecks[$check]}"
exit 1
fi
done

declare -A multiLineRegexChecks=(
["LOG_[^;]+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above"
["\n\n\n"]="Multiple blank lines detected, keep only one. Check the files above"
)

for check in ${!multiLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"

if grep -Pzo -r -I ${check} src; then
echo
echo
echo "${multiLineRegexChecks[$check]}"
exit 1
fi
done

echo
echo "Everything looks good"
68 changes: 21 additions & 47 deletions data/sql/db-world/00-general.sql
Original file line number Diff line number Diff line change
@@ -1,46 +1,25 @@
-- FULL `creature_template` of entry 100000
DELETE FROM `creature_template` WHERE (entry = 100000);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(100000, 0, 0, 0, 0, 0, 23055, 0, 0, 0, 'Han\'al', 'Master Lorekeeper', NULL, 30000, 83, 83, 0, 2007, 3, 1.1, 1.5, 1.2, 1, 0, 0, 0, 8, 33536, 2048, 0, 0, 0, 0, 0, 0, 7, 32, 0, 0, 0, 0, 0, 0, 0, 'SmartAI', 0, 3, 0, 10, 10, 1, 0, 0, 1, 0, 2, 'npc_han_al', 12341);

DELETE FROM npc_text WHERE ID IN (100000, 100001, 100002, 100003);
INSERT INTO npc_text (ID, text0_0, text0_1, lang0, em0_0) VALUES
(100000, "È bello che tu voglia aiutarmi $N, la storia dev'essere scrupolosamente registrata... nulla deve andar perso!", 0, 0, 0),
(100001, "Hai già delle missioni da completare, ritorna quando sarai riuscito a portarle a termine o quando avrai rinunciato...\nNonostante il fallimento potrei avere ancora bisogno di te, $R", 0, 0, 0),
(100002, "Grazie del tuo aiuto, $C, per oggi mi hai aiutato a sufficienza!\nRitorna domani.", 0, 0, 0),
(100003, "Hai già molto lavoro da fare, $N. Non vorrei che ti affaticassi troppo... torna da me quando avrai concluso un po' del tuo lavoro.", 0, 0, 0);

UPDATE `item_template` SET `Flags` = 64, `ScriptName` = 'item_azth_hearthstone_loot_sack', stackable = 1, `spellid_1` = 36177, maxcount = 5 WHERE (entry = 32558);

-- VENDORS (DEBUG)
-- NEUTRAL
DELETE FROM `creature_template` WHERE (entry = 100002);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(100002, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Neutral Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 0, 0, 2000, 2000, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 4, 1, 1, 0, 0, 1, 0, 128, '', 12340);

-- FRIENDLY
DELETE FROM `creature_template` WHERE (entry = 100003);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(100003, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Friendly Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 0, 0, 2000, 2000, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 4, 1, 1, 0, 0, 1, 0, 128, '', 12340);

-- HONORED
DELETE FROM `creature_template` WHERE (entry = 100004);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(100004, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Honored Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 0, 0, 2000, 2000, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 4, 1, 1, 0, 0, 1, 0, 128, '', 12340);

-- REVERED
DELETE FROM `creature_template` WHERE (entry = 100005);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(100005, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Revered Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 0, 0, 2000, 2000, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 4, 1, 1, 0, 0, 1, 0, 128, '', 12340);

-- EXALTED
DELETE FROM `creature_template` WHERE (entry = 100006);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(100006, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Exalted Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 0, 0, 2000, 2000, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 4, 1, 1, 0, 0, 1, 0, 128, '', 12340);
DELETE FROM `creature_template` WHERE `entry` BETWEEN 100000 AND 100006;
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(100000, 0, 0, 0, 0, 0, 23055, 0, 0, 0, "Han'al", 'Master Lorekeeper', '', 30000, 83, 83, 0, 2007, 3, 1.1, 1.5, 1, 1, 20, 1.2, 1, 0, 1, 0, 0, 1, 1, 8, 33536, 2048, 0, 0, 0, 0, 0, 0, 7, 32, 0, 0, 0, 0, 0, 0, 0, 'SmartAI', 0, 0, 10, 10, 1, 1, 0, 0, 1, 0, 0, 2, 'npc_han_al', 12341),
(100001, 0, 0, 0, 0, 0, 10215, 0, 0, 0, 'Manaben', "Han'al Apprentice", '', 0, 80, 80, 0, 2007, 3, 1.1, 1.5, 1, 1, 20, 1.2, 1, 0, 1, 0, 0, 1, 1, 8, 33536, 2048, 0, 0, 0, 0, 0, 0, 7, 32, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 10, 10, 1, 1, 0, 0, 1, 0, 0, 2, '', 12341),
(100002, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Neutral Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 1, 20, 1, 0, 0, 1, 2000, 2000, 1, 1, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 4, 1, 1, 1, 0, 0, 1, 0, 0, 128, '', 12340),
(100003, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Friendly Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 1, 20, 1, 0, 0, 1, 2000, 2000, 1, 1, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 4, 1, 1, 1, 0, 0, 1, 0, 0, 128, '', 12340),
(100004, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Honored Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 1, 20, 1, 0, 0, 1, 2000, 2000, 1, 1, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 4, 1, 1, 1, 0, 0, 1, 0, 0, 128, '', 12340),
(100005, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Revered Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 1, 20, 1, 0, 0, 1, 2000, 2000, 1, 1, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 4, 1, 1, 1, 0, 0, 1, 0, 0, 128, '', 12340),
(100006, 0, 0, 0, 0, 0, 22439, 0, 0, 0, 'Azth Exalted Vendor', 'AzerothShard', '', 0, 70, 70, 1, 35, 128, 1, 1.14286, 1, 1, 20, 1, 0, 0, 1, 2000, 2000, 1, 1, 1, 33555202, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 4, 1, 1, 1, 0, 0, 1, 0, 0, 128, '', 12340);

DELETE FROM `npc_text` WHERE `ID` IN (100000, 100001, 100002, 100003);
INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `em0_0`) VALUES
(100000, "È bello che tu voglia aiutarmi $n, la storia dev'essere scrupolosamente registrata... nulla deve andar perso!", 0, 0, 0),
(100001, "Hai già delle missioni da completare, ritorna quando sarai riuscito a portarle a termine o quando avrai rinunciato...\nNonostante il fallimento potrei avere ancora bisogno di te, $r", 0, 0, 0),
(100002, "Grazie del tuo aiuto, $c, per oggi mi hai aiutato a sufficienza!\nRitorna domani.", 0, 0, 0),
(100003, "Hai già molto lavoro da fare, $n. Non vorrei che ti affaticassi troppo... torna da me quando avrai concluso un po' del tuo lavoro.", 0, 0, 0);

UPDATE `item_template` SET `Flags`=`Flags`|64, `ScriptName`='item_azth_hearthstone_loot_sack', `stackable`=1, `spellid_1`=36177, `maxcount`=5 WHERE `entry`=32558;
UPDATE `creature_template` SET `npcflag`=`npcflag`|129, `unit_flags`=`unit_flags`|768, `type_flags`=`type_flags`|134217728, `flags_extra`=`flags_extra`|2, `scriptname`="npc_azth_vendor", `gossip_menu_id`=32001 WHERE `entry` IN (100002, 100003, 100004, 100005, 100006);

DELETE FROM `creature_template_resistance` WHERE `CreatureID` IN (100002, 100003, 100004, 100005, 100006);
INSERT INTO `creature_template_resistance` (`CreatureID`, `School`, `Resistance`) VALUES
-- (100002, 2, 0),
(100002, 1, 32001),
(100003, 1, 32001),
(100004, 1, 32001),
Expand All @@ -51,13 +30,8 @@ INSERT INTO `creature_template_resistance` (`CreatureID`, `School`, `Resistance`
(100005, 2, 12000),
(100006, 2, 21000);

UPDATE creature_template SET `npcflag` = 129, `unit_flags` = 768, `type_flags` = 134217728, `flags_extra` = 2, scriptname = "npc_azth_vendor", gossip_menu_id = 32001 WHERE entry IN (100002, 100003, 100004, 100005, 100006);

-- END VENDORS DEBUG

-- DEBUG ONLY
DELETE FROM npc_vendor WHERE entry IN (100002, 100003, 100004, 100005, 100006, 100007);
INSERT INTO npc_vendor (entry, item, extendedcost) VALUES
DELETE FROM `npc_vendor` WHERE `entry` IN (100002, 100003, 100004, 100005, 100006, 100007);
INSERT INTO `npc_vendor` (`entry`, `item`, `extendedcost`) VALUES
(100002, 32558, 100010),
(100003, 32558, 100009),
(100004, 32558, 100008),
Expand Down
Loading

0 comments on commit 9c25df7

Please sign in to comment.