From 238797098976a266cba4a4101e92f4fe9616bfd2 Mon Sep 17 00:00:00 2001 From: mikx Date: Thu, 9 Nov 2023 00:08:36 -0500 Subject: [PATCH] removed DungeonRespawn --- modules/DungeonRespawn/.editorconfig | 8 - .../DungeonRespawn/.git_commit_template.txt | 45 --- modules/DungeonRespawn/.gitattributes | 105 ------- .../.github/workflows/core-build.yml | 11 - modules/DungeonRespawn/.gitignore | 48 --- modules/DungeonRespawn/LICENSE | 21 -- modules/DungeonRespawn/README.md | 19 -- modules/DungeonRespawn/README_ES.md | 66 ---- modules/DungeonRespawn/README_example.md | 41 --- modules/DungeonRespawn/conf/conf.sh.dist | 32 -- .../conf/dungeonrespawn.conf.dist | 26 -- .../dungeonrespawn_char_0000_00_00_00.sql | 8 - .../dungeonrespawn_char_2023_01_12_01.sql | 4 - modules/DungeonRespawn/icon.png | Bin 2790 -> 0 bytes modules/DungeonRespawn/include.sh | 10 - .../setup_git_commit_template.sh | 4 - modules/DungeonRespawn/src/DungeonRespawn.cpp | 294 ------------------ modules/DungeonRespawn/src/DungeonRespawn.h | 62 ---- modules/DungeonRespawn/src/MP_loader.cpp | 15 - 19 files changed, 819 deletions(-) delete mode 100644 modules/DungeonRespawn/.editorconfig delete mode 100644 modules/DungeonRespawn/.git_commit_template.txt delete mode 100644 modules/DungeonRespawn/.gitattributes delete mode 100644 modules/DungeonRespawn/.github/workflows/core-build.yml delete mode 100644 modules/DungeonRespawn/.gitignore delete mode 100644 modules/DungeonRespawn/LICENSE delete mode 100644 modules/DungeonRespawn/README.md delete mode 100644 modules/DungeonRespawn/README_ES.md delete mode 100644 modules/DungeonRespawn/README_example.md delete mode 100644 modules/DungeonRespawn/conf/conf.sh.dist delete mode 100644 modules/DungeonRespawn/conf/dungeonrespawn.conf.dist delete mode 100644 modules/DungeonRespawn/data/sql/db-characters/base/dungeonrespawn_char_0000_00_00_00.sql delete mode 100644 modules/DungeonRespawn/data/sql/db-characters/updates/dungeonrespawn_char_2023_01_12_01.sql delete mode 100644 modules/DungeonRespawn/icon.png delete mode 100644 modules/DungeonRespawn/include.sh delete mode 100644 modules/DungeonRespawn/setup_git_commit_template.sh delete mode 100644 modules/DungeonRespawn/src/DungeonRespawn.cpp delete mode 100644 modules/DungeonRespawn/src/DungeonRespawn.h delete mode 100644 modules/DungeonRespawn/src/MP_loader.cpp diff --git a/modules/DungeonRespawn/.editorconfig b/modules/DungeonRespawn/.editorconfig deleted file mode 100644 index eb64e2f..0000000 --- a/modules/DungeonRespawn/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -[*] -charset = utf-8 -indent_style = space -indent_size = 4 -tab_width = 4 -insert_final_newline = true -trim_trailing_whitespace = true -max_line_length = 80 diff --git a/modules/DungeonRespawn/.git_commit_template.txt b/modules/DungeonRespawn/.git_commit_template.txt deleted file mode 100644 index 5c5d933..0000000 --- a/modules/DungeonRespawn/.git_commit_template.txt +++ /dev/null @@ -1,45 +0,0 @@ -### 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. -## ======================================================= diff --git a/modules/DungeonRespawn/.gitattributes b/modules/DungeonRespawn/.gitattributes deleted file mode 100644 index 7ef9001..0000000 --- a/modules/DungeonRespawn/.gitattributes +++ /dev/null @@ -1,105 +0,0 @@ -## 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 diff --git a/modules/DungeonRespawn/.github/workflows/core-build.yml b/modules/DungeonRespawn/.github/workflows/core-build.yml deleted file mode 100644 index a178aed..0000000 --- a/modules/DungeonRespawn/.github/workflows/core-build.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: core-build -on: - push: - pull_request: - workflow_dispatch: - -jobs: - build: - uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main - with: - module_repo: ${{ github.event.repository.name }} diff --git a/modules/DungeonRespawn/.gitignore b/modules/DungeonRespawn/.gitignore deleted file mode 100644 index c6e1299..0000000 --- a/modules/DungeonRespawn/.gitignore +++ /dev/null @@ -1,48 +0,0 @@ -!.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 diff --git a/modules/DungeonRespawn/LICENSE b/modules/DungeonRespawn/LICENSE deleted file mode 100644 index 9031171..0000000 --- a/modules/DungeonRespawn/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 AzerothCore - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/modules/DungeonRespawn/README.md b/modules/DungeonRespawn/README.md deleted file mode 100644 index 3270df6..0000000 --- a/modules/DungeonRespawn/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# ![logo](https://camo.githubusercontent.com/e4f036844d45424178f34d39dc3b0d52fdb82c07c5ef3c2aeb7e3da22c1538b3/68747470733a2f2f692e696d6775722e636f6d2f66517762386d332e706e67)Dungeon Respawn - -## About - -This module will teleport the player to the start of the dungeon on death. - -## Install - -Just clone the module into your modules directory for your server, re-run cmake and compile. - -Then enable the module in the module config. - -## Contact - -If you need any help you can join my [Discord Server](https://discord.gg/xdVPGcpJ8C). - -## Credits - -Thanks to Артём Борисов_99 from the AzerothCore Discord for the module suggestion. diff --git a/modules/DungeonRespawn/README_ES.md b/modules/DungeonRespawn/README_ES.md deleted file mode 100644 index d7d6ddc..0000000 --- a/modules/DungeonRespawn/README_ES.md +++ /dev/null @@ -1,66 +0,0 @@ - [English](README.md) | [Español](README_ES.md) - -# PARTE 1 - Cómo crear su propio módulo - -Puede utilizar estos scripts para iniciar su proyecto: - -[Ejemplos de scripts](https://github.com/azerothcore/azerothcore-boilerplates) - -### ¿Cómo probar su módulo? - -Desactivar PCH (cabeceras pre-compiladas) e intentar compilar. Si ha olvidado algunas cabeceras, es hora de añadirlas. Para desactivar PCH, siga este [link](https://github.com/azerothcore/azerothcore-wotlk/wiki/CMake-options) y ponga `USE_COREPCH ` a 0 con Cmake. - -------------------------------------------------------- - -# PARTE 2 - EJEMPLO DE UN README.md -Recuerde que el README.md le explica al resto de las personas que es lo que hace su módulo. Recomendamos escribirlo en ingles quizás, aunque puede ser traducido luego a otros idiomas. - -# MI NUEVO MÓDULO (título) - -## Descripción - -Este módulo permite hacer esto y esto. -(Debe explicar para que se va a utilizar el modulo, cuál es su utilidad) - -## Cómo utilizar - -Haz esto y aquello. - -Puedes agregar una carpeta de pantalla: - -[screenshot](/screenshots/my_module.png?raw=true "screenshot") - -O incluso un video donde expliques su uso: - -[Youtube](https://www.youtube.com/watch?v=T6UEX47mPeE) - - -## Requisitos - -Se debe especificar que versión de azerothcore requiere, porque podría ser incompatible con alguna más adelante. Entonces aclarar por las dudas su compatibilidad no está de más. - -Mi nuevo módulo requiere: - -- AzerothCore v4.0.0+ - - -## Instalación - -``` -1) Simplemente coloque el módulo dentro del directorio `modules` de AzerothCore (repositorio), no la compilación. -2) Importe el SQL manualmente a la base de datos correcta (auth, mundo o caracteres) o con el `db_assembler.sh` (si se proporciona `include.sh`). -3) Vuelva a ejecutar el Cmake y genere la compilación necesaria. (Revise la guía) -``` - -## Editar la configuración del módulo (opcional) - -Si necesita cambiar la configuración del módulo, vaya a la carpeta de configuración de su servidor (donde está su `worldserver` o `worldserver.exe`), copie `my_module.conf.dist` a `my_module.conf` y edite ese nuevo archivo. - - -## Créditos - -* [Yo](https://github.com/YOUR_GITHUB_NAME) (autor del módulo) Edite el enlace para que apunte a su github si lo desea. -* [BarbzYHOOL](https://github.com/barbzyhool) -* [Talamortis](https://github.com/talamortis) - -AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd) diff --git a/modules/DungeonRespawn/README_example.md b/modules/DungeonRespawn/README_example.md deleted file mode 100644 index f31dca8..0000000 --- a/modules/DungeonRespawn/README_example.md +++ /dev/null @@ -1,41 +0,0 @@ -# MY_NEW_MODULE - -## Description - -This module allows to do this and this. - - -## How to use ingame - -Do this and that. - -![my_new_module screenshot](/screenshots/my_module.png?raw=true "my_new_module screenshot") - - -[![Youtube Link](https://i.imgur.com/Jhrdgv6.png)](https://www.youtube.com/watch?v=T6UEX47mPeE) - - -## Requirements - -My_new_module requires: - -- AzerothCore v4.0.0+ - - -## Installation - -``` -1) Simply `git clone` the module under the `modules` directory of your AzerothCore source or copy paste it manually. -2) Import the SQL manually to the right Database (auth, world or characters) or with the `db_assembler.sh` (if `include.sh` provided). -3) Re-run cmake and launch a clean build of AzerothCore. -``` - -## Edit the module's configuration (optional) - -If you need to change the module configuration, go to your server configuration directory (where your `worldserver` or `worldserver.exe` is), copy `my_module.conf.dist` to `my_module.conf` and edit that new file. - - -## Credits - -* [Me](https://github.com/YOUR_GITHUB_NAME) (author of the module): Check out my soundcloud - Join my discord -* AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd) diff --git a/modules/DungeonRespawn/conf/conf.sh.dist b/modules/DungeonRespawn/conf/conf.sh.dist deleted file mode 100644 index 0e78e8a..0000000 --- a/modules/DungeonRespawn/conf/conf.sh.dist +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -## CUSTOM SQL - Important file used by the db_assembler.sh -## Keep only the required variables (base sql files or updates, depending on the DB) - -## BASE SQL - -DB_AUTH_CUSTOM_PATHS+=( - "$MOD_SKELETON_ROOT/sql/auth/base/" -) - -DB_CHARACTERS_CUSTOM_PATHS+=( - "$MOD_SKELETON_ROOT/sql/characters/base/" -) - -DB_WORLD_CUSTOM_PATHS+=( - "$MOD_SKELETON_ROOT/sql/world/base/" -) - -## UPDATES - -DB_AUTH_UPDATES_PATHS+=( - "$MOD_SKELETON_ROOT/sql/auth/updates/" -) - -DB_CHARACTERS_UPDATES_PATHS+=( - "$MOD_SKELETON_ROOT/sql/characters/updates/" -) - -DB_WORLD_UPDATES_PATHS+=( - "$MOD_SKELETON_ROOT/sql/world/updates/" -) diff --git a/modules/DungeonRespawn/conf/dungeonrespawn.conf.dist b/modules/DungeonRespawn/conf/dungeonrespawn.conf.dist deleted file mode 100644 index 9180b23..0000000 --- a/modules/DungeonRespawn/conf/dungeonrespawn.conf.dist +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 -# - -[worldserver] - -######################################## -# Dungeon Respawn configuration -######################################## -# -# DungeonRespawn.Enable -# Description: Enables the Dungeon Respawn module. -# Default: 0 - Disabled -# 1 - Enabled -# - -DungeonRespawn.Enable = 0 - -# -# DungeonRespawn.RespawnHealthPct -# Description: The amount of health in % to respawn with. -# Range: 0.0 - 100.0 -# Default: 100.0 -# - -DungeonRespawn.RespawnHealthPct = 50.0 diff --git a/modules/DungeonRespawn/data/sql/db-characters/base/dungeonrespawn_char_0000_00_00_00.sql b/modules/DungeonRespawn/data/sql/db-characters/base/dungeonrespawn_char_0000_00_00_00.sql deleted file mode 100644 index 6a8e249..0000000 --- a/modules/DungeonRespawn/data/sql/db-characters/base/dungeonrespawn_char_0000_00_00_00.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE IF NOT EXISTS `dungeonrespawn_playerinfo` ( - `guid` bigint(20) unsigned DEFAULT NULL, - `map` int(11) DEFAULT NULL, - `x` float DEFAULT NULL, - `y` float DEFAULT NULL, - `z` float DEFAULT NULL, - `o` float DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; \ No newline at end of file diff --git a/modules/DungeonRespawn/data/sql/db-characters/updates/dungeonrespawn_char_2023_01_12_01.sql b/modules/DungeonRespawn/data/sql/db-characters/updates/dungeonrespawn_char_2023_01_12_01.sql deleted file mode 100644 index 0cc8c69..0000000 --- a/modules/DungeonRespawn/data/sql/db-characters/updates/dungeonrespawn_char_2023_01_12_01.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM dungeonrespawn_playerinfo; - -ALTER TABLE dungeonrespawn_playerinfo -MODIFY guid BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY; \ No newline at end of file diff --git a/modules/DungeonRespawn/icon.png b/modules/DungeonRespawn/icon.png deleted file mode 100644 index 38bc640b512e9ec2dfcc746e5d8ebfc8b85f9012..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2790 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 - if (!map) - { - return false; - } - - if (!map->IsDungeon() && !map->IsRaid()) - { - return false; - } - - return true; -} -void DSPlayerScript::OnPlayerReleasedGhost(Player* player) -{ - if (!drEnabled) - { - return; - } - - if (!IsInsideDungeonRaid(player)) - { - return; - } - - playersToTeleport.push_back(player->GetGUID()); -} - -void DSPlayerScript::ResurrectPlayer(Player* player) -{ - player->ResurrectPlayer(respawnHpPct / 100.0f, false); - player->SpawnCorpseBones(); -} - -bool DSPlayerScript::OnBeforeTeleport(Player* player, uint32 mapid, float /*x*/, float /*y*/, float /*z*/, float /*orientation*/, uint32 /*options*/, Unit* /*target*/) -{ - if (!drEnabled) - { - return true; - } - - if (!player) - { - return true; - } - - if (player->GetMapId() != mapid) - { - auto prData = GetOrCreateRespawnData(player); - prData->isTeleportingNewMap = true; - } - - if (!IsInsideDungeonRaid(player)) - { - return true; - } - - if (!player->isDead()) - { - return true; - } - - GuidVector::iterator itToRemove; - bool canRestore = false; - - for (auto it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it) - { - if (*it == player->GetGUID()) - { - itToRemove = it; - canRestore = true; - break; - } - } - - if (!canRestore) - { - return true; - } - - playersToTeleport.erase(itToRemove); - - auto prData = GetOrCreateRespawnData(player); - if (prData) - { - //Invalid Player Restore data, use default behaviour. - if (prData->dungeon.map == -1) - { - return true; - } - - if (prData->dungeon.map != int32(player->GetMapId())) - { - return true; - } - - player->TeleportTo(prData->dungeon.map, prData->dungeon.x, prData->dungeon.y, prData->dungeon.z, prData->dungeon.o); - ResurrectPlayer(player); - return false; - } - - return true; -} - -void DSWorldScript::OnAfterConfigLoad(bool reload) -{ - if (reload) - { - SaveRespawnData(); - respawnData.clear(); - } - - drEnabled = sConfigMgr->GetOption("DungeonRespawn.Enable", false); - respawnHpPct = sConfigMgr->GetOption("DungeonRespawn.RespawnHealthPct", 50.0f); - - QueryResult qResult = CharacterDatabase.Query("SELECT `guid`, `map`, `x`, `y`, `z`, `o` FROM `dungeonrespawn_playerinfo`"); - - if (qResult) - { - uint32 dataCount = 0; - - do - { - Field* fields = qResult->Fetch(); - - PlayerRespawnData prData; - DungeonData dData; - prData.guid = ObjectGuid(fields[0].Get()); - dData.map = fields[1].Get(); - dData.x = fields[2].Get(); - dData.y = fields[3].Get(); - dData.z = fields[4].Get(); - dData.o = fields[5].Get(); - prData.dungeon = dData; - prData.isTeleportingNewMap = false; - prData.inDungeon = false; - - respawnData.push_back(prData); - - dataCount++; - } while (qResult->NextRow()); - - LOG_INFO("module", "Loaded '{}' rows from 'dungeonrespawn_playerinfo' table.", dataCount); - } - else - { - LOG_INFO("module", "Loaded '0' rows from 'dungeonrespawn_playerinfo' table."); - return; - } -} - -void DSWorldScript::OnShutdown() -{ - SaveRespawnData(); -} - -void DSWorldScript::SaveRespawnData() -{ - for (const auto& prData : respawnData) - { - if (prData.inDungeon) - { - CharacterDatabase.Execute("INSERT INTO `dungeonrespawn_playerinfo` (guid, map, x, y, z, o) VALUES ({}, {}, {}, {}, {}, {}) ON DUPLICATE KEY UPDATE map={}, x={}, y={}, z={}, o={}", - prData.guid.GetRawValue(), - prData.dungeon.map, - prData.dungeon.x, - prData.dungeon.y, - prData.dungeon.z, - prData.dungeon.o, - prData.dungeon.map, - prData.dungeon.x, - prData.dungeon.y, - prData.dungeon.z, - prData.dungeon.o); - } - else - { - CharacterDatabase.Execute("DELETE FROM `dungeonrespawn_playerinfo` WHERE guid = {}", prData.guid.GetRawValue()); - } - } -} - -PlayerRespawnData* DSPlayerScript::GetOrCreateRespawnData(Player* player) -{ - for (auto it = respawnData.begin(); it != respawnData.end(); ++it) - { - if (it != respawnData.end()) - { - if (player->GetGUID() == it->guid) - { - return &(*it); - } - } - } - - CreateRespawnData(player); - - return GetOrCreateRespawnData(player); -} - -void DSPlayerScript::OnMapChanged(Player* player) -{ - if (!player) - { - return; - } - - auto prData = GetOrCreateRespawnData(player); - - if (!prData) - { - return; - } - - bool inDungeon = IsInsideDungeonRaid(player); - prData->inDungeon = inDungeon; - - if (!inDungeon) - { - return; - } - - if (!prData->isTeleportingNewMap) - { - return; - } - - prData->dungeon.map = player->GetMapId(); - prData->dungeon.x = player->GetPositionX(); - prData->dungeon.y = player->GetPositionY(); - prData->dungeon.z = player->GetPositionZ(); - prData->dungeon.o = player->GetOrientation(); - - prData->isTeleportingNewMap = false; -} - -void DSPlayerScript::CreateRespawnData(Player* player) -{ - DungeonData newDData; - newDData.map = -1; - newDData.x = 0; - newDData.y = 0; - newDData.z = 0; - newDData.o = 0; - - PlayerRespawnData newPrData; - newPrData.dungeon = newDData; - newPrData.guid = player->GetGUID(); - newPrData.isTeleportingNewMap = false; - newPrData.inDungeon = false; - - respawnData.push_back(newPrData); -} - -void DSPlayerScript::OnLogin(Player* player) -{ - if (!player) - { - return; - } - - GetOrCreateRespawnData(player); -} - -void DSPlayerScript::OnLogout(Player* player) -{ - if (!player) - { - return; - } - - for (auto it = playersToTeleport.begin(); it < playersToTeleport.end(); ++it) - { - if (player->GetGUID() == (*it)) - { - playersToTeleport.erase(it); - } - } -} - -void SC_AddDungeonRespawnScripts() -{ - new DSWorldScript(); - new DSPlayerScript(); -} diff --git a/modules/DungeonRespawn/src/DungeonRespawn.h b/modules/DungeonRespawn/src/DungeonRespawn.h deleted file mode 100644 index 9597675..0000000 --- a/modules/DungeonRespawn/src/DungeonRespawn.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef MODULE_DUNGEONRESPAWN_H -#define MODULE_DUNGEONRESPAWN_H - -#include "ScriptMgr.h" -#include "LFGMgr.h" -#include "Player.h" -#include "Config.h" -#include "Chat.h" -#include - -struct DungeonData -{ - int32 map; - float x; - float y; - float z; - float o; -}; - -struct PlayerRespawnData -{ - ObjectGuid guid; - DungeonData dungeon; - bool isTeleportingNewMap; - bool inDungeon; -}; - -std::vector respawnData; - -bool drEnabled; -float respawnHpPct; - -class DSPlayerScript : public PlayerScript -{ -public: - DSPlayerScript() : PlayerScript("DSPlayerScript") { } - -private: - std::vector playersToTeleport; - bool IsInsideDungeonRaid(Player* /*player*/); - void ResurrectPlayer(Player* /*player*/); - PlayerRespawnData* GetOrCreateRespawnData(Player* /*player*/); - void CreateRespawnData(Player* /*player*/); - void OnPlayerReleasedGhost(Player* /*player*/) override; - bool OnBeforeTeleport(Player* /*player*/, uint32 /*mapid*/, float /*x*/, float /*y*/, float /*z*/, float /*orientation*/, uint32 /*options*/, Unit* /*target*/) override; - void OnMapChanged(Player* /*player*/) override; - void OnLogin(Player* /*player*/) override; - void OnLogout(Player* /*player*/) override; -}; - -class DSWorldScript : public WorldScript -{ -public: - DSWorldScript() : WorldScript("DSWorldScript") { } - -private: - void OnAfterConfigLoad(bool /*reload*/) override; - void OnShutdown() override; - void SaveRespawnData(); -}; - -#endif //MODULE_DUNGEONRESPAWN_H diff --git a/modules/DungeonRespawn/src/MP_loader.cpp b/modules/DungeonRespawn/src/MP_loader.cpp deleted file mode 100644 index 5d0e9fc..0000000 --- a/modules/DungeonRespawn/src/MP_loader.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 - */ - -// From SC -void SC_AddDungeonRespawnScripts(); - -// Add all -// cf. the naming convention https://github.com/azerothcore/azerothcore-wotlk/blob/master/doc/changelog/master.md#how-to-upgrade-4 -// additionally replace all '-' in the module folder name with '_' here -void AddDungeonRespawnScripts() -{ - SC_AddDungeonRespawnScripts(); -} -