public void AddCape(string id) { Cape x = new Cape(); x.ID = id; x.Description = "A cape"; Capes.Add(x); }
public void UpdateCape(Cape cape, int courseId, ref List <string> errors) { var conn = new SqlConnection(ConnectionString); try { var adapter = new SqlDataAdapter(UpdateCapeProcedure, conn) { SelectCommand = { CommandType = CommandType.StoredProcedure } }; adapter.SelectCommand.Parameters.Add(new SqlParameter("@course_title", SqlDbType.VarChar, 100)); adapter.SelectCommand.Parameters.Add(new SqlParameter("@avg_easiness", SqlDbType.Float)); adapter.SelectCommand.Parameters.Add(new SqlParameter("@avg_helpfulness", SqlDbType.Float)); adapter.SelectCommand.Parameters.Add(new SqlParameter("@avg_clarity", SqlDbType.Float)); adapter.SelectCommand.Parameters.Add(new SqlParameter("@avg_hours_spend", SqlDbType.Float)); adapter.SelectCommand.Parameters["@course_title"].Value = cape.CourseTitle; adapter.SelectCommand.Parameters["@avg_easiness"].Value = cape.AvgEasiness; adapter.SelectCommand.Parameters["@avg_helpfulness"].Value = cape.AvgHelpfulness; adapter.SelectCommand.Parameters["@avg_clarity"].Value = cape.AvgClarity; adapter.SelectCommand.Parameters["@avg_hours_spend"].Value = cape.AvgHours_spend; var dataSet = new DataSet(); adapter.Fill(dataSet); } catch (Exception e) { errors.Add("Error: " + e); } finally { conn.Dispose(); } }
public string InsertCapeData(Cape cape) { var errors = new List <string>(); var repository = new CapeRepository(); var service = new CapeService(repository); service.InsertCapeData(cape, ref errors); if (errors.Count == 0) { return("ok"); } return("error"); }
public string UpdateCape(Cape cape, int courseId) { var errors = new List <string>(); var repository = new CapeRepository(); var service = new CapeService(repository); service.UpdateCape(cape, courseId, ref errors); if (errors.Count == 0) { return("ok"); } return("error"); }
public object Clone() { var clonedSkin = (Skin)MemberwiseClone(); clonedSkin.Data = Data?.Clone() as byte[]; clonedSkin.Cape = Cape?.Clone() as Cape; clonedSkin.SkinResourcePatch = SkinResourcePatch?.Clone() as SkinResourcePatch; foreach (Animation animation in Animations) { clonedSkin.Animations.Add((Animation)animation.Clone()); } return(clonedSkin); }
public void UpdateCape(Cape cape, int courseId, ref List <string> errors) { if (cape == null) { errors.Add("Cape cannot be null"); throw new ArgumentException(); } if (courseId <= 0) { errors.Add("Invalid course id"); throw new ArgumentException(); } this.repository.UpdateCape(cape, courseId, ref errors); }
//// [ExpectedException(typeof(ArgumentException))] public void UpdateCapeSuccess() { //// Arrange var errors = new List <string>(); var mockRepository = new Mock <ICapeRepository>(); var capeService = new CapeService(mockRepository.Object); var cape = new Cape { CourseId = 2, Easiness = 3.5f, Helpfulness = 2.5f, Clarity = 1.5f, Hours_spend = 12.0f }; //// Act capeService.UpdateCape(cape, 2, ref errors); //// Assert Assert.AreEqual(0, errors.Count); }
//// [ExpectedException(typeof(ArgumentException))] public void InsertCapeESuccessTest() { //// Arrange var errors = new List <string>(); var mockRepository = new Mock <ICapeRepository>(); var capeService = new CapeService(mockRepository.Object); var cape = new Cape { CourseId = 2, Easiness = 4.8f, Helpfulness = 2.5f, Clarity = 1.0f, Hours_spend = 15.0f }; //// Act capeService.InsertCapeData(cape, ref errors); //// Assert Assert.AreEqual(0, errors.Count); }
//// [ExpectedException(typeof(ArgumentException))] public void InsertCapeErrorTest2() { //// Arranage var errors = new List <string>(); var mockRepository = new Mock <ICapeRepository>(); var capeService = new CapeService(mockRepository.Object); var cape = new Cape { CourseId = -1 }; //// Act capeService.InsertCapeData(cape, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }
public List <Cape> GetCape(ref List <string> errors) { var conn = new SqlConnection(ConnectionString); var capeList = new List <Cape>(); try { var adapter = new SqlDataAdapter(GetCapeListProcedure, conn) { SelectCommand = { CommandType = CommandType.StoredProcedure } }; var dataSet = new DataSet(); adapter.Fill(dataSet); if (dataSet.Tables[0].Rows.Count == 0) { return(null); } for (var i = 0; i < dataSet.Tables[0].Rows.Count; i++) { var cape = new Cape { CourseTitle = dataSet.Tables[0].Rows[i]["course_title"].ToString(), AvgEasiness = (float)Convert.ToDouble(dataSet.Tables[0].Rows[i]["avg_easiness"]), AvgHelpfulness = (float)Convert.ToDouble(dataSet.Tables[0].Rows[i]["avg_helpfulness"]), AvgClarity = (float)Convert.ToDouble(dataSet.Tables[0].Rows[i]["avg_clarity"]), AvgHours_spend = (float)Convert.ToDouble(dataSet.Tables[0].Rows[i]["avg_hours_spend"]) }; capeList.Add(cape); } } catch (Exception e) { errors.Add("Error: " + e); } finally { conn.Dispose(); } return(capeList); }
public void InsertCapeData(Cape cape, ref List <string> errors) { if (cape == null) { errors.Add("Cape cannot be null"); //// throw new ArgumentException(); return; } string strRegex = @"[^0-9]"; Regex re = new Regex(strRegex); var flag = re.IsMatch(cape.CourseId.ToString()); this.repository.InsertCapeData(cape, ref errors); }
private void SpawnCape(TeamHat teamHat, Tex2D capeTexture, bool glitch = false) { if (teamHat == null || teamSpawnsDone.ContainsKey(teamHat) || Level.current == null) { // || !(Level.current is GameLevel // || Level.current is Editor // || Level.current is TeamSelect2)) return; } Cape cape = new Cape(teamHat.x, teamHat.y, teamHat); cape._capeTexture = capeTexture; Level.Add(cape); teamSpawnsDone.Add(teamHat, cape); }
public Skin() { Cape = new Cape(); Animations = new List <Animation>(); }
/// <summary> /// Gets all the professor and the courses from the database, and using /// populates the database using the name of the course and professor /// </summary> public void Update() { // Getting the list of courses from the database //var courses = _context.Courses.ToList(); var courses = _context?.Courses.Include(c => c.Sections) .ThenInclude(s => s.Professor) .Include(c => c.Sections) .ToList(); // List of professor and courses that do not have cape review List <Tuple <string, string> > profcourseNotFound = new List <Tuple <string, string> >(); // Keep track of number of course we scrape int delay = 0; // Iterate over all the courses we recieved from the database foreach (var course in courses) { // for each course list out all the sections that are present var sections = course.Sections.ToList(); // Variable to store all the professors that are teaching one course List <string> listOfProfessors = new List <string>(); // Iterate over all the sections for each course foreach (var section in sections) { Professor currProfessor = section.Professor; // Update the Cape review for each professor only one time if (!listOfProfessors.Contains(currProfessor.Name)) { listOfProfessors.Add(currProfessor.Name); // Note: Cape has already been initialized in the database model // as a empty list. // Gets the CAPE page for the specific professor string capePageURL = GenerateURL(currProfessor.Name, course.CourseAbbreviation); // If there is cape review page for the specific professor and specific course if (capePageURL.Length != 0) { ScrapeResult scrapedCapePage = InsertDataFromHtmlPage(capePageURL); Cape newCapeReview = null; // Boolean to keep track if we need to add the cape review to the DB or // just update bool addToDb = true; // Check if we already have the cape for specific professor and course foreach (Cape tempCape in course.Cape) { if (tempCape.Professor == currProfessor) { newCapeReview = tempCape; addToDb = false; } } // If no cape found then make a new one if (newCapeReview == null) { newCapeReview = new Cape(); } if (scrapedCapePage != null) { // Updating the cape review result for professor object newCapeReview.Term = scrapedCapePage.Term; newCapeReview.StudentsEnrolled = scrapedCapePage.StudentsEnrolled; newCapeReview.NumberOfEvaluation = scrapedCapePage.NumberOfEvaluation; newCapeReview.RecommendedClass = scrapedCapePage.RecommendedClass; newCapeReview.RecommendedProfessor = scrapedCapePage.RecommendedProfessor; newCapeReview.StudyHoursPerWeek = scrapedCapePage.StudyHoursPerWeek; newCapeReview.AverageGradeExpected = scrapedCapePage.AverageGradeExpected; newCapeReview.AverageGradeReceived = scrapedCapePage.AverageGradeReceived; newCapeReview.URL = capePageURL; // Adding cape review to professor and cource object if (addToDb) { currProfessor.Cape.Add(newCapeReview); course.Cape.Add(newCapeReview); } } } else { // Used to check when and for which tuples did we not find cape reviews. profcourseNotFound.Add(Tuple.Create(currProfessor.Name, course.CourseAbbreviation)); } } } // After every 100 courses scraped, wait for 10 seconds delay++; if (delay % 100 == 0) { System.Threading.Thread.Sleep(10000); _context.SaveChanges(); } } // Save Changes in the database _context.SaveChanges(); }
public void LoadContent(ContentManager Content) { // load content for items // JUST FOR TESTING// willbe given items from loadout in full game. defaultItems[0] = new Cane(Content.Load<Texture2D>("LoadOut/cane_icon")); defaultItems[1] = new Revolver(Content.Load<Texture2D>("LoadOut/revolver_icon")); defaultItems[2] = new Bowler_Hat(Content.Load<Texture2D>("LoadOut/bowlerhat_icon")); defaultItems[3] = new Cape(Content.Load<Texture2D>("LoadOut/cape_icon")); // Load sounds! soundEffects.Add("Block", Content.Load<SoundEffect>("Sounds/Block")); soundEffects.Add("Hit", Content.Load<SoundEffect>("Sounds/BowlerHat_Hit")); soundEffects.Add("BowlerThrow", Content.Load<SoundEffect>("Sounds/BowlerHat_Throw")); soundEffects.Add("RevolverHit", Content.Load<SoundEffect>("Sounds/Bullet_Hit")); soundEffects.Add("CaneHit", Content.Load<SoundEffect>("Sounds/Cane_Hit")); soundEffects.Add("Cape", Content.Load<SoundEffect>("Sounds/Cape")); soundEffects.Add("Jump", Content.Load<SoundEffect>("Sounds/Jump")); soundEffects.Add("RevolverShoot", Content.Load<SoundEffect>("Sounds/Revolver_Fire")); soundEffects.Add("Footstep", Content.Load<SoundEffect>("Sounds/FootStep")); soundEffects.Add("CapeTug", Content.Load<SoundEffect>("Sounds/CapeTug")); soundEffects.Add("CaneWindUp", Content.Load<SoundEffect>("Sounds/CaneWindUp")); soundEffects.Add("GunClick", Content.Load<SoundEffect>("Sounds/Gun_Click")); soundEffects.Add("KnockedDown", Content.Load<SoundEffect>("Sounds/KnockedDown")); soundEffects.Add("CapeDraw", Content.Load<SoundEffect>("Sounds/CapeDraw")); //Change to using a text file!! // Create animation library to pass to players. animKeys = new string[] { "Idle", "Walk", "Run", "Jump", "Land", "Punch", "PunchHit", "Dodge", "Block", "Down", "Duck", "CaneBonk", "CaneHit", "CanePull", "CaneBalance", "RevolverShoot", "RevolverHit", "RevolverReload", "BowlerThrow", "BowlerCatch", "BowlerRethrow", "Cape", "CapeStuck"}; #region set frame width animFrameWidths = new int[] { 15, 12, 27, 20, 18, 37, 34, 17, 15, 43, 16, 54, 19, 76, 28, 56, 15, 56, 34, 37, 34, 54, 54 }; // frame widths int wBowlerHat = 6; #endregion #region set frame times animFrameTimes = new float[] { 0.1f, 0.1f, 0.05f, 0.1f, 0.1f, 0.09f, 0.1f, 0.05f, 0.1f, 0.08f, 0.08f, 0.07f, // cane bonk 0.08f, // cane hit 0.07f, // cane pull 0.1f, // cane balance 0.08f, // Revolver shoot 0.05f, // Revolver hit 0.08f, // Revovler reload 0.07f, // Bowler hat 0.05f, // Bowler catch 0.07f, // bowler re throws 0.06f, // cape 0.07f // cape stuck }; #endregion #region load textures /*// Load textures Texture2D idle = Content.Load<Texture2D>("Boxing/Player_Idle_Side"); Texture2D walk = Content.Load<Texture2D>("Boxing/Player_Walking_Side"); Texture2D run = Content.Load<Texture2D>("Boxing/Player_Running_Side"); Texture2D jump = Content.Load<Texture2D>("Boxing/Player_Jump"); Texture2D land = Content.Load<Texture2D>("Boxing/Player_Land"); Texture2D punch = Content.Load<Texture2D>("Boxing/Player_Punch"); Texture2D punchHit = Content.Load<Texture2D>("Boxing/Player_Punch_Hit"); Texture2D dodge = Content.Load<Texture2D>("Boxing/Player_Dodge"); Texture2D block = Content.Load<Texture2D>("Boxing/Player_Block"); Texture2D down = Content.Load<Texture2D>("Boxing/Player_Knocked_Down"); Texture2D duck = Content.Load<Texture2D>("Boxing/Player_Duck"); // player item use textures Texture2D caneBonk = Content.Load<Texture2D>("BoxingItems/Player_Cane"); Texture2D caneHit = Content.Load<Texture2D>("BoxingItems/Player_Cane_Hit"); Texture2D canePull = Content.Load<Texture2D>("BoxingItems/Player_Cane_Pull"); Texture2D caneBalance = Content.Load<Texture2D>("BoxingItems/Player_Cane_Balance"); Texture2D revolverShoot = Content.Load<Texture2D>("BoxingItems/Player_Revolver"); Texture2D revolverHit = Content.Load<Texture2D>("BoxingItems/Player_Revolver_Hit"); Texture2D revolverReload = Content.Load<Texture2D>("BoxingItems/Player_Revolver_Reload"); Texture2D bowlerThrow = Content.Load<Texture2D>("BoxingItems/Player_BowlerHat"); Texture2D bowlerCatch = Content.Load<Texture2D>("BoxingItems/Player_BowlerHat_Catch"); Texture2D bowlerReThrow = Content.Load<Texture2D>("BoxingItems/Player_BowlerHat_ReThrow"); */ #endregion #region initialize animations animLooping = new bool[] { true, true, true, false, true, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; Texture2D bowlerHat = Content.Load<Texture2D>("BoxingItems/BowlerHat_Instance"); // Initialize animations; /*animations.Add("Idle", new Animation(idle, fIdle, true, wIdle)); animations.Add("Walk", new Animation(walk, fWalk, true, wWalk)); animations.Add("Run", new Animation(run, fRun, true, wRun)); animations.Add("Jump", new Animation(jump, fJump, false, wJump)); animations.Add("Land", new Animation(land, fLand, true, wLand)); animations.Add("Punch", new Animation(punch, fPunch, false, wPunch)); animations.Add("PunchHit", new Animation(punchHit, fPunchHit, true, wPunchHit)); animations.Add("Dodge", new Animation(dodge, fDodge, true, wDodge)); animations.Add("Block", new Animation(block, fBlock, true, wBlock)); animations.Add("Down", new Animation(down, fDown, false, wDown)); animations.Add("Duck", new Animation(duck, fDuck, false, wDuck)); animations.Add("RevolverShoot", new Animation(revolverShoot, fRevolverShoot, false, wRevolverShoot)); animations.Add("RevolverHit", new Animation(revolverHit, fRevolverHit, false, wRevolverHit)); animations.Add("RevolverReload", new Animation(revolverReload, fRevolverReload, false, wRevolverReload)); animations.Add("bowlerThrow", new Animation(bowlerThrow, fBowlerThrow, false, wBowlerThrow)); animations.Add("bowlerCatch", new Animation(bowlerCatch, fBowlerCatch, false, wBowlerCatch)); animations.Add("bowlerReThrow", new Animation(bowlerReThrow, fBowlerReThrow, false, wBowlerReThrow)); */ // item animations itemAnims.Add("bowlerHat", new Animation(bowlerHat, 1f, true, wBowlerHat)); // Template textures to be used when re-coloring them animTextureTemplates = new Texture2D[] { Content.Load<Texture2D>("Boxing/Player_Idle_Side"), Content.Load<Texture2D>("Boxing/Player_Walking_Side"), Content.Load<Texture2D>("Boxing/Player_Running_Side"), Content.Load<Texture2D>("Boxing/Player_Jump"), Content.Load<Texture2D>("Boxing/Player_Land"), Content.Load<Texture2D>("Boxing/Player_Punch"), Content.Load<Texture2D>("Boxing/Player_Punch_Hit"), Content.Load<Texture2D>("Boxing/Player_Dodge"), Content.Load<Texture2D>("Boxing/Player_Block"), Content.Load<Texture2D>("Boxing/Player_Knocked_Down"), Content.Load<Texture2D>("Boxing/Player_Duck"), Content.Load<Texture2D>("BoxingItems/Player_Cane"), Content.Load<Texture2D>("BoxingItems/Player_Cane_Hit"), Content.Load<Texture2D>("BoxingItems/Player_Cane_Pull"), Content.Load<Texture2D>("BoxingItems/Player_Cane_Balance"), Content.Load<Texture2D>("BoxingItems/Player_Revolver"), Content.Load<Texture2D>("BoxingItems/Player_Revolver_Hit"), Content.Load<Texture2D>("BoxingItems/Player_Revolver_Reload"), Content.Load<Texture2D>("BoxingItems/Player_BowlerHat"), Content.Load<Texture2D>("BoxingItems/Player_BowlerHat_Catch"), Content.Load<Texture2D>("BoxingItems/Player_BowlerHat_ReThrow"), Content.Load<Texture2D>("BoxingItems/Player_Cape"), Content.Load<Texture2D>("BoxingItems/Player_Cape_Stuck") }; #endregion // Initialize bitmaps bitmaps.Add("Punch", new BitMap(Content.Load<Texture2D>("Boxing/Bitmaps/Player_Punch_Bitmap"))); // item animations bitmaps.Add("CaneBonk", new BitMap(Content.Load<Texture2D>("Boxing/Bitmaps/Player_Cane_Bitmap"))); bitmaps.Add("CanePull", new BitMap(Content.Load<Texture2D>("Boxing/Bitmaps/Player_Cane_Pull_Bitmap"))); }
public List <BaseItem> GetAllItemsInNpcBag(byte bag, int npcId) { DbParameter bagIdParameter = _db.CreateParameter(DbNames.GETALLNPCITEMSBYBAGID_BAGID_PARAMETER, bag); bagIdParameter.DbType = DbType.Byte; DbParameter characterIdParameter = _db.CreateParameter(DbNames.GETALLNPCITEMSBYBAGID_NPCID_PARAMETER, npcId); characterIdParameter.DbType = DbType.Int32; List <BaseItem> items = new List <BaseItem>(); _db.Open(); DbDataReader reader = _db.ExcecuteReader(DbNames.GETALLNPCITEMSBYBAGID_STOREDPROC, CommandType.StoredProcedure, bagIdParameter, characterIdParameter); int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFID); int ordinalITEM_BTYPE = reader.GetOrdinal(DbNames.ITEM_BTYPE); int ordinalITEM_BKIND = reader.GetOrdinal(DbNames.ITEM_BKIND); int ordinalITEM_VISUALID = reader.GetOrdinal(DbNames.ITEM_VISUALID); int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS); int ordinalITEM_AMOUNT = reader.GetOrdinal(DbNames.ITEM_AMOUNT); int ordinalITEM_PRICE = reader.GetOrdinal(DbNames.ITEM_PRICE); int ordinalITEM_LEVEL = reader.GetOrdinal(DbNames.ITEM_LEVEL); int ordinalITEM_DEX = reader.GetOrdinal(DbNames.ITEM_DEX); int ordinalITEM_STR = reader.GetOrdinal(DbNames.ITEM_STR); int ordinalITEM_STA = reader.GetOrdinal(DbNames.ITEM_STA); int ordinalITEM_ENE = reader.GetOrdinal(DbNames.ITEM_ENE); int ordinalITEM_DURABILITY = reader.GetOrdinal(DbNames.ITEM_DURABILITY); int ordinalITEM_DAMAGE = reader.GetOrdinal(DbNames.ITEM_DAMAGE); int ordinalITEM_DEFENCE = reader.GetOrdinal(DbNames.ITEM_DEFENCE); int ordinalITEM_ATTACKRATING = reader.GetOrdinal(DbNames.ITEM_ATTACKRATING); int ordinalITEM_ATTACKSPEED = reader.GetOrdinal(DbNames.ITEM_ATTACKSPEED); int ordinalITEM_ATTACKRANGE = reader.GetOrdinal(DbNames.ITEM_ATTACKRANGE); int ordinalITEM_INCMAXLIFE = reader.GetOrdinal(DbNames.ITEM_INCMAXLIFE); int ordinalITEM_INCMAXMANA = reader.GetOrdinal(DbNames.ITEM_INCMAXMANA); int ordinalITEM_LIFEREGEN = reader.GetOrdinal(DbNames.ITEM_LIFEREGEN); int ordinalITEM_MANAREGEN = reader.GetOrdinal(DbNames.ITEM_MANAREGEN); int ordinalITEM_CRITICAL = reader.GetOrdinal(DbNames.ITEM_CRITICAL); int ordinalITEM_TOMAPID = reader.GetOrdinal(DbNames.ITEM_TOMAPID); int ordinalITEM_IMBUERATE = reader.GetOrdinal(DbNames.ITEM_IMBUERATE); int ordinalITEM_IMBUEINCREASE = reader.GetOrdinal(DbNames.ITEM_IMBUEINCREASE); int ordinalITEM_BOOKSKILLID = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLID); int ordinalITEM_BOOKSKILLLEVEL = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLLEVEL); int ordinalITEM_BOOKSKILLDATA = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLDATA); int ordinalITEM_MAXPOLISHTRIES = reader.GetOrdinal(DbNames.ITEM_MAXPOLISHTRIES); int ordinalITEM_MAXIMBUETRIES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES); int ordinalITEM_BAG = reader.GetOrdinal(DbNames.ITEM_BAG); int ordinalITEM_SLOT = reader.GetOrdinal(DbNames.ITEM_SLOT); int ordinalITEM_SIZEX = reader.GetOrdinal(DbNames.ITEM_SIZEX); int ordinalITEM_SIZEY = reader.GetOrdinal(DbNames.ITEM_SIZEY); while (reader.Read()) { BaseItem b = null; int BType = reader.GetByte(ordinalITEM_BTYPE); int BKind = reader.GetByte(ordinalITEM_BKIND); if (BType == (byte)bType.Weapon || BType == (byte)bType.Clothes || BType == (byte)bType.Hat || BType == (byte)bType.Necklace || BType == (byte)bType.Ring || BType == (byte)bType.Shoes || BType == (byte)bType.Cape) { if (BKind == (byte)bKindWeapons.Sword && BType == (byte)bType.Weapon) { b = new Sword(); } if (BKind == (byte)bKindWeapons.Blade && BType == (byte)bType.Weapon) { b = new Blade(); } if (BKind == (byte)bKindWeapons.Fan && BType == (byte)bType.Weapon) { b = new Fan(); } if (BKind == (byte)bKindWeapons.Brush && BType == (byte)bType.Weapon) { b = new Brush(); } if (BKind == (byte)bKindWeapons.Claw && BType == (byte)bType.Weapon) { b = new Claw(); } if (BKind == (byte)bKindWeapons.Axe && BType == (byte)bType.Weapon) { b = new Axe(); } if (BKind == (byte)bKindWeapons.Talon && BType == (byte)bType.Weapon) { b = new Talon(); } if (BKind == (byte)bKindWeapons.Tonfa && BType == (byte)bType.Weapon) { b = new Tonfa(); } if (BKind == (byte)bKindWeapons.Hammer && BType == (byte)bType.Weapon) { b = new Hammer(); } if (BKind == (byte)bKindArmors.SwordMan && BType == (byte)bType.Clothes) { b = new Clothes(); } if (BKind == (byte)bKindArmors.Mage && BType == (byte)bType.Clothes) { b = new Dress(); } if (BKind == (byte)bKindArmors.Warrior && BType == (byte)bType.Clothes) { b = new Armor(); } if (BKind == (byte)bKindArmors.GhostFighter && BType == (byte)bType.Clothes) { b = new LeatherClothes(); } if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Hat) { b = new Hood(); } if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Hat) { b = new Tiara(); } if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Hat) { b = new Helmet(); } if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Hat) { b = new Hat(); } if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Shoes) { b = new SmBoots(); } if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Shoes) { b = new MageBoots(); } if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Shoes) { b = new WarriorShoes(); } if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Shoes) { b = new GhostFighterShoes(); } if (BKind == 0 && BType == (byte)bType.Ring) { b = new Ring(); } if (BKind == 0 && BType == (byte)bType.Necklace) { b = new Necklace(); } if (BType == (byte)bType.Cape) { b = new Cape(); Cape c = b as Cape; c.MaxPolishImbueTries = reader.GetInt16(ordinalITEM_MAXPOLISHTRIES); } Equipment e = b as Equipment; e.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL); e.RequiredDexterity = reader.GetInt16(ordinalITEM_DEX); e.RequiredStrength = reader.GetInt16(ordinalITEM_STR); e.RequiredStamina = reader.GetInt16(ordinalITEM_STA); e.RequiredEnergy = reader.GetInt16(ordinalITEM_ENE); e.Durability = reader.GetInt32(ordinalITEM_DURABILITY); e.MaxDurability = e.Durability; e.Damage = reader.GetInt16(ordinalITEM_DAMAGE); e.Defence = reader.GetInt16(ordinalITEM_DEFENCE); e.AttackRating = reader.GetInt16(ordinalITEM_ATTACKRATING); e.AttackSpeed = reader.GetInt16(ordinalITEM_ATTACKSPEED); e.AttackRange = reader.GetInt16(ordinalITEM_ATTACKRANGE); e.IncMaxLife = reader.GetInt16(ordinalITEM_INCMAXLIFE); e.IncMaxMana = reader.GetInt16(ordinalITEM_INCMAXMANA); e.IncLifeRegen = reader.GetInt16(ordinalITEM_LIFEREGEN); e.IncManaRegen = reader.GetInt16(ordinalITEM_MANAREGEN); e.Critical = reader.GetInt16(ordinalITEM_CRITICAL); e.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUETRIES); } if (BType == (byte)bType.ImbueItem) { if (BKind == (byte)bKindStones.Black) { b = new Black(); } if (BKind == (byte)bKindStones.White) { b = new White(); } if (BKind == (byte)bKindStones.Red) { b = new Red(); } if (BKind == (byte)bKindStones.Dragon) { b = new Dragon(); } ImbueItem im = b as ImbueItem; im.ImbueChance = reader.GetInt16(ordinalITEM_IMBUERATE); im.IncreaseValue = reader.GetInt16(ordinalITEM_IMBUEINCREASE); } if (BType == (byte)bType.Potion) { if (BKind == (byte)bKindPotions.Normal) { b = new Potion(); } if (BKind == (byte)bKindPotions.Elixir) { b = new Elixir(); } PotionItem pot = b as PotionItem; pot.HealHp = reader.GetInt16(ordinalITEM_INCMAXLIFE); pot.HealMana = reader.GetInt16(ordinalITEM_INCMAXMANA); } if (BType == (byte)bType.Book) { if (BKind == (byte)bKindBooks.SoftBook) { b = new SoftBook(); } if (BKind == (byte)bKindBooks.HardBook) { b = new HardBook(); } BookItem book = b as BookItem; book.RequiredClass = reader.GetByte(ordinalITEM_CLASS); book.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL); book.SkillID = reader.GetInt32(ordinalITEM_BOOKSKILLID); book.SkillLevel = reader.GetByte(ordinalITEM_BOOKSKILLLEVEL); book.SkillData = reader.GetInt32(ordinalITEM_BOOKSKILLDATA); } if (BType == (byte)bType.Bead) { if (BKind == (byte)bKindBeads.Normal) { b = new Bead(); } BeadItem bead = b as BeadItem; bead.ToMapID = reader.GetInt32(ordinalITEM_TOMAPID); } b.ReferenceID = reader.GetInt16(ordinalITEM_REFERENCEID); b.VisualID = reader.GetInt16(ordinalITEM_VISUALID); b.Bag = reader.GetByte(ordinalITEM_BAG); b.Slot = reader.GetByte(ordinalITEM_SLOT); b.bType = reader.GetByte(ordinalITEM_BTYPE); b.bKind = reader.GetByte(ordinalITEM_BKIND); b.RequiredClass = reader.GetByte(ordinalITEM_CLASS); b.Amount = reader.GetInt16(ordinalITEM_AMOUNT); b.SizeX = reader.GetByte(ordinalITEM_SIZEX); b.SizeY = reader.GetByte(ordinalITEM_SIZEY); b.Price = reader.GetInt32(ordinalITEM_PRICE); items.Add(b); } reader.Close(); _db.Close(); return(items); }