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
  • Loading branch information
trickerer committed Oct 19, 2024
2 parents 53c0209 + 7abbca0 commit 5d129e6
Show file tree
Hide file tree
Showing 60 changed files with 1,092 additions and 554 deletions.
103 changes: 43 additions & 60 deletions apps/ci/ci-pending-sql.sh
Original file line number Diff line number Diff line change
@@ -1,77 +1,60 @@
#!/usr/bin/env bash

set -euo pipefail

CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

source "$CURRENT_PATH/../bash_shared/includes.sh"

UPDATES_PATH="$AC_PATH_ROOT/data/sql/updates/"

COMMIT_HASH=
UPDATES_PATH="$AC_PATH_ROOT/data/sql/updates"

function import() {
db=$1
folder="db_"$db
pendingPath="$AC_PATH_ROOT/data/sql/updates/pending_$folder"
updPath="$UPDATES_PATH/$folder"
archivedPath="$AC_PATH_ROOT/data/sql/archive/$folder/6.x"

latestUpd=$(ls -1 $updPath/ | tail -n 1)

if [ -z $latestUpd ]; then
latestUpd=$(ls -1 $archivedPath/ | tail -n 1)
echo "> Last update file for db $db is missing! Using archived file" $latestUpd
# get_next_index "data/sql/updates/db_world/2024_10_14_22.sql"
# => 23
# get_next_index ""
# => 00
function get_next_index() {
if [[ -n "$1" ]]; then
PREV_COUNT="$(basename "$1" | cut -f4 -d_ | cut -f1 -d\.)"
printf '%02d' "$((PREV_COUNT + 1))"
else
echo "00"
fi
}

dateToday=$(date +%Y_%m_%d)
counter=0
# lists all SQL files in the appropriate data/sql/updates/db_$1, and then moves them to a standard format, ordered by date and how many imports have happened that day. The name should be in this format:
#
# /path/to/data/sql/updates/db_NAME/YYYY_MM_DD_INDEX.sql
#
# Where INDEX is a number with a minimum with a minimum width (0-padded) of 2
#
# for example, "data/sql/updates/db_world/2024_10_01_03.sql" translates to "the third update in the world database from October 01, 2024"

dateLast=$latestUpd
tmp=${dateLast#*_*_*_}
oldCnt=${tmp%.sql}
oldDate=${dateLast%_$tmp}
TODAY="$(date +%Y_%m_%d)"
function import() {
PENDING_PATH="$AC_PATH_ROOT/data/sql/updates/pending_db_$1"
UPDATES_DIR="$UPDATES_PATH/db_$1"

if [ "$oldDate" = "$dateToday" ]; then
((counter=10#$oldCnt+1)) # 10 # is needed to explictly add to a base 10 number
fi;
# Get the most recent SQL file applied to this database. Used for the header comment
LATEST_UPDATE="$(find "$UPDATES_DIR" -iname "*.sql" | sort -h | tail -n 1)"
# Get latest SQL file applied to this database, today. This could be empty.
LATEST_UPDATE_TODAY="$(find "$UPDATES_DIR" -iname "$TODAY*.sql" | sort -h | tail -n 1)"

for entry in "$pendingPath"/*.sql
for entry in "$PENDING_PATH"/*.sql
do
if [[ -e $entry ]]; then
oldVer=$oldDate"_"$oldCnt

cnt=$(printf -v counter "%02d" $counter ; echo $counter)

newVer=$dateToday"_"$cnt

newFile="$updPath/"$dateToday"_"$cnt".sql"

oldFile=$(basename "$entry")
prefix=${oldFile%_*.sql}
suffix=${oldFile#rev_}
rev=${suffix%.sql}

isRev=0
if [[ $prefix = "rev" && $rev =~ ^-?[0-9]+$ ]]; then
isRev=1
fi

echo "-- DB update $oldVer -> $newVer" > "$newFile";

cat $entry >> "$newFile";

currentHash="$(git log --diff-filter=A "$entry" | grep "^commit " | sed -e 's/commit //')"

if [[ "$COMMIT_HASH" != *"$currentHash"* ]]
then
COMMIT_HASH="$COMMIT_HASH $currentHash"
fi

rm $entry;

oldDate=$dateToday
oldCnt=$cnt

((counter+=1))
if [[ -f "$entry" ]]; then
INDEX="$(get_next_index "$LATEST_UPDATE_TODAY")"
OUTPUT_FILE="${UPDATES_DIR}/${TODAY}_${INDEX}.sql"

# ensure a note is added as a header comment
echo "-- DB update $(basename "$LATEST_UPDATE" .sql) -> $(basename "$OUTPUT_FILE" .sql)" > "$OUTPUT_FILE"
# fill in the SQL contents under that
cat "$entry" >> "$OUTPUT_FILE"
# remove the unneeded file
rm -f "$entry"
# set the newest file to the file we just moved
LATEST_UPDATE_TODAY="$OUTPUT_FILE"
LATEST_UPDATE="$OUTPUT_FILE"
fi
done

Expand Down
22 changes: 22 additions & 0 deletions data/sql/updates/db_world/2024_10_12_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- DB update 2024_10_11_04 -> 2024_10_12_00
UPDATE `creature_template` SET `unit_flags` = 33587202 WHERE (`entry` = 28782);


DELETE FROM `creature_text` WHERE (`CreatureID` = 28782) AND (`GroupID` = 0) AND (`ID` IN (0));
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`)
VALUES(28782, 0, 0, '%s rears up, beckoning you to ride it.', 16, 0, 100.0, 0, 0, 0, 29069, 0, 'Archerus Deathcharger');

UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28768;
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28768) AND (`source_type` = 0) AND (`id` IN (6, 8, 9, 10, 11));
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
(28768, 0, 6, 8, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 19, 28782, 5, 0, 0, 0, 0, 0, 0, 'Dark Rider of Acherus - On Death - Enter Evade Mode'),
(28768, 0, 8, 9, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 0, 19, 28782, 5, 0, 0, 0, 0, 0, 0, 'Dark Rider of Acherus - On Death - Root In Place'),
(28768, 0, 9, 10, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28782, 5, 0, 0, 0, 0, 0, 0, 'Dark Rider of Acherus - On Death - Emote Message'),
(28768, 0, 10, 11, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 19, 33554432, 0, 0, 0, 0, 0, 19, 28782, 5, 0, 0, 0, 0, 0, 0, 'Dark Rider of Acherus - On Death - Remove Not Selectable Unit Flag'),
(28768, 0, 11, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 142, 100, 0, 0, 0, 0, 0, 19, 28782, 5, 0, 0, 0, 0, 0, 0, 'Dark Rider of Acherus - On Death - Ensure Health Is Full When Revealed To Player');

UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28782;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28782) AND (`source_type` = 0) AND (`id` IN (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
(28782, 0, 0, 0, 27, 0, 100, 512, 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Archerus DeathCharger - On Mount - Remove Root Effect');
28 changes: 28 additions & 0 deletions data/sql/updates/db_world/2024_10_12_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- DB update 2024_10_12_00 -> 2024_10_12_01
DELETE FROM `creature_text`
WHERE (`CreatureID`, `GroupID`, `ID`) IN ((28936, 1, 0), (28936, 1, 1), (28936, 1, 2), (28936, 1, 3), (28936, 1, 4), (28936, 1, 5), (28936, 2, 0), (28936, 3, 0), (28936, 4, 0), (28936, 5, 0), (28936, 6, 0), (28936, 7, 0), (28936, 8, 0), (28936, 8, 1), (28936, 8, 2), (28936, 8, 3), (28936, 8, 4), (28936, 8, 5), (28936, 8, 6));
INSERT INTO `creature_text`
(`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`)
VALUES(28936, 1, 0, 'You''ll be hanging in the gallows shortly, Scourge fiend!', 12, 0, 100.0, 0, 0, 0, 29160, 0, 'crusader SAY_CURSADER1'),
(28936, 1, 1, 'You''ll have to kill me, monster. I will tell you NOTHING!', 12, 0, 100.0, 0, 0, 0, 29142, 0, 'crusader SAY_CURSADER2'),
(28936, 1, 2, 'You hit like a girl. Honestly. Is that the best you can do?', 12, 0, 100.0, 0, 0, 0, 29146, 0, 'crusader SAY_CURSADER3'),
(28936, 1, 3, 'ARGH! You burned my last good tabard!', 12, 0, 100.0, 0, 0, 0, 29162, 0, 'crusader SAY_CURSADER4'),
(28936, 1, 4, 'Argh... The pain... The pain is almost as unbearable as the lashings I received in grammar school when I was but a child.', 12, 0, 100.0, 0, 0, 0, 29143, 0, 'crusader SAY_CURSADER5'),
(28936, 1, 5, 'I used to work for Grand Inquisitor Isillien! Your idea of pain is a normal mid-afternoon for me!', 12, 0, 100.0, 0, 0, 0, 29161, 0, 'crusader SAY_CURSADER6'),
(28936, 2, 0, 'I''ll tell you everything! STOP! PLEASE!', 12, 0, 100.0, 0, 0, 0, 29149, 0, 'break crusader SAY_PERSUADED1'),
(28936, 3, 0, 'We... We have only been told that the "Crimson Dawn" is an awakening. You... You see, the Light speaks to the High General. It is the Light...', 12, 0, 100.0, 0, 0, 0, 29150, 0, 'break crusader SAY_PERSUADED2'),
(28936, 4, 0, 'The Light that guides us. This movement was set in motion before you came... We... We do as we are told. It is what must be done.', 12, 0, 100.0, 0, 0, 0, 29151, 0, 'break crusader SAY_PERSUADED3'),
(28936, 5, 0, 'I know very litte else... The High General chooses who may go and who must stay behind. There''s nothing else... You must believe me!', 12, 0, 100.0, 0, 0, 0, 29152, 0, 'break crusader SAY_PERSUADED4'),
(28936, 6, 0, 'LIES! The pain you are about to endure will be talked about for years to come!', 12, 0, 100.0, 0, 0, 0, 29163, 0, 'break crusader SAY_PERSUADED5'),
(28936, 7, 0, 'NO! PLEASE! There is one more thing that I forgot to mention... A courier comes soon... From Hearthglen. It...', 12, 0, 100.0, 0, 0, 0, 29153, 0, 'break crusader SAY_PERSUADED6'),
(28936, 8, 0, 'I''ll tear the secrets from your soul! Tell me about the "Crimson Dawn" and your life may be spared!', 12, 0, 100.0, 0, 0, 0, 29138, 0, 'player SAY_PERSUADE1'),
(28936, 8, 1, 'Tell me what you know about "Crimson Dawn" or the beatings will continue!', 12, 0, 100.0, 0, 0, 0, 29134, 0, 'player SAY_PERSUADE2'),
(28936, 8, 2, 'I''m through being courteous with your kind, human! What is the "Crimson Dawn?"', 12, 0, 100.0, 0, 0, 0, 29135, 0, 'player SAY_PERSUADE3'),
(28936, 8, 3, 'Is your life worth so little? Just tell me what I need to know about "Crimson Dawn" and I''ll end your suffering quickly.', 12, 0, 100.0, 0, 0, 0, 29139, 0, 'player SAY_PERSUADE4'),
(28936, 8, 4, 'I can keep this up for a very long time, Scarlet dog! Tell me about the "Crimson Dawn!"', 12, 0, 100.0, 0, 0, 0, 29137, 0, 'player SAY_PERSUADE'),
(28936, 8, 5, 'What is the "Crimson Dawn?"', 12, 0, 100.0, 0, 0, 0, 29133, 0, 'player SAY_PERSUADE6'),
(28936, 8, 6, '"Crimson Dawn!" What is it! Speak!', 12, 0, 100.0, 0, 0, 0, 29136, 0, 'player SAY_PERSUADE7');

UPDATE `creature_template` SET `ScriptName` = 'npc_crusade_persuaded' WHERE (`entry` = 28940);

UPDATE `item_template` SET `spellppmRate_1` = 8 WHERE (`entry` = 39371);
9 changes: 9 additions & 0 deletions data/sql/updates/db_world/2024_10_13_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- DB update 2024_10_12_01 -> 2024_10_13_00
--
DELETE FROM `game_event_creature_quest` WHERE `quest` IN (13931, 13932);
DELETE FROM `creature_queststarter` WHERE `quest`=13932 AND `id`=24468;
DELETE FROM `creature_queststarter` WHERE `quest`=13931 AND `id`=24510;
INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
(24468, 13932),
(24510, 13931);

46 changes: 46 additions & 0 deletions data/sql/updates/db_world/2024_10_13_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- DB update 2024_10_13_00 -> 2024_10_13_01
--
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24247;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24247) 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
(24247, 0, 0, 0, 0, 0, 100, 0, 10000, 10000, 12000, 12000, 0, 0, 11, 43592, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Koragg - In Combat - Cast \'Mighty Blow\''),
(24247, 0, 1, 0, 0, 0, 100, 0, 15000, 15000, 12000, 12000, 0, 0, 11, 43593, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Koragg - In Combat - Cast \'Cold Stare\'');

UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24246;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24246) 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
(24246, 0, 0, 0, 0, 0, 100, 0, 8000, 8000, 12000, 12000, 0, 0, 11, 43590, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Darkheart - In Combat - Cast \'Psychic Wail\'');

UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24244;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24244) 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
(24244, 0, 0, 0, 0, 0, 100, 0, 2000, 2000, 1000, 1000, 0, 0, 11, 43584, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Gazakroth - In Combat - Cast \'Firebolt\'');

UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24245;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24245) 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
(24245, 0, 0, 0, 0, 0, 100, 0, 15000, 15000, 12000, 12000, 0, 0, 11, 43586, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Fenstalker - In Combat - Cast \'Volatile Infection\'');

UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24242;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24242) 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
(24242, 0, 0, 0, 0, 0, 100, 0, 5000, 5000, 2500, 2500, 0, 0, 11, 43579, 64, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Slither - In Combat - Cast \'Venom Spit\'');

UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24243;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24243) 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
(24243, 0, 0, 0, 0, 0, 100, 0, 13000, 13000, 12000, 12000, 0, 0, 11, 43583, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Lord Raadan - In Combat - Cast \'Thunderclap\''),
(24243, 0, 1, 0, 0, 0, 100, 0, 8000, 8000, 12000, 12000, 0, 0, 11, 43582, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Lord Raadan - In Combat - Cast \'Flame Breath\'');

UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24241;

DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24241) 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
(24241, 0, 0, 0, 16, 0, 100, 0, 43578, 100, 12000, 15000, 1, 0, 11, 43578, 32, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Thurg - On Friendly Unit Missing Buff \'Bloodlust\' - Cast \'Bloodlust\''),
(24241, 0, 1, 0, 14, 0, 100, 0, 10000, 10000, 12000, 12000, 0, 0, 11, 15496, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Thurg - In Combat - Cast \'Cleave\'');
Loading

0 comments on commit 5d129e6

Please sign in to comment.