I will recommend you to do the thing in
this thread first, because is required.
First go to chat.cs
and put the command for botjail.
Code:
if (Cmd[0] == "/botjail") { foreach (Character Char in World.H_Chars.Values) { if (Char.Name == Cmd[1]) { Char.Teleport(1021, 50, 50); GC.LocalMessage(2011, Char.Name + " Have been botjailed, hahahaha. His unaviable to move, jump, write or get write to, because his status will be set to afk. Goodluck bastard!"); Char.AFK = true; } } } if (Cmd[0] == "/release") { foreach (Character Char in World.H_Chars.Values) { if (Char.Name == Cmd[1]) { Char.Teleport(1002, 400, 400); GC.LocalMessage(2011, Char.Name + " Have been released from BotJail. Behave better next time!!"); Char.AFK = false; } } }
Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NewestCOServer.PacketHandling { public class WalkRun { public static void Handle(Main.GameClient GC, byte[] Data) { if (GC.MyChar.AFK == true && GC.MyChar.Loc.Map == 1021) { GC.LocalMessage(2005, "YOU ARE BOTJAILED AND CAN'T MOVE"); GC.MyChar.Teleport(1021, 50, 50); } else if (GC.MyChar.AFK == true) { GC.LocalMessage(2005, "YOU ARE AFK!!!!!!!!!! To get afk off write /afk"); GC.MyChar.Teleport(GC.MyChar.Loc.Map, GC.MyChar.Loc.PreviousX, GC.MyChar.Loc.PreviousY); } else if (GC.MyChar.BuffOf(NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray).Eff == NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray && GC.MyChar.AFK == false) GC.MyChar.RemoveBuff(GC.MyChar.BuffOf(Features.SkillsClass.ExtraEffect.BlessPray)); GC.MyChar.Mining = false; GC.MyChar.AtkMem.Attacking = false; GC.MyChar.Action = 100; Game.World.Action(GC.MyChar, Data); GC.MyChar.Direction = (byte)(Data[4] % 8); GC.MyChar.Loc.Walk((byte)(Data[4] % 8)); Game.World.Spawns(GC.MyChar, true); } } }
Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NewestCOServer.PacketHandling { public class Jump { public static void Handle(Main.GameClient GC, byte[] Data) { if (GC.MyChar.AFK == true && GC.MyChar.Loc.Map == 1021) { GC.LocalMessage(2005, "YOU ARE BOTJAILED AND CAN'T MOVE"); GC.MyChar.Teleport(1021, 50, 50); } else if (GC.MyChar.AFK == true) { GC.LocalMessage(2005, "YOU ARE AFK!!!!!!!!!! To get afk off write /afk"); GC.MyChar.Teleport(GC.MyChar.Loc.Map, GC.MyChar.Loc.PreviousX, GC.MyChar.Loc.PreviousY); } if (GC.MyChar.BuffOf(NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray).Eff == NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray) GC.MyChar.RemoveBuff(GC.MyChar.BuffOf(Features.SkillsClass.ExtraEffect.BlessPray)); GC.MyChar.Mining = false; GC.MyChar.AtkMem.Attacking = false; GC.MyChar.Action = 100; if (GC.MyChar.Loc.AbleToJump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10), GC.MyChar.StatEff.Contains(NewestCOServer.Game.StatusEffectEn.Cyclone) || GC.MyChar.StatEff.Contains(NewestCOServer.Game.StatusEffectEn.Ride))) { if (GC.MyChar.StatEff.Contains(NewestCOServer.Game.StatusEffectEn.Ride)) { if (GC.MyChar.Vigor >= 5) GC.MyChar.Vigor -= 5; else return; } Game.World.Action(GC.MyChar, Data); GC.MyChar.Loc.Jump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10)); Game.World.Spawns(GC.MyChar, true); } else { GC.LocalMessage(2005, "Invalid Jump!"); GC.AddSend(Packets.GeneralData(GC.MyChar.EntityID, 0, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, 0x6c)); } } } }
Code:
if (GC.MyChar.Loc.Map == 1021) { GC.MyChar.AFK = true; }
replace it with:
Code:
if (Cmd[0] == "/exit") { Game.Character[] BaseCharacters = new Character[World.H_Chars.Count]; World.H_Chars.Values.CopyTo(BaseCharacters, 0); NewestCOServer.Main.AuthWorker.Listener.Close(); NewestCOServer.Main.GameWorker.Listener.Close(); EndSession = true; try { foreach (Game.Character C in BaseCharacters) { try { if (C.Loc.Map == 1021) { C.Teleport(1021, 50, 50); C.MyClient.Disconnect(); Console.WriteLine(C.Name + " has logged off successfuly."); } else { C.Teleport(1002, 400, 400); C.MyClient.Disconnect(); Console.WriteLine(C.Name + " has logged off successfuly."); } } catch { continue; } } } catch { } Database.SaveKOs(); Console.WriteLine("KOs saved."); Database.SaveEmpire(); Console.WriteLine("Empire saved."); Features.Guilds.SaveGuilds(); Console.WriteLine("Guilds saved."); Features.SkillsClass.Save(); Console.WriteLine("Skills saved."); MobThread.Close(); ServerStuff.Close(); CompanionThread.Close(); Database.Dispose(); Console.WriteLine("Database disposed."); Console.WriteLine("Will close in 2Seconds."); Thread.Sleep(2000); Environment.Exit(0); }
Now you should have botjail.
use /botjail charname
to botjail a player
use /release charname
to release a player from botjail
Thanks, goodluck.
If you like, then a +thanks would be good :P
lol, take care.