Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Need more info. Are you wanting to prevent players from entering wintergrasp? I.e. if they enter Win

[DiscordArchive] Need more info. Are you wanting to prevent players from entering wintergrasp? I.e. if they enter Win

[DiscordArchive] Need more info. Are you wanting to prevent players from entering wintergrasp? I.e. if they enter Win

rektbyfaith
Administrator
0
06-19-2025, 05:51 AM
#1
Archived author: Aldori • Posted: 2025-06-19T05:51:32.093000+00:00
Original source

Need more info. Are you wanting to prevent players from entering wintergrasp? I.e. if they enter Wintergrasp then teleport them out? Where do you want it to teleport them to?
rektbyfaith
06-19-2025, 05:51 AM #1

Archived author: Aldori • Posted: 2025-06-19T05:51:32.093000+00:00
Original source

Need more info. Are you wanting to prevent players from entering wintergrasp? I.e. if they enter Wintergrasp then teleport them out? Where do you want it to teleport them to?

rektbyfaith
Administrator
0
06-19-2025, 05:52 AM
#2
Archived author: Aldori • Posted: 2025-06-19T05:52:14.176000+00:00
Original source

This is what you want to use https://www.azerothcore.org/eluna/Player/Teleport.html
[Embed: Player:Teleport - Eluna]
API documentation for the Player:Teleport method in the Eluna engine.
https://www.azerothcore.org/eluna/Player/Teleport.html
rektbyfaith
06-19-2025, 05:52 AM #2

Archived author: Aldori • Posted: 2025-06-19T05:52:14.176000+00:00
Original source

This is what you want to use https://www.azerothcore.org/eluna/Player/Teleport.html
[Embed: Player:Teleport - Eluna]
API documentation for the Player:Teleport method in the Eluna engine.
https://www.azerothcore.org/eluna/Player/Teleport.html

rektbyfaith
Administrator
0
06-19-2025, 12:44 PM
#3
Archived author: Yuppls • Posted: 2025-06-19T12:44:35.885000+00:00
Original source

remove all auras from them before you teleport them away.
rektbyfaith
06-19-2025, 12:44 PM #3

Archived author: Yuppls • Posted: 2025-06-19T12:44:35.885000+00:00
Original source

remove all auras from them before you teleport them away.

rektbyfaith
Administrator
0
06-19-2025, 01:44 PM
#4
Archived author: Racknar0 • Posted: 2025-06-19T13:44:45.173000+00:00
Original source

```AFK_KILLER.wintergraspZoneId = 4197 -- ID de Wintergrasp
-- 4) Al unirse a raid en Wintergrasp, validamos si ya hay alguien en esa zona con la misma IP
local function onGroupJoinWinter(event, group, guid)
if not group:IsRaidGroup() then return end

local joined = GetPlayerByGUID(guid)
if not joined then return end

-- Solo si el que se unió está en Wintergrasp
if joined:GetZoneId() ~= AFK_KILLER.wintergraspZoneId then
print("[RaidJoin] " .. joined:GetName() .. " NO está en Wintergrasp, no validamos.")
return
end

local joinedGUID = joined:GetGUIDLow()
local newIP = joined:GetPlayerIP()
print(string.format(
"[RaidJoin] %s se unió a raid en Wintergrasp (IP=%s), comprobando misma zona…",
joined:GetName(), newIP
))

-- Recorremos solo jugadores que verdaderamente están en Wintergrasp
for _, other in ipairs(GetPlayersInWorld()) do
if other:GetZoneId() == AFK_KILLER.wintergraspZoneId then
local otherGUID = other:GetGUIDLow()
-- Excluimos al propio y comparamos IP
if otherGUID ~= joinedGUID and other:GetPlayerIP() == newIP then

-- 1) Sacar del grupo de raid
joined:RemoveFromGroup()

-- 2) Eliminar del raid del BG
joined:RemoveFromBattlegroundRaid()

-- 3) Forzar salida del Battleground (sin enviarlo al cementerio)
joined:LeaveBattleground(false)

-- 4) Ahora sí teleport a Dalaran

-- Teletransportar al jugador a Dalaran
joined:Teleport(571, 5893.778, 648.0709, 645.4964, 6.0681033)
-- Gritar
joined:Yell( "Fui teletransportado a Dalaran por ser un posible multicuenta en Conquista de Invierno.", 0 )
joined:SendBroadcastMessage("Estas marcardo como posible multicuenta en Conquista de Invierno. Has sido teletransportado a Dalaran. si esta acción se repite podrías ser baneado por multicuenta. en campos de batalla.")

print(string.format(
"→ Alerta: %s (zona %d) comparte IP (%s) con %s en Wintergrasp",
other:GetName(),
other:GetZoneId(),
newIP,
joined:GetName()
))
end
end
end
end

-- Registro del evento: 1 = EVENT_GROUP_JOINED
RegisterGroupEvent(1, onGroupJoinWinter)```


My intention is to prevent a person with the same IP from entering Wintergrasp, since there are multi-accounts farming the battleground.
rektbyfaith
06-19-2025, 01:44 PM #4

Archived author: Racknar0 • Posted: 2025-06-19T13:44:45.173000+00:00
Original source

```AFK_KILLER.wintergraspZoneId = 4197 -- ID de Wintergrasp
-- 4) Al unirse a raid en Wintergrasp, validamos si ya hay alguien en esa zona con la misma IP
local function onGroupJoinWinter(event, group, guid)
if not group:IsRaidGroup() then return end

local joined = GetPlayerByGUID(guid)
if not joined then return end

-- Solo si el que se unió está en Wintergrasp
if joined:GetZoneId() ~= AFK_KILLER.wintergraspZoneId then
print("[RaidJoin] " .. joined:GetName() .. " NO está en Wintergrasp, no validamos.")
return
end

local joinedGUID = joined:GetGUIDLow()
local newIP = joined:GetPlayerIP()
print(string.format(
"[RaidJoin] %s se unió a raid en Wintergrasp (IP=%s), comprobando misma zona…",
joined:GetName(), newIP
))

-- Recorremos solo jugadores que verdaderamente están en Wintergrasp
for _, other in ipairs(GetPlayersInWorld()) do
if other:GetZoneId() == AFK_KILLER.wintergraspZoneId then
local otherGUID = other:GetGUIDLow()
-- Excluimos al propio y comparamos IP
if otherGUID ~= joinedGUID and other:GetPlayerIP() == newIP then

-- 1) Sacar del grupo de raid
joined:RemoveFromGroup()

-- 2) Eliminar del raid del BG
joined:RemoveFromBattlegroundRaid()

-- 3) Forzar salida del Battleground (sin enviarlo al cementerio)
joined:LeaveBattleground(false)

-- 4) Ahora sí teleport a Dalaran

-- Teletransportar al jugador a Dalaran
joined:Teleport(571, 5893.778, 648.0709, 645.4964, 6.0681033)
-- Gritar
joined:Yell( "Fui teletransportado a Dalaran por ser un posible multicuenta en Conquista de Invierno.", 0 )
joined:SendBroadcastMessage("Estas marcardo como posible multicuenta en Conquista de Invierno. Has sido teletransportado a Dalaran. si esta acción se repite podrías ser baneado por multicuenta. en campos de batalla.")

print(string.format(
"→ Alerta: %s (zona %d) comparte IP (%s) con %s en Wintergrasp",
other:GetName(),
other:GetZoneId(),
newIP,
joined:GetName()
))
end
end
end
end

-- Registro del evento: 1 = EVENT_GROUP_JOINED
RegisterGroupEvent(1, onGroupJoinWinter)```


My intention is to prevent a person with the same IP from entering Wintergrasp, since there are multi-accounts farming the battleground.

rektbyfaith
Administrator
0
06-19-2025, 01:45 PM
#5
Archived author: Racknar0 • Posted: 2025-06-19T13:45:17.027000+00:00
Original source

I tried this yesterday and it resulted in a lockup/crash.
rektbyfaith
06-19-2025, 01:45 PM #5

Archived author: Racknar0 • Posted: 2025-06-19T13:45:17.027000+00:00
Original source

I tried this yesterday and it resulted in a lockup/crash.

rektbyfaith
Administrator
0
06-19-2025, 02:30 PM
#6
Archived author: Aldori • Posted: 2025-06-19T14:30:05.592000+00:00
Original source

You can try something like this. It's hard to say exactly what the crash is from without any error or log to go with it, but i'm assuming it's from calling 3 different methods that all cause the player to leave the group simultaneously as the teleport as well.
Wintergrasp_tele.txt
rektbyfaith
06-19-2025, 02:30 PM #6

Archived author: Aldori • Posted: 2025-06-19T14:30:05.592000+00:00
Original source

You can try something like this. It's hard to say exactly what the crash is from without any error or log to go with it, but i'm assuming it's from calling 3 different methods that all cause the player to leave the group simultaneously as the teleport as well.
Wintergrasp_tele.txt

rektbyfaith
Administrator
0
06-19-2025, 02:31 PM
#7
Archived author: Racknar0 • Posted: 2025-06-19T14:31:22.688000+00:00
Original source

Alright, I'm going to test it and I'll let you know.
rektbyfaith
06-19-2025, 02:31 PM #7

Archived author: Racknar0 • Posted: 2025-06-19T14:31:22.688000+00:00
Original source

Alright, I'm going to test it and I'll let you know.

rektbyfaith
Administrator
0
06-19-2025, 02:57 PM
#8
Archived author: Racknar0 • Posted: 2025-06-19T14:57:01.339000+00:00
Original source

Quick question: Does joined:RemoveAllAuras() work the same as the .unaura all command? Because in several cases, that command has been used on characters and it permanently removes their auras, causing bugs.
rektbyfaith
06-19-2025, 02:57 PM #8

Archived author: Racknar0 • Posted: 2025-06-19T14:57:01.339000+00:00
Original source

Quick question: Does joined:RemoveAllAuras() work the same as the .unaura all command? Because in several cases, that command has been used on characters and it permanently removes their auras, causing bugs.

rektbyfaith
Administrator
0
06-19-2025, 04:14 PM
#9
Archived author: Racknar0 • Posted: 2025-06-19T16:14:50.992000+00:00
Original source

In the end, I left it like that because the Lua event part you sent me doesn't store the player as an argument — instead, I had to capture the GUID and then extract the player from it.

However, something strange happens: I send the player to Dalaran and disconnect them. When I reconnect, I start flying toward Wintergrasp. When I rejoin the raid, it removes me from the raid but doesn't teleport me to Dalaran — instead, it disconnects me.

Later, if I leave the zone and come back in, it adds me to the raid, removes me again, and then it sends me to Dalaran. That’s the only detail missing — once that’s fixed, it’s done.

I have it running in production with 70 players right now, let’s see how it goes.


```
-- 4) Al unirse a raid en Wintergrasp, validamos si ya hay alguien en esa zona con la misma IP
local function onGroupJoinWinter(event, group, guid)
if not group:IsRaidGroup() then return end

local joined = GetPlayerByGUID(guid)
if not joined or not joined:IsInWorld() then return end

-- Solo si el que se unió está en Wintergrasp
if joined:GetZoneId() ~= AFK_KILLER.wintergraspZoneId then
print("[RaidJoin] " .. joined:GetName() .. " NO está en Wintergrasp, no validamos.")
return
end

local joinedGUID = joined:GetGUIDLow()
local newIP = joined:GetPlayerIP()

print(string.format("[RaidJoin] %s se unió a raid en Wintergrasp (IP=%s), comprobando misma zona…", joined:GetName(), newIP))

-- Recorremos solo jugadores que verdaderamente están en Wintergrasp
for _, other in ipairs(GetPlayersInWorld()) do
if other:GetZoneId() == AFK_KILLER.wintergraspZoneId then
if other:GetGUIDLow() ~= joinedGUID and other:GetPlayerIP() == newIP then

print(string.format("→ Alerta: %s y %s comparten la misma IP (%s) en Wintergrasp.", other:GetName(), joined:GetName(), newIP))

joined:RemoveFromBattlegroundRaid()

if joined:IsInGroup() then
joined:RemoveFromGroup()
end

if joined:InBattleground() then
joined:LeaveBattleground(false)
end

-- Elimina todas las auras activas antes de teletransportar
-- joined:RemoveAllAuras()

-- Teletransporte retrasado para ayudar a prevenir problemas de sincronización
local joinedGUID = joined:GetGUIDLow()

-- programa un único callback dentro de una closure que capture joinedGUID
CreateLuaEvent(function()
local p = GetPlayerByGUID(joinedGUID)
if not p then return end

print("Esta siendo teletransportado a Dalaran por multicuenta…")
print("Jugador encontrado: " .. p:GetName())

-- (ya lo sacaste del BG/grupo antes)
p:Yell("Fui teletransportado a Dalaran por posible multicuenta", 0)
p:Teleport(571, 5893.778, 648.0709, 645.4964, 6.0681033)
-- Kickear al jugador después de teletransportarlo
p:KickPlayer()
end,
100, -- delay en ms
1) -- 1 sola ejecución

return
end
end
end
end

RegisterGroupEvent(1, onGroupJoinWinter)
```
rektbyfaith
06-19-2025, 04:14 PM #9

Archived author: Racknar0 • Posted: 2025-06-19T16:14:50.992000+00:00
Original source

In the end, I left it like that because the Lua event part you sent me doesn't store the player as an argument — instead, I had to capture the GUID and then extract the player from it.

However, something strange happens: I send the player to Dalaran and disconnect them. When I reconnect, I start flying toward Wintergrasp. When I rejoin the raid, it removes me from the raid but doesn't teleport me to Dalaran — instead, it disconnects me.

Later, if I leave the zone and come back in, it adds me to the raid, removes me again, and then it sends me to Dalaran. That’s the only detail missing — once that’s fixed, it’s done.

I have it running in production with 70 players right now, let’s see how it goes.


```
-- 4) Al unirse a raid en Wintergrasp, validamos si ya hay alguien en esa zona con la misma IP
local function onGroupJoinWinter(event, group, guid)
if not group:IsRaidGroup() then return end

local joined = GetPlayerByGUID(guid)
if not joined or not joined:IsInWorld() then return end

-- Solo si el que se unió está en Wintergrasp
if joined:GetZoneId() ~= AFK_KILLER.wintergraspZoneId then
print("[RaidJoin] " .. joined:GetName() .. " NO está en Wintergrasp, no validamos.")
return
end

local joinedGUID = joined:GetGUIDLow()
local newIP = joined:GetPlayerIP()

print(string.format("[RaidJoin] %s se unió a raid en Wintergrasp (IP=%s), comprobando misma zona…", joined:GetName(), newIP))

-- Recorremos solo jugadores que verdaderamente están en Wintergrasp
for _, other in ipairs(GetPlayersInWorld()) do
if other:GetZoneId() == AFK_KILLER.wintergraspZoneId then
if other:GetGUIDLow() ~= joinedGUID and other:GetPlayerIP() == newIP then

print(string.format("→ Alerta: %s y %s comparten la misma IP (%s) en Wintergrasp.", other:GetName(), joined:GetName(), newIP))

joined:RemoveFromBattlegroundRaid()

if joined:IsInGroup() then
joined:RemoveFromGroup()
end

if joined:InBattleground() then
joined:LeaveBattleground(false)
end

-- Elimina todas las auras activas antes de teletransportar
-- joined:RemoveAllAuras()

-- Teletransporte retrasado para ayudar a prevenir problemas de sincronización
local joinedGUID = joined:GetGUIDLow()

-- programa un único callback dentro de una closure que capture joinedGUID
CreateLuaEvent(function()
local p = GetPlayerByGUID(joinedGUID)
if not p then return end

print("Esta siendo teletransportado a Dalaran por multicuenta…")
print("Jugador encontrado: " .. p:GetName())

-- (ya lo sacaste del BG/grupo antes)
p:Yell("Fui teletransportado a Dalaran por posible multicuenta", 0)
p:Teleport(571, 5893.778, 648.0709, 645.4964, 6.0681033)
-- Kickear al jugador después de teletransportarlo
p:KickPlayer()
end,
100, -- delay en ms
1) -- 1 sola ejecución

return
end
end
end
end

RegisterGroupEvent(1, onGroupJoinWinter)
```

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)