вывод из самбомудлей модов для азероткор

This commit is contained in:
2026-03-07 22:28:31 +04:00
parent 5877ea78cd
commit adcfe8e31d
1720 changed files with 1941740 additions and 40 deletions
+4 -6
View File
@@ -4,12 +4,10 @@
/conf/*
!/conf/dist
/modules/*
!/modules/*.md
!/modules/*.sh
!/modules/CMakeLists.txt
!/modules/*.h
!/modules/*.cmake
/modules/CMakeCache.txt
/modules/CMakeFiles/
/modules/Makefile
/modules/cmake_install.cmake
/build*/
/var/*
!/var/build/.gitkeep
-23
View File
@@ -1,23 +0,0 @@
[submodule "modules/mod-eluna"]
path = modules/mod-eluna
url = https://github.com/azerothcore/mod-eluna.git
[submodule "modules/mod-autobalance"]
path = modules/mod-autobalance
url = https://github.com/azerothcore/mod-autobalance.git
[submodule "modules/mod-individual-progression"]
path = modules/mod-individual-progression
url = https://github.com/ZhengPeiRu21/mod-individual-progression.git
[submodule "modules/mod-playerbots"]
path = modules/mod-playerbots
url = https://github.com/mod-playerbots/mod-playerbots.git
[submodule "modules/mod-aoe-loot"]
path = modules/mod-aoe-loot
url = https://github.com/azerothcore/mod-aoe-loot.git
[submodule "modules/mod-learnspells"]
path = modules/mod-learnspells
url = https://github.com/noisiver/mod-learnspells.git
+5 -3
View File
@@ -5,8 +5,8 @@
# README
#
# This script is used to automatically update
# submodules and subrepos included in this project
# Subrepo are updated in bidirectional way (pull + push)
# vendored dependencies and subrepos included in this project.
# Subrepos are updated in bidirectional way (pull + push)
# because they are intended to be developed by this organization
#
# NOTE: only maintainers and CI should run this script and
@@ -16,9 +16,11 @@
set -e
ROOT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../"
# update all submodules
# Update submodules only if the repository still uses them.
if [ -f "$ROOT_PATH/.gitmodules" ]; then
git submodule update --init --recursive
git submodule foreach git pull origin master
fi
# include libraries for git subrepo
source "$ROOT_PATH/deps/git-subrepo/.rc"
source "$ROOT_PATH/deps/acore/bash-lib/src/git-utils/subrepo.sh"
+8
View File
@@ -0,0 +1,8 @@
[*]
charset = utf-8
indent_style = space
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 80
+104
View File
@@ -0,0 +1,104 @@
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text eol=lf
# Text
*.conf text
*.conf.dist text
*.cmake text
## Scripts
*.sh text
*.fish text
*.lua text
## SQL
*.sql text
## C++
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
## For documentation
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
COPYRIGHT text
INSTALL text
license text
LICENSE text
NEWS text
readme text
README text
TODO text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## EXECUTABLES
*.exe binary
*.pyc binary
@@ -0,0 +1,72 @@
name: Bug report
description: Create a bug report to help us improve.
title: "Bug: "
body:
- type: textarea
id: current
attributes:
label: Current Behaviour
description: |
Description of the problem or issue here.
Include entries of affected creatures / items / quests / spells etc.
If this is a crash, post the crashlog (upload to https://gist.github.com/) and include the link here.
Never upload files! Use GIST for text and YouTube for videos!
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behaviour
description: |
Tell us what should happen instead.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce the problem
description: |
What does someone else need to do to encounter the same bug?
placeholder: |
1. Step 1
2. Step 2
3. Step 3
validations:
required: true
- type: textarea
id: extra
attributes:
label: Extra Notes
description: |
Do you have any extra notes that can help solve the issue that does not fit any other field?
placeholder: |
None
validations:
required: false
- type: textarea
id: commit
attributes:
label: AC rev. hash/commit
description: |
Copy the result of the `.server debug` command (if you need to run it from the client get a prat addon)
validations:
required: true
- type: input
id: os
attributes:
label: Operating system
description: |
The Operating System the Server is running on.
i.e. Windows 11 x64, Debian 10 x64, macOS 12, Ubuntu 20.04
validations:
required: true
- type: textarea
id: custom
attributes:
label: Custom changes or Modules
description: |
List which custom changes or modules you have applied, i.e. Eluna module, etc.
placeholder: |
None
validations:
required: false
@@ -0,0 +1,33 @@
name: Feature request
description: Suggest an idea for this project
title: "Feature: "
body:
- type: markdown
attributes:
value: |
Thank you for taking your time to fill out a feature request. Remember to fill out all fields including the title above.
An issue that is not properly filled out will be closed.
- type: textarea
id: description
attributes:
label: Describe your feature request or suggestion in detail
description: |
A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe a possible solution to your feature or suggestion in detail
description: |
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional context
description: |
Add any other context or screenshots about the feature request here.
validations:
required: false
+294
View File
@@ -0,0 +1,294 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore
# mod-aoe-loot
[English](README.md) | [Español](README_ES.md)
[![Build Status](https://github.com/azerothcore/mod-aoe-loot/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-aoe-loot/actions)
## Description
This module enables Area of Effect (AOE) looting functionality for AzerothCore, allowing players to loot multiple nearby corpses by interacting with just one of them. All items and gold from corpses within the configured range are automatically collected into a single loot window.
## Features
- **AOE Looting**: Automatically collect loot from multiple nearby corpses with a single interaction
- **Player Toggle Commands**: Individual players can enable/disable AOE loot using `.aoeloot on/off` commands
- **Multi-language Support**: Full internationalization support with English and Spanish translations (easily extensible to other languages)
- **Configurable Range**: Server administrators can set the maximum distance for AOE loot collection
- **Group Support**: Optional group looting with configurable settings
- **Performance Optimized**: Limits number of corpses processed to maintain server stability
- **Smart Item Management**:
- Automatic gold accumulation with overflow protection
- Quest items sent directly to inventory
- Maximum 15 items per loot window to prevent UI issues
- **Corpse Management**: Automatically cleans up looted corpses to reduce clutter
## Recent Updates
### v2.0 - Player Control & Internationalization
- ✅ Added `.aoeloot on/off` player commands for individual control
- ✅ Implemented multi-language support via `acore_string` system
- ✅ Fixed enum ID alignment issues
- ✅ Complete English and Spanish translations
- ✅ Improved code documentation and structure
### v1.x - Core Functionality
- Initial AOE loot implementation
- Configuration system
- Range and group settings
## Requirements
- AzerothCore v3.0.0+ (latest master branch recommended)
- MySQL 8.0+
- Compiler with C++17 support
## Installation
### 1. Clone the Module
Navigate to your AzerothCore modules directory:
```bash
cd <ACoreDir>/modules
git clone https://github.com/azerothcore/mod-aoe-loot.git
```
### 2. Compile
Re-compile AzerothCore:
```bash
cd <ACoreDir>/build
cmake ../ -DCMAKE_INSTALL_PREFIX=/path/to/server -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
make -j $(nproc)
make install
```
### 3. Configure
Edit your `worldserver.conf` file (or create `AOELoot.conf` in configs folder):
```conf
###################################################################################################
# AOE LOOT MODULE CONFIGURATION
###################################################################################################
#
# AOELoot.Enable
# Description: Enable or disable the AOE Loot module globally
# Default: 1 (enabled)
# 0 (disabled)
AOELoot.Enable = 1
#
# AOELoot.Range
# Description: Maximum distance (in yards) to collect loot from nearby corpses
# Default: 30.0
# Range: 5.0 - 100.0
AOELoot.Range = 30.0
#
# AOELoot.Group
# Description: Allow AOE looting when player is in a group
# Default: 1 (allowed)
# 0 (not allowed)
AOELoot.Group = 1
#
# AOELoot.Message
# Description: Show informational message on player login
# Default: 1 (show message)
# 0 (no message)
AOELoot.Message = 1
###################################################################################################
```
### 4. Corpse Decay Configuration (IMPORTANT)
For optimal experience, modify the corpse decay settings in `worldserver.conf`:
```conf
#
# Rate.Corpse.Decay.Looted
# Description: Multiplier for Corpse.Decay.* to configure how long creature corpses stay
# after they have been looted.
# Default: 0.5
# Recommended: 0.01 (for AOE Loot module)
Rate.Corpse.Decay.Looted = 0.01
```
**Why this is important:** The default decay rate (0.5) can cause corpses to linger after being looted via AOE, creating visual clutter. Setting this to 0.01 ensures corpses disappear quickly after looting.
### 5. Restart Server
Restart your worldserver to load the module:
```bash
./worldserver
```
## Usage
### For Players
#### Commands
- `.aoeloot on` - Enable AOE looting for your character
- `.aoeloot off` - Disable AOE looting for your character
#### How to Use
1. Kill multiple enemies in close proximity
2. Right-click on any corpse to loot
3. All items from nearby corpses will appear in a single loot window
4. Quest items are automatically added to your inventory
**Note:** Player preferences reset on logout. AOE loot is enabled by default if the module is active.
### For Administrators
The module can be controlled through configuration file settings (see Configuration section above).
## Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `AOELoot.Enable` | Boolean | 1 | Enable/disable module globally |
| `AOELoot.Range` | Float | 30.0 | Maximum loot collection radius (5.0 - 100.0) |
| `AOELoot.Group` | Boolean | 1 | Allow AOE loot in groups |
| `AOELoot.Message` | Boolean | 1 | Show login message |
## Multi-language Support
The module includes full multi-language support through AzerothCore's `acore_string` system.
### Currently Supported Languages
- 🇬🇧 English (en_US)
- 🇪🇸 Spanish (es_ES / es_MX)
### Adding More Languages
To add additional language support, update the SQL file:
```sql
UPDATE `acore_string` SET
`locale_frFR` = 'Votre traduction ici',
`locale_deDE` = 'Ihre Übersetzung hier',
`locale_ruRU` = 'Ваш перевод здесь'
WHERE `entry` BETWEEN 50000 AND 50007;
```
Supported locale columns:
- `locale_koKR` (Korean)
- `locale_frFR` (French)
- `locale_deDE` (German)
- `locale_zhCN` (Chinese Simplified)
- `locale_zhTW` (Chinese Traditional)
- `locale_ruRU` (Russian)
## Technical Details
### Database Entries
The module uses `acore_string` entries 50000-50007:
| Entry | Constant | Purpose |
|-------|----------|---------|
| 50000 | AOE_ACORE_STRING_MESSAGE | Login message |
| 50001 | AOE_ITEM_IN_THE_MAIL | Mail notification (reserved) |
| 50002-50003 | - | Reserved for future use |
| 50004 | AOE_LOOT_ALREADY_ENABLED | "Already enabled" message |
| 50005 | AOE_LOOT_ENABLED | "Enabled" confirmation |
| 50006 | AOE_LOOT_ALREADY_DISABLED | "Already disabled" message |
| 50007 | AOE_LOOT_DISABLED | "Disabled" confirmation |
### Performance Considerations
- Maximum 10 corpses processed per loot operation (hardcoded for stability)
- Maximum 15 items per loot window
- Gold overflow protection (prevents exceeding uint32 max value)
- Efficient corpse filtering and cleanup
## Troubleshooting
### Issue: AOE loot not working
**Solutions:**
- Verify module is enabled: `AOELoot.Enable = 1`
- Check if you disabled it personally: use `.aoeloot on`
- Ensure you're within range (default 30 yards)
- If in group, check `AOELoot.Group` setting
### Issue: Corpses not disappearing
**Solution:**
- Set `Rate.Corpse.Decay.Looted = 0.01` in worldserver.conf
### Issue: Messages in wrong language
**Solution:**
- Verify SQL was imported correctly
- Check client locale settings
- Confirm `acore_string` table has translations for your locale
### Issue: "Already enabled/disabled" messages appearing incorrectly
**Solution:**
- This is expected behavior - preferences reset on logout
- On first login, AOE loot is enabled by default
## Known Limitations
- Player preferences do not persist across logout/login sessions
- Maximum 10 corpses processed at once (performance limit)
- Quest items sent to inventory may fill bags quickly
- Range limited to 100 yards maximum
## Future Enhancements
Potential features for future versions:
- [ ] Database persistence for player preferences
- [ ] Configurable max corpses limit
- [ ] Quest item mail option (instead of direct inventory)
- [ ] Visual range indicator
- [ ] Per-character settings UI
- [ ] Statistics tracking (total items/gold looted)
## Credits
- **acidmanifesto** - [Original author and concept](https://github.com/azerothcore/mod-aoe-loot/pull/2)
- **AzerothCore Community** - Hooks, updates, and improvements
- **Contributors** - Player commands, multi-language support, and bug fixes
## Links
- **AzerothCore:** [Repository](https://github.com/azerothcore) | [Website](https://azerothcore.org/) | [Discord](https://discord.gg/PaqQRkd)
- **Module Repository:** [GitHub](https://github.com/azerothcore/mod-aoe-loot)
- **Issues & Suggestions:** [Issue Tracker](https://github.com/azerothcore/mod-aoe-loot/issues)
## License
This module is released under the [GNU AGPL v3 License](https://github.com/azerothcore/mod-aoe-loot/blob/master/LICENSE).
---
### Support
If you encounter any issues or have suggestions:
1. Check the [Troubleshooting](#troubleshooting) section
2. Search [existing issues](https://github.com/azerothcore/mod-aoe-loot/issues)
3. Join the [AzerothCore Discord](https://discord.gg/PaqQRkd)
4. Create a [new issue](https://github.com/azerothcore/mod-aoe-loot/issues/new) with detailed information
**Please include:**
- AzerothCore commit hash
- Operating system and version
- Complete error messages (if any)
- Configuration settings
- Steps to reproduce the issue
+293
View File
@@ -0,0 +1,293 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore
# mod-aoe-loot
[English](README.md) | [Español](README_ES.md)
[![Build Status](https://github.com/azerothcore/mod-aoe-loot/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-aoe-loot/actions)
## Descripción
Este módulo habilita la funcionalidad de saqueo en área (AOE) para AzerothCore, permitiendo a los jugadores saquear múltiples cadáveres cercanos interactuando con solo uno de ellos. Todos los objetos y oro de los cadáveres dentro del rango configurado se recopilan automáticamente en una sola ventana de botín.
## Características
- **Saqueo AOE**: Recolecta automáticamente el botín de múltiples cadáveres cercanos con una sola interacción
- **Comandos de Activación Individual**: Los jugadores pueden activar/desactivar el saqueo AOE usando los comandos `.aoeloot on/off`
- **Soporte Multi-idioma**: Internacionalización completa con traducciones en inglés y español (fácilmente extensible a otros idiomas)
- **Rango Configurable**: Los administradores del servidor pueden establecer la distancia máxima para la recolección de botín AOE
- **Soporte de Grupo**: Saqueo en grupo opcional con configuración personalizable
- **Optimizado para Rendimiento**: Limita el número de cadáveres procesados para mantener la estabilidad del servidor
- **Gestión Inteligente de Objetos**:
- Acumulación automática de oro con protección contra desbordamiento
- Objetos de misión enviados directamente al inventario
- Máximo de 15 objetos por ventana de botín para evitar problemas de interfaz
- **Gestión de Cadáveres**: Limpia automáticamente los cadáveres saqueados para reducir el desorden visual
## Actualizaciones Recientes
### v2.0 - Control del Jugador e Internacionalización
- ✅ Agregados comandos `.aoeloot on/off` para control individual del jugador
- ✅ Implementado soporte multi-idioma mediante el sistema `acore_string`
- ✅ Corregidos problemas de alineación de IDs en enums
- ✅ Traducciones completas en inglés y español
- ✅ Mejorada la documentación y estructura del código
### v1.x - Funcionalidad Principal
- Implementación inicial del saqueo AOE
- Sistema de configuración
- Ajustes de rango y grupo
## Requisitos
- AzerothCore v3.0.0+ (se recomienda la última rama master)
- MySQL 8.0+
- Compilador con soporte para C++17
## Instalación
### 1. Clonar el Módulo
Navega al directorio de módulos de AzerothCore:
```bash
cd <DirectorioACore>/modules
git clone https://github.com/azerothcore/mod-aoe-loot.git
```
### 2. Compilar
Recompila AzerothCore:
```bash
cd <DirectorioACore>/build
cmake ../ -DCMAKE_INSTALL_PREFIX=/ruta/al/servidor -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
make -j $(nproc)
make install
```
### 3. Configurar
Edita tu archivo `worldserver.conf` (o crea `AOELoot.conf` en la carpeta de configuraciones):
```conf
###################################################################################################
# CONFIGURACIÓN DEL MÓDULO AOE LOOT
###################################################################################################
#
# AOELoot.Enable
# Descripción: Habilita o deshabilita el módulo AOE Loot globalmente
# Por defecto: 1 (habilitado)
# 0 (deshabilitado)
AOELoot.Enable = 1
#
# AOELoot.Range
# Descripción: Distancia máxima (en yardas) para recolectar botín de cadáveres cercanos
# Por defecto: 30.0
# Rango: 5.0 - 100.0
AOELoot.Range = 30.0
#
# AOELoot.Group
# Descripción: Permitir saqueo AOE cuando el jugador está en un grupo
# Por defecto: 1 (permitido)
# 0 (no permitido)
AOELoot.Group = 1
#
# AOELoot.Message
# Descripción: Mostrar mensaje informativo al iniciar sesión
# Por defecto: 1 (mostrar mensaje)
# 0 (sin mensaje)
AOELoot.Message = 1
###################################################################################################
```
### 4. Configuración de Degradación de Cadáveres (IMPORTANTE)
Para una experiencia óptima, modifica la configuración de degradación de cadáveres en `worldserver.conf`:
```conf
#
# Rate.Corpse.Decay.Looted
# Descripción: Multiplicador para Corpse.Decay.* que configura cuánto tiempo permanecen
# los cadáveres de las criaturas después de ser saqueados.
# Por defecto: 0.5
# Recomendado: 0.01 (para el módulo AOE Loot)
Rate.Corpse.Decay.Looted = 0.01
```
**Por qué es importante:** La tasa de degradación predeterminada (0.5) puede hacer que los cadáveres permanezcan después de ser saqueados mediante AOE, creando desorden visual. Establecer esto en 0.01 asegura que los cadáveres desaparezcan rápidamente después del saqueo.
### 5. Reiniciar el Servidor
Reinicia tu worldserver para cargar el módulo:
```bash
./worldserver
```
## Uso
### Para Jugadores
#### Comandos
- `.aoeloot on` - Activar el saqueo AOE para tu personaje
- `.aoeloot off` - Desactivar el saqueo AOE para tu personaje
#### Cómo Usar
1. Mata múltiples enemigos en proximidad cercana
2. Haz clic derecho en cualquier cadáver para saquear
3. Todos los objetos de los cadáveres cercanos aparecerán en una sola ventana de botín
4. Los objetos de misión se agregan automáticamente a tu inventario
**Nota:** Las preferencias del jugador se restablecen al cerrar sesión. El saqueo AOE está habilitado por defecto si el módulo está activo.
### Para Administradores
El módulo puede controlarse a través de la configuración del archivo (ver sección de Configuración arriba).
## Opciones de Configuración
| Opción | Tipo | Por Defecto | Descripción |
|--------|------|-------------|-------------|
| `AOELoot.Enable` | Booleano | 1 | Habilitar/deshabilitar módulo globalmente |
| `AOELoot.Range` | Decimal | 30.0 | Radio máximo de recolección de botín (5.0 - 100.0) |
| `AOELoot.Group` | Booleano | 1 | Permitir saqueo AOE en grupos |
| `AOELoot.Message` | Booleano | 1 | Mostrar mensaje de inicio de sesión |
## Soporte Multi-idioma
El módulo incluye soporte completo multi-idioma a través del sistema `acore_string` de AzerothCore.
### Idiomas Actualmente Soportados
- 🇬🇧 Inglés (en_US)
- 🇪🇸 Español (es_ES / es_MX)
### Agregar Más Idiomas
Para agregar soporte de idiomas adicionales, actualiza el archivo SQL:
```sql
UPDATE `acore_string` SET
`locale_frFR` = 'Votre traduction ici',
`locale_deDE` = 'Ihre Übersetzung hier',
`locale_ruRU` = 'Ваш перевод здесь'
WHERE `entry` BETWEEN 50000 AND 50007;
```
Columnas de localización soportadas:
- `locale_koKR` (Coreano)
- `locale_frFR` (Francés)
- `locale_deDE` (Alemán)
- `locale_zhCN` (Chino Simplificado)
- `locale_zhTW` (Chino Tradicional)
- `locale_ruRU` (Ruso)
## Detalles Técnicos
### Entradas de Base de Datos
El módulo utiliza las entradas `acore_string` 50000-50007:
| Entrada | Constante | Propósito |
|---------|-----------|-----------|
| 50000 | AOE_ACORE_STRING_MESSAGE | Mensaje de inicio de sesión |
| 50001 | AOE_ITEM_IN_THE_MAIL | Notificación de correo (reservado) |
| 50002-50003 | - | Reservado para uso futuro |
| 50004 | AOE_LOOT_ALREADY_ENABLED | Mensaje "Ya activado" |
| 50005 | AOE_LOOT_ENABLED | Confirmación "Activado" |
| 50006 | AOE_LOOT_ALREADY_DISABLED | Mensaje "Ya desactivado" |
| 50007 | AOE_LOOT_DISABLED | Confirmación "Desactivado" |
### Consideraciones de Rendimiento
- Máximo 10 cadáveres procesados por operación de saqueo (fijo para estabilidad)
- Máximo 15 objetos por ventana de botín
- Protección contra desbordamiento de oro (previene exceder el valor máximo uint32)
- Filtrado y limpieza eficiente de cadáveres
## Solución de Problemas
### Problema: El saqueo AOE no funciona
**Soluciones:**
- Verifica que el módulo esté habilitado: `AOELoot.Enable = 1`
- Comprueba si lo desactivaste personalmente: usa `.aoeloot on`
- Asegúrate de estar dentro del rango (30 yardas por defecto)
- Si estás en grupo, verifica la configuración `AOELoot.Group`
### Problema: Los cadáveres no desaparecen
**Solución:**
- Establece `Rate.Corpse.Decay.Looted = 0.01` en worldserver.conf
### Problema: Mensajes en idioma incorrecto
**Solución:**
- Verifica que el SQL se importó correctamente
- Comprueba la configuración de localización del cliente
- Confirma que la tabla `acore_string` tiene traducciones para tu localización
### Problema: Mensajes "Ya activado/desactivado" aparecen incorrectamente
**Solución:**
- Este es el comportamiento esperado - las preferencias se restablecen al cerrar sesión
- En el primer inicio de sesión, el saqueo AOE está habilitado por defecto
## Limitaciones Conocidas
- Las preferencias del jugador no persisten entre sesiones de inicio/cierre de sesión
- Máximo 10 cadáveres procesados a la vez (límite de rendimiento)
- Los objetos de misión enviados al inventario pueden llenar las bolsas rápidamente
- Rango limitado a un máximo de 100 yardas
## Mejoras Futuras
Características potenciales para versiones futuras:
- [ ] Persistencia en base de datos para preferencias del jugador
- [ ] Límite configurable de cadáveres máximos
- [ ] Opción de envío de objetos de misión por correo (en lugar de inventario directo)
- [ ] Indicador visual de rango
- [ ] Interfaz de configuración por personaje
- [ ] Seguimiento de estadísticas (objetos/oro total saqueado)
## Créditos
- **acidmanifesto** - [Autor original y concepto](https://github.com/azerothcore/mod-aoe-loot/pull/2)
- **Comunidad AzerothCore** - Hooks, actualizaciones y mejoras
- **Colaboradores** - Comandos de jugador, soporte multi-idioma y correcciones de errores
## Enlaces
- **AzerothCore:** [Repositorio](https://github.com/azerothcore) | [Sitio Web](https://azerothcore.org/) | [Discord](https://discord.gg/PaqQRkd)
- **Repositorio del Módulo:** [GitHub](https://github.com/azerothcore/mod-aoe-loot)
- **Problemas y Sugerencias:** [Rastreador de Problemas](https://github.com/azerothcore/mod-aoe-loot/issues)
## Licencia
Este módulo se publica bajo la [Licencia GNU AGPL v3](https://github.com/azerothcore/mod-aoe-loot/blob/master/LICENSE).
---
### Soporte
Si encuentras algún problema o tienes sugerencias:
1. Consulta la sección [Solución de Problemas](#solución-de-problemas)
2. Busca en [problemas existentes](https://github.com/azerothcore/mod-aoe-loot/issues)
3. Únete al [Discord de AzerothCore](https://discord.gg/PaqQRkd)
4. Crea un [nuevo problema](https://github.com/azerothcore/mod-aoe-loot/issues/new) con información detallada
**Por favor incluye:**
- Hash del commit de AzerothCore
- Sistema operativo y versión
- Mensajes de error completos (si los hay)
- Configuraciones utilizadas
- Pasos para reproducir el problema
+12
View File
@@ -0,0 +1,12 @@
name: core-build
on:
push:
branches:
- 'master'
pull_request:
jobs:
build:
uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main
with:
module_repo: ${{ github.event.repository.name }}
+47
View File
@@ -0,0 +1,47 @@
!.gitignore
#
#Generic
#
.directory
.mailmap
* .orig
* .rej
* .*~
.hg /
*.kdev *
.DS_Store
CMakeLists.txt.user
* .bak
* .patch
* .diff
* .REMOTE.*
* .BACKUP.*
* .BASE.*
* .LOCAL.*
#
# IDE & other softwares
#
/ .settings/
/.externalToolBuilders/*
# exclude in all levels
nbproject/
.sync.ffs_db
*.kate-swp
#
# Eclipse
#
*.pydevproject
.metadata
.gradle
tmp/
*.tmp
*.swp
*~.nib
local.properties
.settings/
.loadpath
.project
.cproject
+661
View File
@@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
@@ -0,0 +1,53 @@
#
# This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# User has manually chosen to ignore the git-tests, so throw them a warning.
# This is done EACH compile so they can be alerted about the consequences.
#
########################################
# AoeLoot module configuration
########################################
#
# AOELoot.Enable
# Description: Enables Module
# Default: 0 - (Disabled)
# 1 - (Enabled)
#
AOELoot.Enable = 1
#
# AOELoot.Message
# Description: Enable message on login
# Default: 0 - (Disabled)
# 1 - (Enabled)
#
AOELoot.Message = 1
#
# AOELoot.Range
# Description: Maximum reach range search loot.
# Default: 55.0
#
AOELoot.Range = 55.0
#
# AOELoot.Group
# Description: Enables area loot if the player is in a group
# Default: 1 (Enabled)
# Possible values: 0 - (Disabled)
# 1 - (Enabled)
#
AOELoot.Group = 1
View File
@@ -0,0 +1,33 @@
SET @MODULE_STRING := 'mod-aoe-loot';
-- module string
DELETE FROM `module_string` WHERE `module` = @MODULE_STRING;
INSERT INTO `module_string` (`module`, `id`, `string`) VALUES
(@MODULE_STRING, 1, 'This server is running the |cff4CFF00Loot aoe|r module.'),
(@MODULE_STRING, 2, '|cff4CFF00[Loot aoe]|r Your items has been mailed to you.'),
(@MODULE_STRING, 3, 'AOE Loot module is active. Use .aoeloot on/off to toggle it.'),
(@MODULE_STRING, 4, 'AOE Loot: Quest item sent to your mailbox.'),
(@MODULE_STRING, 5, 'AOE Loot is already enabled for your character.'),
(@MODULE_STRING, 6, 'AOE Loot enabled for your character. Type .aoeloot off to disable it.'),
(@MODULE_STRING, 7, 'AOE Loot is already disabled for your character.'),
(@MODULE_STRING, 8, 'AOE Loot disabled for your character. Type .aoeloot on to enable it.');
-- localizations
DELETE FROM `module_string_locale` WHERE `module` = @MODULE_STRING;
INSERT INTO `module_string_locale` (`module`, `id`, `locale`, `string`) VALUES
(@MODULE_STRING, 1, 'esES', 'Este servidor está ejecutando el módulo |cff4CFF00Loot aoe|r.'),
(@MODULE_STRING, 2, 'esES', '|cff4CFF00[Loot aoe]|r Sus artículos le han sido enviados por correo.'),
(@MODULE_STRING, 3, 'esES', 'El módulo de Botín AOE está activo. Usa .aoeloot on/off para activarlo o desactivarlo.'),
(@MODULE_STRING, 4, 'esES', 'Botín AOE: Objeto de misión enviado a tu buzón.'),
(@MODULE_STRING, 5, 'esES', 'El Botín AOE ya está activado para tu personaje.'),
(@MODULE_STRING, 6, 'esES', 'Botín AOE activado para tu personaje. Escribe .aoeloot off para desactivarlo.'),
(@MODULE_STRING, 7, 'esES', 'El Botín AOE ya está desactivado para tu personaje.'),
(@MODULE_STRING, 8, 'esES', 'Botín AOE desactivado para tu personaje. Escribe .aoeloot on para activarlo.'),
(@MODULE_STRING, 1, 'esMX', 'Este servidor está ejecutando el módulo |cff4CFF00Loot aoe|r.'),
(@MODULE_STRING, 2, 'esMX', '|cff4CFF00[Loot aoe]|r Sus artículos le han sido enviados por correo.'),
(@MODULE_STRING, 3, 'esMX', 'El módulo de Botín AOE está activo. Usa .aoeloot on/off para activarlo o desactivarlo.'),
(@MODULE_STRING, 4, 'esMX', 'Botín AOE: Objeto de misión enviado a tu buzón.'),
(@MODULE_STRING, 5, 'esMX', 'El Botín AOE ya está activado para tu personaje.'),
(@MODULE_STRING, 6, 'esMX', 'Botín AOE activado para tu personaje. Escribe .aoeloot off para desactivarlo.'),
(@MODULE_STRING, 7, 'esMX', 'El Botín AOE ya está desactivado para tu personaje.'),
(@MODULE_STRING, 8, 'esMX', 'Botín AOE desactivado para tu personaje. Escribe .aoeloot on para activarlo.');
View File
@@ -0,0 +1,25 @@
<!-- First of all, THANK YOU for your contribution. -->
## Changes Proposed:
-
-
## Issues Addressed:
<!-- If your fix has a relating issue, link it below -->
- Closes
## SOURCE:
<!-- If you can, include a source that can strengthen your claim -->
## Tests Performed:
<!-- Does it build without errors? Did you test in-game? What did you test? On which OS did you test? Describe any other tests performed -->
-
-
## How to Test the Changes:
<!-- Describe in a detailed step-by-step order how to test the changes -->
1.
2.
3.
+267
View File
@@ -0,0 +1,267 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "aoe_loot.h"
#include <algorithm>
#include <limits>
std::map<uint64, bool> AoeLootCommandScript::playerAoeLootEnabled;
void AOELootPlayer::OnPlayerLogin(Player* player)
{
if (!player)
return;
if (sConfigMgr->GetOption<bool>("AOELoot.Enable", true) && sConfigMgr->GetOption<bool>("AOELoot.Message", true))
if (WorldSession* session = player->GetSession())
ChatHandler(session).PSendModuleSysMessage(MODULE_STRING, AOE_LOGIN_MESSAGE);
}
bool AOELootServer::CanPacketReceive(WorldSession* session, WorldPacket& packet)
{
// Only handle loot packets
if (packet.GetOpcode() != CMSG_LOOT)
return true;
// Basic validation checks
if (!session)
return true;
Player* player = session->GetPlayer();
if (!player)
return true;
// Check if module is enabled
if (!sConfigMgr->GetOption<bool>("AOELoot.Enable", true))
return true;
// Check if player has AOE loot disabled via command
uint64 playerGuid = player->GetGUID().GetRawValue();
if (AoeLootCommandScript::hasPlayerAoeLootEnabled(playerGuid) &&
!AoeLootCommandScript::getPlayerAoeLootEnabled(playerGuid))
return true;
// Check group settings
if (player->GetGroup() && !sConfigMgr->GetOption<bool>("AOELoot.Group", true))
return true;
// Get configured loot range
float range = sConfigMgr->GetOption<float>("AOELoot.Range", 30.0f);
// Limit range to reasonable values
if (range < 5.0f)
range = 5.0f;
if (range > 100.0f)
range = 100.0f;
// Read target GUID from packet
ObjectGuid targetGuid;
packet >> targetGuid;
if (!targetGuid)
return true;
// Get target creature
Creature* mainCreature = player->GetMap()->GetCreature(targetGuid);
if (!mainCreature)
return true;
// Check if main creature has loot
if (!mainCreature->HasDynamicFlag(UNIT_DYNFLAG_LOOTABLE))
return true;
// Get nearby corpses
std::list<Creature*> nearbyCorpses;
player->GetDeadCreatureListInGrid(nearbyCorpses, range);
// Remove invalid corpses and main target
nearbyCorpses.remove_if([&](Creature* c)
{
return !c ||
c->GetGUID() == targetGuid ||
!c->HasDynamicFlag(UNIT_DYNFLAG_LOOTABLE) ||
!player->isAllowedToLoot(c);
});
// If no other corpses, process normally
if (nearbyCorpses.empty())
{
player->SendLoot(targetGuid, LOOT_CORPSE);
return false;
}
// Get main loot
Loot* mainLoot = &mainCreature->loot;
// Limit number of corpses to process
size_t const maxCorpses = 10; // set to 10 to improve stability
size_t processedCorpses = 0;
// Track total gold to merge
uint32 totalGold = mainLoot->gold;
// Collect all items to merge (don't modify main loot directly)
std::vector<LootItem> itemsToAdd;
std::vector<LootItem> questItemsToAdd;
for (Creature* creature : nearbyCorpses)
{
if (processedCorpses >= maxCorpses)
break;
if (!creature)
continue;
Loot* loot = &creature->loot;
// Skip already looted corpses
if (loot->isLooted())
continue;
// Collect gold
if (loot->gold > 0)
{
// Prevent overflow
if (totalGold < (std::numeric_limits<uint32>::max() - loot->gold))
totalGold += loot->gold;
}
// Collect regular items
for (size_t i = 0; i < loot->items.size(); ++i)
{
// Check if there's still space
if ((mainLoot->items.size() + itemsToAdd.size() + mainLoot->quest_items.size() + questItemsToAdd.size()) >= 15)
break;
itemsToAdd.push_back(loot->items[i]);
}
// Collect quest items
for (size_t i = 0; i < loot->quest_items.size(); ++i)
{
// Check if there's still space
if ((mainLoot->items.size() + itemsToAdd.size() + mainLoot->quest_items.size() + questItemsToAdd.size()) >= 15)
break;
questItemsToAdd.push_back(loot->quest_items[i]);
}
// Clear source loot (but don't modify vector directly)
loot->clear();
creature->AllLootRemovedFromCorpse();
creature->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
processedCorpses++;
}
// Now safely add collected items to main loot
// Update gold
mainLoot->gold = totalGold;
// Add regular items
for (const auto& item : itemsToAdd)
{
if (mainLoot->items.size() < 15)
mainLoot->items.push_back(item);
}
// Add quest items to player inventory
for (const auto& item : questItemsToAdd)
{
player->AddItem(item.itemid, item.count);
}
// Send merged loot window
player->SendLoot(targetGuid, LOOT_CORPSE);
return false;
}
ChatCommandTable AoeLootCommandScript::GetCommands() const
{
static ChatCommandTable aoeLootSubCommandTable =
{
{ "on", HandleAoeLootOnCommand, SEC_PLAYER, Console::No },
{ "off", HandleAoeLootOffCommand, SEC_PLAYER, Console::No }
};
static ChatCommandTable aoeLootCommandTable =
{
{ "aoeloot", aoeLootSubCommandTable }
};
return aoeLootCommandTable;
}
bool AoeLootCommandScript::hasPlayerAoeLootEnabled(uint64 guid)
{
return playerAoeLootEnabled.count(guid) > 0;
}
bool AoeLootCommandScript::getPlayerAoeLootEnabled(uint64 guid)
{
auto it = playerAoeLootEnabled.find(guid);
if (it != playerAoeLootEnabled.end())
return it->second;
return false;
}
void AoeLootCommandScript::setPlayerAoeLootEnabled(uint64 guid, bool mode)
{
playerAoeLootEnabled[guid] = mode;
}
bool AoeLootCommandScript::HandleAoeLootOnCommand(ChatHandler* handler, Optional<std::string> /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
if (!player)
return true;
uint64 playerGuid = player->GetGUID().GetRawValue();
if (AoeLootCommandScript::hasPlayerAoeLootEnabled(playerGuid) &&
AoeLootCommandScript::getPlayerAoeLootEnabled(playerGuid))
{
handler->PSendModuleSysMessage(MODULE_STRING, AOE_LOOT_ALREADY_ENABLED);
return true;
}
AoeLootCommandScript::setPlayerAoeLootEnabled(playerGuid, true);
handler->PSendModuleSysMessage(MODULE_STRING, AOE_LOOT_ENABLED);
return true;
}
bool AoeLootCommandScript::HandleAoeLootOffCommand(ChatHandler* handler, Optional<std::string> /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
if (!player)
return true;
uint64 playerGuid = player->GetGUID().GetRawValue();
if (AoeLootCommandScript::hasPlayerAoeLootEnabled(playerGuid) &&
!AoeLootCommandScript::getPlayerAoeLootEnabled(playerGuid))
{
handler->PSendModuleSysMessage(MODULE_STRING, AOE_LOOT_ALREADY_DISABLED);
return true;
}
AoeLootCommandScript::setPlayerAoeLootEnabled(playerGuid, false);
handler->PSendModuleSysMessage(MODULE_STRING, AOE_LOOT_DISABLED);
return true;
}
+138
View File
@@ -0,0 +1,138 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MODULE_AOELOOT_H
#define MODULE_AOELOOT_H
#include "ScriptMgr.h"
#include "Config.h"
#include "Chat.h"
#include "Player.h"
#include "ScriptedGossip.h"
#include "Group.h"
#include "LootMgr.h"
#include "Creature.h"
#include "Log.h"
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#define MODULE_STRING "mod-aoe-loot"
// Maximum loot items count
constexpr size_t MAX_LOOT_ITEMS = 16;
using namespace Acore::ChatCommands;
enum AoeLootString
{
AOE_LOGIN_MESSAGE = 1, // Login message
AOE_ITEM_IN_THE_MAIL = 2, // Mail notification
AOE_MODULE_ACTIVE = 3, // unused
AOE_QUEST_ITEM_SENT = 4, // unused
AOE_LOOT_ALREADY_ENABLED = 5, // Already enabled message
AOE_LOOT_ENABLED = 6, // Enabled confirmation
AOE_LOOT_ALREADY_DISABLED = 7, // Already disabled message
AOE_LOOT_DISABLED = 8 // Disabled confirmation
};
class AOELootPlayer : public PlayerScript
{
public:
AOELootPlayer() : PlayerScript("AOELootPlayer", { PLAYERHOOK_ON_LOGIN }) {}
void OnPlayerLogin(Player* player) override;
};
class AOELootServer : public ServerScript
{
public:
AOELootServer() : ServerScript("AOELootServer", { SERVERHOOK_CAN_PACKET_RECEIVE }) {}
bool CanPacketReceive(WorldSession* session, WorldPacket& packet) override;
private:
// Helper function - Check if loot is valid
bool IsLootValid(Loot* loot) const;
// Check if loot can be merged
bool CanMergeLoot(Player* player, Creature* creature) const;
// Safely get item count
size_t GetSafeItemCount(Loot* loot) const;
// Safely merge loot items
bool SafeMergeLootItems(Loot* mainLoot, Loot* sourceLoot, size_t& remainingSlots);
};
// Configuration options structure (optional, for better config management)
struct AOELootConfig
{
bool enabled = true;
bool messageOnLogin = true;
bool allowInGroup = true;
float range = 55.0f;
uint32 maxCorpses = 20;
static AOELootConfig* instance()
{
static AOELootConfig instance;
return &instance;
}
void Load()
{
enabled = sConfigMgr->GetOption<bool>("AOELoot.Enable", true);
messageOnLogin = sConfigMgr->GetOption<bool>("AOELoot.Message", true);
allowInGroup = sConfigMgr->GetOption<bool>("AOELoot.Group", true);
range = sConfigMgr->GetOption<float>("AOELoot.Range", 55.0f);
maxCorpses = sConfigMgr->GetOption<uint32>("AOELoot.MaxCorpses", 20);
// Validate configuration values
if (range < 5.0f) range = 5.0f;
if (range > 100.0f) range = 100.0f;
if (maxCorpses < 1) maxCorpses = 1;
if (maxCorpses > 50) maxCorpses = 50;
}
};
class AoeLootCommandScript : public CommandScript
{
public:
AoeLootCommandScript() : CommandScript("AoeLootCommandScript") {}
ChatCommandTable GetCommands() const override;
static bool HandleAoeLootOnCommand(ChatHandler* handler, Optional<std::string> args);
static bool HandleAoeLootOffCommand(ChatHandler* handler, Optional<std::string> args);
// Getters and setters for player AOE loot settings
static bool getPlayerAoeLootEnabled(uint64 guid);
static void setPlayerAoeLootEnabled(uint64 guid, bool mode);
static bool hasPlayerAoeLootEnabled(uint64 guid);
private:
static std::map<uint64, bool> playerAoeLootEnabled;
};
void AddSC_AoeLoot()
{
new AOELootPlayer();
new AOELootServer();
new AoeLootCommandScript();
}
#endif //MODULE_AOELOOT_H
@@ -0,0 +1,25 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// From SC
void AddSC_AoeLoot();
// Add all
void Addmod_aoe_lootScripts()
{
AddSC_AoeLoot();
}
+8
View File
@@ -0,0 +1,8 @@
[*]
charset = utf-8
indent_style = space
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 80
@@ -0,0 +1,49 @@
### TITLE
## Type(Scope/Subscope): Commit ultra short explanation
## |---- Write below the examples with a maximum of 50 characters ----|
## Example 1: fix(DB/SAI): Missing spell to NPC Hogger
## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros
## Example 3: feat(CORE/Commands): New GM command to do something
### DESCRIPTION
## Explain why this change is being made, what does it fix etc...
## |---- Write below the examples with a maximum of 72 characters per lines ----|
## Example: Hogger (id: 492) was not charging player when being engaged.
## Provide links to any issue, commit, pull request or other resource
## Example 1: Closes issue #23
## Example 2: Ported from other project's commit (link)
## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/
## =======================================================
## EXTRA INFOS
## =======================================================
## "Type" can be:
## feat (new feature)
## fix (bug fix)
## refactor (refactoring production code)
## style (formatting, missing semi colons, etc; no code change)
## docs (changes to documentation)
## test (adding or refactoring tests; no production code change)
## chore (updating bash scripts, git files etc; no production code change)
## --------------------
## Remember to
## Capitalize the subject line
## Use the imperative mood in the subject line
## Do not end the subject line with a period
## Separate subject from body with a blank line
## Use the body to explain what and why rather than how
## Can use multiple lines with "-" for bullet points in body
## --------------------
## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/
## =======================================================
## "Scope" can be:
## CORE (core related, c++)
## DB (database related, sql)
## =======================================================
## "Subscope" is optional and depends on the nature of the commit.
## =======================================================
+105
View File
@@ -0,0 +1,105 @@
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto eol=lf
# Text
*.conf text
*.conf.dist text
*.cmake text
## Scripts
*.sh text
*.fish text
*.lua text
## SQL
*.sql text
## C++
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
## For documentation
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## EXECUTABLES
*.exe binary
*.pyc binary
@@ -0,0 +1,82 @@
name: Bug report
description: Create a bug report to help us improve.
title: "Bug: "
body:
- type: textarea
id: current
attributes:
label: Current Behaviour
description: |
Description of the problem or issue here.
Include entries of affected creatures / items / quests / spells etc.
If this is a crash, post the crashlog (upload to https://gist.github.com/) and include the link here.
Never upload files! Use GIST for text and YouTube for videos!
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behaviour
description: |
Tell us what should happen instead.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce the problem
description: |
What does someone else need to do to encounter the same bug?
placeholder: |
1. Step 1
2. Step 2
3. Step 3
validations:
required: true
- type: textarea
id: extra
attributes:
label: Extra Notes
description: |
Do you have any extra notes that can help solve the issue that does not fit any other field?
placeholder: |
None
validations:
required: false
- type: textarea
id: abcommands
attributes:
label: AutoBalance Debug Commands
description: |
Please include text or an image of the `.ab mapstat` command. If your issue is concerning scaling of creatures, please also include the `.ab creaturestat` command while targeting the problematic creature.
placeholder: |
None
validations:
required: false
- type: textarea
id: commit
attributes:
label: AC rev. hash/commit
description: |
Copy the result of the `.server debug` command (if you need to run it from the client get a prat addon)
validations:
required: true
- type: input
id: os
attributes:
label: Operating system
description: |
The Operating System the Server is running on.
i.e. Windows 11 x64, Debian 10 x64, macOS 12, Ubuntu 20.04
validations:
required: true
- type: textarea
id: custom
attributes:
label: Custom changes or Modules
description: |
List which custom changes or modules you have applied, i.e. Eluna module, etc.
placeholder: |
None
validations:
required: false
@@ -0,0 +1,33 @@
name: Feature request
description: Suggest an idea for this project
title: "Feature: "
body:
- type: markdown
attributes:
value: |
Thank you for taking your time to fill out a feature request. Remember to fill out all fields including the title above.
An issue that is not properly filled out will be closed.
- type: textarea
id: description
attributes:
label: Describe your feature request or suggestion in detail
description: |
A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe a possible solution to your feature or suggestion in detail
description: |
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional context
description: |
Add any other context or screenshots about the feature request here.
validations:
required: false
@@ -0,0 +1,12 @@
name: core-build
on:
push:
branches:
- 'master'
pull_request:
jobs:
build:
uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main
with:
module_repo: ${{ github.event.repository.name }}
+51
View File
@@ -0,0 +1,51 @@
!.gitignore
#
#Generic
#
.directory
.mailmap
*.orig
*.rej
*.*~
.hg/
*.kdev*
.DS_Store
CMakeLists.txt.user
*.bak
*.patch
*.diff
*.REMOTE.*
*.BACKUP.*
*.BASE.*
*.LOCAL.*
#
# IDE & other softwares
#
/.settings/
/.externalToolBuilders/*
# exclude in all levels
nbproject/
.sync.ffs_db
*.kate-swp
.idea
cmake-build-debug
.vscode
#
# Eclipse
#
*.pydevproject
.metadata
.gradle
tmp/
*.tmp
*.swp
*~.nib
local.properties
.settings/
.loadpath
.project
.cproject
+40
View File
@@ -0,0 +1,40 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore
## Beta testing warning
The current version of the master branch is currently in beta, under testing to ensure all the functionalities are working properly.
If you encur in problems please open an Issue and consider to use the last [stable version](https://github.com/azerothcore/mod-autobalance/releases/tag/stable) of this repository.
## AutoBalance
- Latest build status with azerothcore: [![Build Status](https://github.com/azerothcore/mod-autobalance/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-autobalance)
This module is intended to scale based on number of players, instance mobs and bosses' health, mana, and damage.
**NOTE:** This module requires at least [this commit](https://github.com/azerothcore/azerothcore-wotlk/commit/f127e583aae3cfa51a77d056c1892a7de07ffb52) of AzerothCore in order to work correctly. Older versions are not supported.
All settings are well-described in the configuration file.
**PLEASE** include the output from the `.ab mapstat` and `.ab creaturestat` commands (while targeting a problematic creature) when reporting issues. This will help us to quickly identify the problem and provide a solution.
## In-game Commands
| Command | Permission | Description |
| :------ | :--------- | :---------- |
| `.ab mapstat` | All Players | Displays AB-calcualted settings for the current map, including player count, difficulty, world modifiers, and others. |
| `.ab creaturestat` | All Players | Displays AB-calculated settings for the targeted dungeon creature including level scaling, difficulty, modifiers, and boss status. |
| `.ab setoffset` | Game Masters | Sets the server-wide player difficulty offset. Instances will be scaled as though they had this many more/less players than they really do. |
| `.ab getoffset` | All Players | Gets the current server-wide player difficulty offset. Instances will be scaled as though they had this many more/less players than they really do. |
| `.reload config` | Game Masters | Reloads all your configuration files, including `AutoBalance.conf`. This lets you update AutoBalance settings without restarting your worldserver. This module is designed to contiue to work as expected when this command is issued. |
## Logger Names
| Logger | Description |
| :----- | ----------- |
| `Logger.module.AutoBalance` | Main logger, verbose debug logs. Map detection, list management, creature adjustments, multiplier, modifiers. Catch-all. |
| `Logger.module.AutoBalance_CombatLocking` | Debug logs related to the combat locking/unlocking mechanism for maps. |
| `Logger.module.AutoBalance_DamageHealingCC` | Debug logs for the spell/melee/CC modifications that are made in real-time. |
| `Logger.module.AutoBalance_StatGeneration` | Detailed debug logs that show all the calculation steps in how different multipliers are derived. |
## References
- [Interactive Inflection Point Spreadsheet](https://docs.google.com/spreadsheets/d/100cmKIJIjCZ-ncWd0K9ykO8KUgwFTcwg4h2nfE_UeCc/copy)
- [InflectionPoint Curve Examples](https://i.imgur.com/x42UnUR.png)
- [Impact of CurveFloor and CurveCeiling on enemy multiplier](https://i.imgur.com/I8S4cwJ.png)
@@ -0,0 +1,9 @@
{
"name": "mod-autobalance",
"version": "2.2.0",
"compatibility" : [
{ "version": "1.0.0", "branch": "none" },
{ "version": "^2.0.0", "branch": "2.0" },
{ "version": "^3.0.0", "branch": "master" }
]
}
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File
@@ -0,0 +1,25 @@
<!-- First of all, THANK YOU for your contribution. -->
## Changes Proposed:
-
-
## Issues Addressed:
<!-- If your fix has a relating issue, link it below -->
- Closes
## SOURCE:
<!-- If you can, include a source that can strengthen your claim -->
## Tests Performed:
<!-- Does it build without errors? Did you test in-game? What did you test? On which OS did you test? Describe any other tests performed -->
-
-
## How to Test the Changes:
<!-- Describe in a detailed step-by-step order how to test the changes -->
1.
2.
3.
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
## Set a local git commit template
git config --local commit.template ".git_commit_template.txt" ;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_ALL_CREATURE_SCRIPT_H
#define __AB_ALL_CREATURE_SCRIPT_H
#include "ScriptMgr.h"
class AutoBalance_AllCreatureScript : public AllCreatureScript
{
public:
AutoBalance_AllCreatureScript()
: AllCreatureScript("AutoBalance_AllCreatureScript")
{
}
void OnBeforeCreatureSelectLevel(const CreatureTemplate* /*creatureTemplate*/, Creature* creature, uint8& level) override;
void Creature_SelectLevel(const CreatureTemplate* /* cinfo */, Creature* creature) override;
void OnCreatureAddWorld(Creature* creature) override;
void OnCreatureRemoveWorld(Creature* creature) override;
void OnAllCreatureUpdate(Creature* creature, uint32 /*diff*/) override;
// Reset the passed creature to stock if the config has changed
bool ResetCreatureIfNeeded(Creature* creature);
void ModifyCreatureAttributes(Creature* creature);
private:
bool _isSummonCloneOfSummoner(Creature* summon);
};
#endif /* __AB_ALL_CREATURE_SCRIPT_H */
@@ -0,0 +1,227 @@
#include "ABAllMapScript.h"
#include "ABConfig.h"
#include "ABMapInfo.h"
#include "ABUtils.h"
#include "Chat.h"
#include "Message.h"
void AutoBalance_AllMapScript::OnPlayerEnterAll(Map* map, Player* player)
{
if (!EnableGlobal)
return;
if (!map->IsDungeon())
return;
LOG_DEBUG("module.AutoBalance", "AutoBalance:: ------------------------------------------------");
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerEnterAll: Player {}{} | enters {} ({}{})",
player->GetName(),
player->IsGameMaster() ? " (GM)" : "",
map->GetMapName(),
map->GetId(),
map->GetInstanceId() ? "-" + std::to_string(map->GetInstanceId()) : ""
);
// get the map's info
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
// store the previous difficulty for comparison later
int prevAdjustedPlayerCount = mapABInfo->adjustedPlayerCount;
// add player to this map's player list
AddPlayerToMap(map, player);
// recalculate the zone's level stats
mapABInfo->highestCreatureLevel = 0;
mapABInfo->lowestCreatureLevel = 0;
//mapABInfo->avgCreatureLevel = 0;
mapABInfo->activeCreatureCount = 0;
WorldSession* session = player->GetSession();
LocaleConstant locale = session->GetSessionDbLocaleIndex();
// if the previous player count is the same as the new player count, update without force
if ((prevAdjustedPlayerCount == mapABInfo->adjustedPlayerCount) && (mapABInfo->adjustedPlayerCount != 1))
{
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerEnterAll: Player difficulty unchanged at {}. Updating map data (no force).",
mapABInfo->adjustedPlayerCount
);
// Update the map's data
UpdateMapDataIfNeeded(map, false);
}
else
{
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerEnterAll: Player difficulty changed from ({})->({}). Updating map data (force).",
prevAdjustedPlayerCount,
mapABInfo->adjustedPlayerCount
);
// Update the map's data, forced
UpdateMapDataIfNeeded(map, true);
}
// see which existing creatures are active
for (std::vector<Creature*>::iterator creatureIterator = mapABInfo->allMapCreatures.begin(); creatureIterator != mapABInfo->allMapCreatures.end(); ++creatureIterator)
{
AddCreatureToMapCreatureList(*creatureIterator, false, true);
}
// Notify players of the change
if (PlayerChangeNotify && mapABInfo->enabled)
{
if (map->GetEntry()->IsDungeon() && player)
{
if (mapABInfo->playerCount)
{
for (std::vector<Player*>::const_iterator playerIterator = mapABInfo->allMapPlayers.begin(); playerIterator != mapABInfo->allMapPlayers.end(); ++playerIterator)
{
Player* thisPlayer = *playerIterator;
if (thisPlayer)
{
ChatHandler chatHandle = ChatHandler(thisPlayer->GetSession());
InstanceMap* instanceMap = map->ToInstanceMap();
std::string instanceDifficulty; if (instanceMap->IsHeroic()) instanceDifficulty = "Heroic"; else instanceDifficulty = "Normal";
if (thisPlayer && thisPlayer == player) // This is the player that entered
{
chatHandle.PSendSysMessage(ABGetLocaleText(locale, "welcome_to_player").c_str(),
map->GetMapName(),
instanceMap->GetMaxPlayers(),
instanceDifficulty.c_str(),
mapABInfo->playerCount,
mapABInfo->adjustedPlayerCount);
// notify GMs that they won't be accounted for
if (player->IsGameMaster())
chatHandle.PSendSysMessage(ABGetLocaleText(locale, "welcome_to_gm").c_str());
}
else
{
// announce non-GMs entering the instance only
if (!player->IsGameMaster())
chatHandle.PSendSysMessage(ABGetLocaleText(locale, "announce_non_gm_entering_instance").c_str(), player->GetName().c_str(), mapABInfo->playerCount, mapABInfo->adjustedPlayerCount);
}
}
}
}
}
}
}
void AutoBalance_AllMapScript::OnPlayerLeaveAll(Map* map, Player* player)
{
if (!EnableGlobal)
return;
if (!map->IsDungeon())
return;
LOG_DEBUG("module.AutoBalance", "AutoBalance:: ------------------------------------------------");
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerLeaveAll: Player {}{} | exits {} ({}{})",
player->GetName(),
player->IsGameMaster() ? " (GM)" : "",
map->GetMapName(),
map->GetId(),
map->GetInstanceId() ? "-" + std::to_string(map->GetInstanceId()) : ""
);
// get the map's info
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
// store the previous difficulty for comparison later
int prevAdjustedPlayerCount = mapABInfo->adjustedPlayerCount;
// remove this player from this map's player list
bool playerWasRemoved = RemovePlayerFromMap(map, player);
// report the number of players in the map
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerLeaveAll: There are {} player(s) left in the map.", mapABInfo->allMapPlayers.size());
// if a player was NOT removed, return now - stats don't need to be updated
if (!playerWasRemoved)
return;
// recalculate the zone's level stats
mapABInfo->highestCreatureLevel = 0;
mapABInfo->lowestCreatureLevel = 0;
//mapABInfo->avgCreatureLevel = 0;
mapABInfo->activeCreatureCount = 0;
// see which existing creatures are active
for (std::vector<Creature*>::iterator creatureIterator = mapABInfo->allMapCreatures.begin(); creatureIterator != mapABInfo->allMapCreatures.end(); ++creatureIterator)
AddCreatureToMapCreatureList(*creatureIterator, false, true);
// if the previous player count is the same as the new player count, update without force
if (prevAdjustedPlayerCount == mapABInfo->adjustedPlayerCount)
{
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerLeaveAll: Player difficulty unchanged at {}. Updating map data (no force).",
mapABInfo->adjustedPlayerCount
);
// Update the map's data
UpdateMapDataIfNeeded(map, false);
}
else
{
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerLeaveAll: Player difficulty changed from ({})->({}). Updating map data (force).",
prevAdjustedPlayerCount,
mapABInfo->adjustedPlayerCount
);
// Update the map's data, forced
UpdateMapDataIfNeeded(map, true);
}
// updates the player count and levels for the map
if (map->GetEntry() && map->GetEntry()->IsDungeon())
{
{
mapABInfo->playerCount = mapABInfo->allMapPlayers.size();
LOG_DEBUG("module.AutoBalance", "AutoBalance_AllMapScript::OnPlayerLeaveAll: Player {} left the instance.",
player->GetName(),
mapABInfo->playerCount,
mapABInfo->adjustedPlayerCount
);
}
}
// Notify remaining players in the instance that a player left
if (PlayerChangeNotify && mapABInfo->enabled)
{
if (map->GetEntry()->IsDungeon() && player && !player->IsGameMaster())
{
if (mapABInfo->playerCount)
{
for (std::vector<Player*>::const_iterator playerIterator = mapABInfo->allMapPlayers.begin(); playerIterator != mapABInfo->allMapPlayers.end(); ++playerIterator)
{
Player* thisPlayer = *playerIterator;
if (thisPlayer && thisPlayer != player)
{
ChatHandler chatHandle = ChatHandler(thisPlayer->GetSession());
if (mapABInfo->combatLocked)
{
chatHandle.PSendSysMessage(ABGetLocaleText(thisPlayer->GetSession()->GetSessionDbLocaleIndex(), "leaving_instance_combat").c_str(),
player->GetName().c_str(),
mapABInfo->adjustedPlayerCount);
}
else
{
chatHandle.PSendSysMessage(ABGetLocaleText(thisPlayer->GetSession()->GetSessionDbLocaleIndex(), "leaving_instance").c_str(),
player->GetName().c_str(),
mapABInfo->playerCount,
mapABInfo->adjustedPlayerCount);
}
}
}
}
}
}
}
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_ALL_MAP_SCRIPT_H
#define __AB_ALL_MAP_SCRIPT_H
#include "ScriptMgr.h"
class AutoBalance_AllMapScript : public AllMapScript
{
public:
AutoBalance_AllMapScript()
: AllMapScript("AutoBalance_AllMapScript", {
ALLMAPHOOK_ON_PLAYER_ENTER_ALL,
ALLMAPHOOK_ON_PLAYER_LEAVE_ALL
})
{
}
// hook triggers after the player has already entered the world
void OnPlayerEnterAll(Map* map, Player* player) override;
// hook triggers just before the player left the world
void OnPlayerLeaveAll(Map* map, Player* player) override;
};
#endif
@@ -0,0 +1,186 @@
#include "ABCommandScript.h"
#include "ABConfig.h"
#include "ABCreatureInfo.h"
#include "ABMapInfo.h"
#include "ABUtils.h"
#include "Message.h"
bool AutoBalance_CommandScript::HandleABSetOffsetCommand(ChatHandler* handler, const char* args)
{
if (!*args)
{
handler->PSendSysMessage(".autobalance setoffset #");
handler->PSendSysMessage(ABGetLocaleText(handler->GetSession()->GetSessionDbLocaleIndex(), "set_offset_command_description").c_str());
return false;
}
char* offset = strtok((char*)args, " ");
int32 offseti = -1;
if (offset)
{
offseti = (uint32)atoi(offset);
std::vector<std::string> args = { std::to_string(offseti) };
handler->PSendSysMessage(ABGetLocaleText(handler->GetSession()->GetSessionDbLocaleIndex(), "set_offset_command_success").c_str(), offseti);
PlayerCountDifficultyOffset = offseti;
globalConfigTime = GetCurrentConfigTime();
return true;
}
else
handler->PSendSysMessage(ABGetLocaleText(handler->GetSession()->GetSessionDbLocaleIndex(), "set_offset_command_error").c_str());
return false;
}
bool AutoBalance_CommandScript::HandleABGetOffsetCommand(ChatHandler* handler, const char* /*args*/)
{
handler->PSendSysMessage(ABGetLocaleText(handler->GetSession()->GetSessionDbLocaleIndex(), "get_offset_command_success").c_str(), PlayerCountDifficultyOffset);
return true;
}
bool AutoBalance_CommandScript::HandleABMapStatsCommand(ChatHandler* handler, const char* /*args*/)
{
Player* player = handler->GetPlayer();
auto locale = handler->GetSession()->GetSessionDbLocaleIndex();
AutoBalanceMapInfo* mapABInfo = GetMapInfo(player->GetMap());
if (player->GetMap()->IsDungeon())
{
handler->PSendSysMessage("---");
// Map basics
handler->PSendSysMessage("{} ({}-player {}) | ID {}-{}{}",
player->GetMap()->GetMapName(),
player->GetMap()->ToInstanceMap()->GetMaxPlayers(),
player->GetMap()->ToInstanceMap()->IsHeroic() ? "Heroic" : "Normal",
player->GetMapId(),
player->GetInstanceId(),
mapABInfo->enabled ? "" : " | AutoBalance DISABLED");
// if the map isn't enabled, don't display anything else
// if (!mapABInfo->enabled) { return true; }
// Player stats
handler->PSendSysMessage("Players on map: {} (Lvl {} - {})",
mapABInfo->playerCount,
mapABInfo->lowestPlayerLevel,
mapABInfo->highestPlayerLevel
);
// Adjusted player count (multiple scenarios)
if (mapABInfo->combatLockTripped)
handler->PSendSysMessage(ABGetLocaleText(locale, "adjusted_player_count_combat_locked").c_str(), mapABInfo->adjustedPlayerCount);
else if (mapABInfo->playerCount < mapABInfo->minPlayers && !PlayerCountDifficultyOffset)
handler->PSendSysMessage(ABGetLocaleText(locale, "adjusted_player_count_map_minimum").c_str(), mapABInfo->adjustedPlayerCount);
else if (mapABInfo->playerCount < mapABInfo->minPlayers && PlayerCountDifficultyOffset)
handler->PSendSysMessage(ABGetLocaleText(locale, "adjusted_player_count_map_minimum_difficulty_offset").c_str(), mapABInfo->adjustedPlayerCount, PlayerCountDifficultyOffset);
else if (PlayerCountDifficultyOffset)
handler->PSendSysMessage(ABGetLocaleText(locale, "adjusted_player_count_difficulty_offset").c_str(), mapABInfo->adjustedPlayerCount, PlayerCountDifficultyOffset);
else
handler->PSendSysMessage(ABGetLocaleText(locale, "adjusted_player_count").c_str(), mapABInfo->adjustedPlayerCount);
// LFG levels
handler->PSendSysMessage(ABGetLocaleText(locale, "lfg_range").c_str(), mapABInfo->lfgMinLevel, mapABInfo->lfgMaxLevel, mapABInfo->lfgTargetLevel);
// Calculated map level (creature average)
handler->PSendSysMessage(ABGetLocaleText(locale, "map_level").c_str(),
(uint8)(mapABInfo->avgCreatureLevel + 0.5f),
mapABInfo->isLevelScalingEnabled && mapABInfo->enabled ? "->" + std::to_string(mapABInfo->highestPlayerLevel) + ABGetLocaleText(locale, "level_scaling_enabled").c_str() : ABGetLocaleText(locale, "level_scaling_disabled").c_str()
);
// World Health Multiplier
handler->PSendSysMessage(ABGetLocaleText(locale, "world_health_multiplier").c_str(), mapABInfo->worldHealthMultiplier);
// World Damage and Healing Multiplier
if (mapABInfo->worldDamageHealingMultiplier != mapABInfo->scaledWorldDamageHealingMultiplier)
{
handler->PSendSysMessage(ABGetLocaleText(locale, "world_hostile_damage_healing_multiplier_to").c_str(),
mapABInfo->worldDamageHealingMultiplier,
mapABInfo->scaledWorldDamageHealingMultiplier
);
}
else
{
handler->PSendSysMessage(ABGetLocaleText(locale, "world_hostile_damage_healing_multiplier").c_str(),
mapABInfo->worldDamageHealingMultiplier
);
}
// Creature Stats
handler->PSendSysMessage(ABGetLocaleText(locale, "original_creature_level_range").c_str(),
mapABInfo->lowestCreatureLevel,
mapABInfo->highestCreatureLevel,
mapABInfo->avgCreatureLevel
);
handler->PSendSysMessage(ABGetLocaleText(locale, "active_total_creatures_in_map").c_str(),
mapABInfo->activeCreatureCount,
mapABInfo->allMapCreatures.size()
);
return true;
}
else
{
handler->PSendSysMessage(ABGetLocaleText(locale, "ab_command_only_in_instance").c_str());
return false;
}
}
bool AutoBalance_CommandScript::HandleABCreatureStatsCommand(ChatHandler* handler, const char* /*args*/)
{
Creature* target = handler->getSelectedCreature();
auto locale = handler->GetSession()->GetSessionDbLocaleIndex();
if (!target)
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
else if (!target->GetMap()->IsDungeon())
{
handler->PSendSysMessage(ABGetLocaleText(locale, "target_no_in_instance").c_str());
handler->SetSentErrorMessage(true);
return false;
}
AutoBalanceCreatureInfo* targetABInfo = target->CustomData.GetDefault<AutoBalanceCreatureInfo>("AutoBalanceCreatureInfo");
handler->PSendSysMessage("---");
handler->PSendSysMessage("{} ({}{}{}), {}",
target->GetName(),
targetABInfo->UnmodifiedLevel,
isCreatureRelevant(target) && targetABInfo->UnmodifiedLevel != target->GetLevel() ? "->" + std::to_string(targetABInfo->selectedLevel) : "",
isBossOrBossSummon(target) ? " | Boss" : "",
targetABInfo->isActive ? ABGetLocaleText(locale, "active_for_map_stats").c_str() : ABGetLocaleText(locale, "ignored_for_map_stats").c_str());
handler->PSendSysMessage(ABGetLocaleText(locale, "creature_difficulty_level").c_str(), targetABInfo->instancePlayerCount);
// summon
if (target->IsSummon() && targetABInfo->summoner && targetABInfo->isCloneOfSummoner)
handler->PSendSysMessage(ABGetLocaleText(locale, "clone_of_summon").c_str(), targetABInfo->summonerName, targetABInfo->summonerLevel);
else if (target->IsSummon() && targetABInfo->summoner)
handler->PSendSysMessage(ABGetLocaleText(locale, "summon_of_summon").c_str(), targetABInfo->summonerName, targetABInfo->summonerLevel);
else if (target->IsSummon())
handler->PSendSysMessage(ABGetLocaleText(locale, "summon_without_summoner").c_str());
// level scaled
if (targetABInfo->UnmodifiedLevel != target->GetLevel())
{
handler->PSendSysMessage(ABGetLocaleText(locale, "health_multiplier_to").c_str(), targetABInfo->HealthMultiplier, targetABInfo->ScaledHealthMultiplier);
handler->PSendSysMessage(ABGetLocaleText(locale, "mana_multiplier_to").c_str(), targetABInfo->ManaMultiplier, targetABInfo->ScaledManaMultiplier);
handler->PSendSysMessage(ABGetLocaleText(locale, "armor_multiplier_to").c_str(), targetABInfo->ArmorMultiplier, targetABInfo->ScaledArmorMultiplier);
handler->PSendSysMessage(ABGetLocaleText(locale, "damage_multiplier_to").c_str(), targetABInfo->DamageMultiplier, targetABInfo->ScaledDamageMultiplier);
}
// not level scaled
else
{
handler->PSendSysMessage(ABGetLocaleText(locale, "health_multiplier").c_str(), targetABInfo->HealthMultiplier);
handler->PSendSysMessage(ABGetLocaleText(locale, "mana_multiplier").c_str(), targetABInfo->ManaMultiplier);
handler->PSendSysMessage(ABGetLocaleText(locale, "armor_multiplier").c_str(), targetABInfo->ArmorMultiplier);
handler->PSendSysMessage(ABGetLocaleText(locale, "damage_multiplier").c_str(), targetABInfo->DamageMultiplier);
}
handler->PSendSysMessage(ABGetLocaleText(locale, "cc_duration_multiplier").c_str(), targetABInfo->CCDurationMultiplier);
handler->PSendSysMessage(ABGetLocaleText(locale, "xp_money_multiplier").c_str(), targetABInfo->XPModifier, targetABInfo->MoneyModifier);
return true;
}
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_COMMAND_SCRIPT_H
#define __AB_COMMAND_SCRIPT_H
#include "Chat.h"
#include "Config.h"
#include "ScriptMgr.h"
using namespace Acore::ChatCommands;
class AutoBalance_CommandScript : public CommandScript
{
public:
AutoBalance_CommandScript() : CommandScript("AutoBalance_CommandScript") { }
ChatCommandTable GetCommands() const override
{
static ChatCommandTable ABCommandTable =
{
{ "setoffset", HandleABSetOffsetCommand, SEC_GAMEMASTER, Console::Yes },
{ "getoffset", HandleABGetOffsetCommand, SEC_PLAYER, Console::Yes },
{ "mapstat", HandleABMapStatsCommand, SEC_PLAYER, Console::Yes },
{ "creaturestat", HandleABCreatureStatsCommand, SEC_PLAYER, Console::Yes }
};
static ChatCommandTable commandTable =
{
{ "autobalance", ABCommandTable },
{ "ab", ABCommandTable },
};
return commandTable;
};
static bool HandleABSetOffsetCommand(ChatHandler* handler, const char* args);
static bool HandleABGetOffsetCommand(ChatHandler* handler, const char* args);
static bool HandleABMapStatsCommand(ChatHandler* handler, const char* args);
static bool HandleABCreatureStatsCommand(ChatHandler* handler, const char* args);
};
#endif /* __AB_COMMAND_SCRIPT_H */
+349
View File
@@ -0,0 +1,349 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#include "ABConfig.h"
#include "ABUtils.h"
std::map <int, int> forcedCreatureIds;
std::list<uint32> disabledDungeonIds;
uint32 minPlayersNormal;
uint32 minPlayersHeroic;
uint32 minPlayersRaid;
uint32 minPlayersRaidHeroic;
std::map<uint32, uint8> minPlayersPerDungeonIdMap;
std::map<uint32, uint8> minPlayersPerHeroicDungeonIdMap;
std::map<uint32, AutoBalanceInflectionPointSettings> dungeonOverrides;
std::map<uint32, AutoBalanceInflectionPointSettings> bossOverrides;
std::map<uint32, AutoBalanceStatModifiers> statModifierOverrides;
std::map<uint32, AutoBalanceStatModifiers> statModifierBossOverrides;
std::map<uint32, AutoBalanceStatModifiers> statModifierCreatureOverrides;
std::map<uint8, AutoBalanceLevelScalingDynamicLevelSettings> levelScalingDynamicLevelOverrides;
std::map<uint32, uint32> levelScalingDistanceCheckOverrides;
// spell IDs that spend player health
// player abilities don't actually appear to be caught by `ModifySpellDamageTaken`,
// but I'm leaving them here in case they ever DO get caught by it
std::list<uint32> spellIdsThatSpendPlayerHealth =
{
45529, // Blood Tap
2687, // Bloodrage
27869, // Dark Rune
16666, // Demonic Rune
755, // Health Funnel (Rank 1)
3698, // Health Funnel (Rank 2)
3699, // Health Funnel (Rank 3)
3700, // Health Funnel (Rank 4)
11693, // Health Funnel (Rank 5)
11694, // Health Funnel (Rank 6)
11695, // Health Funnel (Rank 7)
27259, // Health Funnel (Rank 8)
47856, // Health Funnel (Rank 9)
1454, // Life Tap (Rank 1)
1455, // Life Tap (Rank 2)
1456, // Life Tap (Rank 3)
11687, // Life Tap (Rank 4)
11688, // Life Tap (Rank 5)
11689, // Life Tap (Rank 6)
27222, // Life Tap (Rank 7)
57946, // Life Tap (Rank 8)
29858, // Soulshatter
55213 // Unholy Frenzy
};
// spell IDs that should never be modified
// handles cases where a spell is reflecting damage or otherwise converting player damage to something else
std::list<uint32> spellIdsToNeverModify =
{
1177 // Twin Empathy (AQ40 Twin Emperors, only in `spell_dbc` database table)
};
// creature IDs that should never be considered clones
// handles cases where a creature is spawned by another creature, but is not a clone (doesn't retain health/mana values)
std::list<uint32> creatureIDsThatAreNotClones =
{
16152 // Attumen the Huntsman (Karazhan) combined form
};
int8 PlayerCountDifficultyOffset;
bool LevelScaling;
int8 LevelScalingSkipHigherLevels;
int8 LevelScalingSkipLowerLevels;
int8 LevelScalingDynamicLevelCeilingDungeons;
int8 LevelScalingDynamicLevelFloorDungeons;
int8 LevelScalingDynamicLevelCeilingRaids;
int8 LevelScalingDynamicLevelFloorRaids;
int8 LevelScalingDynamicLevelCeilingHeroicDungeons;
int8 LevelScalingDynamicLevelFloorHeroicDungeons;
int8 LevelScalingDynamicLevelCeilingHeroicRaids;
int8 LevelScalingDynamicLevelFloorHeroicRaids;
ScalingMethod LevelScalingMethod;
uint32 rewardRaid;
uint32 rewardDungeon;
uint32 MinPlayerReward;
bool Announcement;
bool LevelScalingEndGameBoost;
bool PlayerChangeNotify;
bool rewardEnabled;
float MinHPModifier;
float MinManaModifier;
float MinDamageModifier;
float MinCCDurationModifier;
float MaxCCDurationModifier;
//
// RewardScaling.*
//
ScalingMethod RewardScalingMethod;
bool RewardScalingXP;
bool RewardScalingMoney;
float RewardScalingXPModifier;
float RewardScalingMoneyModifier;
uint64_t globalConfigTime = GetCurrentConfigTime();
//
// Enable.*
//
bool EnableGlobal;
bool Enable5M;
bool Enable10M;
bool Enable15M;
bool Enable20M;
bool Enable25M;
bool Enable40M;
bool Enable5MHeroic;
bool Enable10MHeroic;
bool Enable25MHeroic;
bool EnableOtherNormal;
bool EnableOtherHeroic;
//
// InflectionPoint*
//
float InflectionPoint;
float InflectionPointCurveFloor;
float InflectionPointCurveCeiling;
float InflectionPointBoss;
float InflectionPointHeroic;
float InflectionPointHeroicCurveFloor;
float InflectionPointHeroicCurveCeiling;
float InflectionPointHeroicBoss;
float InflectionPointRaid;
float InflectionPointRaidCurveFloor;
float InflectionPointRaidCurveCeiling;
float InflectionPointRaidBoss;
float InflectionPointRaidHeroic;
float InflectionPointRaidHeroicCurveFloor;
float InflectionPointRaidHeroicCurveCeiling;
float InflectionPointRaidHeroicBoss;
float InflectionPointRaid10M;
float InflectionPointRaid10MCurveFloor;
float InflectionPointRaid10MCurveCeiling;
float InflectionPointRaid10MBoss;
float InflectionPointRaid10MHeroic;
float InflectionPointRaid10MHeroicCurveFloor;
float InflectionPointRaid10MHeroicCurveCeiling;
float InflectionPointRaid10MHeroicBoss;
float InflectionPointRaid15M;
float InflectionPointRaid15MCurveFloor;
float InflectionPointRaid15MCurveCeiling;
float InflectionPointRaid15MBoss;
float InflectionPointRaid20M;
float InflectionPointRaid20MCurveFloor;
float InflectionPointRaid20MCurveCeiling;
float InflectionPointRaid20MBoss;
float InflectionPointRaid25M;
float InflectionPointRaid25MCurveFloor;
float InflectionPointRaid25MCurveCeiling;
float InflectionPointRaid25MBoss;
float InflectionPointRaid25MHeroic;
float InflectionPointRaid25MHeroicCurveFloor;
float InflectionPointRaid25MHeroicCurveCeiling;
float InflectionPointRaid25MHeroicBoss;
float InflectionPointRaid40M;
float InflectionPointRaid40MCurveFloor;
float InflectionPointRaid40MCurveCeiling;
float InflectionPointRaid40MBoss;
//
// StatModifier*
//
float StatModifier_Global;
float StatModifier_Health;
float StatModifier_Mana;
float StatModifier_Armor;
float StatModifier_Damage;
float StatModifier_CCDuration;
float StatModifierHeroic_Global;
float StatModifierHeroic_Health;
float StatModifierHeroic_Mana;
float StatModifierHeroic_Armor;
float StatModifierHeroic_Damage;
float StatModifierHeroic_CCDuration;
float StatModifierRaid_Global;
float StatModifierRaid_Health;
float StatModifierRaid_Mana;
float StatModifierRaid_Armor;
float StatModifierRaid_Damage;
float StatModifierRaid_CCDuration;
float StatModifierRaidHeroic_Global;
float StatModifierRaidHeroic_Health;
float StatModifierRaidHeroic_Mana;
float StatModifierRaidHeroic_Armor;
float StatModifierRaidHeroic_Damage;
float StatModifierRaidHeroic_CCDuration;
float StatModifierRaid10M_Global;
float StatModifierRaid10M_Health;
float StatModifierRaid10M_Mana;
float StatModifierRaid10M_Armor;
float StatModifierRaid10M_Damage;
float StatModifierRaid10M_CCDuration;
float StatModifierRaid10MHeroic_Global;
float StatModifierRaid10MHeroic_Health;
float StatModifierRaid10MHeroic_Mana;
float StatModifierRaid10MHeroic_Armor;
float StatModifierRaid10MHeroic_Damage;
float StatModifierRaid10MHeroic_CCDuration;
float StatModifierRaid15M_Global;
float StatModifierRaid15M_Health;
float StatModifierRaid15M_Mana;
float StatModifierRaid15M_Armor;
float StatModifierRaid15M_Damage;
float StatModifierRaid15M_CCDuration;
float StatModifierRaid20M_Global;
float StatModifierRaid20M_Health;
float StatModifierRaid20M_Mana;
float StatModifierRaid20M_Armor;
float StatModifierRaid20M_Damage;
float StatModifierRaid20M_CCDuration;
float StatModifierRaid25M_Global;
float StatModifierRaid25M_Health;
float StatModifierRaid25M_Mana;
float StatModifierRaid25M_Armor;
float StatModifierRaid25M_Damage;
float StatModifierRaid25M_CCDuration;
float StatModifierRaid25MHeroic_Global;
float StatModifierRaid25MHeroic_Health;
float StatModifierRaid25MHeroic_Mana;
float StatModifierRaid25MHeroic_Armor;
float StatModifierRaid25MHeroic_Damage;
float StatModifierRaid25MHeroic_CCDuration;
float StatModifierRaid40M_Global;
float StatModifierRaid40M_Health;
float StatModifierRaid40M_Mana;
float StatModifierRaid40M_Armor;
float StatModifierRaid40M_Damage;
float StatModifierRaid40M_CCDuration;
//
// StatModifier* (Boss)
//
float StatModifier_Boss_Global;
float StatModifier_Boss_Health;
float StatModifier_Boss_Mana;
float StatModifier_Boss_Armor;
float StatModifier_Boss_Damage;
float StatModifier_Boss_CCDuration;
float StatModifierHeroic_Boss_Global;
float StatModifierHeroic_Boss_Health;
float StatModifierHeroic_Boss_Mana;
float StatModifierHeroic_Boss_Armor;
float StatModifierHeroic_Boss_Damage;
float StatModifierHeroic_Boss_CCDuration;
float StatModifierRaid_Boss_Global;
float StatModifierRaid_Boss_Health;
float StatModifierRaid_Boss_Mana;
float StatModifierRaid_Boss_Armor;
float StatModifierRaid_Boss_Damage;
float StatModifierRaid_Boss_CCDuration;
float StatModifierRaidHeroic_Boss_Global;
float StatModifierRaidHeroic_Boss_Health;
float StatModifierRaidHeroic_Boss_Mana;
float StatModifierRaidHeroic_Boss_Armor;
float StatModifierRaidHeroic_Boss_Damage;
float StatModifierRaidHeroic_Boss_CCDuration;
float StatModifierRaid10M_Boss_Global;
float StatModifierRaid10M_Boss_Health;
float StatModifierRaid10M_Boss_Mana;
float StatModifierRaid10M_Boss_Armor;
float StatModifierRaid10M_Boss_Damage;
float StatModifierRaid10M_Boss_CCDuration;
float StatModifierRaid10MHeroic_Boss_Global;
float StatModifierRaid10MHeroic_Boss_Health;
float StatModifierRaid10MHeroic_Boss_Mana;
float StatModifierRaid10MHeroic_Boss_Armor;
float StatModifierRaid10MHeroic_Boss_Damage;
float StatModifierRaid10MHeroic_Boss_CCDuration;
float StatModifierRaid15M_Boss_Global;
float StatModifierRaid15M_Boss_Health;
float StatModifierRaid15M_Boss_Mana;
float StatModifierRaid15M_Boss_Armor;
float StatModifierRaid15M_Boss_Damage;
float StatModifierRaid15M_Boss_CCDuration;
float StatModifierRaid20M_Boss_Global;
float StatModifierRaid20M_Boss_Health;
float StatModifierRaid20M_Boss_Mana;
float StatModifierRaid20M_Boss_Armor;
float StatModifierRaid20M_Boss_Damage;
float StatModifierRaid20M_Boss_CCDuration;
float StatModifierRaid25M_Boss_Global;
float StatModifierRaid25M_Boss_Health;
float StatModifierRaid25M_Boss_Mana;
float StatModifierRaid25M_Boss_Armor;
float StatModifierRaid25M_Boss_Damage;
float StatModifierRaid25M_Boss_CCDuration;
float StatModifierRaid25MHeroic_Boss_Global;
float StatModifierRaid25MHeroic_Boss_Health;
float StatModifierRaid25MHeroic_Boss_Mana;
float StatModifierRaid25MHeroic_Boss_Armor;
float StatModifierRaid25MHeroic_Boss_Damage;
float StatModifierRaid25MHeroic_Boss_CCDuration;
float StatModifierRaid40M_Boss_Global;
float StatModifierRaid40M_Boss_Health;
float StatModifierRaid40M_Boss_Mana;
float StatModifierRaid40M_Boss_Armor;
float StatModifierRaid40M_Boss_Damage;
float StatModifierRaid40M_Boss_CCDuration;
+321
View File
@@ -0,0 +1,321 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_CONFIG_H
#define __AB_CONFIG_H
#include "ABInflectionPointSettings.h"
#include "ABLevelScalingDynamicLevelSettings.h"
#include "ABStatModifiers.h"
#include "AutoBalance.h"
#include "SharedDefines.h"
#include <list>
#include <map>
extern std::map<uint32, AutoBalanceInflectionPointSettings> dungeonOverrides;
extern std::map<uint32, AutoBalanceInflectionPointSettings> bossOverrides;
extern std::map<uint32, AutoBalanceStatModifiers> statModifierOverrides;
extern std::map<uint32, AutoBalanceStatModifiers> statModifierBossOverrides;
extern std::map<uint32, AutoBalanceStatModifiers> statModifierCreatureOverrides;
extern std::map<uint8 , AutoBalanceLevelScalingDynamicLevelSettings> levelScalingDynamicLevelOverrides;
extern std::map<uint32, uint32> levelScalingDistanceCheckOverrides;
extern std::map <int, int> forcedCreatureIds;
extern std::list<uint32> disabledDungeonIds;
extern uint32 minPlayersNormal;
extern uint32 minPlayersHeroic;
extern uint32 minPlayersRaid;
extern uint32 minPlayersRaidHeroic;
extern std::map<uint32, uint8> minPlayersPerDungeonIdMap;
extern std::map<uint32, uint8> minPlayersPerHeroicDungeonIdMap;
extern std::list<uint32> spellIdsThatSpendPlayerHealth;
extern std::list<uint32> spellIdsToNeverModify;
extern std::list<uint32> creatureIDsThatAreNotClones;
extern int8 PlayerCountDifficultyOffset;
extern bool LevelScaling;
extern int8 LevelScalingSkipHigherLevels;
extern int8 LevelScalingSkipLowerLevels;
extern int8 LevelScalingDynamicLevelCeilingDungeons;
extern int8 LevelScalingDynamicLevelFloorDungeons;
extern int8 LevelScalingDynamicLevelCeilingRaids;
extern int8 LevelScalingDynamicLevelFloorRaids;
extern int8 LevelScalingDynamicLevelCeilingHeroicDungeons;
extern int8 LevelScalingDynamicLevelFloorHeroicDungeons;
extern int8 LevelScalingDynamicLevelCeilingHeroicRaids;
extern int8 LevelScalingDynamicLevelFloorHeroicRaids;
extern ScalingMethod LevelScalingMethod;
extern uint32 rewardRaid;
extern uint32 rewardDungeon;
extern uint32 MinPlayerReward;
extern bool Announcement;
extern bool LevelScalingEndGameBoost;
extern bool PlayerChangeNotify;
extern bool rewardEnabled;
extern float MinHPModifier;
extern float MinManaModifier;
extern float MinDamageModifier;
extern float MinCCDurationModifier;
extern float MaxCCDurationModifier;
//
// RewardScaling.*
//
extern ScalingMethod RewardScalingMethod;
extern bool RewardScalingXP;
extern bool RewardScalingMoney;
extern float RewardScalingXPModifier;
extern float RewardScalingMoneyModifier;
extern uint64_t globalConfigTime;
//
// Enable.*
//
extern bool EnableGlobal;
extern bool Enable5M;
extern bool Enable10M;
extern bool Enable15M;
extern bool Enable20M;
extern bool Enable25M;
extern bool Enable40M;
extern bool Enable5MHeroic;
extern bool Enable10MHeroic;
extern bool Enable25MHeroic;
extern bool EnableOtherNormal;
extern bool EnableOtherHeroic;
//
// InflectionPoint*
//
extern float InflectionPoint;
extern float InflectionPointCurveFloor;
extern float InflectionPointCurveCeiling;
extern float InflectionPointBoss;
extern float InflectionPointHeroic;
extern float InflectionPointHeroicCurveFloor;
extern float InflectionPointHeroicCurveCeiling;
extern float InflectionPointHeroicBoss;
extern float InflectionPointRaid;
extern float InflectionPointRaidCurveFloor;
extern float InflectionPointRaidCurveCeiling;
extern float InflectionPointRaidBoss;
extern float InflectionPointRaidHeroic;
extern float InflectionPointRaidHeroicCurveFloor;
extern float InflectionPointRaidHeroicCurveCeiling;
extern float InflectionPointRaidHeroicBoss;
extern float InflectionPointRaid10M;
extern float InflectionPointRaid10MCurveFloor;
extern float InflectionPointRaid10MCurveCeiling;
extern float InflectionPointRaid10MBoss;
extern float InflectionPointRaid10MHeroic;
extern float InflectionPointRaid10MHeroicCurveFloor;
extern float InflectionPointRaid10MHeroicCurveCeiling;
extern float InflectionPointRaid10MHeroicBoss;
extern float InflectionPointRaid15M;
extern float InflectionPointRaid15MCurveFloor;
extern float InflectionPointRaid15MCurveCeiling;
extern float InflectionPointRaid15MBoss;
extern float InflectionPointRaid20M;
extern float InflectionPointRaid20MCurveFloor;
extern float InflectionPointRaid20MCurveCeiling;
extern float InflectionPointRaid20MBoss;
extern float InflectionPointRaid25M;
extern float InflectionPointRaid25MCurveFloor;
extern float InflectionPointRaid25MCurveCeiling;
extern float InflectionPointRaid25MBoss;
extern float InflectionPointRaid25MHeroic;
extern float InflectionPointRaid25MHeroicCurveFloor;
extern float InflectionPointRaid25MHeroicCurveCeiling;
extern float InflectionPointRaid25MHeroicBoss;
extern float InflectionPointRaid40M;
extern float InflectionPointRaid40MCurveFloor;
extern float InflectionPointRaid40MCurveCeiling;
extern float InflectionPointRaid40MBoss;
//
// StatModifier*
//
extern float StatModifier_Global;
extern float StatModifier_Health;
extern float StatModifier_Mana;
extern float StatModifier_Armor;
extern float StatModifier_Damage;
extern float StatModifier_CCDuration;
extern float StatModifierHeroic_Global;
extern float StatModifierHeroic_Health;
extern float StatModifierHeroic_Mana;
extern float StatModifierHeroic_Armor;
extern float StatModifierHeroic_Damage;
extern float StatModifierHeroic_CCDuration;
extern float StatModifierRaid_Global;
extern float StatModifierRaid_Health;
extern float StatModifierRaid_Mana;
extern float StatModifierRaid_Armor;
extern float StatModifierRaid_Damage;
extern float StatModifierRaid_CCDuration;
extern float StatModifierRaidHeroic_Global;
extern float StatModifierRaidHeroic_Health;
extern float StatModifierRaidHeroic_Mana;
extern float StatModifierRaidHeroic_Armor;
extern float StatModifierRaidHeroic_Damage;
extern float StatModifierRaidHeroic_CCDuration;
extern float StatModifierRaid10M_Global;
extern float StatModifierRaid10M_Health;
extern float StatModifierRaid10M_Mana;
extern float StatModifierRaid10M_Armor;
extern float StatModifierRaid10M_Damage;
extern float StatModifierRaid10M_CCDuration;
extern float StatModifierRaid10MHeroic_Global;
extern float StatModifierRaid10MHeroic_Health;
extern float StatModifierRaid10MHeroic_Mana;
extern float StatModifierRaid10MHeroic_Armor;
extern float StatModifierRaid10MHeroic_Damage;
extern float StatModifierRaid10MHeroic_CCDuration;
extern float StatModifierRaid15M_Global;
extern float StatModifierRaid15M_Health;
extern float StatModifierRaid15M_Mana;
extern float StatModifierRaid15M_Armor;
extern float StatModifierRaid15M_Damage;
extern float StatModifierRaid15M_CCDuration;
extern float StatModifierRaid20M_Global;
extern float StatModifierRaid20M_Health;
extern float StatModifierRaid20M_Mana;
extern float StatModifierRaid20M_Armor;
extern float StatModifierRaid20M_Damage;
extern float StatModifierRaid20M_CCDuration;
extern float StatModifierRaid25M_Global;
extern float StatModifierRaid25M_Health;
extern float StatModifierRaid25M_Mana;
extern float StatModifierRaid25M_Armor;
extern float StatModifierRaid25M_Damage;
extern float StatModifierRaid25M_CCDuration;
extern float StatModifierRaid25MHeroic_Global;
extern float StatModifierRaid25MHeroic_Health;
extern float StatModifierRaid25MHeroic_Mana;
extern float StatModifierRaid25MHeroic_Armor;
extern float StatModifierRaid25MHeroic_Damage;
extern float StatModifierRaid25MHeroic_CCDuration;
extern float StatModifierRaid40M_Global;
extern float StatModifierRaid40M_Health;
extern float StatModifierRaid40M_Mana;
extern float StatModifierRaid40M_Armor;
extern float StatModifierRaid40M_Damage;
extern float StatModifierRaid40M_CCDuration;
//
// StatModifier* (Boss)
//
extern float StatModifier_Boss_Global;
extern float StatModifier_Boss_Health;
extern float StatModifier_Boss_Mana;
extern float StatModifier_Boss_Armor;
extern float StatModifier_Boss_Damage;
extern float StatModifier_Boss_CCDuration;
extern float StatModifierHeroic_Boss_Global;
extern float StatModifierHeroic_Boss_Health;
extern float StatModifierHeroic_Boss_Mana;
extern float StatModifierHeroic_Boss_Armor;
extern float StatModifierHeroic_Boss_Damage;
extern float StatModifierHeroic_Boss_CCDuration;
extern float StatModifierRaid_Boss_Global;
extern float StatModifierRaid_Boss_Health;
extern float StatModifierRaid_Boss_Mana;
extern float StatModifierRaid_Boss_Armor;
extern float StatModifierRaid_Boss_Damage;
extern float StatModifierRaid_Boss_CCDuration;
extern float StatModifierRaidHeroic_Boss_Global;
extern float StatModifierRaidHeroic_Boss_Health;
extern float StatModifierRaidHeroic_Boss_Mana;
extern float StatModifierRaidHeroic_Boss_Armor;
extern float StatModifierRaidHeroic_Boss_Damage;
extern float StatModifierRaidHeroic_Boss_CCDuration;
extern float StatModifierRaid10M_Boss_Global;
extern float StatModifierRaid10M_Boss_Health;
extern float StatModifierRaid10M_Boss_Mana;
extern float StatModifierRaid10M_Boss_Armor;
extern float StatModifierRaid10M_Boss_Damage;
extern float StatModifierRaid10M_Boss_CCDuration;
extern float StatModifierRaid10MHeroic_Boss_Global;
extern float StatModifierRaid10MHeroic_Boss_Health;
extern float StatModifierRaid10MHeroic_Boss_Mana;
extern float StatModifierRaid10MHeroic_Boss_Armor;
extern float StatModifierRaid10MHeroic_Boss_Damage;
extern float StatModifierRaid10MHeroic_Boss_CCDuration;
extern float StatModifierRaid15M_Boss_Global;
extern float StatModifierRaid15M_Boss_Health;
extern float StatModifierRaid15M_Boss_Mana;
extern float StatModifierRaid15M_Boss_Armor;
extern float StatModifierRaid15M_Boss_Damage;
extern float StatModifierRaid15M_Boss_CCDuration;
extern float StatModifierRaid40M_Boss_Damage;
extern float StatModifierRaid20M_Boss_Global;
extern float StatModifierRaid20M_Boss_Health;
extern float StatModifierRaid20M_Boss_Mana;
extern float StatModifierRaid20M_Boss_Armor;
extern float StatModifierRaid20M_Boss_Damage;
extern float StatModifierRaid20M_Boss_CCDuration;
extern float StatModifierRaid25M_Boss_Global;
extern float StatModifierRaid25M_Boss_Health;
extern float StatModifierRaid25M_Boss_Mana;
extern float StatModifierRaid25M_Boss_Armor;
extern float StatModifierRaid25M_Boss_Damage;
extern float StatModifierRaid25M_Boss_CCDuration;
extern float StatModifierRaid25MHeroic_Boss_Global;
extern float StatModifierRaid25MHeroic_Boss_Health;
extern float StatModifierRaid25MHeroic_Boss_Mana;
extern float StatModifierRaid25MHeroic_Boss_Armor;
extern float StatModifierRaid25MHeroic_Boss_Damage;
extern float StatModifierRaid25MHeroic_Boss_CCDuration;
extern float StatModifierRaid40M_Boss_Global;
extern float StatModifierRaid40M_Boss_Health;
extern float StatModifierRaid40M_Boss_Mana;
extern float StatModifierRaid40M_Boss_Armor;
extern float StatModifierRaid40M_Boss_CCDuration;
#endif
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_CREATURE_INFO_H
#define __AB_CREATURE_INFO_H
#include "AutoBalance.h"
#include "Creature.h"
#include "DataMap.h"
class AutoBalanceCreatureInfo : public DataMap::Base
{
public:
AutoBalanceCreatureInfo() {}
uint64_t mapConfigTime = 1; // The last map config time that this creature was updated
uint32 instancePlayerCount = 0; // The number of players this creature has been scaled for
uint8 selectedLevel = 0; // The level that this creature should be set to
float DamageMultiplier = 1.0f; // Per-player damage multiplier (no level scaling)
float ScaledDamageMultiplier = 1.0f; // Per-player and level scaling damage multiplier
float HealthMultiplier = 1.0f; // Per-player health multiplier (no level scaling)
float ScaledHealthMultiplier = 1.0f; // Per-player and level scaling health multiplier
float ManaMultiplier = 1.0f; // Per-player mana multiplier (no level scaling)
float ScaledManaMultiplier = 1.0f; // Per-player and level scaling mana multiplier
float ArmorMultiplier = 1.0f; // Per-player armor multiplier (no level scaling)
float ScaledArmorMultiplier = 1.0f; // Per-player and level scaling armor multiplier
float CCDurationMultiplier = 1.0f; // Per-player crowd control duration multiplier (level scaling doesn't affect this)
float XPModifier = 1.0f; // Per-player XP modifier (level scaling provided by normal XP distribution)
float MoneyModifier = 1.0f; // Per-player money modifier (no level scaling)
uint8 UnmodifiedLevel = 0; // Original level of the creature as determined by the game
bool isActive = false; // Whether or not the current creature is affecting map stats. May change as conditions change.
bool wasAliveNowDead = false; // Whether or not the creature was alive and is now dead
bool isInCreatureList = false; // Whether or not the creature is in the map's creature list
bool isBrandNew = false; // Whether or not the creature is brand new to the map (hasn't been added to the world yet)
bool neverLevelScale = false; // Whether or not the creature should never be level scaled (can still be player scaled)
uint32 initialMaxHealth = 0; // Stored max health value to be applied just before being added to the world
// creature->IsSummon() // Whether or not the creature is a summon
Creature* summoner = nullptr; // The creature that summoned this creature
std::string summonerName = ""; // The name of the creature that summoned this creature
uint8 summonerLevel = 0; // The level of the creature that summoned this creature
bool isCloneOfSummoner = false; // Whether or not the creature is a clone of its summoner
Relevance relevance = AUTOBALANCE_RELEVANCE_UNCHECKED; // Whether or not the creature is relevant for scaling
};
#endif
@@ -0,0 +1,176 @@
#include "ABGameObjectScript.h"
#include "ABConfig.h"
#include "ABMapInfo.h"
#include "ABUtils.h"
void AutoBalance_GameObjectScript::OnGameObjectModifyHealth(GameObject* target, Unit* source, int32& amount, SpellInfo const* spellInfo)
{
// uncomment to debug this hook
bool _debug_damage_and_healing = (source && target && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer()));
if (_debug_damage_and_healing)
_Debug_Output("OnGameObjectModifyHealth", target, source, amount, "BEFORE:", spellInfo->SpellName[0], spellInfo->Id);
// modify the amount
amount = _Modify_GameObject_Damage_Healing(target, source, amount, spellInfo);
if (_debug_damage_and_healing)
_Debug_Output("OnGameObjectModifyHealth", target, source, amount, "AFTER:", spellInfo->SpellName[0], spellInfo->Id);
}
void AutoBalance_GameObjectScript::_Debug_Output(std::string function_name, GameObject* target, Unit* source, int32 amount, std::string prefix, std::string spell_name, uint32 spell_id)
{
if (target && source && amount)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::{}: {} {} {} {} ({} - {})",
function_name,
prefix,
source->GetName(),
amount,
target->GetName(),
spell_name,
spell_id
);
}
else if (target && source)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::{}: {} {} 0 {} ({} - {})",
function_name,
prefix,
source->GetName(),
target->GetName(),
spell_name,
spell_id
);
}
else if (target && amount)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::{}: {} ?? {} {} ({} - {})",
function_name,
prefix,
amount,
target->GetName(),
spell_name,
spell_id
);
}
else if (target)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::{}: {} ?? ?? {} ({} - {})",
function_name,
prefix,
target->GetName(),
spell_name,
spell_id
);
}
else
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::{}: {} W? T? F? ({} - {})",
function_name,
prefix,
spell_name,
spell_id
);
}
}
int32 AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing(GameObject* target, Unit* source, int32 amount, SpellInfo const* spellInfo)
{
//
// Pre-flight Checks
//
// uncomment to debug this function
bool _debug_damage_and_healing = (source && target && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer()));
// check that we're enabled globally, else return the original value
if (!EnableGlobal)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: EnableGlobal is false, returning original value of ({}).", amount);
return amount;
}
// make sure the target is in an instance, else return the original damage
if (!(target->GetMap()->IsDungeon()))
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target is not in an instance, returning original value of ({}).", amount);
return amount;
}
// make sure the target is in the world, else return the original value
if (!target->IsInWorld())
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target does not exist in the world, returning original value of ({}).", amount);
return amount;
}
// if the spell ID is in our "never modify" list, return the original value
if
(
spellInfo &&
spellInfo->Id &&
std::find
(
spellIdsToNeverModify.begin(),
spellIdsToNeverModify.end(),
spellInfo->Id
) != spellIdsToNeverModify.end()
)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Spell {}({}) is in the never modify list, returning original value of ({}).",
spellInfo->SpellName[0],
spellInfo->Id,
amount
);
return amount;
}
// get the map's info
AutoBalanceMapInfo* targetMapABInfo = GetMapInfo(target->GetMap());
// if the target's map is not enabled, return the original damage
if (!targetMapABInfo->enabled)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target's map is not enabled, returning original value of ({}).", amount);
return amount;
}
//
// Multiplier calculation
//
// calculate the new damage amount using the map's World Health Multiplier
int32 newAmount = _Calculate_Amount_For_GameObject(target, amount, targetMapABInfo->worldHealthMultiplier);
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Returning modified damage: ({}) -> ({})", amount, newAmount);
return newAmount;
}
int32 AutoBalance_GameObjectScript::_Calculate_Amount_For_GameObject(GameObject* target, int32 amount, float multiplier)
{
// since it would be very complicated to reduce the real health of destructible game objects, instead we will
// adjust the damage to them as though their health were scaled. Damage will usually be dealt by vehicles and
// other non-player sources, so this effect shouldn't be as noticable as if we applied it to the player.
uint32 realMaxHealth = target->GetGOValue()->Building.MaxHealth;
uint32 scaledMaxHealth = realMaxHealth * multiplier;
float percentDamageOfScaledMaxHealth = (float)amount / (float)scaledMaxHealth;
uint32 scaledAmount = realMaxHealth * percentDamageOfScaledMaxHealth;
return scaledAmount;
}
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_GAME_OBJECT_SCRIPT_H
#define __AB_GAME_OBJECT_SCRIPT_H
#include "ScriptMgr.h"
#include "SpellInfo.h"
#include "Unit.h"
class AutoBalance_GameObjectScript : public AllGameObjectScript
{
public:
AutoBalance_GameObjectScript()
: AllGameObjectScript("AutoBalance_GameObjectScript")
{}
void OnGameObjectModifyHealth(GameObject* target, Unit* source, int32& amount, SpellInfo const* spellInfo) override;
private:
[[maybe_unused]] bool _debug_damage_and_healing = false; // defaults to false, overwritten in each function
void _Debug_Output(std::string function_name, GameObject* target, Unit* source, int32 amount, std::string prefix = "", std::string spell_name = "Unknown Spell", uint32 spell_id = 0);
int32 _Modify_GameObject_Damage_Healing(GameObject* target, Unit* source, int32 amount, SpellInfo const* spellInfo);
int32 _Calculate_Amount_For_GameObject(GameObject* target, int32 amount, float multiplier);
};
#endif
@@ -0,0 +1,45 @@
#include "ABGlobalScript.h"
#include "ABConfig.h"
#include "ABMapInfo.h"
#include "ABUtils.h"
void AutoBalance_GlobalScript::OnAfterUpdateEncounterState(Map* map, EncounterCreditType type, uint32 /*creditEntry*/, Unit* /*source*/, Difficulty /*difficulty_fixed*/, DungeonEncounterList const* /*encounters*/, uint32 /*dungeonCompleted*/, bool updated)
{
//if (!dungeonCompleted)
// return;
if (!rewardEnabled || !updated)
return;
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
if (mapABInfo->adjustedPlayerCount < MinPlayerReward)
return;
// skip if it's not a pre-wotlk dungeon/raid and if it's not scaled
if (!LevelScaling || mapABInfo->mapLevel <= 70 || mapABInfo->lfgMinLevel <= 70
// skip when not in dungeon or not kill credit
|| type != ENCOUNTER_CREDIT_KILL_CREATURE || !map->IsDungeon())
return;
Map::PlayerList const& playerList = map->GetPlayers();
if (playerList.IsEmpty())
return;
uint32 reward = map->ToInstanceMap()->GetMaxPlayers() > 5 ? rewardRaid : rewardDungeon;
if (!reward)
return;
//instanceStart=0, endTime;
uint8 difficulty = map->GetDifficulty();
for (Map::PlayerList::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
{
if (!itr->GetSource() || itr->GetSource()->IsGameMaster() || itr->GetSource()->GetLevel() < DEFAULT_MAX_LEVEL)
continue;
itr->GetSource()->AddItem(reward, 1 + difficulty); // difficulty boost
}
}
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_GLOBAL_SCRIPT_H
#define __AB_GLOBAL_SCRIPT_H
#include "ScriptMgr.h"
class AutoBalance_GlobalScript : public GlobalScript {
public:
AutoBalance_GlobalScript() : GlobalScript("AutoBalance_GlobalScript", {
GLOBALHOOK_ON_AFTER_UPDATE_ENCOUNTER_STATE
}) { }
void OnAfterUpdateEncounterState(Map* map, EncounterCreditType type, uint32 creditEntry, Unit* source, Difficulty difficulty_fixed, DungeonEncounterList const* encounters, uint32 dungeonCompleted, bool updated) override;
};
#endif /* __AB_GLOBAL_SCRIPT_H */
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_INFLECTION_POINT_SETTINGS_H
#define __AB_INFLECTION_POINT_SETTINGS_H
#include "DataMap.h"
class AutoBalanceInflectionPointSettings : public DataMap::Base
{
public:
AutoBalanceInflectionPointSettings() {}
AutoBalanceInflectionPointSettings(float value, float curveFloor, float curveCeiling) :
value(value), curveFloor(curveFloor), curveCeiling(curveCeiling) {}
float value = 0.5;
float curveFloor = 0.0;
float curveCeiling = 1.0;
};
#endif
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_LEVEL_SCALING_DYNAMIC_LEVEL_SETTINGS_H
#define __AB_LEVEL_SCALING_DYNAMIC_LEVEL_SETTINGS_H
#include "DataMap.h"
class AutoBalanceLevelScalingDynamicLevelSettings : public DataMap::Base
{
public:
AutoBalanceLevelScalingDynamicLevelSettings() {}
AutoBalanceLevelScalingDynamicLevelSettings(int skipHigher, int skipLower, int ceiling, int floor) :
skipHigher(skipHigher), skipLower(skipLower), ceiling(ceiling), floor(floor) {}
int skipHigher = 0;
int skipLower = 0;
int ceiling = 1;
int floor = 1;
};
#endif
+62
View File
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_MAP_INFO_H
#define __AB_MAP_INFO_H
#include "Creature.h"
#include "DataMap.h"
#include "Player.h"
#include <vector>
class AutoBalanceMapInfo : public DataMap::Base
{
public:
AutoBalanceMapInfo() {}
std::vector<Creature*> allMapCreatures; // All creatures in the map, active and non-active
std::vector<Player*> allMapPlayers; // All players that are currently in the map
bool enabled = false; // Should AutoBalance make any changes to this map or its creatures?
uint64_t globalConfigTime = 1; // The last global config time that this map was updated
uint64_t mapConfigTime = 1; // The last map config time that this map was updated
uint8 playerCount = 0; // The actual number of non-GM players in the map
uint8 adjustedPlayerCount = 0; // The currently difficulty level expressed as number of players
uint8 minPlayers = 1; // Will be set by the config
uint8 mapLevel = 0; // Calculated from the avgCreatureLevel
uint8 lowestPlayerLevel = 0; // The lowest-level player in the map
uint8 highestPlayerLevel = 0; // The highest-level player in the map
uint8 lfgMinLevel = 0; // The minimum level for the map according to LFG
uint8 lfgTargetLevel = 0; // The target level for the map according to LFG
uint8 lfgMaxLevel = 0; // The maximum level for the map according to LFG
uint8 worldMultiplierTargetLevel = 0; // The level of the pseudo-creature that the world modifiers scale to
float worldDamageHealingMultiplier = 1.0f; // The damage/healing multiplier for the world (where source isn't an enemy creature)
float scaledWorldDamageHealingMultiplier = 1.0f; // The damage/healing multiplier for the world (where source isn't an enemy creature)
float worldHealthMultiplier = 1.0f; // The "health" multiplier for any destructible buildings in the map
bool combatLocked = false; // Whether or not the map is combat locked
bool combatLockTripped = false; // Set to true when combat locking was needed during this current combat (some tried to leave)
uint8 combatLockMinPlayers = 0; // The instance cannot be set to less than this number of players until combat ends
uint8 highestCreatureLevel = 0; // The highest-level creature in the map
uint8 lowestCreatureLevel = 0; // The lowest-level creature in the map
float avgCreatureLevel = 0; // The average level of all active creatures in the map (continuously updated)
uint32 activeCreatureCount = 0; // The number of creatures in the map that are included in the map's stats (not necessarily alive)
bool isLevelScalingEnabled = false; // Whether level scaling is enabled on this map
uint8 levelScalingSkipHigherLevels = 0; // Used to determine if this map should scale or not
uint8 levelScalingSkipLowerLevels = 0; // Used to determine if this map should scale or not
uint8 levelScalingDynamicCeiling = 0; // How many levels MORE than the highestPlayerLevel creature should be scaled to
uint8 levelScalingDynamicFloor = 0; // How many levels LESS than the highestPlayerLevel creature should be scaled to
uint8 prevMapLevel = 0; // Used to reduce calculations when they are not necessary
bool initialized = false; // Whether or not the map has been initialized
};
#endif
@@ -0,0 +1,11 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#include "ABModuleScript.h"
ABModuleScript::ABModuleScript(const char* name)
: ModuleScript(name)
{
ScriptRegistry<ABModuleScript>::AddScript(this);
}
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_MODULE_SCRIPT_H
#define __AB_MODULE_SCRIPT_H
#include "Creature.h"
#include "ScriptMgr.h"
/*
* Dedicated hooks for Autobalance Module
* Can be used to extend/customize this system
*/
class ABModuleScript : public ModuleScript
{
protected:
ABModuleScript(const char* name);
public:
virtual bool OnBeforeModifyAttributes(Creature* /*creature*/, uint32& /*instancePlayerCount*/) { return true; }
virtual bool OnAfterDefaultMultiplier(Creature* /*creature*/, float& /*defaultMultiplier*/) { return true; }
virtual bool OnBeforeUpdateStats (Creature* /*creature*/, uint32& /*scaledHealth*/, uint32& /*scaledMana*/, float& /*damageMultiplier*/, uint32& /*newBaseArmor*/) { return true; }
};
template class ScriptRegistry<ABModuleScript>;
#endif
@@ -0,0 +1,242 @@
#include <string>
#include "ABConfig.h"
#include "ABCreatureInfo.h"
#include "ABMapInfo.h"
#include "ABPlayerScript.h"
#include "ABUtils.h"
#include "Chat.h"
#include "Message.h"
void AutoBalance_PlayerScript::OnPlayerLogin(Player* Player)
{
if (EnableGlobal && Announcement)
ChatHandler(Player->GetSession()).SendSysMessage("This server is running the |cff4CFF00AutoBalance |rmodule.");
}
void AutoBalance_PlayerScript::OnPlayerLevelChanged(Player* player, uint8 oldlevel)
{
LOG_DEBUG("module.AutoBalance", "AutoBalance:: ------------------------------------------------");
LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnLevelChanged: {} has leveled ({}->{})", player->GetName(), oldlevel, player->GetLevel());
if (!player || player->IsGameMaster())
return;
Map* map = player->GetMap();
if (!map || !map->IsDungeon())
return;
// update the map's player stats
UpdateMapPlayerStats(map);
// schedule all creatures for an update
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
mapABInfo->mapConfigTime = GetCurrentConfigTime();
}
void AutoBalance_PlayerScript::OnPlayerGiveXP(Player* player, uint32& amount, Unit* victim, uint8 /*xpSource*/)
{
Map* map = player->GetMap();
// If this isn't a dungeon, make no changes
if (!map->IsDungeon() || !map->GetInstanceId() || !victim)
return;
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
if (victim && RewardScalingXP && mapABInfo->enabled)
{
Map* map = player->GetMap();
AutoBalanceCreatureInfo* creatureABInfo = victim->CustomData.GetDefault<AutoBalanceCreatureInfo>("AutoBalanceCreatureInfo");
if (map->IsDungeon())
{
if (RewardScalingMethod == AUTOBALANCE_SCALING_DYNAMIC)
{
LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnGiveXP: Distributing XP from '{}' to '{}' in dynamic mode - {}->{}",
victim->GetName(), player->GetName(), amount, uint32(amount * creatureABInfo->XPModifier));
amount = uint32(amount * creatureABInfo->XPModifier);
}
else if (RewardScalingMethod == AUTOBALANCE_SCALING_FIXED)
{
// Ensure that the players always get the same XP, even when entering the dungeon alone
auto maxPlayerCount = map->ToInstanceMap()->GetMaxPlayers();
auto currentPlayerCount = mapABInfo->playerCount;
LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnGiveXP: Distributing XP from '{}' to '{}' in fixed mode - {}->{}",
victim->GetName(), player->GetName(), amount, uint32(amount * creatureABInfo->XPModifier * ((float)currentPlayerCount / maxPlayerCount)));
amount = uint32(amount * creatureABInfo->XPModifier * ((float)currentPlayerCount / maxPlayerCount));
}
}
}
}
void AutoBalance_PlayerScript::OnPlayerBeforeLootMoney(Player* player, Loot* loot)
{
Map* map = player->GetMap();
// If this isn't a dungeon, make no changes
if (!map->IsDungeon())
return;
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
ObjectGuid sourceGuid = loot->sourceWorldObjectGUID;
if (mapABInfo->enabled && RewardScalingMoney)
{
// if the loot source is a creature, honor the modifiers for that creature
if (sourceGuid.IsCreature())
{
Creature* sourceCreature = ObjectAccessor::GetCreature(*player, sourceGuid);
AutoBalanceCreatureInfo* creatureABInfo = sourceCreature->CustomData.GetDefault<AutoBalanceCreatureInfo>("AutoBalanceCreatureInfo");
// Dynamic Mode
if (RewardScalingMethod == AUTOBALANCE_SCALING_DYNAMIC)
{
LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnBeforeLootMoney: Distributing money from '{}' in dynamic mode - {}->{}",
sourceCreature->GetName(), loot->gold, uint32(loot->gold * creatureABInfo->MoneyModifier));
loot->gold = uint32(loot->gold * creatureABInfo->MoneyModifier);
}
// Fixed Mode
else if (RewardScalingMethod == AUTOBALANCE_SCALING_FIXED)
{
// Ensure that the players always get the same money, even when entering the dungeon alone
auto maxPlayerCount = map->ToInstanceMap()->GetMaxPlayers();
auto currentPlayerCount = mapABInfo->playerCount;
LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnBeforeLootMoney: Distributing money from '{}' in fixed mode - {}->{}",
sourceCreature->GetName(), loot->gold, uint32(loot->gold * creatureABInfo->MoneyModifier * ((float)currentPlayerCount / maxPlayerCount)));
loot->gold = uint32(loot->gold * creatureABInfo->MoneyModifier * ((float)currentPlayerCount / maxPlayerCount));
}
}
// for all other loot sources, just distribute in Fixed mode as though the instance was full
else
{
auto maxPlayerCount = map->ToInstanceMap()->GetMaxPlayers();
auto currentPlayerCount = mapABInfo->playerCount;
LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnBeforeLootMoney: Distributing money from a non-creature in fixed mode - {}->{}",
loot->gold, uint32(loot->gold * ((float)currentPlayerCount / maxPlayerCount)));
loot->gold = uint32(loot->gold * ((float)currentPlayerCount / maxPlayerCount));
}
}
}
void AutoBalance_PlayerScript::OnPlayerEnterCombat(Player* player, Unit* /*enemy*/)
{
// if the player or their map is gone, return
if (!player || !player->GetMap())
return;
Map* map = player->GetMap();
// If this isn't a dungeon, no work to do
if (!map || !map->IsDungeon())
return;
LOG_DEBUG("module.AutoBalance_CombatLocking", "AutoBalance_PlayerScript::OnPlayerEnterCombat: {} enters combat.", player->GetName());
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
// if this map isn't enabled, no work to do
if (!mapABInfo->enabled)
return;
// lock the current map
if (!mapABInfo->combatLocked)
{
mapABInfo->combatLocked = true;
mapABInfo->combatLockMinPlayers = mapABInfo->playerCount;
LOG_DEBUG("module.AutoBalance_CombatLocking", "AutoBalance_PlayerScript::OnPlayerEnterCombat: Map {} ({}{}) | Locking difficulty to no less than ({}) as {} enters combat.",
map->GetMapName(),
map->GetId(),
map->GetInstanceId() ? "-" + std::to_string(map->GetInstanceId()) : "",
mapABInfo->combatLockMinPlayers,
player->GetName()
);
}
}
void AutoBalance_PlayerScript::OnPlayerLeaveCombat(Player* player)
{
// if the player or their map is gone, return
if (!player || !player->GetMap())
return;
Map* map = player->GetMap();
// If this isn't a dungeon, no work to do
if (!map || !map->IsDungeon())
return;
// this hook can get called even if the player isn't in combat
// I believe this happens whenever AC attempts to remove combat, but it doesn't check to see if the player is in combat first
// unfortunately, `player->IsInCombat()` doesn't work here
LOG_DEBUG("module.AutoBalance_CombatLocking", "AutoBalance_PlayerScript::OnPlayerLeaveCombat: {} leaves (or wasn't in) combat.", player->GetName());
AutoBalanceMapInfo* mapABInfo = GetMapInfo(map);
// if this map isn't enabled, no work to do
if (!mapABInfo->enabled)
return;
// check to see if any of the other players are in combat
bool anyPlayersInCombat = false;
for (auto player : mapABInfo->allMapPlayers)
{
if (player && player->IsInCombat())
{
anyPlayersInCombat = true;
LOG_DEBUG("module.AutoBalance_CombatLocking", "AutoBalance_PlayerScript::OnPlayerLeaveCombat: Map {} ({}{}) | Player {} (and potentially others) are still in combat.",
map->GetMapName(),
map->GetId(),
map->GetInstanceId() ? "-" + std::to_string(map->GetInstanceId()) : "",
player->GetName()
);
break;
}
}
auto locale = player->GetSession()->GetSessionDbLocaleIndex();
// if no players are in combat, unlock the map
if (!anyPlayersInCombat && mapABInfo->combatLocked)
{
mapABInfo->combatLocked = false;
mapABInfo->combatLockMinPlayers = 0;
LOG_DEBUG("module.AutoBalance_CombatLocking", "AutoBalance_PlayerScript::OnPlayerLeaveCombat: Map {} ({}{}) | Unlocking difficulty as {} leaves combat.",
map->GetMapName(),
map->GetId(),
map->GetInstanceId() ? "-" + std::to_string(map->GetInstanceId()) : "",
player->GetName()
);
// if the combat lock needed to be used, notify the players of it lifting
if (mapABInfo->combatLockTripped)
{
for (auto player : mapABInfo->allMapPlayers)
{
if (player && player->GetSession())
ChatHandler(player->GetSession()).PSendSysMessage(ABGetLocaleText(locale, "leaving_instance_combat_change").c_str());
}
}
// if the number of players changed while combat was in progress, schedule the map for an update
if (mapABInfo->combatLockTripped && mapABInfo->playerCount != mapABInfo->combatLockMinPlayers)
{
mapABInfo->mapConfigTime = 1;
LOG_DEBUG("module.AutoBalance_CombatLocking", "AutoBalance_PlayerScript::OnPlayerLeaveCombat: Map {} ({}{}) | Reset map config time to ({}).",
map->GetMapName(),
map->GetId(),
map->GetInstanceId() ? "-" + std::to_string(map->GetInstanceId()) : "",
mapABInfo->mapConfigTime
);
mapABInfo->combatLockTripped = false;
}
}
}
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_PLAYER_SCRIPT_H
#define __AB_PLAYER_SCRIPT_H
#include "Player.h"
#include "ScriptMgr.h"
#include "Unit.h"
class AutoBalance_PlayerScript : public PlayerScript
{
public:
AutoBalance_PlayerScript()
: PlayerScript("AutoBalance_PlayerScript")
{
}
void OnPlayerLogin(Player* Player) override;
virtual void OnPlayerLevelChanged(Player* player, uint8 oldlevel) override;
void OnPlayerGiveXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource) override;
void OnPlayerBeforeLootMoney(Player* player, Loot* loot) override;
virtual void OnPlayerEnterCombat(Player* player, Unit* enemy) override;
virtual void OnPlayerLeaveCombat(Player* player) override;
};
#endif /* __AB_PLAYER_SCRIPT_H */
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#include "ABModuleScript.h"
#include "ABScriptMgr.h"
#include "ScriptMgr.h"
#include "ScriptMgrMacros.h"
ABScriptMgr* ABScriptMgr::instance()
{
static ABScriptMgr instance;
return &instance;
}
bool ABScriptMgr::OnBeforeModifyAttributes(Creature* creature, uint32& instancePlayerCount)
{
auto ret = IsValidBoolScript<ABModuleScript>([&](ABModuleScript* script)
{
return !script->OnBeforeModifyAttributes(creature, instancePlayerCount);
});
if (ret && *ret)
return false;
return true;
}
bool ABScriptMgr::OnAfterDefaultMultiplier(Creature* creature, float& defaultMultiplier)
{
auto ret = IsValidBoolScript<ABModuleScript>([&](ABModuleScript* script)
{
return !script->OnAfterDefaultMultiplier(creature, defaultMultiplier);
});
if (ret && *ret)
return false;
return true;
}
bool ABScriptMgr::OnBeforeUpdateStats(Creature* creature, uint32& scaledHealth, uint32& scaledMana, float& damageMultiplier, uint32& newBaseArmor)
{
auto ret = IsValidBoolScript<ABModuleScript>([&](ABModuleScript* script)
{
return !script->OnBeforeUpdateStats(creature, scaledHealth, scaledMana, damageMultiplier, newBaseArmor);
});
if (ret && *ret)
return false;
return true;
}
+32
View File
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_SCRIPT_MGR_H
#define __AB_SCRIPT_MGR_H
#include "Creature.h"
#include "ScriptMgr.h"
// Manages registration, loading, and execution of scripts.
class ABScriptMgr
{
public: /* Initialization */
static ABScriptMgr* instance();
// Called at the start of ModifyCreatureAttributes method.
// It can be used to add some condition to skip autobalancing system for example.
bool OnBeforeModifyAttributes(Creature* creature, uint32 & instancePlayerCount);
// Called right after default multiplier has been set, you can use it to change.
// Current scaling formula based on number of players or just skip modifications
bool OnAfterDefaultMultiplier(Creature* creature, float &defaultMultiplier);
// Called before change creature values, to tune some values or skip modifications.
bool OnBeforeUpdateStats (Creature* creature, uint32 &scaledHealth, uint32 &scaledMana, float &damageMultiplier, uint32 &newBaseArmor);
};
#define sABScriptMgr ABScriptMgr::instance()
#endif
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_MODULE_STAT_MODIFIERS_H
#define __AB_MODULE_STAT_MODIFIERS_H
#include "DataMap.h"
class AutoBalanceStatModifiers : public DataMap::Base
{
public:
AutoBalanceStatModifiers() {}
AutoBalanceStatModifiers(float global, float health, float mana, float armor, float damage, float ccduration) :
global(global), health(health), mana(mana), armor(armor), damage(damage), ccduration(ccduration) {}
float global = 1.0;
float health = 1.0;
float mana = 1.0;
float armor = 1.0;
float damage = 1.0;
float ccduration = 1.0;
};
#endif
@@ -0,0 +1,557 @@
#include "ABUnitScript.h"
#include "ABConfig.h"
#include "ABCreatureInfo.h"
#include "ABMapInfo.h"
#include "ABUtils.h"
void AutoBalance_UnitScript::ModifyPeriodicDamageAurasTick(Unit* target, Unit* source, uint32& amount, SpellInfo const* spellInfo)
{
// if the spell is negative (damage), we need to flip the sign
// if the spell is positive (healing or other) we keep it the same
int32 adjustedAmount = !spellInfo->IsPositive() ? amount * -1 : amount;
// only debug if the source or target is a player
bool _debug_damage_and_healing = ((source && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer())) || (target && target->GetTypeId() == TYPEID_PLAYER));
_debug_damage_and_healing = (source && source->GetMap()->GetInstanceId());
if (_debug_damage_and_healing)
_Debug_Output("ModifyPeriodicDamageAurasTick", target, source, adjustedAmount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_BEFORE, spellInfo->SpellName[0], spellInfo->Id);
// set amount to the absolute value of the function call
// the provided amount doesn't indicate whether it's a positive or negative value
adjustedAmount = _Modify_Damage_Healing(target, source, adjustedAmount, spellInfo);
amount = abs(adjustedAmount);
if (_debug_damage_and_healing)
_Debug_Output("ModifyPeriodicDamageAurasTick", target, source, adjustedAmount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_AFTER, spellInfo->SpellName[0], spellInfo->Id);
}
void AutoBalance_UnitScript::ModifySpellDamageTaken(Unit* target, Unit* source, int32& amount, SpellInfo const* spellInfo)
{
// if the spell is negative (damage), we need to flip the sign to negative
// if the spell is positive (healing or other) we keep it the same (positive)
int32 adjustedAmount = !spellInfo->IsPositive() ? amount * -1 : amount;
// only debug if the source or target is a player
bool _debug_damage_and_healing = ((source && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer())) || (target && target->GetTypeId() == TYPEID_PLAYER));
_debug_damage_and_healing = (source && source->GetMap()->GetInstanceId());
if (_debug_damage_and_healing)
_Debug_Output("ModifySpellDamageTaken", target, source, adjustedAmount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_BEFORE, spellInfo->SpellName[0], spellInfo->Id);
// set amount to the absolute value of the function call
// the provided amount doesn't indicate whether it's a positive or negative value
adjustedAmount = _Modify_Damage_Healing(target, source, adjustedAmount, spellInfo);
amount = abs(adjustedAmount);
if (_debug_damage_and_healing)
_Debug_Output("ModifySpellDamageTaken", target, source, adjustedAmount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_AFTER, spellInfo->SpellName[0], spellInfo->Id);
}
void AutoBalance_UnitScript::ModifyMeleeDamage(Unit* target, Unit* source, uint32& amount)
{
// melee damage is always negative, so we need to flip the sign to negative
int32 adjustedAmount = amount * -1;
// only debug if the source or target is a player
bool _debug_damage_and_healing = ((source && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer())) || (target && target->GetTypeId() == TYPEID_PLAYER));
_debug_damage_and_healing = (source && source->GetMap()->GetInstanceId());
if (_debug_damage_and_healing)
_Debug_Output("ModifyMeleeDamage", target, source, adjustedAmount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_BEFORE, "Melee");
// set amount to the absolute value of the function call
adjustedAmount = _Modify_Damage_Healing(target, source, adjustedAmount);
amount = abs(adjustedAmount);
if (_debug_damage_and_healing)
_Debug_Output("ModifyMeleeDamage", target, source, adjustedAmount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_AFTER, "Melee");
}
void AutoBalance_UnitScript::ModifyHealReceived(Unit* target, Unit* source, uint32& amount, SpellInfo const* spellInfo)
{
// healing is always positive, no need for any sign flip
// only debug if the source or target is a player
bool _debug_damage_and_healing = ((source && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer())) || (target && target->GetTypeId() == TYPEID_PLAYER));
_debug_damage_and_healing = (source && source->GetMap()->GetInstanceId());
if (_debug_damage_and_healing)
_Debug_Output("ModifyHealReceived", target, source, amount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_BEFORE, spellInfo->SpellName[0], spellInfo->Id);
amount = _Modify_Damage_Healing(target, source, amount, spellInfo);
if (_debug_damage_and_healing)
_Debug_Output("ModifyHealReceived", target, source, amount, AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_AFTER, spellInfo->SpellName[0], spellInfo->Id);
}
void AutoBalance_UnitScript::OnAuraApply(Unit* unit, Aura* aura)
{
// only debug if the source or target is a player
bool _debug_damage_and_healing = (unit && unit->GetTypeId() == TYPEID_PLAYER);
_debug_damage_and_healing = (unit && unit->GetMap()->GetInstanceId());
// Only if this aura has a duration
if (aura && (aura->GetDuration() > 0 || aura->GetMaxDuration() > 0))
{
uint32 auraDuration = _Modifier_CCDuration(unit, aura->GetCaster(), aura);
// only update if we decided to change it
if (auraDuration != (float)aura->GetDuration())
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::OnAuraApply(): Spell '{}' had it's duration adjusted ({}->{}).",
aura->GetSpellInfo()->SpellName[0],
aura->GetMaxDuration() / 1000,
auraDuration / 1000
);
aura->SetMaxDuration(auraDuration);
aura->SetDuration(auraDuration);
}
}
}
void AutoBalance_UnitScript::_Debug_Output(std::string function_name, Unit* target, Unit* source, int32 amount, Damage_Healing_Debug_Phase phase, std::string spell_name, uint32 spell_id)
{
if (phase == AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_BEFORE)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance:: ------------------------------------------------");
}
if (target && source && amount)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::{}: {}: {}{} {} {}{} with {}{} for ({})",
function_name,
phase ? "AFTER" : "BEFORE",
source->GetName(),
source->GetEntry() ? " (" + std::to_string(source->GetEntry()) + ")" : "",
amount > 0 ? "heals" : "damages",
target->GetName(),
target->GetEntry() ? " (" + std::to_string(target->GetEntry()) + ")" : "",
spell_name,
spell_id ? " (" + std::to_string(spell_id) + ")" : "",
amount
);
}
else if (target && source)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::{}: {}: {}{} damages {}{} with {}{} for (0)",
function_name,
phase ? "AFTER" : "BEFORE",
source->GetName(),
source->GetEntry() ? " (" + std::to_string(source->GetEntry()) + ")" : "",
target->GetName(),
target->GetEntry() ? " (" + std::to_string(target->GetEntry()) + ")" : "",
spell_name,
spell_id ? " (" + std::to_string(spell_id) + ")" : ""
);
}
else if (target && amount)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::{}: {}: ?? {} {}{} with {}{} for ({})",
function_name,
phase ? "AFTER" : "BEFORE",
amount > 0 ? "heals" : "damages",
target->GetName(),
target->GetEntry() ? " (" + std::to_string(target->GetEntry()) + ")" : "",
spell_name,
spell_id ? " (" + std::to_string(spell_id) + ")" : "",
amount
);
}
else if (target)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::{}: {}: ?? affects {}{} with {}{}",
function_name,
phase ? "AFTER" : "BEFORE",
target->GetName(),
target->GetEntry() ? " (" + std::to_string(target->GetEntry()) + ")" : "",
spell_name,
spell_id ? " (" + std::to_string(spell_id) + ")" : ""
);
}
else
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::{}: {}: W? T? F? with {}{}",
function_name,
phase ? "AFTER" : "BEFORE",
spell_name,
spell_id ? " (" + std::to_string(spell_id) + ")" : ""
);
}
}
int32 AutoBalance_UnitScript::_Modify_Damage_Healing(Unit* target, Unit* source, int32 amount, SpellInfo const* spellInfo)
{
//
// Pre-flight Checks
//
// only debug if the source or target is a player
bool _debug_damage_and_healing = ((source && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer())) || (target && target->GetTypeId() == TYPEID_PLAYER));
_debug_damage_and_healing = (source && source->GetMap()->GetInstanceId());
// check that we're enabled globally, else return the original value
if (!EnableGlobal)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: EnableGlobal is false, returning original value of ({}).", amount);
return amount;
}
// if the source is gone (logged off? despawned?), use the same target and source.
// hacky, but better than crashing or having the damage go to 1.0x
if (!source)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is null, using target as source.");
source = target;
}
// make sure the source and target are in an instance, else return the original damage
if (!(source->GetMap()->IsDungeon() && target->GetMap()->IsDungeon()))
{
//if (_debug_damage_and_healing)
// LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Not in an instance, returning original value of ({}).", amount);
return amount;
}
// make sure that the source is in the world, else return the original value
if (!source->IsInWorld())
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source does not exist in the world, returning original value of ({}).", amount);
return amount;
}
// if the spell ID is in our "never modify" list, return the original value
if
(
spellInfo &&
spellInfo->Id &&
std::find
(
spellIdsToNeverModify.begin(),
spellIdsToNeverModify.end(),
spellInfo->Id
) != spellIdsToNeverModify.end()
)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Spell {}({}) is in the never modify list, returning original value of ({}).",
spellInfo->SpellName[0],
spellInfo->Id,
amount
);
return amount;
}
// get the maps' info
AutoBalanceMapInfo* sourceMapABInfo = GetMapInfo(source->GetMap());
AutoBalanceMapInfo* targetMapABInfo = GetMapInfo(target->GetMap());
// if either the target or the source's maps are not enabled, return the original damage
if (!sourceMapABInfo->enabled || !targetMapABInfo->enabled)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source or Target's map is not enabled, returning original value of ({}).", amount);
return amount;
}
//
// Source and Target Checking
//
// if the source is a player and they are healing themselves, return the original value
if (source->GetTypeId() == TYPEID_PLAYER && source->GetGUID() == target->GetGUID() && amount >= 0)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a player that is self-healing, returning original value of ({}).", amount);
return amount;
}
// if the source is a player and they are damaging themselves, log to debug but continue
else if (source->GetTypeId() == TYPEID_PLAYER && source->GetGUID() == target->GetGUID() && amount < 0)
{
// if the spell used is in our list of spells to ignore, return the original value
if
(
spellInfo &&
spellInfo->Id &&
std::find
(
spellIdsThatSpendPlayerHealth.begin(),
spellIdsThatSpendPlayerHealth.end(),
spellInfo->Id
) != spellIdsThatSpendPlayerHealth.end()
)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a player that is self-damaging with a spell that is ignored, returning original value of ({}).", amount);
return amount;
}
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a player that is self-damaging, continuing.");
}
// if the source is a player and they are damaging unit that is friendly, log to debug but continue
else if (source->GetTypeId() == TYPEID_PLAYER && target->IsFriendlyTo(source) && amount < 0)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a player that is damaging a friendly unit, continuing.");
}
// if the source is a player under any other condition, return the original value
else if (source->GetTypeId() == TYPEID_PLAYER)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is an enemy player, returning original value of ({}).", amount);
return amount;
}
// if the creature is attacking itself with an aura with effect type SPELL_AURA_SHARE_DAMAGE_PCT, return the orginal damage
else if
(
source->GetTypeId() == TYPEID_UNIT &&
source->GetTypeId() != TYPEID_PLAYER &&
source->GetGUID() == target->GetGUID() &&
_isAuraWithEffectType(spellInfo, SPELL_AURA_SHARE_DAMAGE_PCT)
)
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a creature that is self-damaging with an aura that shares damage, returning original value of ({}).", amount);
return amount;
}
// if the source is under the control of the player, return the original damage
// noteably, this should NOT include mind control targets
if ((source->IsHunterPet() || source->IsPet() || source->IsSummon()) && source->IsControlledByPlayer())
{
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a player-controlled pet or summon, returning original value of ({}).", amount);
return amount;
}
//
// Multiplier calculation
//
float damageMultiplier = 1.0f;
// if the source is a player AND the target is that same player AND the value is damage (negative), use the map's multiplier
if (source->GetTypeId() == TYPEID_PLAYER && source->GetGUID() == target->GetGUID() && amount < 0)
{
// if this aura damages based on a percent of the player's max health, use the un-level-scaled multiplier
if (_isAuraWithEffectType(spellInfo, SPELL_AURA_PERIODIC_DAMAGE_PERCENT))
{
damageMultiplier = sourceMapABInfo->worldDamageHealingMultiplier;
if (_debug_damage_and_healing)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Spell damage based on percent of max health. Ignore level scaling.");
LOG_DEBUG("module.AutoBalance_DamageHealingCC",
"AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a player and the target is that same player, using the map's (level-scaling ignored) multiplier: ({})",
damageMultiplier
);
}
}
else
{
damageMultiplier = sourceMapABInfo->scaledWorldDamageHealingMultiplier;
if (_debug_damage_and_healing)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC",
"AutoBalance_UnitScript::_Modify_Damage_Healing: Source is a player and the target is that same player, using the map's multiplier: ({})",
damageMultiplier
);
}
}
}
// if the target is a player AND the value is healing (positive), use the map's damage multiplier
// (player to player healing was already eliminated in the Source and Target Checking section)
else if (target->GetTypeId() == TYPEID_PLAYER && amount >= 0)
{
damageMultiplier = targetMapABInfo->scaledWorldDamageHealingMultiplier;
if (_debug_damage_and_healing)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC",
"AutoBalance_UnitScript::_Modify_Damage_Healing: A non-player is healing a player, using the map's multiplier: ({})",
damageMultiplier
);
}
}
// if the target is a player AND the source is not a creature, use the map's multiplier
else if (target->GetTypeId() == TYPEID_PLAYER && source->GetTypeId() != TYPEID_UNIT && amount < 0)
{
// if this aura damages based on a percent of the player's max health, use the un-level-scaled multiplier
if (_isAuraWithEffectType(spellInfo, SPELL_AURA_PERIODIC_DAMAGE_PERCENT))
{
damageMultiplier = targetMapABInfo->worldDamageHealingMultiplier;
if (_debug_damage_and_healing)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Spell damage based on percent of max health. Ignore level scaling.");
LOG_DEBUG("module.AutoBalance_DamageHealingCC",
"AutoBalance_UnitScript::_Modify_Damage_Healing: Target is a player and the source is not a creature, using the map's (level-scaling-ignored) multiplier: ({})",
damageMultiplier
);
}
}
else
{
damageMultiplier = targetMapABInfo->scaledWorldDamageHealingMultiplier;
if (_debug_damage_and_healing)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC",
"AutoBalance_UnitScript::_Modify_Damage_Healing: Target is a player and the source is not a creature, using the map's multiplier: ({})",
damageMultiplier
);
}
}
}
// otherwise, use the source creature's damage multiplier
else
{
// if this aura damages based on a percent of the player's max health, use the un-level-scaled multiplier
if (_isAuraWithEffectType(spellInfo, SPELL_AURA_PERIODIC_DAMAGE_PERCENT))
{
damageMultiplier = source->CustomData.GetDefault<AutoBalanceCreatureInfo>("AutoBalanceCreatureInfo")->DamageMultiplier;
if (_debug_damage_and_healing)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Spell damage based on percent of max health. Ignore level scaling.");
LOG_DEBUG("module.AutoBalance_DamageHealingCC",
"AutoBalance_UnitScript::_Modify_Damage_Healing: Using the source creature's (level-scaling ignored) damage multiplier: ({})",
damageMultiplier
);
}
}
// non percent-based, used the normal multiplier
else
{
damageMultiplier = source->CustomData.GetDefault<AutoBalanceCreatureInfo>("AutoBalanceCreatureInfo")->ScaledDamageMultiplier;
if (_debug_damage_and_healing)
{
LOG_DEBUG("module.AutoBalance_DamageHealingCC",
"AutoBalance_UnitScript::_Modify_Damage_Healing: Using the source creature's damage multiplier: ({})",
damageMultiplier
);
}
}
}
// we are good to go, return the original damage times the multiplier
if (_debug_damage_and_healing)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_Modify_Damage_Healing: Returning modified {}: ({}) * ({}) = ({})",
amount <= 0 ? "damage" : "healing",
amount,
damageMultiplier,
amount * damageMultiplier
);
return amount * damageMultiplier;
}
uint32 AutoBalance_UnitScript::_Modifier_CCDuration(Unit* target, Unit* caster, Aura* aura)
{
// store the original duration of the aura
float originalDuration = (float)aura->GetDuration();
// check that we're enabled globally, else return the original duration
if (!EnableGlobal)
return originalDuration;
// ensure that both the target and the caster are defined
if (!target || !caster)
return originalDuration;
// if the aura wasn't cast just now, don't change it
if (aura->GetDuration() != aura->GetMaxDuration())
return originalDuration;
// if the target isn't a player or the caster is a player, return the original duration
if (!target->IsPlayer() || caster->IsPlayer())
return originalDuration;
// make sure we're in an instance, else return the original duration
if (!(target->GetMap()->IsDungeon() && caster->GetMap()->IsDungeon()))
return originalDuration;
// get the current creature's CC duration multiplier
float ccDurationMultiplier = caster->CustomData.GetDefault<AutoBalanceCreatureInfo>("AutoBalanceCreatureInfo")->CCDurationMultiplier;
// if it's the default of 1.0, return the original damage
if (ccDurationMultiplier == 1)
return originalDuration;
// if the aura was cast by a pet or summon, return the original duration
if ((caster->IsHunterPet() || caster->IsPet() || caster->IsSummon()) && caster->IsControlledByPlayer())
return originalDuration;
// only if this aura is a CC
if (
aura->HasEffectType(SPELL_AURA_MOD_CHARM) ||
aura->HasEffectType(SPELL_AURA_MOD_CONFUSE) ||
aura->HasEffectType(SPELL_AURA_MOD_DISARM) ||
aura->HasEffectType(SPELL_AURA_MOD_FEAR) ||
aura->HasEffectType(SPELL_AURA_MOD_PACIFY) ||
aura->HasEffectType(SPELL_AURA_MOD_POSSESS) ||
aura->HasEffectType(SPELL_AURA_MOD_SILENCE) ||
aura->HasEffectType(SPELL_AURA_MOD_STUN) ||
aura->HasEffectType(SPELL_AURA_MOD_SPEED_SLOW_ALL)
)
{
return originalDuration * ccDurationMultiplier;
}
else
return originalDuration;
}
bool AutoBalance_UnitScript::_isAuraWithEffectType(SpellInfo const* spellInfo, AuraType auraType, bool log)
{
// if the spell is not defined, return false
if (!spellInfo)
{
if (log)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_isAuraWithEffectType: SpellInfo is null, returning false.");
return false;
}
// if the spell doesn't have any effects, return false
if (!spellInfo->GetEffects().size())
{
if (log)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_isAuraWithEffectType: SpellInfo has no effects, returning false.");
return false;
}
// iterate through the spell effects
for (SpellEffectInfo effect : spellInfo->GetEffects())
{
// if the effect is not an aura, continue to next effect
if (!effect.IsAura())
{
if (log)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_isAuraWithEffectType: SpellInfo has an effect that is not an aura, continuing to next effect.");
continue;
}
if (effect.ApplyAuraName == auraType)
{
// if the effect is an aura of the target type, return true
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_isAuraWithEffectType: SpellInfo has an aura of the target type, returning true.");
return true;
}
}
// if no aura effect of type auraType was found, return false
if (log)
LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_UnitScript::_isAuraWithEffectType: SpellInfo has no aura of the target type, returning false.");
return false;
}
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_UNIT_SCRIPT_H
#define __AB_UNIT_SCRIPT_H
#include "AutoBalance.h"
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellInfo.h"
class AutoBalance_UnitScript : public UnitScript
{
public:
AutoBalance_UnitScript()
: UnitScript("AutoBalance_UnitScript", true, {
UNITHOOK_MODIFY_PERIODIC_DAMAGE_AURAS_TICK,
UNITHOOK_MODIFY_SPELL_DAMAGE_TAKEN,
UNITHOOK_MODIFY_MELEE_DAMAGE,
UNITHOOK_MODIFY_HEAL_RECEIVED,
UNITHOOK_ON_AURA_APPLY
})
{
}
void ModifyPeriodicDamageAurasTick(Unit* target, Unit* source, uint32& amount, SpellInfo const* spellInfo) override;
void ModifySpellDamageTaken(Unit* target, Unit* source, int32& amount, SpellInfo const* spellInfo) override;
void ModifyMeleeDamage(Unit* target, Unit* source, uint32& amount) override;
void ModifyHealReceived(Unit* target, Unit* source, uint32& amount, SpellInfo const* spellInfo) override;
void OnAuraApply(Unit* unit, Aura* aura) override;
private:
[[maybe_unused]] bool _debug_damage_and_healing = false; // defaults to false, overwritten in each function
void _Debug_Output(std::string function_name, Unit* target, Unit* source, int32 amount, Damage_Healing_Debug_Phase phase, std::string spell_name = "Unknown Spell", uint32 spell_id = 0);
int32 _Modify_Damage_Healing(Unit* target, Unit* source, int32 amount, SpellInfo const* spellInfo = nullptr);
uint32 _Modifier_CCDuration(Unit* target, Unit* caster, Aura* aura);
bool _isAuraWithEffectType(SpellInfo const* spellInfo, AuraType auraType, bool log = false);
};
#endif /* __AB_UNIT_SCRIPT_H */
File diff suppressed because it is too large Load Diff
+64
View File
@@ -0,0 +1,64 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_UTILS_H
#define __AB_UTILS_H
#include "ABInflectionPointSettings.h"
#include "ABLevelScalingDynamicLevelSettings.h"
#include "ABMapInfo.h"
#include "ABStatModifiers.h"
#include "AutoBalance.h"
#include "Creature.h"
#include "Map.h"
#include "SharedDefines.h"
#include <list>
#include <map>
#include <string>
void AddCreatureToMapCreatureList(Creature* creature, bool addToCreatureList = true, bool forceRecalculation = false);
void RemoveCreatureFromMapData(Creature* creature);
uint64_t GetCurrentConfigTime();
uint32 getBaseExpansionValueForLevel(const uint32 baseValues[3], uint8 targetLevel);
float getBaseExpansionValueForLevel(const float baseValues[3], uint8 targetLevel);
float getDefaultMultiplier(Map* map, AutoBalanceInflectionPointSettings inflectionPointSettings);
int GetForcedNumPlayers(int creatureId);
World_Multipliers getWorldMultiplier(Map* map, BaseValueType baseValueType);
AutoBalanceInflectionPointSettings getInflectionPointSettings(InstanceMap* instanceMap, bool isBoss = false);
void getStatModifiersDebug(Map* map, Creature* creature, std::string message);
AutoBalanceStatModifiers getStatModifiers(Map* map, Creature* creature = nullptr);
bool hasBossOverride(uint32 dungeonId);
bool hasDungeonOverride(uint32 dungeonId);
bool hasDynamicLevelOverride(uint32 dungeonId);
bool hasLevelScalingDistanceCheckOverride(uint32 dungeonId);
bool hasStatModifierBossOverride(uint32 dungeonId);
bool hasStatModifierCreatureOverride(uint32 creatureId);
bool hasStatModifierOverride(uint32 dungeonId);
bool isBossOrBossSummon(Creature* creature, bool log = false);
bool isCreatureRelevant(Creature* creature);
bool isDungeonInDisabledDungeonIds(uint32 dungeonId);
bool isDungeonInMinPlayerMap(uint32 dungeonId, bool isHeroic);
void LoadForcedCreatureIdsFromString(std::string creatureIds, int forcedPlayerCount);
std::list<uint32> LoadDisabledDungeons(std::string dungeonIdString);
std::map <uint32, uint32> LoadDistanceCheckOverrides(std::string dungeonIdString);
std::map <uint8 , AutoBalanceLevelScalingDynamicLevelSettings> LoadDynamicLevelOverrides(std::string dungeonIdString);
std::map <uint32, AutoBalanceInflectionPointSettings> LoadInflectionPointOverrides(std::string dungeonIdString);
void LoadMapSettings(Map* map);
std::map <uint32, uint8> LoadMinPlayersPerDungeonId(std::string minPlayersString);
std::map <uint32, AutoBalanceStatModifiers> LoadStatModifierOverrides(std::string dungeonIdString);
bool ShouldMapBeEnabled (Map* map);
void UpdateMapPlayerStats (Map* map);
void AddPlayerToMap(Map* map, Player* player);
bool RemovePlayerFromMap(Map* map, Player* player);
bool UpdateMapDataIfNeeded(Map* map, bool force = false);
AutoBalanceMapInfo* GetMapInfo(Map* map);
#endif
@@ -0,0 +1,509 @@
#include "ABWorldScript.h"
#include "ABConfig.h"
#include "ABUtils.h"
#include "Configuration/Config.h"
#include "Log.h"
void AutoBalance_WorldScript::OnBeforeConfigLoad(bool /*reload*/)
{
SetInitialWorldSettings();
globalConfigTime = GetCurrentConfigTime();
LOG_INFO("module.AutoBalance", "AutoBalance::OnBeforeConfigLoad: Config loaded. Global config time set to ({}).", globalConfigTime);
}
void AutoBalance_WorldScript::SetInitialWorldSettings()
{
forcedCreatureIds.clear();
disabledDungeonIds.clear();
dungeonOverrides.clear();
bossOverrides.clear();
statModifierOverrides.clear();
statModifierBossOverrides.clear();
statModifierCreatureOverrides.clear();
levelScalingDynamicLevelOverrides.clear();
levelScalingDistanceCheckOverrides.clear();
LoadForcedCreatureIdsFromString(sConfigMgr->GetOption<std::string>("AutoBalance.ForcedID40", ""), 40);
LoadForcedCreatureIdsFromString(sConfigMgr->GetOption<std::string>("AutoBalance.ForcedID25", ""), 25);
LoadForcedCreatureIdsFromString(sConfigMgr->GetOption<std::string>("AutoBalance.ForcedID10", ""), 10);
LoadForcedCreatureIdsFromString(sConfigMgr->GetOption<std::string>("AutoBalance.ForcedID5" , ""), 5);
LoadForcedCreatureIdsFromString(sConfigMgr->GetOption<std::string>("AutoBalance.ForcedID2" , ""), 2);
LoadForcedCreatureIdsFromString(sConfigMgr->GetOption<std::string>("AutoBalance.DisabledID", ""), 0);
//
// Disabled Dungeon IDs
//
disabledDungeonIds = LoadDisabledDungeons(sConfigMgr->GetOption<std::string>("AutoBalance.Disable.PerInstance", ""));
//
// Min Players
//
minPlayersNormal = sConfigMgr->GetOption<int>("AutoBalance.MinPlayers", 1);
minPlayersHeroic = sConfigMgr->GetOption<int>("AutoBalance.MinPlayers.Heroic", 1);
minPlayersRaid = sConfigMgr->GetOption<int>("AutoBalance.MinPlayers.Raid", minPlayersNormal);
minPlayersRaidHeroic = sConfigMgr->GetOption<int>("AutoBalance.MinPlayers.RaidHeroic", minPlayersHeroic);
if (sConfigMgr->GetOption<float>("AutoBalance.PerDungeonPlayerCounts", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.PerDungeonPlayerCounts` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
minPlayersPerDungeonIdMap = LoadMinPlayersPerDungeonId(
sConfigMgr->GetOption<std::string>("AutoBalance.MinPlayers.PerInstance",
sConfigMgr->GetOption<std::string>("AutoBalance.PerDungeonPlayerCounts", "", false), false)); // `AutoBalance.PerDungeonPlayerCounts` for backwards compatibility
minPlayersPerHeroicDungeonIdMap = LoadMinPlayersPerDungeonId(
sConfigMgr->GetOption<std::string>("AutoBalance.MinPlayers.Heroic.PerInstance",
sConfigMgr->GetOption<std::string>("AutoBalance.PerDungeonPlayerCounts", "", false), false)); // `AutoBalance.PerDungeonPlayerCounts` for backwards compatibility
//
// Overrides
//
if (sConfigMgr->GetOption<float>("AutoBalance.PerDungeonScaling", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.PerDungeonScaling` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
dungeonOverrides = LoadInflectionPointOverrides(
sConfigMgr->GetOption<std::string>("AutoBalance.InflectionPoint.PerInstance",
sConfigMgr->GetOption<std::string>("AutoBalance.PerDungeonScaling", "", false), false)); // `AutoBalance.PerDungeonScaling` for backwards compatibility
if (sConfigMgr->GetOption<float>("AutoBalance.PerDungeonBossScaling", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.PerDungeonBossScaling` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
bossOverrides = LoadInflectionPointOverrides(
sConfigMgr->GetOption<std::string>("AutoBalance.InflectionPoint.Boss.PerInstance",
sConfigMgr->GetOption<std::string>("AutoBalance.PerDungeonBossScaling", "", false), false)); // `AutoBalance.PerDungeonBossScaling` for backwards compatibility
statModifierOverrides = LoadStatModifierOverrides(
sConfigMgr->GetOption<std::string>("AutoBalance.StatModifier.PerInstance", "", false));
statModifierBossOverrides = LoadStatModifierOverrides(
sConfigMgr->GetOption<std::string>("AutoBalance.StatModifier.Boss.PerInstance", "", false));
statModifierCreatureOverrides = LoadStatModifierOverrides(
sConfigMgr->GetOption<std::string>("AutoBalance.StatModifier.PerCreature", "", false));
levelScalingDynamicLevelOverrides = LoadDynamicLevelOverrides(
sConfigMgr->GetOption<std::string>("AutoBalance.LevelScaling.DynamicLevel.PerInstance", "", false));
levelScalingDistanceCheckOverrides = LoadDistanceCheckOverrides(
sConfigMgr->GetOption<std::string>("AutoBalance.LevelScaling.DynamicLevel.DistanceCheck.PerInstance", "", false));
//
// AutoBalance.Enable.*
// Deprecated setting warning
//
if (sConfigMgr->GetOption<int>("AutoBalance.enable", -1, false) != -1)
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.enable` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
EnableGlobal = sConfigMgr->GetOption<bool>("AutoBalance.Enable.Global" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false)); // `AutoBalance.enable` for backwards compatibility
Enable5M = sConfigMgr->GetOption<bool>("AutoBalance.Enable.5M" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable10M = sConfigMgr->GetOption<bool>("AutoBalance.Enable.10M" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable15M = sConfigMgr->GetOption<bool>("AutoBalance.Enable.15M" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable20M = sConfigMgr->GetOption<bool>("AutoBalance.Enable.20M" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable25M = sConfigMgr->GetOption<bool>("AutoBalance.Enable.25M" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable40M = sConfigMgr->GetOption<bool>("AutoBalance.Enable.40M" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
EnableOtherNormal = sConfigMgr->GetOption<bool>("AutoBalance.Enable.OtherNormal", sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable5MHeroic = sConfigMgr->GetOption<bool>("AutoBalance.Enable.5MHeroic" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable10MHeroic = sConfigMgr->GetOption<bool>("AutoBalance.Enable.10MHeroic" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
Enable25MHeroic = sConfigMgr->GetOption<bool>("AutoBalance.Enable.25MHeroic" , sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
EnableOtherHeroic = sConfigMgr->GetOption<bool>("AutoBalance.Enable.OtherHeroic", sConfigMgr->GetOption<bool>("AutoBalance.enable", 1, false));
//
// Deprecated setting warning
//
if (sConfigMgr->GetOption<int>("AutoBalance.DungeonsOnly", -1, false) != -1)
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.DungeonsOnly` defined in `AutoBalance.conf`. This variable has been removed and has no effect. Please see `AutoBalance.conf.dist` for more details.");
if (sConfigMgr->GetOption<int>("AutoBalance.levelUseDbValuesWhenExists", -1, false) != -1)
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.levelUseDbValuesWhenExists` defined in `AutoBalance.conf`. This variable has been removed and has no effect. Please see `AutoBalance.conf.dist` for more details.");
//
// Misc Settings
// TODO: Organize and standardize variable names
//
PlayerChangeNotify = sConfigMgr->GetOption<bool> ("AutoBalance.PlayerChangeNotify", 1);
rewardEnabled = sConfigMgr->GetOption<bool> ("AutoBalance.reward.enable", 1);
PlayerCountDifficultyOffset = sConfigMgr->GetOption<uint32>("AutoBalance.playerCountDifficultyOffset", 0);
rewardRaid = sConfigMgr->GetOption<uint32>("AutoBalance.reward.raidToken", 49426);
rewardDungeon = sConfigMgr->GetOption<uint32>("AutoBalance.reward.dungeonToken", 47241);
MinPlayerReward = sConfigMgr->GetOption<float> ("AutoBalance.reward.MinPlayerReward", 1);
//
// InflectionPoint*
// warn the console if deprecated values are detected
//
if (sConfigMgr->GetOption<float>("AutoBalance.BossInflectionMult", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.BossInflectionMult` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
InflectionPoint = sConfigMgr->GetOption<float>("AutoBalance.InflectionPoint", 0.5f, false);
InflectionPointCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPoint.CurveFloor", 0.0f, false);
InflectionPointCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPoint.CurveCeiling", 1.0f, false);
InflectionPointBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPoint.BossModifier", sConfigMgr->GetOption<float>("AutoBalance.BossInflectionMult", 1.0f, false), false); // `AutoBalance.BossInflectionMult` for backwards compatibility
InflectionPointHeroic = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointHeroic", 0.5f, false);
InflectionPointHeroicCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointHeroic.CurveFloor", 0.0f, false);
InflectionPointHeroicCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointHeroic.CurveCeiling", 1.0f, false);
InflectionPointHeroicBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointHeroic.BossModifier", sConfigMgr->GetOption<float>("AutoBalance.BossInflectionMult", 1.0f, false), false); // `AutoBalance.BossInflectionMult` for backwards compatibility
InflectionPointRaid = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid", 0.5f, false);
InflectionPointRaidCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid.CurveFloor", 0.0f, false);
InflectionPointRaidCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid.CurveCeiling", 1.0f, false);
InflectionPointRaidBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid.BossModifier", sConfigMgr->GetOption<float>("AutoBalance.BossInflectionMult", 1.0f, false), false); // `AutoBalance.BossInflectionMult` for backwards compatibility
InflectionPointRaidHeroic = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaidHeroic", 0.5f, false);
InflectionPointRaidHeroicCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaidHeroic.CurveFloor", 0.0f, false);
InflectionPointRaidHeroicCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaidHeroic.CurveCeiling", 1.0f, false);
InflectionPointRaidHeroicBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaidHeroic.BossModifier", sConfigMgr->GetOption<float>("AutoBalance.BossInflectionMult", 1.0f, false), false); // `AutoBalance.BossInflectionMult` for backwards compatibility
InflectionPointRaid10M = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10M", InflectionPointRaid, false);
InflectionPointRaid10MCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10M.CurveFloor", InflectionPointRaidCurveFloor, false);
InflectionPointRaid10MCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10M.CurveCeiling", InflectionPointRaidCurveCeiling, false);
InflectionPointRaid10MBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10M.BossModifier", InflectionPointRaidBoss, false);
InflectionPointRaid10MHeroic = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10MHeroic", InflectionPointRaidHeroic, false);
InflectionPointRaid10MHeroicCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10MHeroic.CurveFloor", InflectionPointRaidHeroicCurveFloor, false);
InflectionPointRaid10MHeroicCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10MHeroic.CurveCeiling", InflectionPointRaidHeroicCurveCeiling, false);
InflectionPointRaid10MHeroicBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid10MHeroic.BossModifier", InflectionPointRaidHeroicBoss, false);
InflectionPointRaid15M = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid15M", InflectionPointRaid, false);
InflectionPointRaid15MCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid15M.CurveFloor", InflectionPointRaidCurveFloor, false);
InflectionPointRaid15MCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid15M.CurveCeiling", InflectionPointRaidCurveCeiling, false);
InflectionPointRaid15MBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid15M.BossModifier", InflectionPointRaidBoss, false);
InflectionPointRaid20M = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid20M", InflectionPointRaid, false);
InflectionPointRaid20MCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid20M.CurveFloor", InflectionPointRaidCurveFloor, false);
InflectionPointRaid20MCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid20M.CurveCeiling", InflectionPointRaidCurveCeiling, false);
InflectionPointRaid20MBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid20M.BossModifier", InflectionPointRaidBoss, false);
InflectionPointRaid25M = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25M", InflectionPointRaid, false);
InflectionPointRaid25MCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25M.CurveFloor", InflectionPointRaidCurveFloor, false);
InflectionPointRaid25MCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25M.CurveCeiling", InflectionPointRaidCurveCeiling, false);
InflectionPointRaid25MBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25M.BossModifier", InflectionPointRaidBoss, false);
InflectionPointRaid25MHeroic = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25MHeroic", InflectionPointRaidHeroic, false);
InflectionPointRaid25MHeroicCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25MHeroic.CurveFloor", InflectionPointRaidHeroicCurveFloor, false);
InflectionPointRaid25MHeroicCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25MHeroic.CurveCeiling", InflectionPointRaidHeroicCurveCeiling, false);
InflectionPointRaid25MHeroicBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid25MHeroic.BossModifier", InflectionPointRaidHeroicBoss, false);
InflectionPointRaid40M = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid40M", InflectionPointRaid, false);
InflectionPointRaid40MCurveFloor = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid40M.CurveFloor", InflectionPointRaidCurveFloor, false);
InflectionPointRaid40MCurveCeiling = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid40M.CurveCeiling", InflectionPointRaidCurveCeiling, false);
InflectionPointRaid40MBoss = sConfigMgr->GetOption<float>("AutoBalance.InflectionPointRaid40M.BossModifier", InflectionPointRaidBoss, false);
//
// StatModifier*
// warn the console if deprecated values are detected
//
if (sConfigMgr->GetOption<float>("AutoBalance.rate.global", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.rate.global` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
if (sConfigMgr->GetOption<float>("AutoBalance.rate.health", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.rate.health` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
if (sConfigMgr->GetOption<float>("AutoBalance.rate.mana", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.rate.mana` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
if (sConfigMgr->GetOption<float>("AutoBalance.rate.armor", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.rate.armor` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
if (sConfigMgr->GetOption<float>("AutoBalance.rate.damage", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.rate.damage` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
//
// 5-player dungeons
//
StatModifier_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifier_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifier_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifier_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifier_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifier_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.CCDuration", -1.0f, false);
StatModifier_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Boss.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifier_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Boss.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifier_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Boss.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifier_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Boss.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifier_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Boss.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifier_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifier.Boss.CCDuration", -1.0f, false);
//
// 5-player heroic dungeons
//
StatModifierHeroic_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifierHeroic_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifierHeroic_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifierHeroic_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifierHeroic_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifierHeroic_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.CCDuration", -1.0f, false);
StatModifierHeroic_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Boss.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifierHeroic_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Boss.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifierHeroic_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Boss.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifierHeroic_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Boss.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifierHeroic_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Boss.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifierHeroic_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierHeroic.Boss.CCDuration", -1.0f, false);
//
// Default for all raids
//
StatModifierRaid_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifierRaid_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifierRaid_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifierRaid_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifierRaid_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifierRaid_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.CCDuration", -1.0f, false);
StatModifierRaid_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Boss.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifierRaid_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Boss.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifierRaid_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Boss.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifierRaid_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Boss.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifierRaid_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Boss.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifierRaid_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid.Boss.CCDuration", -1.0f, false);
//
// Default for all heroic raids
//
StatModifierRaidHeroic_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifierRaidHeroic_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifierRaidHeroic_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifierRaidHeroic_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifierRaidHeroic_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifierRaidHeroic_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.CCDuration", -1.0f, false);
StatModifierRaidHeroic_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Boss.Global", sConfigMgr->GetOption<float>("AutoBalance.rate.global", 1.0f, false), false); // `AutoBalance.rate.global` for backwards compatibility
StatModifierRaidHeroic_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Boss.Health", sConfigMgr->GetOption<float>("AutoBalance.rate.health", 1.0f, false), false); // `AutoBalance.rate.health` for backwards compatibility
StatModifierRaidHeroic_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Boss.Mana", sConfigMgr->GetOption<float>("AutoBalance.rate.mana", 1.0f, false), false); // `AutoBalance.rate.mana` for backwards compatibility
StatModifierRaidHeroic_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Boss.Armor", sConfigMgr->GetOption<float>("AutoBalance.rate.armor", 1.0f, false), false); // `AutoBalance.rate.armor` for backwards compatibility
StatModifierRaidHeroic_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Boss.Damage", sConfigMgr->GetOption<float>("AutoBalance.rate.damage", 1.0f, false), false); // `AutoBalance.rate.damage` for backwards compatibility
StatModifierRaidHeroic_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaidHeroic.Boss.CCDuration", -1.0f, false);
//
// 10-player raids
//
StatModifierRaid10M_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Global", StatModifierRaid_Global, false);
StatModifierRaid10M_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Health", StatModifierRaid_Health, false);
StatModifierRaid10M_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Mana", StatModifierRaid_Mana, false);
StatModifierRaid10M_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Armor", StatModifierRaid_Armor, false);
StatModifierRaid10M_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Damage", StatModifierRaid_Damage, false);
StatModifierRaid10M_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.CCDuration", StatModifierRaid_CCDuration, false);
StatModifierRaid10M_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Boss.Global", StatModifierRaid_Boss_Global, false);
StatModifierRaid10M_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Boss.Health", StatModifierRaid_Boss_Health, false);
StatModifierRaid10M_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Boss.Mana", StatModifierRaid_Boss_Mana, false);
StatModifierRaid10M_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Boss.Armor", StatModifierRaid_Boss_Armor, false);
StatModifierRaid10M_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Boss.Damage", StatModifierRaid_Boss_Damage, false);
StatModifierRaid10M_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10M.Boss.CCDuration", StatModifierRaid_Boss_CCDuration, false);
//
// 10-player heroic raids
//
StatModifierRaid10MHeroic_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Global", StatModifierRaidHeroic_Global, false);
StatModifierRaid10MHeroic_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Health", StatModifierRaidHeroic_Health, false);
StatModifierRaid10MHeroic_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Mana", StatModifierRaidHeroic_Mana, false);
StatModifierRaid10MHeroic_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Armor", StatModifierRaidHeroic_Armor, false);
StatModifierRaid10MHeroic_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Damage", StatModifierRaidHeroic_Damage, false);
StatModifierRaid10MHeroic_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.CCDuration", StatModifierRaidHeroic_CCDuration, false);
StatModifierRaid10MHeroic_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Boss.Global", StatModifierRaidHeroic_Boss_Global, false);
StatModifierRaid10MHeroic_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Boss.Health", StatModifierRaidHeroic_Boss_Health, false);
StatModifierRaid10MHeroic_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Boss.Mana", StatModifierRaidHeroic_Boss_Mana, false);
StatModifierRaid10MHeroic_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Boss.Armor", StatModifierRaidHeroic_Boss_Armor, false);
StatModifierRaid10MHeroic_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Boss.Damage", StatModifierRaidHeroic_Boss_Damage, false);
StatModifierRaid10MHeroic_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid10MHeroic.Boss.CCDuration", StatModifierRaidHeroic_Boss_CCDuration, false);
//
// 15-player raids
//
StatModifierRaid15M_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Global", StatModifierRaid_Global, false);
StatModifierRaid15M_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Health", StatModifierRaid_Health, false);
StatModifierRaid15M_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Mana", StatModifierRaid_Mana, false);
StatModifierRaid15M_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Armor", StatModifierRaid_Armor, false);
StatModifierRaid15M_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Damage", StatModifierRaid_Damage, false);
StatModifierRaid15M_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.CCDuration", StatModifierRaid_CCDuration, false);
StatModifierRaid15M_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Boss.Global", StatModifierRaid_Boss_Global, false);
StatModifierRaid15M_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Boss.Health", StatModifierRaid_Boss_Health, false);
StatModifierRaid15M_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Boss.Mana", StatModifierRaid_Boss_Mana, false);
StatModifierRaid15M_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Boss.Armor", StatModifierRaid_Boss_Armor, false);
StatModifierRaid15M_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Boss.Damage", StatModifierRaid_Boss_Damage, false);
StatModifierRaid15M_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid15M.Boss.CCDuration", StatModifierRaid_Boss_CCDuration, false);
//
// 20-player raids
//
StatModifierRaid20M_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Global", StatModifierRaid_Global, false);
StatModifierRaid20M_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Health", StatModifierRaid_Health, false);
StatModifierRaid20M_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Mana", StatModifierRaid_Mana, false);
StatModifierRaid20M_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Armor", StatModifierRaid_Armor, false);
StatModifierRaid20M_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Damage", StatModifierRaid_Damage, false);
StatModifierRaid20M_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.CCDuration", StatModifierRaid_CCDuration, false);
StatModifierRaid20M_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Boss.Global", StatModifierRaid_Boss_Global, false);
StatModifierRaid20M_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Boss.Health", StatModifierRaid_Boss_Health, false);
StatModifierRaid20M_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Boss.Mana", StatModifierRaid_Boss_Mana, false);
StatModifierRaid20M_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Boss.Armor", StatModifierRaid_Boss_Armor, false);
StatModifierRaid20M_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Boss.Damage", StatModifierRaid_Boss_Damage, false);
StatModifierRaid20M_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid20M.Boss.CCDuration", StatModifierRaid_Boss_CCDuration, false);
//
// 25-player raids
//
StatModifierRaid25M_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Global", StatModifierRaid_Global, false);
StatModifierRaid25M_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Health", StatModifierRaid_Health, false);
StatModifierRaid25M_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Mana", StatModifierRaid_Mana, false);
StatModifierRaid25M_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Armor", StatModifierRaid_Armor, false);
StatModifierRaid25M_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Damage", StatModifierRaid_Damage, false);
StatModifierRaid25M_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.CCDuration", StatModifierRaid_CCDuration, false);
StatModifierRaid25M_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Boss.Global", StatModifierRaid_Boss_Global, false);
StatModifierRaid25M_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Boss.Health", StatModifierRaid_Boss_Health, false);
StatModifierRaid25M_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Boss.Mana", StatModifierRaid_Boss_Mana, false);
StatModifierRaid25M_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Boss.Armor", StatModifierRaid_Boss_Armor, false);
StatModifierRaid25M_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Boss.Damage", StatModifierRaid_Boss_Damage, false);
StatModifierRaid25M_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25M.Boss.CCDuration", StatModifierRaid_Boss_CCDuration, false);
//
// 25-player heroic raids
//
StatModifierRaid25MHeroic_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Global", StatModifierRaidHeroic_Global, false);
StatModifierRaid25MHeroic_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Health", StatModifierRaidHeroic_Health, false);
StatModifierRaid25MHeroic_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Mana", StatModifierRaidHeroic_Mana, false);
StatModifierRaid25MHeroic_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Armor", StatModifierRaidHeroic_Armor, false);
StatModifierRaid25MHeroic_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Damage", StatModifierRaidHeroic_Damage, false);
StatModifierRaid25MHeroic_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.CCDuration", StatModifierRaidHeroic_CCDuration, false);
StatModifierRaid25MHeroic_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Boss.Global", StatModifierRaidHeroic_Boss_Global, false);
StatModifierRaid25MHeroic_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Boss.Health", StatModifierRaidHeroic_Boss_Health, false);
StatModifierRaid25MHeroic_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Boss.Mana", StatModifierRaidHeroic_Boss_Mana, false);
StatModifierRaid25MHeroic_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Boss.Armor", StatModifierRaidHeroic_Boss_Armor, false);
StatModifierRaid25MHeroic_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Boss.Damage", StatModifierRaidHeroic_Boss_Damage, false);
StatModifierRaid25MHeroic_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid25MHeroic.Boss.CCDuration", StatModifierRaidHeroic_Boss_CCDuration, false);
//
// 40-player raids
//
StatModifierRaid40M_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Global", StatModifierRaid_Global, false);
StatModifierRaid40M_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Health", StatModifierRaid_Health, false);
StatModifierRaid40M_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Mana", StatModifierRaid_Mana, false);
StatModifierRaid40M_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Armor", StatModifierRaid_Armor, false);
StatModifierRaid40M_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Damage", StatModifierRaid_Damage, false);
StatModifierRaid40M_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.CCDuration", StatModifierRaid_CCDuration, false);
StatModifierRaid40M_Boss_Global = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Boss.Global", StatModifierRaid_Boss_Global, false);
StatModifierRaid40M_Boss_Health = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Boss.Health", StatModifierRaid_Boss_Health, false);
StatModifierRaid40M_Boss_Mana = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Boss.Mana", StatModifierRaid_Boss_Mana, false);
StatModifierRaid40M_Boss_Armor = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Boss.Armor", StatModifierRaid_Boss_Armor, false);
StatModifierRaid40M_Boss_Damage = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Boss.Damage", StatModifierRaid_Boss_Damage, false);
StatModifierRaid40M_Boss_CCDuration = sConfigMgr->GetOption<float>("AutoBalance.StatModifierRaid40M.Boss.CCDuration", StatModifierRaid_Boss_CCDuration, false);
//
// Modifier Min/Max
//
MinHPModifier = sConfigMgr->GetOption<float>("AutoBalance.MinHPModifier", 0.1f);
MinManaModifier = sConfigMgr->GetOption<float>("AutoBalance.MinManaModifier", 0.01f);
MinDamageModifier = sConfigMgr->GetOption<float>("AutoBalance.MinDamageModifier", 0.01f);
MinCCDurationModifier = sConfigMgr->GetOption<float>("AutoBalance.MinCCDurationModifier", 0.25f);
MaxCCDurationModifier = sConfigMgr->GetOption<float>("AutoBalance.MaxCCDurationModifier", 1.0f);
//
// LevelScaling.*
//
LevelScaling = sConfigMgr->GetOption<bool>("AutoBalance.LevelScaling", true);
std::string LevelScalingMethodString = sConfigMgr->GetOption<std::string>("AutoBalance.LevelScaling.Method", "dynamic", false);
if (LevelScalingMethodString == "fixed")
LevelScalingMethod = AUTOBALANCE_SCALING_FIXED;
else if (LevelScalingMethodString == "dynamic")
LevelScalingMethod = AUTOBALANCE_SCALING_DYNAMIC;
else
{
LOG_ERROR("server.loading", "mod-autobalance: invalid value `{}` for `AutoBalance.LevelScaling.Method` defined in `AutoBalance.conf`. Defaulting to a value of `dynamic`.", LevelScalingMethodString);
LevelScalingMethod = AUTOBALANCE_SCALING_DYNAMIC;
}
if (sConfigMgr->GetOption<float>("AutoBalance.LevelHigherOffset", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.LevelHigherOffset` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
LevelScalingSkipHigherLevels = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.SkipHigherLevels", sConfigMgr->GetOption<uint32>("AutoBalance.LevelHigherOffset", 3, false), true);
if (sConfigMgr->GetOption<float>("AutoBalance.LevelLowerOffset", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.LevelLowerOffset` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
LevelScalingSkipLowerLevels = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.SkipLowerLevels", sConfigMgr->GetOption<uint32>("AutoBalance.LevelLowerOffset", 5, false), true);
LevelScalingDynamicLevelCeilingDungeons = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Ceiling.Dungeons", 1);
LevelScalingDynamicLevelFloorDungeons = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Floor.Dungeons", 5);
LevelScalingDynamicLevelCeilingHeroicDungeons = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Ceiling.HeroicDungeons", 2);
LevelScalingDynamicLevelFloorHeroicDungeons = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Floor.HeroicDungeons", 5);
LevelScalingDynamicLevelCeilingRaids = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Ceiling.Raids", 3);
LevelScalingDynamicLevelFloorRaids = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Floor.Raids", 5);
LevelScalingDynamicLevelCeilingHeroicRaids = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Ceiling.HeroicRaids", 3);
LevelScalingDynamicLevelFloorHeroicRaids = sConfigMgr->GetOption<uint8>("AutoBalance.LevelScaling.DynamicLevel.Floor.HeroicRaids", 5);
if (sConfigMgr->GetOption<float>("AutoBalance.LevelEndGameBoost", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.LevelEndGameBoost` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
LevelScalingEndGameBoost = sConfigMgr->GetOption<bool>("AutoBalance.LevelScaling.EndGameBoost", sConfigMgr->GetOption<bool>("AutoBalance.LevelEndGameBoost", 1, false), true);
if (LevelScalingEndGameBoost)
{
LOG_WARN("server.loading", "mod-autobalance: `AutoBalance.LevelScaling.EndGameBoost` is enabled in the configuration, but is not currently implemented. No effect.");
LevelScalingEndGameBoost = 0;
}
//
// RewardScaling.*
// warn the console if deprecated values are detected
//
if (sConfigMgr->GetOption<float>("AutoBalance.DungeonScaleDownXP", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.DungeonScaleDownXP` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
if (sConfigMgr->GetOption<float>("AutoBalance.DungeonScaleDownMoney", false, false))
LOG_WARN("server.loading", "mod-autobalance: deprecated value `AutoBalance.DungeonScaleDownMoney` defined in `AutoBalance.conf`. This variable will be removed in a future release. Please see `AutoBalance.conf.dist` for more details.");
std::string RewardScalingMethodString = sConfigMgr->GetOption<std::string>("AutoBalance.RewardScaling.Method", "dynamic", false);
if (RewardScalingMethodString == "fixed")
RewardScalingMethod = AUTOBALANCE_SCALING_FIXED;
else if (RewardScalingMethodString == "dynamic")
RewardScalingMethod = AUTOBALANCE_SCALING_DYNAMIC;
else
{
LOG_ERROR("server.loading", "mod-autobalance: invalid value `{}` for `AutoBalance.RewardScaling.Method` defined in `AutoBalance.conf`. Defaulting to a value of `dynamic`.", RewardScalingMethodString);
RewardScalingMethod = AUTOBALANCE_SCALING_DYNAMIC;
}
RewardScalingXP = sConfigMgr->GetOption<bool>("AutoBalance.RewardScaling.XP", sConfigMgr->GetOption<bool>("AutoBalance.DungeonScaleDownXP", true, false));
RewardScalingXPModifier = sConfigMgr->GetOption<float>("AutoBalance.RewardScaling.XP.Modifier", 1.0f, false);
RewardScalingMoney = sConfigMgr->GetOption<bool>("AutoBalance.RewardScaling.Money", sConfigMgr->GetOption<bool>("AutoBalance.DungeonScaleDownMoney", true, false));
RewardScalingMoneyModifier = sConfigMgr->GetOption<float>("AutoBalance.RewardScaling.Money.Modifier", 1.0f, false);
//
// Announcement
//
Announcement = sConfigMgr->GetOption<bool>("AutoBalanceAnnounce.enable", true);
}
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE
*/
#ifndef __AB_WORLD_SCRIPT_H
#define __AB_WORLD_SCRIPT_H
#include "WorldScript.h"
class AutoBalance_WorldScript : public WorldScript
{
public:
AutoBalance_WorldScript()
: WorldScript("AutoBalance_WorldScript", {
WORLDHOOK_ON_BEFORE_CONFIG_LOAD
})
{
}
void OnBeforeConfigLoad(bool /*reload*/) override;
void SetInitialWorldSettings();
};
#endif
@@ -0,0 +1,6 @@
void AddAutoBalanceScripts();
void Addmod_autobalanceScripts()
{
AddAutoBalanceScripts();
}
@@ -0,0 +1,85 @@
/*
* Copyright (C) 2018 AzerothCore <http://www.azerothcore.org>
* Copyright (C) 2012 CVMagic <http://www.trinitycore.org/f/topic/6551-vas-autobalance/>
* Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* Copyright (C) 1985-2010 KalCorp <http://vasserver.dyndns.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Script Name: AutoBalance
* Original Authors: KalCorp and Vaughner
* Maintainer(s): AzerothCore
* Original Script Name: AutoBalance
* Description: This script is intended to scale based on number of players,
* instance mobs & world bosses' level, health, mana, and damage.
*/
#include "AutoBalance.h"
#include "ABAllCreatureScript.h"
#include "ABAllMapScript.h"
#include "ABCommandScript.h"
#include "ABConfig.h"
#include "ABCreatureInfo.h"
#include "ABGameObjectScript.h"
#include "ABGlobalScript.h"
#include "ABInflectionPointSettings.h"
#include "ABLevelScalingDynamicLevelSettings.h"
#include "ABMapInfo.h"
#include "ABModuleScript.h"
#include "ABPlayerScript.h"
#include "ABScriptMgr.h"
#include "ABStatModifiers.h"
#include "ABUnitScript.h"
#include "ABUtils.h"
#include "ABWorldScript.h"
#include "Configuration/Config.h"
#include "Chat.h"
#include "Creature.h"
#include "Group.h"
#include "Language.h"
#include "Log.h"
#include "Map.h"
#include "MapMgr.h"
#include "Message.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptMgrMacros.h"
#include "SharedDefines.h"
#include "Unit.h"
#include "World.h"
#include <chrono>
#include <vector>
#if AC_COMPILER == AC_COMPILER_GNU
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
void AddAutoBalanceScripts()
{
new AutoBalance_WorldScript();
new AutoBalance_PlayerScript();
new AutoBalance_UnitScript();
new AutoBalance_GameObjectScript();
new AutoBalance_AllCreatureScript();
new AutoBalance_AllMapScript();
new AutoBalance_CommandScript();
new AutoBalance_GlobalScript();
}
+35
View File
@@ -0,0 +1,35 @@
#ifndef MOD_AUTOBALANCE_H
#define MOD_AUTOBALANCE_H
enum ScalingMethod
{
AUTOBALANCE_SCALING_FIXED,
AUTOBALANCE_SCALING_DYNAMIC
};
enum BaseValueType
{
AUTOBALANCE_HEALTH,
AUTOBALANCE_DAMAGE_HEALING
};
enum Relevance
{
AUTOBALANCE_RELEVANCE_FALSE,
AUTOBALANCE_RELEVANCE_TRUE,
AUTOBALANCE_RELEVANCE_UNCHECKED
};
enum Damage_Healing_Debug_Phase
{
AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_BEFORE,
AUTOBALANCE_DAMAGE_HEALING_DEBUG_PHASE_AFTER
};
struct World_Multipliers
{
float scaled = 1.0f;
float unscaled = 1.0f;
};
#endif
+569
View File
@@ -0,0 +1,569 @@
#include "Message.h"
#include "DatabaseEnv.h"
#include "ItemTemplate.h"
#include <iostream>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
const std::unordered_map<LocaleConstant, std::string> AB_WELCOME_TO_PLAYER = {
{LOCALE_enUS, "|cffc3dbff [AutoBalance]|r|cffFF8000 Welcome to {} ({}-player {}). There are {} player(s) in this instance. Difficulty set to {} player(s).|r"},
{LOCALE_koKR, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} ({}-player {})에 오신 것을 환영합니다. 이 인스턴스에는 {}명의 플레이어가 있습니다. 난이도가 {}명으로 설정되었습니다.|r"},
{LOCALE_frFR, "|cffc3dbff [AutoBalance]|r|cffFF8000 Bienvenue dans {} ({} {}). Il y a {} joueur(s) dans cette instance. La difficulté est réglée sur {} joueur(s).|r"},
{LOCALE_deDE, "|cffc3dbff [AutoBalance]|r|cffFF8000 Willkommen in {} ({} Spieler {}). Es gibt {} Spieler in dieser Instanz. Schwierigkeit auf {} Spieler eingestellt.|r"},
{LOCALE_zhCN, "|cffc3dbff [AutoBalance]|r|cffFF8000 欢迎来到 {}{}人 {})。此副本中有 {} 名玩家。难度设置为 {} 名玩家。|r"},
{LOCALE_zhTW, "|cffc3dbff [AutoBalance]|r|cffFF8000 歡迎來到 {}{}人 {})。此副本中有 {} 名玩家。難度設定為 {} 名玩家。|r"},
{LOCALE_esES, "|cffc3dbff [AutoBalance]|r|cffFF8000 Bienvenido a {} ({} jugador {}). Hay {} jugador(es) en esta instancia. La dificultad se establece en {} jugador(es).|r"},
{LOCALE_esMX, "|cffc3dbff [AutoBalance]|r|cffFF8000 Bienvenido a {} ({} jugador {}). Hay {} jugador(es) en esta instancia. La dificultad se establece en {} jugador(es).|r"},
{LOCALE_ruRU, "|cffc3dbff [AutoBalance]|r|cffFF8000 Добро пожаловать в {} ({} игрок {}). В этом экземпляре {} игроков. Сложность установлена на {} игроков.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_WELCOME_TO_GM = {
{LOCALE_enUS, "|cffc3dbff [AutoBalance]|r|cffFF8000 Your GM flag is turned on. AutoBalance will ignore you. Please turn GM off and exit/re-enter the instance if you'd like to be considering for AutoBalancing.|r"},
{LOCALE_koKR, "|cffc3dbff [AutoBalance]|r|cffFF8000 GM 플래그가 켜져 있습니다. AutoBalance는 당신을 무시합니다. AutoBalancing을 고려하려면 GM을 끄고 인스턴스를 나가고 다시 들어가십시오.|r"},
{LOCALE_frFR, "|cffc3dbff [AutoBalance]|r|cffFF8000 Votre drapeau GM est activé. AutoBalance vous ignorera. Veuillez désactiver GM et sortir/revenir dans l'instance si vous souhaitez être pris en compte pour l'AutoBalancing.|r"},
{LOCALE_deDE, "|cffc3dbff [AutoBalance]|r|cffFF8000 Ihre GM-Flagge ist eingeschaltet. AutoBalance wird Sie ignorieren. Bitte schalten Sie GM aus und verlassen Sie das Instanz, wenn Sie für das AutoBalancing berücksichtigt werden möchten.|r"},
{LOCALE_zhCN, "|cffc3dbff [AutoBalance]|r|cffFF8000 您的GM模式已打开。AutoBalance将忽略。如果您希望考虑自动平衡,请关闭GM并退出/重新进入副本。|r"},
{LOCALE_zhTW, "|cffc3dbff [AutoBalance]|r|cffFF8000 您的GM模式已打開。AutoBalance將忽略。如果您希望考慮自動平衡,請關閉GM並退出/重新進入副本。|r"},
{LOCALE_esES, "|cffc3dbff [AutoBalance]|r|cffFF8000 Su bandera de GM está encendida. AutoBalance te ignorará. Por favor, apague GM y salga/vuelva a entrar en la instancia si desea ser considerado para el AutoBalance.|r"},
{LOCALE_esMX, "|cffc3dbff [AutoBalance]|r|cffFF8000 Su bandera de GM está encendida. AutoBalance te ignorará. Por favor, apague GM y salga/vuelva a entrar en la instancia si desea ser considerado para el AutoBalance.|r"},
{LOCALE_ruRU, "|cffc3dbff [AutoBalance]|r|cffFF8000 Ваш флаг GM включен. AutoBalance будет игнорировать вас. Пожалуйста, отключите GM и выйдите/войдите в экземпляр, если хотите, чтобы вас учитывали при автобалансировке.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ANNOUNCE_NON_GM_ENTERING_INSTANCE = {
{LOCALE_enUS, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} enters the instance. There are {} player(s) in this instance. Difficulty set to {} player(s).|r"},
{LOCALE_koKR, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}이(가) 인스턴스에 들어왔습니다. 이 인스턴스에는 {}명의 플레이어가 있습니다. 난이도가 {}명으로 설정되었습니다.|r"},
{LOCALE_frFR, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} entre dans l'instance. Il y a {} joueur(s) dans cette instance. La difficulté est réglée sur {} joueur(s).|r"},
{LOCALE_deDE, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} betritt die Instanz. Es gibt {} Spieler in dieser Instanz. Schwierigkeit auf {} Spieler eingestellt.|r"},
{LOCALE_zhCN, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}进入了副本。此副本中有 {} 名玩家。难度设置为 {} 名玩家。|r"},
{LOCALE_zhTW, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}進入了副本。此副本中有 {} 名玩家。難度設定為 {} 名玩家。|r"},
{LOCALE_esES, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} entra en la instancia. Hay {} jugador(es) en esta instancia. La dificultad se establece en {} jugador(es).|r"},
{LOCALE_esMX, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} entra en la instancia. Hay {} jugador(es) en esta instancia. La dificultad se establece en {} jugador(es).|r"},
{LOCALE_ruRU, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} входит в экземпляр. В этом экземпляре {} игроков. Сложность установлена на {} игроков.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_LEAVING_INSTANCE_COMBAT = {
{LOCALE_enUS, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} left the instance while combat was in progress. Difficulty locked to no less than {} players until combat ends.|r"},
{LOCALE_koKR, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}이(가) 전투 중에 인스턴스를 떠났습니다. 전투가 끝날 때까지 난이도가 {}명 미만으로 잠겨 있습니다.|r"},
{LOCALE_frFR, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} a quitté l'instance alors que le combat était en cours. La difficulté est verrouillée à pas moins de {} joueur(s) jusqu'à la fin du combat.|r"},
{LOCALE_deDE, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} hat die Instanz verlassen, während der Kampf im Gange war. Die Schwierigkeit ist gesperrt, bis der Kampf endet, auf nicht weniger als {} Spieler.|r"},
{LOCALE_zhCN, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}在战斗进行中离开了副本。直到战斗结束,难度锁定为不少于 {} 名玩家。|r"},
{LOCALE_zhTW, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}在戰鬥進行中離開了副本。直到戰鬥結束,難度鎖定為不少於 {} 名玩家。|r"},
{LOCALE_esES, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} salió de la instancia mientras el combate estaba en progreso. La dificultad está bloqueada a no menos de {} jugador(es) hasta que termine el combate.|r"}
};
const std::unordered_map<LocaleConstant, std::string> AB_LEAVING_INSTANCE = {
{LOCALE_enUS, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} left the instance. There are {} player(s) in this instance. Difficulty set to {} player(s).|r"},
{LOCALE_koKR, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}이(가) 인스턴스를 떠났습니다. 이 인스턴스에는 {}명의 플레이어가 있습니다. 난이도가 {}명으로 설정되었습니다.|r"},
{LOCALE_frFR, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} a quitté l'instance. Il y a {} joueur(s) dans cette instance. La difficulté est réglée sur {} joueur(s).|r"},
{LOCALE_deDE, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} hat die Instanz verlassen. Es gibt {} Spieler in dieser Instanz. Schwierigkeit auf {} Spieler eingestellt.|r"},
{LOCALE_zhCN, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}离开了副本。此副本中有 {} 名玩家。难度设置为 {} 名玩家。|r"},
{LOCALE_zhTW, "|cffc3dbff [AutoBalance]|r|cffFF8000 {}離開了副本。此副本中有 {} 名玩家。難度設定為 {} 名玩家。|r"},
{LOCALE_esES, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} salió de la instancia. Hay {} jugador(es) en esta instancia. La dificultad se establece en {} jugador(es).|r"},
{LOCALE_esMX, "|cffc3dbff [AutoBalance]|r|cffFF8000 {} salió de la instancia. Hay {} jugador(es) en esta instancia. La dificultad se establece en {}"}
};
const std::unordered_map<LocaleConstant, std::string> AB_SET_OFFSET_COMMAND_DESCRIPTION = {
{LOCALE_enUS, "Set the player difficulty offset for this instance. Usage: .ab offset <number>.|r"},
{LOCALE_koKR, "이 인스턴스의 플레이어 난이도 오프셋을 설정합니다. 사용법: .ab offset <숫자>.|r"},
{LOCALE_frFR, "Définissez le décalage de difficulté du joueur pour cette instance. Utilisation : .ab offset <nombre>.|r"},
{LOCALE_deDE, "Legen Sie den Spieler-Schwierigkeits-Offset für diese Instanz fest. Verwendung: .ab offset <Nummer>.|r"},
{LOCALE_zhCN, "设置此副本的玩家难度。用法:.ab offset <数字>。|r"},
{LOCALE_zhTW, "設定此副本的玩家難度。用法:.ab offset <數字>。|r"},
{LOCALE_esES, "Establece el desplazamiento de dificultad del jugador para esta instancia. Uso: .ab offset <número>.|r"},
{LOCALE_esMX, "Establece el desplazamiento de dificultad del jugador para esta instancia. Uso: .ab offset <número>.|r"},
{LOCALE_ruRU, "Устанавливает смещение сложности игрока для этого экземп"}
};
const std::unordered_map<LocaleConstant, std::string> AB_SET_OFFSET_COMMAND_SUCCESS = {
{LOCALE_enUS, "Changing Player Difficulty Offset to {}.|r"},
{LOCALE_koKR, "플레이어 난이도 오프셋을 {}(으)로 변경합니다.|r"},
{LOCALE_frFR, "Modification du décalage de difficulté du joueur à {}.|r"},
{LOCALE_deDE, "Spieler-Schwierigkeits-Offset auf {} ändern.|r"},
{LOCALE_zhCN, "将玩家难度更改为 {}。|r"},
{LOCALE_zhTW, "將玩家難度更改為 {}。|r"},
{LOCALE_esES, "Cambiando el desplazamiento de dificultad del jugador a {}.|r"},
{LOCALE_esMX, "Cambiando el desplazamiento de dificultad del jugador a {}.|r"},
{LOCALE_ruRU, "Изменение смещения сложности игрока на {}.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_SET_OFFSET_COMMAND_ERROR = {
{LOCALE_enUS, "Error changing Player Difficulty Offset! Please try again.|r"},
{LOCALE_koKR, "플레이어 난이도 오프셋 변경 중 오류가 발생했습니다! 다시 시도하십시오.|r"},
{LOCALE_frFR, "Erreur lors de la modification du décalage de difficulté du joueur ! Veuillez réessayer.|r"},
{LOCALE_deDE, "Fehler beim Ändern des Spieler-Schwierigkeits-Offsets! Bitte versuchen Sie es erneut.|r"},
{LOCALE_zhCN, "更改玩家难度时出错!请重试。|r"},
{LOCALE_zhTW, "更改玩家難度時出錯!請重試。|r"},
{LOCALE_esES, "¡Error al cambiar el desplazamiento de dificultad del jugador! Por favor, inténtelo de nuevo.|r"},
{LOCALE_esMX, "¡Error al cambiar el desplazamiento de dificultad del jugador! Por favor, inténtelo de nuevo.|r"},
{LOCALE_ruRU, "Ошибка при изменении смещения сложности игрока! Пожалуйста, попробуйте еще раз.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_GET_OFFSET_COMMAND_SUCCESS = {
{LOCALE_enUS, "Current Player Difficulty Offset = {}.|r"},
{LOCALE_koKR, "현재 플레이어 난이도 오프셋 = {}.|r"},
{LOCALE_frFR, "Décalage de difficulté actuel du joueur = {}.|r"},
{LOCALE_deDE, "Aktueller Spieler-Schwierigkeits-Offset = {}.|r"},
{LOCALE_zhCN, "当前玩家难度偏移 = {}。|r"},
{LOCALE_zhTW, "當前玩家難度偏移 = {}。|r"},
{LOCALE_esES, "Desplazamiento de dificultad actual del jugador = {}.|r"},
{LOCALE_esMX, "Desplazamiento de dificultad actual del jugador = {}.|r"},
{LOCALE_ruRU, "Текущее смещение сложности игрока = {}.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ADJUSTED_PLAYER_COUNT_COMBAT_LOCKED = {
{LOCALE_enUS, "Adjusted Player Count: {} (Combat Locked)|r"},
{LOCALE_koKR, "조정된 플레이어 수: {} (전투 잠금됨)|r"},
{LOCALE_frFR, "Nombre de joueurs ajusté : {} (verrouillé en combat)|r"},
{LOCALE_deDE, "Angepasste Spieleranzahl: {} (Kampf gesperrt)|r"},
{LOCALE_zhCN, "调整后的玩家数量:{}(战斗锁定)|r"},
{LOCALE_zhTW, "調整後的玩家數量:{}(戰鬥鎖定)|r"},
{LOCALE_esES, "Cantidad de jugadores ajustada: {} (bloqueada en combate)|r"},
{LOCALE_esMX, "Cantidad de jugadores ajustada: {} (bloqueada en combate)|r"},
{LOCALE_ruRU, "Количество игроков, отрегулированное: {} (заблокировано в бою)|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ADJUSTED_PLAYER_COUNT_MAP_MINIMUM = {
{LOCALE_enUS, "Adjusted Player Count: {} (Map Minimum)|r"},
{LOCALE_koKR, "조정된 플레이어 수: {} (지도 최소)|r"},
{LOCALE_frFR, "Nombre de joueurs ajusté : {} (minimum de la carte)|r"},
{LOCALE_deDE, "Angepasste Spieleranzahl: {} (Kartenminimum)|r"},
{LOCALE_zhCN, "调整后的玩家数量:{}(地图最小)|r"},
{LOCALE_zhTW, "調整後的玩家數量:{}(地圖最小)|r"},
{LOCALE_esES, "Cantidad de jugadores ajustada: {} (mínimo del mapa)|r"},
{LOCALE_esMX, "Cantidad de jugadores ajustada: {} (mínimo del mapa)|r"},
{LOCALE_ruRU, "Количество игроков, отрегулированное: {} (минимальное для карты)|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ADJUSTED_PLAYER_COUNT_MAP_MINIMUM_DIFFICULTY_OFFSET = {
{LOCALE_enUS, "Adjusted Player Count: {} (Map Minimum + Difficulty Offset of {})|r"},
{LOCALE_koKR, "조정된 플레이어 수: {} (지도 최소 + {}의 난이도 오프셋)|r"},
{LOCALE_frFR, "Nombre de joueurs ajusté : {} (minimum de la carte + décalage de difficulté de {})|r"},
{LOCALE_deDE, "Angepasste Spieleranzahl: {} (Kartenminimum + Schwierigkeits-Offset von {})|r"},
{LOCALE_zhCN, "调整后的玩家数量:{}(地图最小 + {}的难度修正)|r"},
{LOCALE_zhTW, "調整後的玩家數量:{}(地圖最小 + {}的難度修正)|r"},
{LOCALE_esES, "Cantidad de jugadores ajustada: {} (mínimo del mapa + desplazamiento de dificultad de {})|r"},
{LOCALE_esMX, "Cantidad de jugadores ajustada: {} (mínimo del mapa + desplazamiento de dificultad de {})|r"},
{LOCALE_ruRU, "Количество игроков, отрегулированное: {} (минимальное для карты"}
};
const std::unordered_map<LocaleConstant, std::string> AB_ADJUSTED_PLAYER_COUNT_DIFFICULTY_OFFSET = {
{LOCALE_enUS, "Adjusted Player Count: {} (Difficulty Offset of {})|r"},
{LOCALE_koKR, "조정된 플레이어 수: {} ({}의 난이도 오프셋)|r"},
{LOCALE_frFR, "Nombre de joueurs ajusté : {} (décalage de difficulté de {})|r"},
{LOCALE_deDE, "Angepasste Spieleranzahl: {} (Schwierigkeits-Offset von {})|r"},
{LOCALE_zhCN, "调整后的玩家数量:{}({}的难度修正)|r"},
{LOCALE_zhTW, "調整後的玩家數量:{}({}的難度修正)|r"},
{LOCALE_esES, "Cantidad de jugadores ajustada: {} (desplazamiento de dificultad de {})|r"},
{LOCALE_esMX, "Cantidad de jugadores ajustada: {} (desplazamiento de dificultad de {})|r"},
{LOCALE_ruRU, "Количество игроков, отрегулированное: {} (смещение сложности {})|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ADJUSTED_PLAYER_COUNT = {
{LOCALE_enUS, "Adjusted Player Count: {}|r"},
{LOCALE_koKR, "조정된 플레이어 수: {}|r"},
{LOCALE_frFR, "Nombre de joueurs ajusté : {}|r"},
{LOCALE_deDE, "Angepasste Spieleranzahl: {}|r"},
{LOCALE_zhCN, "调整后的玩家数量:{}|r"},
{LOCALE_zhTW, "調整後的玩家數量:{}|r"},
{LOCALE_esES, "Cantidad de jugadores ajustada: {}|r"},
{LOCALE_esMX, "Cantidad de jugadores ajustada: {}|r"},
{LOCALE_ruRU, "Количество игроков, отрегулированное: {}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_LFG_RANGE = {
{LOCALE_enUS, "LFG Range: Lvl {} - {} (Target: Lvl {})|r"},
{LOCALE_koKR, "LFG 범위: 레벨 {} - {} (대상: 레벨 {})|r"},
{LOCALE_frFR, "Plage LFG : Niveau {} - {} (Cible : Niveau {})|r"},
{LOCALE_deDE, "LFG-Bereich: Stufe {} - {} (Ziel: Stufe {})|r"},
{LOCALE_zhCN, "LFG范围:等级 {} - {}(目标:等级 {})|r"},
{LOCALE_zhTW, "LFG範圍:等級 {} - {}(目標:等級 {})|r"},
{LOCALE_esES, "Rango de LFG: Nivel {} - {} (Objetivo: Nivel {})|r"},
{LOCALE_esMX, "Rango de LFG: Nivel {} - {} (Objetivo: Nivel {})|r"},
{LOCALE_ruRU, "Диапазон поиска группы: Ур. {} - {} (Цель: Ур. {})|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_MAP_LEVEL = {
{LOCALE_enUS, "Map Level: {}{}|r"},
{LOCALE_koKR, "지도 레벨: {}{}|r"},
{LOCALE_frFR, "Niveau de la carte : {}{}|r"},
{LOCALE_deDE, "Kartenlevel: {}{}|r"},
{LOCALE_zhCN, "地图等级:{}{}|r"},
{LOCALE_zhTW, "地圖等級:{}{}|r"},
{LOCALE_esES, "Nivel del mapa: {}{}|r"},
{LOCALE_esMX, "Nivel del mapa: {}{}|r"},
{LOCALE_ruRU, "Уровень карты: {}{}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_LEVEL_SCALING_ENABLED = {
{LOCALE_enUS, " (Level Scaling Enabled)|r"},
{LOCALE_koKR, " (레벨 스케일링 활성화됨)|r"},
{LOCALE_frFR, " (Mise à l'échelle des niveaux activée)|r"},
{LOCALE_deDE, " (Stufenanpassung aktiviert)|r"},
{LOCALE_zhCN, " (启用等级自动平衡)|r"},
{LOCALE_zhTW, " (啟用等級縮放平衡)|r"},
{LOCALE_esES, " (Escalado de nivel activado)|r"},
{LOCALE_esMX, " (Escalado de nivel activado)|r"},
{LOCALE_ruRU, " (Масштабирование уровней включено)|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_LEVEL_SCALING_DISABLED = {
{LOCALE_enUS, " (Level Scaling Disabled)|r"},
{LOCALE_koKR, " (레벨 스케일링 비활성화됨)|r"},
{LOCALE_frFR, " (Mise à l'échelle des niveaux désactivée)|r"},
{LOCALE_deDE, " (Stufenanpassung deaktiviert)|r"},
{LOCALE_zhCN, " (禁用等级自动平衡)|r"},
{LOCALE_zhTW, " (停用等級縮放平衡)|r"},
{LOCALE_esES, " (Escalado de nivel desactivado)|r"},
{LOCALE_esMX, " (Escalado de nivel desactivado)|r"},
{LOCALE_ruRU, " (Масштабирование уровней отключено)|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_WORLD_HEALTH_MULTIPLIER = {
{LOCALE_enUS, "World health multiplier: {:.3f}|r"},
{LOCALE_koKR, "월드 체력 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de santé mondiale : {:.3f}|r"},
{LOCALE_deDE, "Weltgesundheitsmultiplikator: {:.3f}|r"},
{LOCALE_zhCN, "全局生命值倍率:{:.3f}|r"},
{LOCALE_zhTW, "全局生命值倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de salud mundial: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de salud mundial: {:.3f}|r"},
{LOCALE_ruRU, "Множитель здоровья мира: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_WORLD_HOSTILE_DAMAGE_HEALING_MULTIPLIER_TO = {
{LOCALE_enUS, "World hostile damage and healing multiplier: {:.3f} -> {:.3f}|r"},
{LOCALE_koKR, "월드 적 대미지 및 치유 배율: {:.3f} -> {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de dégâts et de soins hostiles mondiaux : {:.3f} -> {:.3f}|r"},
{LOCALE_deDE, "Weltweiter feindlicher Schadens- und Heilungs-Multiplikator: {:.3f} -> {:.3f}|r"},
{LOCALE_zhCN, "全局伤害和治疗倍率:{:.3f} -> {:.3f}|r"},
{LOCALE_zhTW, "全局敵對傷害和治療倍增器:{:.3f} -> {:.3f}|r"},
{LOCALE_esES, "Multiplicador de daño y curación hostil mundial: {:.3f} -> {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de daño y curación hostil mundial: {:.3f} -> {:.3f}|r"},
{LOCALE_ruRU, "Множитель урона и лечения мира: {:.3f} -> {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_WORLD_HOSTILE_DAMAGE_HEALING_MULTIPLIER = {
{LOCALE_enUS, "World hostile damage and healing multiplier: {:.3f}|r"},
{LOCALE_koKR, "월드 적 대미지 및 치유 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de dégâts et de soins hostiles mondiaux : {:.3f}|r"},
{LOCALE_deDE, "Weltweiter feindlicher Schadens- und Heilungs-Multiplikator: {:.3f}|r"},
{LOCALE_zhCN, "全局伤害和治疗倍率:{:.3f}|r"},
{LOCALE_zhTW, "全局敵對傷害和治療倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de daño y curación hostil mundial: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de daño y curación hostil mundial: {:.3f}|r"},
{LOCALE_ruRU, "Множитель урона и лечения мира: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ORIGINAL_CREATURE_LEVEL_RANGE = {
{LOCALE_enUS, "Original Creature Level Range: {} - {} (Avg: {:.2f})|r"},
{LOCALE_koKR, "원래 크리쳐 레벨 범위: {} - {} (평균: {:.2f})|r"},
{LOCALE_frFR, "Plage de niveaux de créatures d'origine : {} - {} (Moyenne : {:.2f})|r"},
{LOCALE_deDE, "Originaler Kreaturenlevelbereich: {} - {} (Durchschnitt: {:.2f})|r"},
{LOCALE_zhCN, "原始生物等级范围:{} - {}(平均:{:2.f}|r"},
{LOCALE_zhTW, "原始生物等級範圍:{} - {}(平均:{:2.f}|r"},
{LOCALE_esES, "Rango de niveles de criaturas originales: {} - {} (Promedio: {:.2f})|r"},
{LOCALE_esMX, "Rango de niveles de criaturas originales: {} - {} (Promedio: {:.2f})|r"},
{LOCALE_ruRU, "Исходный диапазон уровней существ: {} - {} (Среднее: {:.2f})|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ACTIVE_TOTAL_CREATURES_IN_MAP = {
{LOCALE_enUS, "Active | Total Creatures in map: {} | {}|r"},
{LOCALE_koKR, "활성 | 지도 내 총 크리쳐: {} | {}|r"},
{LOCALE_frFR, "Actif | Créatures totales dans la carte : {} | {}|r"},
{LOCALE_deDE, "Aktiv | Gesamte Kreaturen in der Karte: {} | {}|r"},
{LOCALE_zhCN, "Active | 地图中的总生物: {} | {}|r"},
{LOCALE_zhTW, "Active | 地圖中的總生物: {} | {}|r"},
{LOCALE_esES, "Activo | Criaturas totales en el mapa: {} | {}|r"},
{LOCALE_esMX, "Activo | Criaturas totales en el mapa: {} | {}|r"},
{LOCALE_ruRU, "Активные | Всего существ на карте: {} | {}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_COMMAND_ONLY_IN_INSTANCE = {
{LOCALE_enUS, "This command can only be used in a dungeon or raid.|r"},
{LOCALE_koKR, "이 명령은 던전이나 공격대에서만 사용할 수 있습니다.|r"},
{LOCALE_frFR, "Cette commande ne peut être utilisée que dans un donjon ou un raid.|r"},
{LOCALE_deDE, "Dieser Befehl kann nur in einem Dungeon oder Schlachtzug verwendet werden.|r"},
{LOCALE_zhCN, "此命令只能在地下城或团队副本中使用。|r"},
{LOCALE_zhTW, "此命令只能在地城或團隊副本中使用。|r"},
{LOCALE_esES, "Este comando solo se puede usar en una mazmorra o banda.|r"},
{LOCALE_esMX, "Este comando solo se puede usar en una mazmorra o banda.|r"},
{LOCALE_ruRU, "Эту команду можно использовать только в подземелье или рейде.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_TARGET_NO_IN_INSTANCE = {
{LOCALE_enUS, "That target is not in an instance.|r"},
{LOCALE_koKR, "그 대상은 인스턴스에 있지 않습니다.|r"},
{LOCALE_frFR, "Cette cible n'est pas dans une instance.|r"},
{LOCALE_deDE, "Dieses Ziel befindet sich nicht in einer Instanz.|r"},
{LOCALE_zhCN, "该目标不在副本中。|r"},
{LOCALE_zhTW, "該目標不在副本中。|r"},
{LOCALE_esES, "Ese objetivo no está en una instancia.|r"},
{LOCALE_esMX, "Ese objetivo no está en una instancia.|r"},
{LOCALE_ruRU, "Эта цель не находится в подземелье.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ACTIVE_FOR_MAP_STATS = {
{LOCALE_enUS, "Active for Map Stats|r"},
{LOCALE_koKR, "지도 통계용 활성|r"},
{LOCALE_frFR, "Actif pour les statistiques de la carte|r"},
{LOCALE_deDE, "Aktiv für Kartenstatistiken|r"},
{LOCALE_zhCN, "地图平衡激活|r"},
{LOCALE_zhTW, "地圖平衡激活|r"},
{LOCALE_esES, "Activo para estadísticas del mapa|r"},
{LOCALE_esMX, "Activo para estadísticas del mapa|r"},
{LOCALE_ruRU, "Активно для статистики карты|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_IGNORED_FOR_MAP_STATS = {
{LOCALE_enUS, "Ignored for Map Stats|r"},
{LOCALE_koKR, "지도 통계용 무시됨|r"},
{LOCALE_frFR, "Ignoré pour les statistiques de la carte|r"},
{LOCALE_deDE, "Ignoriert für Kartenstatistiken|r"},
{LOCALE_zhCN, "地图平衡已忽略|r"},
{LOCALE_zhTW, "地圖平衡已忽略|r"},
{LOCALE_esES, "Ignorado para estadísticas del mapa|r"},
{LOCALE_esMX, "Ignorado para estadísticas del mapa|r"},
{LOCALE_ruRU, "Игнорируется для статистики карты|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_CREATURE_DIFFICULTY_LEVEL = {
{LOCALE_enUS, "Creature difficulty level: {} player(s)|r"},
{LOCALE_koKR, "생물 난이도 레벨: {} 플레이어|r"},
{LOCALE_frFR, "Niveau de difficulté de la créature : {} joueur(s)|r"},
{LOCALE_deDE, "Kreaturschwierigkeitsstufe: {} Spieler|r"},
{LOCALE_zhCN, "生物难度等级:{} 玩家|r"},
{LOCALE_zhTW, "生物難度等級:{} 玩家|r"},
{LOCALE_esES, "Nivel de dificultad de la criatura: {} jugador(es)|r"},
{LOCALE_esMX, "Nivel de dificultad de la criatura: {} jugador(es)|r"},
{LOCALE_ruRU, "Уровень сложности существа: {} игрок(ов)|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_CLONE_OF_SUMMON = {
{LOCALE_enUS, "Clone of {} ({})|r"},
{LOCALE_koKR, "{}의 복제 ({})|r"},
{LOCALE_frFR, "Clone de {} ({})|r"},
{LOCALE_deDE, "Klon von {} ({})|r"},
{LOCALE_zhCN, "{}的克隆({}|r"},
{LOCALE_zhTW, "{}的克隆({}|r"},
{LOCALE_esES, "Clon de {} ({})|r"},
{LOCALE_esMX, "Clon de {} ({})|r"},
{LOCALE_ruRU, "Клон {} ({})|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_SUMMON_OF_SUMMON = {
{LOCALE_enUS, "Summon of {} ({})|r"},
{LOCALE_koKR, "{}의 소환 ({})|r"},
{LOCALE_frFR, "Invocation de {} ({})|r"},
{LOCALE_deDE, "Beschwörung von {} ({})|r"},
{LOCALE_zhCN, "{}的召唤({}|r"},
{LOCALE_zhTW, "{}的召喚({}|r"},
{LOCALE_esES, "Invocación de {} ({})|r"},
{LOCALE_esMX, "Invocación de {} ({})|r"},
{LOCALE_ruRU, "Призыв {} ({})|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_SUMMON_WITHOUT_SUMMONER = {
{LOCALE_enUS, "Summon without a summoner.|r"},
{LOCALE_koKR, "소환사 없는 소환.|r"},
{LOCALE_frFR, "Invocation sans invocateur.|r"},
{LOCALE_deDE, "Beschwörung ohne Beschwörer.|r"},
{LOCALE_zhCN, "没有召唤者的召唤物。|r"},
{LOCALE_zhTW, "沒有召喚者的召喚物。|r"},
{LOCALE_esES, "Invocación sin invocador.|r"},
{LOCALE_esMX, "Invocación sin invocador.|r"},
{LOCALE_ruRU, "Призыв без призывателя.|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_HEALTH_MULTIPLIER_TO = {
{LOCALE_enUS, "Health multiplier: {:.3f} -> {:.3f}|r"},
{LOCALE_koKR, "체력 배율: {:.3f} -> {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de santé : {:.3f} -> {:.3f}|r"},
{LOCALE_deDE, "Gesundheitsmultiplikator: {:.3f} -> {:.3f}|r"},
{LOCALE_zhCN, "生命值倍率:{:.3f} -> {:.3f}|r"},
{LOCALE_zhTW, "生命值倍增器:{:.3f} -> {:.3f}|r"},
{LOCALE_esES, "Multiplicador de salud: {:.3f} -> {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de salud: {:.3f} -> {:.3f}|r"},
{LOCALE_ruRU, "Множитель здоровья: {:.3f} -> {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_MANA_MULTIPLIER_TO = {
{LOCALE_enUS, "Mana multiplier: {:.3f} -> {:.3f}|r"},
{LOCALE_koKR, "마나 배율: {:.3f} -> {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de mana : {:.3f} -> {:.3f}|r"},
{LOCALE_deDE, "Manamultiplikator: {:.3f} -> {:.3f}|r"},
{LOCALE_zhCN, "法力值倍率:{:.3f} -> {:.3f}|r"},
{LOCALE_zhTW, "法力值倍增器:{:.3f} -> {:.3f}|r"},
{LOCALE_esES, "Multiplicador de maná: {:.3f} -> {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de maná: {:.3f} -> {:.3f}|r"},
{LOCALE_ruRU, "Множитель маны: {:.3f} -> {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ARMOR_MULTIPLIER_TO = {
{LOCALE_enUS, "Armor multiplier: {:.3f} -> {:.3f}|r"},
{LOCALE_koKR, "방어구 배율: {:.3f} -> {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur d'armure : {:.3f} -> {:.3f}|r"},
{LOCALE_deDE, "Rüstungsmultiplikator: {:.3f} -> {:.3f}|r"},
{LOCALE_zhCN, "护甲倍率:{:.3f} -> {:.3f}|r"},
{LOCALE_zhTW, "護甲倍增器:{:.3f} -> {:.3f}|r"},
{LOCALE_esES, "Multiplicador de armadura: {:.3f} -> {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de armadura: {:.3f} -> {:.3f}|r"},
{LOCALE_ruRU, "Множитель брони: {:.3f} -> {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_DAMAGE_MULTIPLIER_TO = {
{LOCALE_enUS, "Damage multiplier: {:.3f} -> {:.3f}|r"},
{LOCALE_koKR, "피해 배율: {:.3f} -> {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de dégâts : {:.3f} -> {:.3f}|r"},
{LOCALE_deDE, "Schadensmultiplikator: {:.3f} -> {:.3f}|r"},
{LOCALE_zhCN, "伤害倍率:{:.3f} -> {:.3f}|r"},
{LOCALE_zhTW, "傷害倍增器:{:.3f} -> {:.3f}|r"},
{LOCALE_esES, "Multiplicador de daño: {:.3f} -> {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de daño: {:.3f} -> {:.3f}|r"},
{LOCALE_ruRU, "Множитель урона: {:.3f} -> {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_HEALTH_MULTIPLIER = {
{LOCALE_enUS, "Health multiplier: {:.3f}|r"},
{LOCALE_koKR, "체력 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de santé : {:.3f}|r"},
{LOCALE_deDE, "Gesundheitsmultiplikator: {:.3f}|r"},
{LOCALE_zhCN, "生命值倍率:{:.3f}|r"},
{LOCALE_zhTW, "生命值倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de salud: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de salud: {:.3f}|r"},
{LOCALE_ruRU, "Множитель здоровья: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_MANA_MULTIPLIER = {
{LOCALE_enUS, "Mana multiplier: {:.3f}|r"},
{LOCALE_koKR, "마나 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de mana : {:.3f}|r"},
{LOCALE_deDE, "Manamultiplikator: {:.3f}|r"},
{LOCALE_zhCN, "法力值倍率:{:.3f}|r"},
{LOCALE_zhTW, "法力值倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de maná: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de maná: {:.3f}|r"},
{LOCALE_ruRU, "Множитель маны: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_ARMOR_MULTIPLIER = {
{LOCALE_enUS, "Armor multiplier: {:.3f}|r"},
{LOCALE_koKR, "방어구 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur d'armure : {:.3f}|r"},
{LOCALE_deDE, "Rüstungsmultiplikator: {:.3f}|r"},
{LOCALE_zhCN, "护甲倍率:{:.3f}|r"},
{LOCALE_zhTW, "護甲倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de armadura: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de armadura: {:.3f}|r"},
{LOCALE_ruRU, "Множитель брони: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_DAMAGE_MULTIPLIER = {
{LOCALE_enUS, "Damage multiplier: {:.3f}|r"},
{LOCALE_koKR, "피해 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de dégâts : {:.3f}|r"},
{LOCALE_deDE, "Schadensmultiplikator: {:.3f}|r"},
{LOCALE_zhCN, "伤害倍率:{:.3f}|r"},
{LOCALE_zhTW, "傷害倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de daño: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de daño: {:.3f}|r"},
{LOCALE_ruRU, "Множитель урона: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_CC_DURATION_MULTIPLIER = {
{LOCALE_enUS, "CC Duration multiplier: {:.3f}|r"},
{LOCALE_koKR, "CC 지속시간 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur de durée de la CC : {:.3f}|r"},
{LOCALE_deDE, "CC-Dauer-Multiplikator: {:.3f}|r"},
{LOCALE_zhCN, "控制持续时间倍率:{:.3f}|r"},
{LOCALE_zhTW, "控制持續時間倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de duración de CC: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de duración de CC: {:.3f}|r"},
{LOCALE_ruRU, "Множитель длительности контроля: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_XP_MONEY_MULTIPLIER = {
{LOCALE_enUS, "XP multiplier: {:.3f} Money multiplier: {:.3f}|r"},
{LOCALE_koKR, "경험치 배율: {:.3f} 돈 배율: {:.3f}|r"},
{LOCALE_frFR, "Multiplicateur d'XP : {:.3f} Multiplicateur d'argent : {:.3f}|r"},
{LOCALE_deDE, "XP-Multiplikator: {:.3f} Geldmultiplikator: {:.3f}|r"},
{LOCALE_zhCN, "经验值倍率:{:.3f} 金钱倍率:{:.3f}|r"},
{LOCALE_zhTW, "經驗值倍增器:{:.3f} 金錢倍增器:{:.3f}|r"},
{LOCALE_esES, "Multiplicador de XP: {:.3f} Multiplicador de dinero: {:.3f}|r"},
{LOCALE_esMX, "Multiplicador de XP: {:.3f} Multiplicador de dinero: {:.3f}|r"},
{LOCALE_ruRU, "Множитель опыта: {:.3f} Множитель денег: {:.3f}|r"},
};
const std::unordered_map<LocaleConstant, std::string> AB_LEAVING_INSTANCE_COMBAT_CHANGE = {
{LOCALE_enUS, "|cffc3dbff [AutoBalance]|r|cffFF8000 Combat has ended. Difficulty is no longer locked.|r"},
{LOCALE_koKR, "|cffc3dbff [AutoBalance]|r|cffFF8000 전투가 종료되었습니다. 난이도가 더 이상 잠겨 있지 않습니다.|r"},
{LOCALE_frFR, "|cffc3dbff [AutoBalance]|r|cffFF8000 Le combat est terminé. La difficulté n'est plus verrouillée.|r"},
{LOCALE_deDE, "|cffc3dbff [AutoBalance]|r|cffFF8000 Der Kampf ist vorbei. Die Schwierigkeit ist nicht mehr gesperrt.|r"},
{LOCALE_zhCN, "|cffc3dbff [AutoBalance]|r|cffFF8000 战斗结束了。难度不再被锁定。|r"},
{LOCALE_zhTW, "|cffc3dbff [AutoBalance]|r|cffFF8000 戰鬥已結束。難度不再被鎖定。|r"},
{LOCALE_esES, "|cffc3dbff [AutoBalance]|r|cffFF8000 El combate ha terminado. La dificultad ya no está bloqueada.|r"},
{LOCALE_esMX, "|cffc3dbff [AutoBalance]|r|cffFF8000 El combate ha terminado. La dificultad ya no está bloqueada.|r"},
{LOCALE_ruRU, "|cffc3dbff [AutoBalance]|r|cffFF8000 Бой окончен. Сложность больше не заблокирована.|r"},
};
std::unordered_map<std::string, const std::unordered_map<LocaleConstant, std::string>*> abTextMaps = {
{"welcome_to_player", &AB_WELCOME_TO_PLAYER},
{"welcome_to_gm", &AB_WELCOME_TO_GM},
{"announce_non_gm_entering_instance", &AB_ANNOUNCE_NON_GM_ENTERING_INSTANCE},
{"leaving_instance_combat", &AB_LEAVING_INSTANCE_COMBAT},
{"leaving_instance", &AB_LEAVING_INSTANCE},
{"set_offset_command_description", &AB_SET_OFFSET_COMMAND_DESCRIPTION},
{"set_offset_command_success", &AB_SET_OFFSET_COMMAND_SUCCESS},
{"set_offset_command_error", &AB_SET_OFFSET_COMMAND_ERROR},
{"get_offset_command_success", &AB_GET_OFFSET_COMMAND_SUCCESS},
{"adjusted_player_count_combat_locked", &AB_ADJUSTED_PLAYER_COUNT_COMBAT_LOCKED},
{"adjusted_player_count_map_minimum", &AB_ADJUSTED_PLAYER_COUNT_MAP_MINIMUM},
{"adjusted_player_count_map_minimum_difficulty_offset", &AB_ADJUSTED_PLAYER_COUNT_MAP_MINIMUM_DIFFICULTY_OFFSET},
{"adjusted_player_count_difficulty_offset", &AB_ADJUSTED_PLAYER_COUNT_DIFFICULTY_OFFSET},
{"adjusted_player_count", &AB_ADJUSTED_PLAYER_COUNT},
{"lfg_range", &AB_LFG_RANGE},
{"map_level", &AB_MAP_LEVEL},
{"level_scaling_enabled", &AB_LEVEL_SCALING_ENABLED},
{"level_scaling_disabled", &AB_LEVEL_SCALING_DISABLED},
{"world_health_multiplier", &AB_WORLD_HEALTH_MULTIPLIER},
{"world_hostile_damage_healing_multiplier_to", &AB_WORLD_HOSTILE_DAMAGE_HEALING_MULTIPLIER_TO},
{"world_hostile_damage_healing_multiplier", &AB_WORLD_HOSTILE_DAMAGE_HEALING_MULTIPLIER},
{"original_creature_level_range", &AB_ORIGINAL_CREATURE_LEVEL_RANGE},
{"active_total_creatures_in_map", &AB_ACTIVE_TOTAL_CREATURES_IN_MAP},
{"ab_command_only_in_instance", &AB_COMMAND_ONLY_IN_INSTANCE},
{"target_no_in_instance", &AB_TARGET_NO_IN_INSTANCE},
{"active_for_map_stats", &AB_ACTIVE_FOR_MAP_STATS},
{"ignored_for_map_stats", &AB_IGNORED_FOR_MAP_STATS},
{"creature_difficulty_level", &AB_CREATURE_DIFFICULTY_LEVEL},
{"clone_of_summon", &AB_CLONE_OF_SUMMON},
{"summon_of_summon", &AB_SUMMON_OF_SUMMON},
{"summon_without_summoner", &AB_SUMMON_WITHOUT_SUMMONER},
{"health_multiplier_to", &AB_HEALTH_MULTIPLIER_TO},
{"mana_multiplier_to", &AB_MANA_MULTIPLIER_TO},
{"armor_multiplier_to", &AB_ARMOR_MULTIPLIER_TO},
{"damage_multiplier_to", &AB_DAMAGE_MULTIPLIER_TO},
{"health_multiplier", &AB_HEALTH_MULTIPLIER},
{"mana_multiplier", &AB_MANA_MULTIPLIER},
{"armor_multiplier", &AB_ARMOR_MULTIPLIER},
{"damage_multiplier", &AB_DAMAGE_MULTIPLIER},
{"cc_duration_multiplier", &AB_CC_DURATION_MULTIPLIER},
{"xp_money_multiplier", &AB_XP_MONEY_MULTIPLIER},
{"leaving_instance_combat_change", &AB_LEAVING_INSTANCE_COMBAT_CHANGE},
};
std::string ABGetLocaleText(LocaleConstant locale, const std::string& titleType) {
auto textMapIt = abTextMaps.find(titleType);
if (textMapIt != abTextMaps.end())
{
const std::unordered_map<LocaleConstant, std::string>* textMap = textMapIt->second;
auto it = textMap->find(locale);
if (it != textMap->end())
return it->second;
}
return "";
}
+12
View File
@@ -0,0 +1,12 @@
// Message.h
#ifndef AB_MESSAGE_H
#define AB_MESSAGE_H
#include "Common.h"
#include "ItemTemplate.h"
#include <string>
std::string ABGetLocaleText(LocaleConstant locale, const std::string& titleType);
#endif // AB_MESSAGE_H
+8
View File
@@ -0,0 +1,8 @@
[*]
charset = utf-8
indent_style = space
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 80
@@ -0,0 +1,49 @@
### TITLE
## Type(Scope/Subscope): Commit ultra short explanation
## |---- Write below the examples with a maximum of 50 characters ----|
## Example 1: fix(DB/SAI): Missing spell to NPC Hogger
## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros
## Example 3: feat(CORE/Commands): New GM command to do something
### DESCRIPTION
## Explain why this change is being made, what does it fix etc...
## |---- Write below the examples with a maximum of 72 characters per lines ----|
## Example: Hogger (id: 492) was not charging player when being engaged.
## Provide links to any issue, commit, pull request or other resource
## Example 1: Closes issue #23
## Example 2: Ported from other project's commit (link)
## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/
## =======================================================
## EXTRA INFOS
## =======================================================
## "Type" can be:
## feat (new feature)
## fix (bug fix)
## refactor (refactoring production code)
## style (formatting, missing semi colons, etc; no code change)
## docs (changes to documentation)
## test (adding or refactoring tests; no production code change)
## chore (updating bash scripts, git files etc; no production code change)
## --------------------
## Remember to
## Capitalize the subject line
## Use the imperative mood in the subject line
## Do not end the subject line with a period
## Separate subject from body with a blank line
## Use the body to explain what and why rather than how
## Can use multiple lines with "-" for bullet points in body
## --------------------
## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/
## =======================================================
## "Scope" can be:
## CORE (core related, c++)
## DB (database related, sql)
## =======================================================
## "Subscope" is optional and depends on the nature of the commit.
## =======================================================
+105
View File
@@ -0,0 +1,105 @@
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto eol=lf
# Text
*.conf text
*.conf.dist text
*.cmake text
## Scripts
*.sh text
*.fish text
*.lua text
## SQL
*.sql text
## C++
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
## For documentation
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## EXECUTABLES
*.exe binary
*.pyc binary
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 64 KiB

+14
View File
@@ -0,0 +1,14 @@
name: Build mod-eluna with Lua51 🌙
on:
push:
branches:
- 'master'
- 'main'
pull_request:
jobs:
build_lua51:
uses: ./.github/workflows/core-build-base.yml
with:
lua_version: 'lua51'
+14
View File
@@ -0,0 +1,14 @@
name: Build mod-eluna with Lua52 🌙
on:
push:
branches:
- 'master'
- 'main'
pull_request:
jobs:
build_lua52:
uses: ./.github/workflows/core-build-base.yml
with:
lua_version: 'lua52'
+14
View File
@@ -0,0 +1,14 @@
name: Build mod-eluna with Lua53 🌙
on:
push:
branches:
- 'master'
- 'main'
pull_request:
jobs:
build_lua53:
uses: ./.github/workflows/core-build-base.yml
with:
lua_version: 'lua53'
+14
View File
@@ -0,0 +1,14 @@
name: Build mod-eluna with Lua54 🌙
on:
push:
branches:
- 'master'
- 'main'
pull_request:
jobs:
build_lua54:
uses: ./.github/workflows/core-build-base.yml
with:
lua_version: 'lua54'
+14
View File
@@ -0,0 +1,14 @@
name: Build mod-eluna with LuaJIT 🌙
on:
push:
branches:
- 'master'
- 'main'
pull_request:
jobs:
build_luajit:
uses: ./.github/workflows/core-build-base.yml
with:
lua_version: 'luajit'
+85
View File
@@ -0,0 +1,85 @@
name: Build mod-eluna base 🛠️
on:
workflow_call:
inputs:
lua_version:
required: true
type: string
jobs:
install_and_build:
runs-on: ubuntu-24.04
steps:
- name: Check out AzerothCore 🧑‍💻
uses: actions/checkout@v4
with:
repository: 'azerothcore/azerothcore-wotlk'
ref: 'master'
submodules: 'recursive'
fetch-depth: 0
- name: Check out module repository 📂
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: 'modules/${{ github.event.repository.name }}'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache compilation artifacts 💾
uses: actions/cache@v4
with:
path: var/ccache
key: ccache:${{ matrix.compiler.CC }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:clang-18:${{ github.ref }}
ccache:clang-18
- name: Install build dependencies 🧰
shell: bash
run: |
sudo apt update
sudo apt-get -y install ccache clang cmake curl google-perftools \
libmysqlclient-dev make unzip build-essential cmake-data \
libboost-all-dev libbz2-dev libncurses5-dev libmysql++-dev \
libreadline6-dev libssl-dev libtool openssl zlib1g-dev
- name: Build mod-eluna with ${{ inputs.lua_version }} 🏗️
run: |
rm -rf build
mkdir build && cd build
cmake .. \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DSCRIPTS="static" \
-DMODULES="static" \
-DWITH_WARNINGS="ON" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_C_FLAGS="-Werror" \
-DCMAKE_CXX_FLAGS="-Werror" \
-DLUA_VERSION=${{ inputs.lua_version }}
make -j$(nproc)
cd ..
- name: Run Cppcheck for static code analysis 🔍
run: |
sudo apt update -y
sudo apt install -y cppcheck
cd modules/${{ github.event.repository.name }}
cppcheck -j$(nproc) --force --inline-suppr \
-I src/LuaEngine/ \
-I src/ \
--suppress=*:src/lualib/* \
--suppress=*:src/LuaEngine/libs/* \
--output-file=report.txt \
.
if [ -s report.txt ]; then
echo "Cppcheck detected issues 🚨:"
cat report.txt
exit 1
else
echo "No issues detected by cppcheck ✅."
fi
+48
View File
@@ -0,0 +1,48 @@
!.gitignore
#
#Generic
#
.directory
.mailmap
*.orig
*.rej
*.*~
.hg/
*.kdev*
.DS_Store
CMakeLists.txt.user
*.bak
*.patch
*.diff
*.REMOTE.*
*.BACKUP.*
*.BASE.*
*.LOCAL.*
#
# IDE & other softwares
#
/.settings/
/.externalToolBuilders/*
# exclude in all levels
nbproject/
.sync.ffs_db
*.kate-swp
#
# Eclipse
#
*.pydevproject
.metadata
.gradle
tmp/
*.tmp
*.swp
*~.nib
local.properties
.settings/
.loadpath
.project
.cproject
+21
View File
@@ -0,0 +1,21 @@
set(LUA_VERSION "lua52" CACHE STRING "Lua version to use")
set_property(CACHE LUA_VERSION PROPERTY STRINGS luajit lua51 lua52 lua53 lua54)
MESSAGE(STATUS "Lua version: ${LUA_VERSION}")
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
option(LUA_STATIC "link lua statically" ON)
if (LUA_STATIC)
MESSAGE(STATUS "Lua linking: static")
else()
MESSAGE(STATUS "Lua linking: dynamic")
endif()
if (LUA_VERSION MATCHES "luajit")
add_subdirectory(src/lualib/luajit)
else()
add_subdirectory(src/lualib/lua)
endif()
+93
View File
@@ -0,0 +1,93 @@
<div align="center">
# [![Eluna](src/LuaEngine/docs/Eluna.png)](https://github.com/ElunaLuaEngine/Eluna)
*Unleash the power of Lua scripting in your AzerothCore server*
[![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/ZKSVREE7)
[![Lua](https://img.shields.io/badge/Lua-5.2-2C2D72?style=for-the-badge&logo=lua&logoColor=white)](http://www.lua.org/manual/5.2/)
[![AzerothCore](https://img.shields.io/badge/AzerothCore-Integrated-darkgreen?style=for-the-badge)](http://www.azerothcore.org/)
---
</div>
> [!NOTE]
> mod-eluna © is a powerful Lua scripting engine embedded into the AzerothCore emulator. We are committed to continuously improving mod-eluna for both developers and server administrators.
## 📚 Additions from Eluna/master
| Category | Method | Github |
|:---------|:-----------|:-------|
| [**RegisterPlayerEvent**](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | | |
| | [`PLAYER_EVENT_ON_PET_ADDED_TO_WORLD`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/3 |
| | [`PLAYER_EVENT_ON_LEARN_SPELL`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/46 |
| | [`PLAYER_ON_ACHIEVEMENT_COMPLETE`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/47 |
| | [`PLAYER_EVENT_ON_FFAPVP_CHANGE`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/63 |
| | [`PLAYER_EVENT_ON_UPDATE_AREA`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/65 |
| | [`PLAYER_EVENT_ON_CAN_INIT_TRADE`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/83 |
| | [`PLAYER_EVENT_ON_CAN_SEND_MAIL`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/85 |
| | [`PLAYER_EVENT_ON_CAN_JOIN_LFG`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/86 |
| | [`PLAYER_EVENT_ON_QUEST_REWARD_ITEM`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/88 |
| | [`PLAYER_EVENT_ON_CREATE_ITEM`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/88 |
| | [`PLAYER_EVENT_ON_STORE_NEW_ITEM`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/88 |
| | [`PLAYER_EVENT_ON_COMPLETE_QUEST`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/90 |
| | [`PLAYER_EVENT_ON_CAN_GROUP_INVITE`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/100 |
| | [`PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/119 |
| | [`PLAYER_EVENT_ON_BG_DESERTION`](https://www.azerothcore.org/eluna/Global/RegisterPlayerEvent.html) | https://github.com/azerothcore/mod-eluna/pull/146 |
| **[Player](https://www.azerothcore.org/eluna/Player/index.html)** | | |
| | [`Player:GetMailCount()`](https://www.azerothcore.org/eluna/Player/GetMailCount.html) | https://github.com/azerothcore/mod-eluna/pull/76 |
| | [`Player:GetXP()`](https://www.azerothcore.org/eluna/Player/GetXP.html) | https://github.com/azerothcore/mod-eluna/pull/77 |
| | [`Player:GetAchievementCriteriaProgress()`](https://www.azerothcore.org/eluna/Player/GetAchievementCriteriaProgress.html) | https://github.com/azerothcore/mod-eluna/pull/78 |
| | [`Player:SendListInventory(object, vendorentry)`](https://www.azerothcore.org/eluna/Player/SendListInventory.html) | https://github.com/azerothcore/mod-eluna/pull/48 |
| | [`Player:GetPlayerSettingValue()`](https://www.azerothcore.org/eluna/Player/GetPlayerSettingValue.html) and [`Player:UpdatePlayerSetting()`](https://www.azerothcore.org/eluna/Player/GetPlayerSettingValue.html) | https://github.com/azerothcore/mod-eluna/pull/125 |
| | [`Player:GetTrader()`](https://www.azerothcore.org/eluna/Player/GetTrader.html) | https://github.com/azerothcore/mod-eluna/pull/126 |
| | [`Player:CanCompleteRepeatableQuest(questid)`](https://www.azerothcore.org/eluna/Player/CanCompleteRepeatableQuest.html) | https://github.com/azerothcore/mod-eluna/pull/141 |
| | [`Player:CanRewardQuest(questId)`](https://www.azerothcore.org/eluna/Player/CanRewardQuest.html) | https://github.com/azerothcore/mod-eluna/pull/141 |
| | [`Player:SetGlyph(glyphId, slotIndex)`](https://www.azerothcore.org/eluna/Player/SetGlyph.html) | https://github.com/azerothcore/mod-eluna/pull/152 |
| **[Group](https://www.azerothcore.org/eluna/Group/index.html)** | | |
| | [`Group:GetGroupType()`](https://www.azerothcore.org/eluna/Group/GetGroupType.html) | https://github.com/azerothcore/mod-eluna/pull/82 |
| | [`Group:SetMemberFlag()`](https://www.azerothcore.org/eluna/Group/SetMemberFlag.html) | https://github.com/azerothcore/mod-eluna/pull/102 |
| **[Unit](https://www.azerothcore.org/eluna/Unit/index.html)** | | |
| | [`Unit:ModifyThreatPct()`](https://www.azerothcore.org/eluna/Unit/ModifyThreatPct.html) | https://github.com/azerothcore/mod-eluna/pull/25 |
| | [`Unit:GetAttackers()`](https://www.azerothcore.org/eluna/Unit/GetAttackers.html) | https://github.com/azerothcore/mod-eluna/pull/116 |
| | [`Unit:GetThreatList()`](https://www.azerothcore.org/eluna/Unit/GetThreatList.html) | https://github.com/azerothcore/mod-eluna/pull/117 |
| | [`Unit:GetUnitFlags()`](https://www.azerothcore.org/eluna/Unit/GetUnitFlags.html) | https://github.com/azerothcore/mod-eluna/pull/137 |
| | [`Unit:GetUnitFlagsTwo()`](https://www.azerothcore.org/eluna/Unit/GetUnitFlagsTwo.html) | https://github.com/azerothcore/mod-eluna/pull/137 |
| | [`Unit:SetUnitFlags(flags)`](https://www.azerothcore.org/eluna/Unit/SetUnitFlags.html) | https://github.com/azerothcore/mod-eluna/pull/137 |
| | [`Unit:SetUnitFlagsTwo(flags)`](https://www.azerothcore.org/eluna/Unit/SetUnitFlagsTwo.html) | https://github.com/azerothcore/mod-eluna/pull/137 |
| | [`Unit:SetSpeedRate(unitMoveType, speed)`](https://www.azerothcore.org/eluna/Unit/SetSpeedRate.html) | https://github.com/azerothcore/mod-eluna/pull/155 |
| | [`Unit:GetSpeedRate()`](https://www.azerothcore.org/eluna/Unit/GetSpeedRate.html) | https://github.com/azerothcore/mod-eluna/pull/155 |
| **[GameObject](https://www.azerothcore.org/eluna/GameObject/index.html)** | | |
| | [`GameObject:AddLoot()`](https://www.azerothcore.org/eluna/GameObject/AddLoot.html) | https://github.com/azerothcore/mod-eluna/pull/52 |
| **[Object](https://www.azerothcore.org/eluna/Object/index.html)** | | |
| | [`Object:IsPlayer()`](https://www.azerothcore.org/eluna/Object/IsPlayer.html) | https://github.com/azerothcore/mod-eluna/pull/42 |
| **[Item](https://www.azerothcore.org/eluna/Item/index.html)** | | |
| | [`Item:GetItemTemplate()`](https://www.azerothcore.org/eluna/Item/GetItemTemplate.html) | https://github.com/azerothcore/mod-eluna/pull/84 |
| **[Global](https://www.azerothcore.org/eluna/Unit/index.html)** | | |
| | [`HttpRequest`](https://www.azerothcore.org/eluna/Global/HttpRequest.html) | https://github.com/azerothcore/mod-eluna/pull/2 |
| | [`GetItemTemplate(itemEntry)`](https://www.azerothcore.org/eluna/Global/GetItemTemplate.html) | https://github.com/azerothcore/mod-eluna/pull/84 |
| | [`ChatHandler`](https://www.azerothcore.org/eluna/Global/ChatHandler.html) | https://github.com/azerothcore/mod-eluna/pull/23 |
| | [`ItemTemplate`](https://www.azerothcore.org/eluna/ItemTemplate/index.html) | https://github.com/azerothcore/mod-eluna/pull/84 |
| | [`Roll`](https://www.azerothcore.org/eluna/Roll/index.html) | https://github.com/azerothcore/mod-eluna/pull/119 |
| | `ELUNA_LOG_INFO` for [`RunCommand()`](https://www.azerothcore.org/eluna/Global/RunCommand.html) | https://github.com/azerothcore/mod-eluna/pull/75 |
| | [`GetOwnerHalaa()`](https://www.azerothcore.org/eluna/Global/GetOwnerHalaa.html) and [`SetOwnerHalaa(teamId)`](https://www.azerothcore.org/eluna/Global/SetOwnerHalaa.html) | https://github.com/azerothcore/mod-eluna/pull/79 |
| | [`WorldDBQueryAsync`](https://www.azerothcore.org/eluna/Global/WorldDBQueryAsync.html), [`CharDBQueryAsync`](https://www.azerothcore.org/eluna/Global/CharDBQueryAsync.html) and [`AuthDBQueryAsync`](https://www.azerothcore.org/eluna/Global/AuthDBQueryAsync.html) | https://github.com/azerothcore/mod-eluna/pull/113 |
## 🤝 Contributing
We welcome contributions! Here's how you can help:
```mermaid
graph LR
A[Fork Repository] --> B[Create Branch]
B --> C[Make Changes]
C --> D[Submit PR]
D --> E[Review Process]
```
<div align="center">
---
<sub>Made with ❤️ by the Eluna Community</sub>
[⬆ Back to Top](#)
</div>
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+146
View File
@@ -0,0 +1,146 @@
<div align="center">
# [![mod-eluna](src/LuaEngine/docs/Eluna.png)](https://github.com/azerothcore/mod-eluna)
*Unleash the power of Lua scripting in your AzerothCore server*
[![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/ZKSVREE7)
[![Lua](https://img.shields.io/badge/Lua-5.2-2C2D72?style=for-the-badge&logo=lua&logoColor=white)](http://www.lua.org/manual/5.2/)
[![AzerothCore](https://img.shields.io/badge/AzerothCore-Integrated-darkgreen?style=for-the-badge)](http://www.azerothcore.org/)
---
</div>
> [!IMPORTANT]
> **mod-eluna** is an independent Lua scripting engine specifically designed for AzerothCore. This project has **diverged from the original Eluna project** and is no longer compatible with standard Eluna scripts. Scripts written for mod-eluna will not work with the original Eluna engine and vice versa.
## 🚀 Overview
mod-eluna is a powerful, AzerothCore-specific implementation of a Lua scripting engine that enables server administrators and developers to create custom gameplay features, events, and mechanics without modifying the core server code.
### Key Features
- **Native AzerothCore Integration**: Built specifically for AzerothCore's architecture
- **Enhanced API**: Extended functionality for AzerothCore, beyond the original Eluna specification.
- **Community-Driven Development**: Actively maintained with community contributions
## ⚠️ Compatibility Notice
### mod-eluna vs Original Eluna
**mod-eluna is NOT compatible with the original Eluna project.** This fork has evolved independently with AzerothCore-specific enhancements and API changes that make scripts non-interchangeable.
### For Original Eluna Compatibility
If you need to use standard Eluna scripts or maintain compatibility with the original Eluna project, please use the dedicated AzerothCore port available at:
**🔗 [ElunaAzerothCore](https://github.com/Eluna-Ports/ElunaAzerothCore)**
This repository maintains compatibility with the original Eluna API and supports standard Eluna scripts.
## 📋 Table of Contents
- [Installation](#-installation)
- [Documentation](#-documentation)
- [API Reference](#api-reference)
- [Support](#-support)
- [Contributing](#-contributing)
- [Acknowledgements](#-acknowledgements)
## ⚡ Installation
### Prerequisites
- AzerothCore server installation
- Git version control system
- CMake build system
### Installation Steps
```bash
# Navigate to your AzerothCore modules directory
cd <azerothcore-path>/modules
# Clone the mod-eluna repository
git clone https://github.com/azerothcore/mod-eluna.git
# Configure build with your preferred Lua version
cd <azerothcore-build-directory>
cmake ../ -DLUA_VERSION=luajit # Options: luajit, lua52, lua53, lua54
# Default: If no version is specified, Lua 5.2 will be used
# Rebuild your AzerothCore server
make -j$(nproc)
```
### Supported Lua Versions
- **LuaJIT** (Recommended for performance)
- **Lua 5.2** (Default)
- **Lua 5.3**
- **Lua 5.4**
## 📚 Documentation
### Getting Started
- [Installation Guide](https://github.com/azerothcore/mod-eluna/tree/master/docs/USAGE.md)
- [Implementation Details](https://github.com/azerothcore/mod-eluna/tree/master/docs/IMPL_DETAILS.md)
### API Reference
- **[mod-eluna API Documentation](https://www.azerothcore.org/eluna/)** - Complete API reference for mod-eluna
- **[Hooks Documentation](https://github.com/azerothcore/mod-eluna/blob/master/src/LuaEngine/Hooks.h)** - Available event hooks
- **[Lua 5.2 Reference](http://www.lua.org/manual/5.2/)** - Official Lua language documentation
> [!WARNING]
> **API Differences**: mod-eluna functions may not be available in the original Eluna project and vice versa. Always refer to the mod-eluna specific documentation when developing scripts.
## 💬 Support
### Getting Help
- **GitHub Issues**: [Report bugs or request features](https://github.com/azerothcore/mod-eluna/issues)
- **Discord Community**: [Join our Discord server](https://discord.com/invite/bx3y5Qmy)
- **AzerothCore Discord**: [Official AzerothCore support](http://www.azerothcore.org/)
### Resources
- [Lua Programming Guide](http://www.lua.org/)
- [AzerothCore Documentation](http://www.azerothcore.org/)
## 🤝 Contributing
We welcome contributions from the community! Here's how you can help:
### Development Workflow
![](.github/images/workflow.svg "workflow example")
### Contribution Guidelines
1. **Fork** the repository
2. **Create** a feature branch from `master`
3. **Implement** your changes with proper testing
4. **Follow** the existing code style and conventions
5. **Submit** a pull request with a clear description
## 🌟 Acknowledgements
### Original Project
mod-eluna is built upon the foundation of the original [Eluna](https://github.com/ElunaLuaEngine/Eluna) project. We acknowledge and thank the original Eluna team for their pioneering work in Lua scripting for World of Warcraft server emulators.
### Related Projects
- **[Original Eluna Repository](https://github.com/ElunaLuaEngine/Eluna)** - The original Eluna project
- **[Eluna Discord Community](https://discord.gg/bjkCVWqqfX)** - Original Eluna community support
- **[ElunaAzerothCore](https://github.com/Eluna-Ports/ElunaAzerothCore)** - AzerothCore with original Eluna compatibility
### Supported Emulators
- **[AzerothCore](http://www.azerothcore.org/)** - Primary target (this project)
- **[TrinityCore](https://www.trinitycore.org/)** - Original Eluna support
- **[MaNGOS](https://www.getmangos.eu/)**
- **[cMaNGOS](https://cmangos.net/)**
## 📄 License
This project is licensed under the GNU General Public License v3.0. See [LICENSE](https://github.com/azerothcore/mod-eluna/blob/master/LICENSE) for details.
---
<div align="center">
<sub>Developed with ❤️ by the AzerothCore and mod-eluna community</sub>
[⬆ Back to Top](#-overview)
</div>
+92
View File
@@ -0,0 +1,92 @@
### [![Eluna](src/LuaEngine/docs/Eluna.png)](https://github.com/ElunaLuaEngine/Eluna)
## 关于
Eluna Lua Engine &copy; 是嵌入到魔兽世界模拟器中的lua引擎。 Eluna支持MaNGOSCMaNGOSTrinityCore和AzerothCore。
我们目前正在努力使Eluna从内到外变得更好。
如果您在安装或脚本方面遇到问题,请随时提出问题。
有关文档和参考,请参阅[Eluna API (AC版)](https://www.azerothcore.org/pages/eluna/index.html) and [Lua 参考手册](http://www.lua.org/manual/5.2/).
## 社区
您可以加入官方的Eluna Discord服务器,在那里您将能够找到社区提供的资源,版本和支持:
<a href="https://discord.gg/bjkCVWqqfX">
<img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" />
</a>
官方的Azerothcore Discord服务器也提供了一个专门用于lua开发的通道:
<a href="https://discord.gg/gkt4y2x">
<img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" />
</a>
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) mod-eluna for AzerothCore
- azerothcore 的最新构建状态:[![Build Status](https://github.com/azerothcore/mod-eluna/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-eluna)
[english](README.md) | [中文说明](README_CN.md) | [Español](README_ES.md)
一个AzerothCore的[Eluna](https://github.com/ElunaLuaEngine/Eluna)模块。
## 如何安装:
### 1) 下载源代码
您可以使用 git 获取源代码。
#### 使用 git 下载
1. 在命令行中打开 `azerothcore-wotlk` 的文件夹。
2. 进入 **modules** 文件夹: `cd modules`
3. 使用以下命令下载模块源代码。
```
git clone https://github.com/azerothcore/mod-eluna.git mod-eluna
```
### 2) 构建
您需要再次运行 cmake 并重新生成项目。
AC版的Eluna API:
[https://www.azerothcore.org/pages/eluna/index.html](https://www.azerothcore.org/pages/eluna/index.html)
## 文档
* [入门指南](https://github.com/ElunaLuaEngine/Eluna/blob/master/docs/USAGE.md)
* [Eluna特性](https://github.com/ElunaLuaEngine/Eluna/blob/master/docs/IMPL_DETAILS.md)
* [功能文档(AC版本)](https://www.azerothcore.org/pages/eluna/index.html)
* [Hook文档](https://github.com/ElunaLuaEngine/Eluna/blob/master/Hooks.h)
* [Lua参考手册](http://www.lua.org/manual/5.2/)
* [论坛 - 支持, 发布, 指南](https://www.getmangos.eu/forums/forum/119-eluna-central/)
* [示例脚本](https://github.com/ElunaLuaEngine/Scripts)
* [贡献](https://github.com/ElunaLuaEngine/Eluna/blob/master/docs/CONTRIBUTING.md)
## 链接
* [MaNGOS](http://getmangos.eu/)
* [cMaNGOS](http://cmangos.net/)
* [TrinityCore](http://www.trinitycore.org/)
* [AzerothCore](http://www.azerothcore.org/)
* [Lua.org](http://www.lua.org/)
* [License](https://github.com/ElunaLuaEngine/Eluna/blob/master/docs/LICENSE.md)
## 来自Eluna/master的拓展
- 添加了 HttpRequest 方法. https://github.com/azerothcore/Eluna/pull/2
- 添加玩家注册事件43(当宠物添加到世界中时): `PLAYER_EVENT_ON_PET_ADDED_TO_WORLD` https://github.com/azerothcore/Eluna/pull/3
- 添加聊天处理方法到玩家事件中。 https://github.com/azerothcore/Eluna/pull/23
- 暴露方法 `ModifyThreatPct()`. https://github.com/azerothcore/Eluna/pull/25
- 暴露方法 `Object:IsPlayer()`. https://github.com/azerothcore/Eluna/pull/42
- 添加玩家注册事件44(当玩家学习技能时): `PLAYER_EVENT_ON_LEARN_SPELL`. https://github.com/azerothcore/mod-eluna/pull/46
- 添加玩家注册事件45(当玩家完成成就时): `PLAYER_ON_ACHIEVEMENT_COMPLETE`。 https://github.com/azerothcore/mod-eluna/pull/47
- 添加玩家注册事件51(当玩家获得任务奖励时) `PLAYER_EVENT_ON_QUEST_REWARD_ITEM`。https://github.com/azerothcore/mod-eluna/pull/88
- 添加玩家注册事件52(当玩家创建物品时) `PLAYER_EVENT_ON_CREATE_ITEM`。https://github.com/azerothcore/mod-eluna/pull/88
- 添加玩家注册事件53(当玩家创建物品实例时) `PLAYER_EVENT_ON_STORE_NEW_ITEM`。https://github.com/azerothcore/mod-eluna/pull/88
- 添加玩家注册事件54(当玩家完成任务时) `PLAYER_EVENT_ON_COMPLETE_QUEST`。https://github.com/azerothcore/mod-eluna/pull/90
- 新增参数*商人Id*到方法player:SendListInventory(object, vendorentry)中。 https://github.com/azerothcore/mod-eluna/pull/48
- 添加方法`gameobject:AddLoot()`, 可以在线给**空**的容器中添加战利品。 https://github.com/azerothcore/mod-eluna/pull/52
+26
View File
@@ -0,0 +1,26 @@
# Esta traducción proviene de una versión desactualizada.
##
##
##
##
# mod-LuaEngine
[English](README.md) | [中文说明](README_CN.md) | [Español](README_ES.md)
Un módulo de Eluna para AzerothCore.
Cómo instalar:
1. Descargar o clonar este módulo:
> [Descargar archivo zip](https://github.com/azerothcore/mod-eluna-lua-engine/archive/master.zip)
> o clonar `git clone https://github.com/azerothcore/mod-eluna-lua-engine.git`
2. Póngalo en la carpeta de módulos del Azerothcore.
> $HOME/azerothcore/modules/
3. Descargar o clonar el archivo central de ELUNA:
> [Descargar archivo zip](https://github.com/ElunaLuaEngine/Eluna/archive/master.zip)
> o clonar `git clone https://github.com/ElunaLuaEngine/Eluna.git .`
4. Dentro de la carpeta del módulo de Eluna de Azeroth, se encuentra una carpeta / directorio llamado: `LuaEngine` (mod-eluna-lua-engine/LuaEngine). Debe depositar los ficheros de lua, directamente dentro de esa carpeta. Los archivos directamente, no un directorio y luego los ficheros dentro. Por eso te utiliza el “.” cuando se está clonando, para que no genere un directorio nuevo.
5. Una vez copiado los ficheros y descargado el modulo, debes volver a compilar. Si seguiste la guía de instalación, debiste haber generado un directorio build, dentro de azerothcore. Dirígete a él y realiza la compilación como lo menciona en la guía.
Eluna API :
[http://elunaluaengine.github.io/](http://elunaluaengine.github.io/)
+1
View File
@@ -0,0 +1 @@
theme: jekyll-theme-architect
+159
View File
@@ -0,0 +1,159 @@
[worldserver]
###################################################################################################
# ELUNA SETTINGS
#
# Eluna.Enabled
# Description: Enable or disable Eluna LuaEngine
# Default: true - (enabled)
# false - (disabled)
#
# Eluna.TraceBack
# Description: Sets whether to use debug.traceback function on a lua error or not.
# Notice that you can redefine the function.
# Default: false - (use default error output)
# true - (use debug.traceback function)
#
# Eluna.ScriptPath
# Description: Sets the location of the script folder to load scripts from
# The path can be relative or absolute.
# Default: "lua_scripts"
#
# Eluna.PlayerAnnounceReload
# Description: Enable or disable whether the reload announcement is sent to players (Lowest security level).
# Default: false - (disabled)
# true - (enabled)
#
# Eluna.RequirePaths
# Description: Sets the location of additional require paths.
# These paths are absolute and follows the standard Lua require path patterns.
# Below are a set of "standard" paths used by most package managers.
# "/usr/share/%s/?.lua;/usr/local/share/lua/%s/?.lua;/usr/local/share/lua/%s/?/init.lua;/usr/share/lua/%s/?.lua;/usr/share/lua/%s/?/init.lua;"
# Default: ""
#
# Eluna.RequireCPaths
# Description: Sets the location of additional require C paths.
# These paths are absolute and follows the standard Lua require path patterns.
# Below are a set of "standard" paths used by most package managers.
# "/usr/local/lib/lua/%s/?.so;/usr/lib/x86_64-linux-gnu/lua/%s/?.so;/usr/local/lib/lua/%s/loadall.so;"
# Default: ""
#
# Eluna.AutoReload
# Description: Enable or disable automatic reloading of Lua scripts when files are modified.
# This feature watches the script directory for changes and automatically
# triggers a reload when .lua files are added, modified, or deleted.
# Useful for development but should be disabled in production environments.
# Default: false - (disabled)
# true - (enabled)
#
# Eluna.AutoReloadInterval
# Description: Sets the interval in seconds between file system checks for auto-reload.
# Lower values provide faster detection but use more CPU resources.
# Higher values reduce CPU usage but increase detection delay.
# Default: 1 - (check every 1 second)
#
# Eluna.BytecodeCache
# Description: Enable or disable bytecode caching for improved performance.
# When enabled, Lua/MoonScript files are compiled to bytecode and cached in memory.
# This significantly speeds up script reloading (.reload eluna).
# Cache is cleared only when files are modified or server restarts.
# Default: true - (enabled)
# false - (disabled)
Eluna.Enabled = true
Eluna.TraceBack = false
Eluna.ScriptPath = "lua_scripts"
Eluna.PlayerAnnounceReload = false
Eluna.RequirePaths = ""
Eluna.RequireCPaths = ""
Eluna.AutoReload = false
Eluna.AutoReloadInterval = 1
Eluna.BytecodeCache = true
###################################################################################################
# LOGGING SYSTEM SETTINGS
#
# Appender config values: Given an appender "name"
# Appender.name
# Description: Defines 'where to log'.
# Format: Type,LogLevel,Flags,optional1,optional2,optional3
#
# Type
# 0 - (None)
# 1 - (Console)
# 2 - (File)
# 3 - (DB)
#
# LogLevel
# 0 - (Disabled)
# 1 - (Fatal)
# 2 - (Error)
# 3 - (Warning)
# 4 - (Info)
# 5 - (Debug)
# 6 - (Trace)
#
# Flags:
# 0 - None
# 1 - Prefix Timestamp to the text
# 2 - Prefix Log Level to the text
# 4 - Prefix Log Filter type to the text
# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS
# (Only used with Type = 2)
# 16 - Make a backup of existing file before overwrite
# (Only used with Mode = w)
#
# Colors (read as optional1 if Type = Console)
# Format: "fatal error warn info debug trace"
# 0 - BLACK
# 1 - RED
# 2 - GREEN
# 3 - BROWN
# 4 - BLUE
# 5 - MAGENTA
# 6 - CYAN
# 7 - GREY
# 8 - YELLOW
# 9 - LRED
# 10 - LGREEN
# 11 - LBLUE
# 12 - LMAGENTA
# 13 - LCYAN
# 14 - WHITE
# Example: "1 9 3 6 5 8"
#
# File: Name of the file (read as optional1 if Type = File)
# Allows to use one "%s" to create dynamic files
#
# Mode: Mode to open the file (read as optional2 if Type = File)
# a - (Append)
# w - (Overwrite)
#
# MaxFileSize: Maximum file size of the log file before creating a new log file
# (read as optional3 if Type = File)
# Size is measured in bytes expressed in a 64-bit unsigned integer.
# Maximum value is 4294967295 (4 GB). Leave blank for no limit.
# NOTE: Does not work with dynamic filenames.
# Example: 536870912 (512 MB)
#
Appender.ElunaLog=2,5,0,eluna.log,w
Appender.ElunaConsole=1,4,0,"0 9 0 3 5 0"
# Logger config values: Given a logger "name"
# Logger.name
# Description: Defines 'What to log'
# Format: LogLevel,AppenderList
#
# LogLevel
# 0 - (Disabled)
# 1 - (Fatal)
# 2 - (Error)
# 3 - (Warning)
# 4 - (Info)
# 5 - (Debug)
# 6 - (Trace)
#
# AppenderList: List of appenders linked to logger
# (Using spaces as separator).
#
Logger.eluna=4,ElunaLog ElunaConsole
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File
+24
View File
@@ -0,0 +1,24 @@
# BEST PRACTICES
## Create a new table
**Example:**
```
CREATE TABLE IF NOT EXISTS `table`(
`id` int(11) unsigned NOT NULL,
`active` BOOLEAN DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```
**Boolean datatype in mysql:**
Use "TinyInt(1)"" or "Boolean" (this is the same thing)
"bit(1)" can also work, but it may require a syntax like b'(0) and b'(1) when inserting (not sure).
If there are multiple booleans in the same table, bit(1) is better, otherwise it's the same result.
## Resources
https://www.w3schools.com/sql/sql_datatypes.asp
View File

Some files were not shown because too many files have changed in this diff Show More