Skip to content

Commit

Permalink
Merge pull request #8 from azerothcore/master
Browse files Browse the repository at this point in the history
chore: align wowgaming/aowow with azerothcore/aowow
  • Loading branch information
Helias committed Aug 24, 2024
2 parents cfdfab3 + a62698d commit 452e2f3
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/generate-aowow-database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: generate-aowow-database
on:
workflow_dispatch:

jobs:
generate-aowow-db:
permissions: write-all
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v4

- name: "run scripts"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone https://github.com/azerothcore/acore-docker
cd acore-docker
docker compose up -d
cd ../setup/
bash generate-db.sh
cd ..
release_name=$(date '+%Y-%m-%d_%H-%M-%S')
gh release create $release_name
gh release upload $release_name "aowow_db.sql.zip"
60 changes: 60 additions & 0 deletions setup/generate-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# acore-docker credentials
echo "
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
\$AoWoWconf['aowow'] = array (
'host' => '127.0.0.1:63306',
'user' => 'root',
'pass' => 'password',
'db' => 'tmp_aowow',
'prefix' => 'aowow_',
);
\$AoWoWconf['world'] = array (
'host' => '127.0.0.1:63306',
'user' => 'root',
'pass' => 'password',
'db' => 'acore_world',
'prefix' => '',
);
\$AoWoWconf['auth'] = array (
'host' => '127.0.0.1:63306',
'user' => 'root',
'pass' => 'password',
'db' => 'acore_auth',
'prefix' => '',
);
\$AoWoWconf['characters']['1'] = array (
'host' => '127.0.0.1:63306',
'user' => 'root',
'pass' => 'password',
'db' => 'acore_characters',
'prefix' => '',
);
?>
" >> ../config/config.php

mysql -u root -ppassword -h 127.0.0.1 -P 63306 -e "CREATE DATABASE tmp_aowow;"
mysql -u root -ppassword -h 127.0.0.1 -P 63306 tmp_aowow < db_structure.sql
mysql -u root -ppassword -h 127.0.0.1 -P 63306 acore_world < spell_learn_spell.sql

cd ..

mkdir -p setup/mpqdata/enus/DBFilesClient/

wget https://github.com/wowgaming/client-data/releases/download/v16/data.zip
unzip data.zip "dbc/*" -d ./
mv dbc/* "setup/mpqdata/enus/DBFilesClient/"

php aowow --sql

mysqldump -u root -ppassword -h 127.0.0.1 -P 63306 tmp_aowow --ignore-table=tmp_aowow.aowow_config > aowow_update.sql
mysqldump -u root -ppassword -h 127.0.0.1 -P 63306 acore_world > acore_world.sql
zip aowow_db.sql.zip aowow_update.sql acore_world.sql
10 changes: 9 additions & 1 deletion setup/tools/sqlgen/creature.func.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function generate(array $ids = []) : bool
IF(ie.entry IS NULL, 0, ?d) AS cuFlags, -- cuFlags
difficulty_entry_1, difficulty_entry_2, difficulty_entry_3,
KillCredit1, KillCredit2,
0 AS modelid1, 0 AS modelid2, 0 AS modelid3, 0 AS modelid4,
IFNULL(ctm1.CreatureDisplayID, 0), IFNULL(ctm2.CreatureDisplayID, 0), IFNULL(ctm3.CreatureDisplayID, 0), IFNULL(ctm4.CreatureDisplayID, 0),
"" AS textureString, -- textureString
0 AS modelId, -- modelId
0 AS humanoid, -- uses creaturedisplayinfoextra
Expand Down Expand Up @@ -118,6 +118,14 @@ public function generate(array $ids = []) : bool
creature_template_resistance ctr5 ON ct.entry = ctr5.CreatureID AND ctr5.School = 5
LEFT JOIN
creature_template_resistance ctr6 ON ct.entry = ctr6.CreatureID AND ctr6.School = 6
LEFT JOIN
creature_template_model ctm1 ON ct.entry = ctm1.CreatureID AND ctm1.Idx = 0
LEFT JOIN
creature_template_model ctm2 ON ct.entry = ctm2.CreatureID AND ctm2.Idx = 1
LEFT JOIN
creature_template_model ctm3 ON ct.entry = ctm3.CreatureID AND ctm3.Idx = 2
LEFT JOIN
creature_template_model ctm4 ON ct.entry = ctm4.CreatureID AND ctm4.Idx = 3
WHERE
ct.entry > ?d
{
Expand Down

0 comments on commit 452e2f3

Please sign in to comment.