Created
April 2, 2013 17:33
-
-
Save Raydor/5294300 to your computer and use it in GitHub Desktop.
Evita a los jugadores que vayan a la Isla MJ y les envía a La Jaula.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp | |
--- a/src/server/game/Entities/Player/Player.cpp | |
+++ b/src/server/game/Entities/Player/Player.cpp | |
@@ -34,6 +34,7 @@ | |
#include "Chat.h" | |
#include <cmath> | |
#include "Common.h" | |
+#include "Config.h" | |
#include "ConditionMgr.h" | |
#include "CreatureAI.h" | |
#include "DatabaseEnv.h" | |
@@ -7514,6 +7515,53 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) | |
if (Guild* guild = GetGuild()) | |
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_ZONEID, newZone); | |
} | |
+ // Previene a los jugadores de entrar en la Isla de los MJ | |
+ if (sWorld->getBoolConfig(CONFIG_GMISLAND_NO_PERMITIDO_PLAYERS) == true) | |
+ { | |
+ if (newZone == 876 && AccountMgr::IsPlayerAccount(GetSession()->GetSecurity())) | |
+ { | |
+ uint32 map = 13; | |
+ double coords[4] = { 1.118799, 0.477914, -144.708650, 3.133046 }; // Jail Box | |
+ | |
+ std::string config = ConfigMgr::GetStringDefault("IslaMJ.TeleportarHacia", ""); | |
+ if (config != "") | |
+ { | |
+ std::istringstream ss(config); | |
+ | |
+ for (int i = 0; i < 5; ++i) | |
+ { | |
+ if (!ss) | |
+ break; | |
+ | |
+ if (i == 0) | |
+ ss >> map; | |
+ else | |
+ ss >> coords[i - 1]; | |
+ } | |
+ } | |
+ | |
+ if (map == 876) | |
+ { | |
+ sLog->outError("Error: No se puede asignar un teleport a la Isla MJ (mapa:876). Enviando al posible hacker a la posicion por defecto (La Jaula)"); | |
+ map = 13; | |
+ coords[0] = 1.118799; // x | |
+ coords[1] = 0.477914; // y | |
+ coords[2] = -144.708650; // z | |
+ coords[3] = 3.133046; // orientacion | |
+ } | |
+ | |
+ sLog->outError("El Jugador (GUID: %u) ha intentado acceder a la Isla de los MJ.", GetGUIDLow()); | |
+ TeleportTo(map, coords[0], coords[1], coords[2], coords[3]); // Tele to Jail Box | |
+ if (map == 13) | |
+ CastSpell(this, 9454, true); // Casteo de la spell Freeze sobre el jugador | |
+ | |
+ if (sWorld->getBoolConfig(CONFIG_GMISLAND_BANEO_HABILITADO) == true) | |
+ { | |
+ sLog->outError("El Jugador (GUID: %u) ha intentado acceder a la Isla de los MJ. Baneando la Cuenta de Jugador.", GetGUIDLow()); | |
+ sWorld->BanAccount(BAN_ACCOUNT, this->GetName(), secsToTimeString(TimeStringToSecs("-1"), true).c_str(), "Estar en la Isla de los MJ", "Proteccion Antihack"); | |
+ } | |
+ } | |
+ } | |
// group update | |
if (Group* group = GetGroup()) | |
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp | |
--- a/src/server/game/Spells/SpellEffects.cpp | |
+++ b/src/server/game/Spells/SpellEffects.cpp | |
@@ -4549,6 +4549,13 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/) | |
Player* target = (Player*)m_caster; | |
+ // Esto sirve para prevenir a los jugadores usar el Atascado en La Jaula. | |
+ if (target->GetMapId() == 13 && AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity())) | |
+ { | |
+ sLog->outError("El jugador %s (guid %u) ha intentado usar Atascado en La Jaula.", target->GetName(), target->GetGUIDLow()); | |
+ return; | |
+ } | |
+ | |
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck"); | |
sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName().c_str(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); | |
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp | |
--- a/src/server/game/World/World.cpp | |
+++ b/src/server/game/World/World.cpp | |
@@ -1227,6 +1227,10 @@ void World::LoadConfigSettings(bool reload) | |
m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true); | |
m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true); | |
+ // Previene a los jugadores acceder a la Isla de los MJ | |
+ m_bool_configs[CONFIG_GMISLAND_NO_PERMITIDO_PLAYERS] = ConfigMgr::GetBoolDefault("IslaMJ.ProhibirAccesoJugadores.Habilitado", true); | |
+ m_bool_configs[CONFIG_GMISLAND_BANEO_HABILITADO] = ConfigMgr::GetBoolDefault("IslaMJ.Baneo.Habilitado", false); | |
+ | |
// call ScriptMgr if we're reloading the configuration | |
m_bool_configs[CONFIG_WINTERGRASP_ENABLE] = ConfigMgr::GetBoolDefault("Wintergrasp.Enable", false); | |
m_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMax", 100); | |
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h | |
--- a/src/server/game/World/World.h | |
+++ b/src/server/game/World/World.h | |
@@ -164,6 +164,8 @@ enum WorldBoolConfigs | |
CONFIG_QUEST_IGNORE_AUTO_ACCEPT, | |
CONFIG_QUEST_IGNORE_AUTO_COMPLETE, | |
CONFIG_WARDEN_ENABLED, | |
+ CONFIG_GMISLAND_NO_PERMITIDO_PLAYERS, | |
+ CONFIG_GMISLAND_BANEO_HABILITADO, | |
CONFIG_WINTERGRASP_ENABLE, | |
BOOL_CONFIG_VALUE_COUNT | |
}; | |
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist | |
--- a/src/server/worldserver/worldserver.conf.dist | |
+++ b/src/server/worldserver/worldserver.conf.dist | |
@@ -2926,6 +2926,29 @@ PlayerDump.DisallowPaths = 1 | |
PlayerDump.DisallowOverwrite = 1 | |
# | |
+# IslaMJ.ProhibirAccesoJugadores.Habilitado | |
+# Previene el acceso a los jugadores a la Isla de los MJ | |
+# Por defecto: 1 - Habilitado (los jugadores no pueden entrar a la IslaMJ) | |
+# 0 - Deshabilitado (los jugadores pueden entrar a la IslaMJ) | |
+ | |
+IslaMJ.ProhibirAccesoJugadores.Habilitado = 1 | |
+ | |
+# | |
+# IslaMJ.TeleportarHacia | |
+# Teletransporta al jugador a las coordenadas especificas (mapa, x, y, z, orientacion) | |
+# Por defecto: "13 1.118799 0.477914 -144.708650 3.133046" (La Jaula) | |
+ | |
+IslaMJ.TeleportarHacia = "13 1.118799 0.477914 -144.708650 3.133046" | |
+ | |
+# | |
+# IslaMJ.Baneo.Habilitado | |
+# Habilita el baneo a los jugadores que intentan acceder a la Isla de los MJ | |
+# Por defecto: 0 - Deshabilitado (no los banea) | |
+# 1 - Habilitado (banea a los jugadores que entran) | |
+ | |
+IslaMJ.Baneo.Habilitado = 0 | |
+ | |
+# | |
################################################################################################### | |
################################################################################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment