public Npc(ShineNpc spoint) { IsAttackable = false; Point = spoint; LinkTable lt = null; if (Point.Role == "Gate" && !DataProvider.Instance.NpcLinkTable.TryGetValue(spoint.RoleArg0, out lt)) { Log.WriteLine(LogLevel.Warn, "Could not load LinkTable for NPC {0} LT {1}", Point.MobName, Point.RoleArg0); } Gate = lt; this.ID = DataProvider.Instance.GetMobIDFromName(Point.MobName); this.Position = new Vector2(spoint.CoordX, spoint.CoordY); if (spoint.Direct < 0) { this.Rotation = (byte)((360 + spoint.Direct) / 2); } else { this.Rotation = (byte)(spoint.Direct / 2); } }
public static ShineNpc Load(DataRow row) { ShineNpc info = new ShineNpc { MobID = (short)(Int32)row["MobID"], Flags = (ushort)row["Flags"], MobName = (string)row["MobName"], Map = (string)row["Map"], CoordX = (int)row["RegenX"], CoordY = (int)row["RegenY"], Direct = (short)(Int32)row["Direct"], NpcMenu = (byte)(SByte)row["NPCMenu"], Role = (string)row["Role"], RoleArg0 = (string)row["RoleArg0"], }; if (info.Flags == 1) { info.VendorItems = new List<Vendor>(); } return info; }
public static ShineNpc Load(DataRow row) { var info = new ShineNpc { MobID = (short)(int)row["MobID"], Flags = (ushort)row["Flags"], MobName = (string)row["MobName"], Map = (string)row["Map"], CoordX = (int)row["RegenX"], CoordY = (int)row["RegenY"], Direct = (short)(int)row["Direct"], NpcMenu = (byte)(sbyte)row["NPCMenu"], Role = (string)row["Role"], RoleArg0 = (string)row["RoleArg0"] }; if (info.Flags == 1) { info.VendorItems = new List <Vendor>(); } return(info); }