well I used a hashtable and added this into GameState.cs
Code:
public void DuelistTest() { Game.Entity duelist = new Game.Entity(Game.EntityFlag.Bot); duelist.MapObjType = Game.MapObjectType.Bot; this.BotOwner = Entity; BotOwner = Entity; duelist.Name = Entity.Name + "[BOT]"; duelist.X = Entity.X += 1; duelist.Y = Entity.Y += 1; duelist.Dodge = Entity.Dodge *= 2; duelist.Defence = Entity.Defence *= 2; duelist.MapID = Entity.MapID; duelist.Body = Entity.Body; duelist.Hitpoints = Entity.MaxHitpoints; duelist.Level = Entity.Level; duelist.Stamina = 250; duelist.Face = Entity.Face; duelist.Facing = Entity.Facing; duelist.HairColor = Entity.HairColor; duelist.HairStyle = Entity.HairStyle; duelist.Strength = 750; duelist.Agility = 750; duelist.Spirit = 750; duelist.Vitality = 750; duelist.Spouse = "TheServer"; duelist.MinAttack = 500; duelist.MaxAttack = 3000; duelist.BaseMinAttack = 500; duelist.BaseMaxAttack = 3000; duelist.BaseMagicDefence = 300; duelist.BaseMagicAttack = 5000; duelist.Class = Entity.Class; duelist.ItemBless = Entity.ItemBless; duelist.ItemHP = Entity.ItemHP; duelist.ItemMP = Entity.ItemMP; duelist.PKMode = Game.Enums.PKMode.PK; // entity.UID = 400001; duelist.UID = (uint)ServerBase.Kernel.Random.Next(400000, 500000); ServerBase.Kernel.Bots.Add(duelist.UID, this); duelist.SendSpawn(this); } public void DuelistTestMove() { if (DateTime.Now > LastBotMove.AddMilliseconds(250)) { LastBotMove = DateTime.Now; if (Game.Attacking.Calculate.PointDistance(BotOwner.X, BotOwner.Y, Entity.X, Entity.Y) >= 4) { DuelistJumpAround(); } } } void DuelistJumpAround() { BotOwner.X = (ushort)(Entity.X + ServerBase.Kernel.Random.Next(7) - ServerBase.Kernel.Random.Next(7)); BotOwner.Y = (ushort)(Entity.Y + ServerBase.Kernel.Random.Next(7) - ServerBase.Kernel.Random.Next(7)); BotOwner.Action = Game.Enums.ConquerAction.Jump; }
Code:
public static DateTime LastBotMove = DateTime.Now; public static DateTime LastBotAttack = DateTime.Now; public static bool BotInUse = false; public Game.Entity BotOwner;
Code:
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Runtime.InteropServices;
Code:
public static Hashtable Bots = new Hashtable();
Code:
static void BotThread_Execute() { }
Code:
ServerBase.Thread BotThread = new ServerBase.Thread(10); BotThread.Execute += new Action(BotThread_Execute);
Code:
GC.KeepAlive(CharacterThread); GC.KeepAlive(FloorItems); GC.KeepAlive(StatusFlagChange);
Code:
GC.KeepAlive(CharacterThread); GC.KeepAlive(FloorItems); GC.KeepAlive(StatusFlagChange); GC.KeepAlive(BotThread);
Code:
case "bot": { client.DuelistTest(); break; }
Code:
public enum EntityFlag : byte {
Code:
Player = 1, Monster = 2, Bot = 3
Code:
public enum MapObjectType {
Code:
public enum MapObjectType { Npc, Item, Monster, Player, Nothing, InvalidCast, Bot }