public static ShineNPC Load(DataTableReaderEx reader) { ShineNPC info = new ShineNPC { MobName = reader.GetString("MobName"), Map = reader.GetString("Map"), Coord_X = reader.GetInt32("Coord-X"), Coord_Y = reader.GetInt32("Coord-Y"), Direct = reader.GetInt16("Direct"), NPCMenu = reader.GetByte("NPCMenu"), Role = reader.GetString("Role"), RoleArg0 = reader.GetString("RoleArg0"), }; return info; }
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.Coord_X, spoint.Coord_Y); if (spoint.Direct < 0) { this.Rotation = (byte)((360 + spoint.Direct) / 2); } else { this.Rotation = (byte)(spoint.Direct / 2); } }