Fácil amigos este fue un anti speed que inplemente hace muchos años en mi sourcer y lo tenía desactivado pero he visto mucha gente que anda usando hack así que lo volví a activar lo comparto para quienes les interese tenerlo en su sourcer directamente y no en el loader ya que en el loader se puede pasar desapercivido con un poco de cónocimiento
En mi caso yo lo tengo en el PacketHandler.cs que mi sourcer es un poco vieja y maneja dicha estructura a qui el código:
static void PlayerJump(Data generalData, Client.GameClient client)
{
client.Entity.KillCount2 = 0;
//client.Entity.KillCount /= 2;
client.Entity.SpiritFocus = false;
ushort oldX = client.Entity.X;
ushort oldY = client.Entity.Y;
client.Entity.Action = DeltaPower.Game.Enums.ConquerAction.None;
client.Mining = false;
if (client.Entity.ContainsFlag(Update.Flags.CastPray))
{
client.Entity.RemoveFlag(Update.Flags.CastPray);
foreach (var Client in client.Prayers)
{
if (Client.Entity.ContainsFlag(Update.Flags.Praying))
{
Client.Entity.RemoveFlag(Update.Flags.Praying);
}
}
client.Prayers.Clear();
}
if (client.Entity.ContainsFlag(Update.Flags.Praying))
{
client.Entity.RemoveFlag(Update.Flags.Praying);
client.PrayLead.Prayers.Remove(client);
client.PrayLead = null;
}
Time32 Now = Time32.Now;
client.Attackable = true;
if (client.Entity.AttackPacket != null)
{
client.Entity.AttackPacket = null;
}
if (client.Entity.Dead)
{
if (Now > client.Entity.DeathStamp.AddSeconds(4))
{
client.Disconnect();
return;
}
}
ushort new_X = BitConverter.ToUInt16(generalData.ToArray(), 12);
ushort new_Y = BitConverter.ToUInt16(generalData.ToArray(), 14);
if (client.lastJumpDistance == 0) goto Jump;
if (client.Entity.ContainsFlag(Update.Flags.Ride))
{
int distance = Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
ushort take = (ushort)(1.5F * (distance / 2));
if (client.Vigor >= take)
{
client.Vigor -= take;
Network.GamePackets.Vigor vigor = new Network.GamePackets.Vigor(true);
vigor.Amount = client.Vigor;
vigor.Send(client);
}
else
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
}
client.LastJumpTime = (int)Kernel.maxJumpTime(client.lastJumpDistance);
int a1 = Convert.ToInt32(generalData.TimeStamp.GetHashCode() - client.LastClientJump.GetHashCode());
if (a1 <= 500)
{
if (!client.Entity.OnCyclone() && !client.Entity.ContainsFlag(Update.Flags.Ride) && !client.Entity.OnOblivion() && !client.Entity.OnSuperman() && !client.Entity.OnSuperman() && !client.Entity.OnSuperCyclone() && !client.Entity.OnDragonCyclone() && !client.Entity.Transformed)
{
if (Now > client.Entity.OblivionStamp.AddSeconds(client.Entity.OblivionTime + 5) && Now > client.Entity.CycloneStamp.AddSeconds(client.Entity.CycloneTime + 5) && Now > client.Entity.SupermanStamp.AddSeconds(client.Entity.SupermanTime + 5)&& Now > client.Entity.DragonCycloneStamp.AddSeconds(client.Entity.DragonCycloneTime + 5) && Now > client.Entity.BladeFlurryStamp.AddSeconds(client.Entity.SupermanTime + 5) && Now > client.Entity.CycloneStamp.AddSeconds(client.Entity.CycloneTime + 5))
{
//ServerBase.Kernel.Txt(new Message("[Anti-SpeedHack] " + client.Entity.Name + " He/She Is Using SpeedHack and He/She Was Teleported To Jail, If He/She Still Using Will Get Banned .", System.Drawing.Color.Red, Message.Center), Program.GamePool);
client.Entity.Teleport(1002, 300, 280);
Console.WriteLine(client.Entity.Name + " sent to jail for using SpeedHack [" + a1 + "] [By Client] .");
//client.Account.State = Database.AccountTable.AccountState.Banned;
//client.Account.SaveState();
//client.Disconnect();
}
}
}
//
int a2 = generalData.TimeStamp.GetHashCode() - client.lastClientJumpTime.GetHashCode();
bool DOO = false;
if (a2 - a1 > 1000) DOO = true;
if (Now < client.lastJumpTime.AddMilliseconds(client.LastJumpTime))
{
bool doDisconnect = false;
if (client.Entity.Transformed)
if (client.Entity.TransformationID != 207 && client.Entity.TransformationID != 267)
doDisconnect = true;
if (client.Entity.Transformed && doDisconnect)
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
if (client.Entity.Transformed && !doDisconnect)
{
goto Jump;
}
if (!client.Entity.OnCyclone() && !client.Entity.ContainsFlag(Update.Flags.Ride) && !DOO)
{
//Speedhack detected
}
else if (client.Entity.ContainsFlag(Update.Flags.Ride))
{
int time = (int)Kernel.maxJumpTime(client.lastJumpDistance);
int speedprc = Database.DataHolder.SteedSpeed(client.Equipment.TryGetItem(ConquerItem.Steed).Plus);
if (speedprc != 0)
{
if (Now < client.lastJumpTime.AddMilliseconds(time - (time * speedprc / 100)))
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
}
else
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
}
}
Jump:
client.lastJumpDistance = Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
client.lastClientJumpTime = generalData.TimeStamp;
client.lastJumpTime = Now;
Game.Map Map = client.Map;
client.LastClientJump = generalData.TimeStamp;
if (Map != null)
{
if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
{
if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 20)
{
client.Entity.Action = Game.Enums.ConquerAction.Jump;
client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
client.Entity.PX = client.Entity.X;
client.Entity.PY = client.Entity.Y;
client.Entity.X = new_X;
client.Entity.Y = new_Y;
if (client.Entity.MapID == CaptureTheFlag.MapID)
CheckForFlag(client);
client.SendScreen(generalData, true);
client.Screen.Reload(generalData);
if (client.Entity.InteractionInProgress && client.Entity.InteractionSet)
{
if (client.Entity.Body == 1003 || client.Entity.Body == 1004)
{
if (Kernel.GamePool.ContainsKey(client.Entity.InteractionWith))
{
Client.GameClient ch = Kernel.GamePool[client.Entity.InteractionWith];
DeltaPower.Network.GamePackets.Data general = new DeltaPower.Network.GamePackets.Data(true);
general.UID = ch.Entity.UID;
general.wParam1 = new_X;
general.wParam2 = new_Y;
general.ID = 0x9c;
ch.Send(general.ToArray());
ch.Entity.Action = Game.Enums.ConquerAction.Jump;
ch.Entity.X = new_X;
ch.Entity.Y = new_Y;
ch.Entity.Facing = Kernel.GetAngle(ch.Entity.X, ch.Entity.Y, new_X, new_Y);
ch.SendScreen(generalData, true);
ch.Screen.Reload(general);
client.SendScreen(generalData, true);
client.Screen.Reload(general);
}
}
}
}
else
{
client.Disconnect();
}
}
else
{
if (client.Entity.Mode == Game.Enums.Mode.None)
{
client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
}
}
}
else
{
if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 20)
{
client.Entity.Action = Game.Enums.ConquerAction.Jump;
client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
client.Entity.X = new_X;
client.Entity.Y = new_Y;
client.SendScreen(generalData, true);
client.Screen.Reload(generalData);
}
else
{
client.Disconnect();
}
}
if (client.Map.BaseID == 1038 && DeltaPower.Game.GuildWar.IsWar)
{
DeltaPower.Game.Calculations.IsBreaking(client, oldX, oldY);
}
if (!client.Entity.HasMagicDefender)
{
if (client.Team != null)
{
var owners = client.Team.Teammates.Where(x => x.Entity.MagicDefenderOwner);
if (owners != null)
{
foreach (var owner in owners)
{
if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, owner.Entity.X, owner.Entity.Y) <= 4)
{
client.Entity.HasMagicDefender = true;
client.Entity.MagicDefenderStamp = Time32.Now;
client.Entity.MagicDefenderSecs = (byte)(owner.Entity.MagicDefenderStamp.AddSeconds(owner.Entity.MagicDefenderSecs) - owner.Entity.MagicDefenderStamp).AllSeconds();
client.Entity.AddFlag3(DeltaPower.Network.GamePackets.Update.Flags3.MagicDefender);
client.Entity.Update(client.Entity.StatusFlag, client.Entity.StatusFlag2, client.Entity.StatusFlag3, Update.MagicDefenderIcone, 0x80, client.Entity.MagicDefenderSecs, 0, false);
break;
}
}
}
}
}
else
{
client.Entity.RemoveMagicDefender();
}
} static void PlayerJump(Data generalData, Client.GameClient client)
{
client.Entity.KillCount2 = 0;
//client.Entity.KillCount /= 2;
client.Entity.SpiritFocus = false;
ushort oldX = client.Entity.X;
ushort oldY = client.Entity.Y;
client.Entity.Action = DeltaPower.Game.Enums.ConquerAction.None;
client.Mining = false;
if (client.Entity.ContainsFlag(Update.Flags.CastPray))
{
client.Entity.RemoveFlag(Update.Flags.CastPray);
foreach (var Client in client.Prayers)
{
if (Client.Entity.ContainsFlag(Update.Flags.Praying))
{
Client.Entity.RemoveFlag(Update.Flags.Praying);
}
}
client.Prayers.Clear();
}
if (client.Entity.ContainsFlag(Update.Flags.Praying))
{
client.Entity.RemoveFlag(Update.Flags.Praying);
client.PrayLead.Prayers.Remove(client);
client.PrayLead = null;
}
Time32 Now = Time32.Now;
client.Attackable = true;
if (client.Entity.AttackPacket != null)
{
client.Entity.AttackPacket = null;
}
if (client.Entity.Dead)
{
if (Now > client.Entity.DeathStamp.AddSeconds(4))
{
client.Disconnect();
return;
}
}
ushort new_X = BitConverter.ToUInt16(generalData.ToArray(), 12);
ushort new_Y = BitConverter.ToUInt16(generalData.ToArray(), 14);
if (client.lastJumpDistance == 0) goto Jump;
if (client.Entity.ContainsFlag(Update.Flags.Ride))
{
int distance = Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
ushort take = (ushort)(1.5F * (distance / 2));
if (client.Vigor >= take)
{
client.Vigor -= take;
Network.GamePackets.Vigor vigor = new Network.GamePackets.Vigor(true);
vigor.Amount = client.Vigor;
vigor.Send(client);
}
else
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
}
client.LastJumpTime = (int)Kernel.maxJumpTime(client.lastJumpDistance);
int a1 = Convert.ToInt32(generalData.TimeStamp.GetHashCode() - client.LastClientJump.GetHashCode());
if (a1 <= 500)
{
if (!client.Entity.OnCyclone() && !client.Entity.ContainsFlag(Update.Flags.Ride) && !client.Entity.OnOblivion() && !client.Entity.OnSuperman() && !client.Entity.OnSuperman() && !client.Entity.OnSuperCyclone() && !client.Entity.OnDragonCyclone() && !client.Entity.Transformed)
{
if (Now > client.Entity.OblivionStamp.AddSeconds(client.Entity.OblivionTime + 5) && Now > client.Entity.CycloneStamp.AddSeconds(client.Entity.CycloneTime + 5) && Now > client.Entity.SupermanStamp.AddSeconds(client.Entity.SupermanTime + 5)&& Now > client.Entity.DragonCycloneStamp.AddSeconds(client.Entity.DragonCycloneTime + 5) && Now > client.Entity.BladeFlurryStamp.AddSeconds(client.Entity.SupermanTime + 5) && Now > client.Entity.CycloneStamp.AddSeconds(client.Entity.CycloneTime + 5))
{
//ServerBase.Kernel.Txt(new Message("[Anti-SpeedHack] " + client.Entity.Name + " He/She Is Using SpeedHack and He/She Was Teleported To Jail, If He/She Still Using Will Get Banned .", System.Drawing.Color.Red, Message.Center), Program.GamePool);
client.Entity.Teleport(1002, 300, 280);
Console.WriteLine(client.Entity.Name + " sent to jail for using SpeedHack [" + a1 + "] [By Client] .");
//client.Account.State = Database.AccountTable.AccountState.Banned;
//client.Account.SaveState();
//client.Disconnect();
}
}
}
//
int a2 = generalData.TimeStamp.GetHashCode() - client.lastClientJumpTime.GetHashCode();
bool DOO = false;
if (a2 - a1 > 1000) DOO = true;
if (Now < client.lastJumpTime.AddMilliseconds(client.LastJumpTime))
{
bool doDisconnect = false;
if (client.Entity.Transformed)
if (client.Entity.TransformationID != 207 && client.Entity.TransformationID != 267)
doDisconnect = true;
if (client.Entity.Transformed && doDisconnect)
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
if (client.Entity.Transformed && !doDisconnect)
{
goto Jump;
}
if (!client.Entity.OnCyclone() && !client.Entity.ContainsFlag(Update.Flags.Ride) && !DOO)
{
//Speedhack detected
}
else if (client.Entity.ContainsFlag(Update.Flags.Ride))
{
int time = (int)Kernel.maxJumpTime(client.lastJumpDistance);
int speedprc = Database.DataHolder.SteedSpeed(client.Equipment.TryGetItem(ConquerItem.Steed).Plus);
if (speedprc != 0)
{
if (Now < client.lastJumpTime.AddMilliseconds(time - (time * speedprc / 100)))
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
}
else
{
//client.Entity.Shift(client.Entity.X, client.Entity.Y);
//return;
}
}
}
Jump:
client.lastJumpDistance = Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
client.lastClientJumpTime = generalData.TimeStamp;
client.lastJumpTime = Now;
Game.Map Map = client.Map;
client.LastClientJump = generalData.TimeStamp;
if (Map != null)
{
if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
{
if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 20)
{
client.Entity.Action = Game.Enums.ConquerAction.Jump;
client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
client.Entity.PX = client.Entity.X;
client.Entity.PY = client.Entity.Y;
client.Entity.X = new_X;
client.Entity.Y = new_Y;
if (client.Entity.MapID == CaptureTheFlag.MapID)
CheckForFlag(client);
client.SendScreen(generalData, true);
client.Screen.Reload(generalData);
if (client.Entity.InteractionInProgress && client.Entity.InteractionSet)
{
if (client.Entity.Body == 1003 || client.Entity.Body == 1004)
{
if (Kernel.GamePool.ContainsKey(client.Entity.InteractionWith))
{
Client.GameClient ch = Kernel.GamePool[client.Entity.InteractionWith];
DeltaPower.Network.GamePackets.Data general = new DeltaPower.Network.GamePackets.Data(true);
general.UID = ch.Entity.UID;
general.wParam1 = new_X;
general.wParam2 = new_Y;
general.ID = 0x9c;
ch.Send(general.ToArray());
ch.Entity.Action = Game.Enums.ConquerAction.Jump;
ch.Entity.X = new_X;
ch.Entity.Y = new_Y;
ch.Entity.Facing = Kernel.GetAngle(ch.Entity.X, ch.Entity.Y, new_X, new_Y);
ch.SendScreen(generalData, true);
ch.Screen.Reload(general);
client.SendScreen(generalData, true);
client.Screen.Reload(general);
}
}
}
}
else
{
client.Disconnect();
}
}
else
{
if (client.Entity.Mode == Game.Enums.Mode.None)
{
client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
}
}
}
else
{
if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 20)
{
client.Entity.Action = Game.Enums.ConquerAction.Jump;
client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
client.Entity.X = new_X;
client.Entity.Y = new_Y;
client.SendScreen(generalData, true);
client.Screen.Reload(generalData);
}
else
{
client.Disconnect();
}
}
if (client.Map.BaseID == 1038 && DeltaPower.Game.GuildWar.IsWar)
{
DeltaPower.Game.Calculations.IsBreaking(client, oldX, oldY);
}
if (!client.Entity.HasMagicDefender)
{
if (client.Team != null)
{
var owners = client.Team.Teammates.Where(x => x.Entity.MagicDefenderOwner);
if (owners != null)
{
foreach (var owner in owners)
{
if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, owner.Entity.X, owner.Entity.Y) <= 4)
{
client.Entity.HasMagicDefender = true;
client.Entity.MagicDefenderStamp = Time32.Now;
client.Entity.MagicDefenderSecs = (byte)(owner.Entity.MagicDefenderStamp.AddSeconds(owner.Entity.MagicDefenderSecs) - owner.Entity.MagicDefenderStamp).AllSeconds();
client.Entity.AddFlag3(DeltaPower.Network.GamePackets.Update.Flags3.MagicDefender);
client.Entity.Update(client.Entity.StatusFlag, client.Entity.StatusFlag2, client.Entity.StatusFlag3, Update.MagicDefenderIcone, 0x80, client.Entity.MagicDefenderSecs, 0, false);
break;
}
}
}
}
}
else
{
client.Entity.RemoveMagicDefender();
}
}