eluna fixes

This commit is contained in:
Deckard
2025-10-04 22:35:48 -04:00
parent 8b2eeff3fd
commit 13fc1b7e66
3 changed files with 148 additions and 21 deletions

View File

@@ -20,7 +20,9 @@ WORLD_EXTERNAL_PORT=8215
SOAP_EXTERNAL_PORT=7778
# Server address for client connections (production)
SERVER_ADDRESS=192.168.0.188
# SERVER_ADDRESS=192.168.0.188
# Server address for client connections (local)
SERVER_ADDRESS=127.0.0.1
# Use WORLD_EXTERNAL_PORT for realmlist (client connection port)
REALM_PORT=8215

View File

@@ -274,7 +274,14 @@ services:
image: ${AC_ELUNA_IMAGE}
pull_policy: ${IMAGE_PULL_POLICY}
container_name: ${CONTAINER_ELUNA}
user: "0:0" # Run as root to handle NFS permissions
command: npm run dev
volumes:
# TypeScript source files (input)
- ${STORAGE_PATH}/typescript:/eluna-ts/src
# Compiled Lua scripts (output)
- ${STORAGE_PATH}/lua_scripts:/eluna-ts/dist
environment:
- ELUNATS_BUILD_FILE=${ELUNATS_BUILD_FILE:-index.ts}
restart: unless-stopped
networks:
- azerothcore
@@ -721,27 +728,39 @@ services:
fi
if [ "$MODULE_ASSISTANT" = "1" ] && [ ! -d "mod-assistant" ]; then
echo '🤖 Installing mod-assistant...'
echo ' 📖 Project: https://github.com/azerothcore/mod-assistant'
echo ' Provides AI-powered assistance and automation features'
echo ' 📖 Project: https://github.com/noisiver/mod-assistant'
echo ' NPC (ID: 9000000) providing heirlooms, glyphs, gems, profession services'
echo ' 🔧 REBUILD REQUIRED: Container must be rebuilt with source-based compilation'
echo ' 🔬 STATUS: IN TESTING - Currently under verification'
git clone https://github.com/azerothcore/mod-assistant.git mod-assistant
git clone https://github.com/noisiver/mod-assistant.git mod-assistant
fi
if [ "$MODULE_REAGENT_BANK" = "1" ] && [ ! -d "mod-reagent-bank" ]; then
echo '🏦 Installing mod-reagent-bank...'
echo ' 📖 Project: https://github.com/azerothcore/mod-reagent-bank'
echo ' Adds reagent bank functionality similar to retail WoW'
echo ' 📖 Project: https://github.com/ZhengPeiRu21/mod-reagent-bank'
echo ' Reagent banker NPC for storing crafting materials, frees bag space'
echo ' 🔧 REBUILD REQUIRED: Container must be rebuilt with source-based compilation'
echo ' 🔬 STATUS: IN TESTING - Currently under verification'
git clone https://github.com/azerothcore/mod-reagent-bank.git mod-reagent-bank
git clone https://github.com/ZhengPeiRu21/mod-reagent-bank.git mod-reagent-bank
fi
if [ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" = "1" ] && [ ! -d "mod-black-market" ]; then
echo '🏴‍☠️ Installing mod-black-market...'
echo ' 📖 Project: https://github.com/azerothcore/mod-black-market'
echo ' Black Market Auction House for rare and unique items'
echo ' 🔧 REBUILD REQUIRED: Container must be rebuilt with source-based compilation'
echo ' 📖 Project: https://github.com/Youpeoples/Black-Market-Auction-House'
echo ' MoP Black Market Auction House backported using Eluna Lua engine'
echo ' ⚠️ SPECIAL MODULE: Uses Lua scripts, not C++ compilation'
echo ' 🔧 REQUIRES: mod-eluna must be enabled and functional'
echo ' 🔬 STATUS: IN TESTING - Currently under verification'
git clone https://github.com/azerothcore/mod-black-market.git mod-black-market
git clone https://github.com/Youpeoples/Black-Market-Auction-House.git mod-black-market
# Special handling: Copy Lua scripts to lua_scripts directory
if [ "$MODULE_ELUNA" = "1" ] && [ -d "mod-black-market/Server Files/lua_scripts" ]; then
echo ' 🔧 Integrating Black Market Lua scripts with mod-eluna...'
mkdir -p /azerothcore/lua_scripts
cp -r mod-black-market/Server\ Files/lua_scripts/* /azerothcore/lua_scripts/ 2>/dev/null || true
echo ' ✅ Black Market Lua scripts copied to /azerothcore/lua_scripts directory'
ls -la /azerothcore/lua_scripts/ | grep -E "\\.lua$" || echo " No .lua files found after copy"
else
echo ' ⚠️ WARNING: mod-eluna not enabled - Black Market will not function'
fi
fi
echo 'Managing configuration files...'
@@ -820,7 +839,7 @@ services:
fi
if [ "$MODULE_ELUNA" != "1" ]; then
rm -f /azerothcore/env/dist/etc/mod_LuaEngine.conf*
rm -f /azerothcore/env/dist/etc/mod_eluna.conf*
fi
if [ "$MODULE_ARAC" != "1" ]; then
rm -f /azerothcore/env/dist/etc/arac.conf*
@@ -899,7 +918,7 @@ services:
if [ -d "$$module_dir/data/sql/world" ]; then
find "$$module_dir/data/sql/world" -name "*.sql" -type f | while read sql_file; do
echo " Executing world SQL: $$(basename "$$sql_file")"
if mysql --skip-ssl-verify -h "${CONTAINER_MYSQL}" -P 3306 -u root -p"${MYSQL_ROOT_PASSWORD}" "${DB_WORLD_NAME}" < "$$sql_file" >/dev/null 2>&1; then
if mariadb --ssl=false -h "${CONTAINER_MYSQL}" -P 3306 -u root -p"${MYSQL_ROOT_PASSWORD}" "${DB_WORLD_NAME}" < "$$sql_file" >/dev/null 2>&1; then
echo " ✅ Successfully executed $$(basename "$$sql_file")"
else
echo " ❌ Failed to execute $$sql_file"
@@ -911,7 +930,7 @@ services:
if [ -d "$$module_dir/data/sql/auth" ]; then
find "$$module_dir/data/sql/auth" -name "*.sql" -type f | while read sql_file; do
echo " Executing auth SQL: $$(basename "$$sql_file")"
if mysql --skip-ssl-verify -h "${CONTAINER_MYSQL}" -P 3306 -u root -p"${MYSQL_ROOT_PASSWORD}" "${DB_AUTH_NAME}" < "$$sql_file" >/dev/null 2>&1; then
if mariadb --ssl=false -h "${CONTAINER_MYSQL}" -P 3306 -u root -p"${MYSQL_ROOT_PASSWORD}" "${DB_AUTH_NAME}" < "$$sql_file" >/dev/null 2>&1; then
echo " ✅ Successfully executed $$(basename "$$sql_file")"
else
echo " ❌ Failed to execute $$sql_file"
@@ -923,7 +942,7 @@ services:
if [ -d "$$module_dir/data/sql/characters" ]; then
find "$$module_dir/data/sql/characters" -name "*.sql" -type f | while read sql_file; do
echo " Executing characters SQL: $$(basename "$$sql_file")"
if mysql --skip-ssl-verify -h "${CONTAINER_MYSQL}" -P 3306 -u root -p"${MYSQL_ROOT_PASSWORD}" "${DB_CHARACTERS_NAME}" < "$$sql_file" >/dev/null 2>&1; then
if mariadb --ssl=false -h "${CONTAINER_MYSQL}" -P 3306 -u root -p"${MYSQL_ROOT_PASSWORD}" "${DB_CHARACTERS_NAME}" < "$$sql_file" >/dev/null 2>&1; then
echo " ✅ Successfully executed $$(basename "$$sql_file")"
else
echo " ❌ Failed to execute $$sql_file"
@@ -947,10 +966,10 @@ services:
fi
}
# Install MySQL client if not available
which mysql >/dev/null 2>&1 || {
echo "Installing MySQL client..."
apk add --no-cache mysql-client >/dev/null 2>&1 || echo "Warning: Could not install MySQL client"
# Install MariaDB client if not available
which mariadb >/dev/null 2>&1 || {
echo "Installing MariaDB client..."
apk add --no-cache mariadb-client >/dev/null 2>&1 || echo "Warning: Could not install MariaDB client"
}
# Execute SQL for enabled modules only
@@ -1143,7 +1162,7 @@ services:
[ "$MODULE_LEVEL_GRANT" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-quest-count-level"
[ "$MODULE_ASSISTANT" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-assistant"
[ "$MODULE_REAGENT_BANK" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-reagent-bank"
[ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-black-market"
# Note: mod-black-market is Lua-based, doesn't need C++ compilation
if [ -n "$ENABLED_MODULES" ]; then
ENABLED_COUNT=$(echo $ENABLED_MODULES | wc -w)

View File

@@ -67,6 +67,17 @@ else
print_status "INFO" "lua_scripts directory already exists"
fi
# Create typescript directory for ac-eluna container
TYPESCRIPT_DIR="${STORAGE_PATH}/typescript"
print_status "INFO" "Creating TypeScript scripts directory: $TYPESCRIPT_DIR"
if [ ! -d "$TYPESCRIPT_DIR" ]; then
mkdir -p "$TYPESCRIPT_DIR"
print_status "SUCCESS" "Created typescript directory"
else
print_status "INFO" "typescript directory already exists"
fi
# Create example scripts
print_status "HEADER" "CREATING EXAMPLE LUA SCRIPTS"
@@ -218,6 +229,85 @@ EOF
print_status "SUCCESS" "Created init.lua loader script"
# Create TypeScript example
print_status "HEADER" "CREATING TYPESCRIPT EXAMPLE"
cat > "$TYPESCRIPT_DIR/index.ts" << 'EOF'
// ==============================================
// TypeScript Example for AzerothCore Eluna-TS
// ==============================================
// This TypeScript file will be compiled to Lua by ac-eluna container
// Event constants
const PLAYER_EVENT_ON_LOGIN = 3;
const PLAYER_EVENT_ON_LEVEL_CHANGE = 13;
// Welcome message for players
function OnPlayerLogin(event: number, player: Player): void {
const playerName = player.GetName();
const playerLevel = player.GetLevel();
player.SendBroadcastMessage(
`|cff00ff00Welcome ${playerName}! You are level ${playerLevel}.|r`
);
player.SendBroadcastMessage(
"|cffyellow🚀 This server supports TypeScript scripting via Eluna-TS!|r"
);
print(`TypeScript: Player ${playerName} logged in at level ${playerLevel}`);
}
// Level up rewards
function OnPlayerLevelUp(event: number, player: Player, oldLevel: number): void {
const newLevel = player.GetLevel();
const playerName = player.GetName();
if (newLevel <= oldLevel) {
return;
}
player.SendBroadcastMessage(
`|cffff6600Congratulations on reaching level ${newLevel}!|r`
);
// Milestone rewards
const rewards: { [key: number]: { gold?: number; message: string } } = {
10: { gold: 100, message: "1 gold for reaching level 10!" },
20: { gold: 500, message: "5 gold for reaching level 20!" },
30: { gold: 1000, message: "10 gold for reaching level 30!" },
40: { gold: 2000, message: "20 gold for reaching level 40!" },
50: { gold: 5000, message: "50 gold for reaching level 50!" },
60: { gold: 10000, message: "100 gold for reaching the original cap!" },
70: { gold: 20000, message: "200 gold for reaching TBC cap!" },
80: { gold: 50000, message: "500 gold for reaching max level!" }
};
const reward = rewards[newLevel];
if (reward) {
if (reward.gold) {
player.ModifyMoney(reward.gold * 10000); // Convert to copper
}
player.SendBroadcastMessage(`|cffff0000${reward.message}|r`);
if (newLevel >= 60) {
SendWorldMessage(
`|cffff6600${playerName} has reached level ${newLevel}! Congratulations!|r`
);
}
}
print(`TypeScript: Player ${playerName} leveled from ${oldLevel} to ${newLevel}`);
}
// Register events
RegisterPlayerEvent(PLAYER_EVENT_ON_LOGIN, OnPlayerLogin);
RegisterPlayerEvent(PLAYER_EVENT_ON_LEVEL_CHANGE, OnPlayerLevelUp);
print("✅ TypeScript scripts loaded and will be compiled to Lua by ac-eluna");
EOF
print_status "SUCCESS" "Created TypeScript example: index.ts"
# Create Eluna configuration documentation
cat > "$LUA_SCRIPTS_DIR/README.md" << 'EOF'
# AzerothCore Eluna Lua Scripts
@@ -322,17 +412,33 @@ else
print_status "INFO" "No separate Eluna container found (using embedded mod-eluna)"
fi
# Check for Black Market integration
if [ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" = "1" ]; then
print_status "INFO" "Black Market Auction House module enabled - requires Eluna integration"
if [ -f "$LUA_SCRIPTS_DIR/bmah_server.lua" ]; then
print_status "SUCCESS" "Black Market Lua script found in lua_scripts directory"
else
print_status "WARNING" "Black Market Lua script not found - will be copied during module installation"
fi
fi
# Summary
print_status "HEADER" "SETUP COMPLETE"
echo "📁 Lua Scripts Directory: $LUA_SCRIPTS_DIR"
echo "📁 TypeScript Directory: $TYPESCRIPT_DIR"
echo ""
echo "📜 Example Scripts Created:"
echo " Lua Scripts:"
echo " • welcome.lua - Player login messages"
echo " • server_info.lua - Custom info commands"
echo " • level_rewards.lua - Milestone rewards"
echo " • init.lua - Script loader documentation"
echo " • README.md - Complete documentation"
echo ""
echo " TypeScript Scripts:"
echo " • index.ts - TypeScript example with type safety"
echo ""
print_status "INFO" "Next Steps:"
echo "1. Start/restart your worldserver container"