public Control Render(Blade blade) { return(new MenuButton(_label, (_) => { System.Diagnostics.Process.Start(_url); }, _svgIcon ?? Icons.Application)); }
private void Combo() { CurrentTarget = TargetSelector.GetTarget(Spells[R].Range, DamageType.Physical); CastQ(CurrentTarget); if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Combo.UseE")) { CastE(CurrentTarget); } if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Items.Enabled")) { if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Items.UseTIA")) { Tiamat.Cast(null); } if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Items.UseHDR")) { Hydra.Cast(null); } if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Items.UseBRK") && CurrentTarget != null) { Blade.Cast(CurrentTarget); } if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Items.UseBLG") && CurrentTarget != null) { Bilgewater.Cast(CurrentTarget); } if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Items.UseYMU")) { Youmu.Cast(null); } } }
public Control Render(Blade blade) { return(new MenuButton(_label, (_) => { LINQPad.Util.OpenQuery(_scriptPath, _run, _run); }, _svgIcon ?? (_run ? Icons.Application : Icons.File))); }
// Start is called before the first frame update void Start() { m_Rigidbody = GetComponent <Rigidbody>(); m_Blade = GetComponentInChildren <Blade>(); previousTouchPhase = TouchPhase.Ended; }
public ActionResult DeleteProduct(int id, int producttype) { switch (producttype) { case 1: Blade blade = _database.Blades.Find(id); _database.Blades.Remove(blade); _database.SaveChanges(); break; case 2: Handle handle = _database.Handles.Find(id); _database.Handles.Remove(handle); _database.SaveChanges(); break; case 3: ReelSeat reelseat = _database.ReelSeats.Find(id); _database.ReelSeats.Remove(reelseat); _database.SaveChanges(); break; default: break; } return(RedirectToAction("Index")); }
internal void UseItems(Obj_AI_Base target) { var KhazixServerPosition = Khazix.ServerPosition.LSTo2D(); var targetServerPosition = target.ServerPosition.LSTo2D(); if (Hydra.IsReady() && Khazix.LSDistance(target) <= Hydra.Range) { Hydra.Cast(); } if (Tiamat.IsReady() && Khazix.LSDistance(target) <= Tiamat.Range) { Tiamat.Cast(); } if (Titanic.IsReady() && Khazix.LSDistance(target) <= Tiamat.Range) { Tiamat.Cast(); } if (Blade.IsReady() && Khazix.LSDistance(target) <= Blade.Range) { Blade.Cast(target); } if (Youmu.IsReady() && Khazix.LSDistance(target) <= Youmu.Range) { Youmu.Cast(target); } if (Bilgewater.IsReady() && Khazix.LSDistance(target) <= Bilgewater.Range) { Bilgewater.Cast(target); } }
public Control Render(Blade blade) { return(new MenuButton(_label, (_) => { _onClick(); }, _svgIcon)); }
private static void UseItems(Obj_AI_Base target) { var PlayerServerPosition = Player.ServerPosition.To2D(); var targetServerPosition = target.ServerPosition.To2D(); if (Hydra.IsReady() && Vector2.Distance(PlayerServerPosition, targetServerPosition) <= Hydra.Range) { Hydra.Cast(); } if (Tiamat.IsReady() && Vector2.Distance(PlayerServerPosition, targetServerPosition) <= Tiamat.Range) { Tiamat.Cast(); } if (Blade.IsReady() && Vector2.Distance(PlayerServerPosition, targetServerPosition) <= Blade.Range) { Blade.Cast(target); } if (Youmu.IsReady() && Vector2.Distance(PlayerServerPosition, targetServerPosition) <= Youmu.Range) { Youmu.Cast(target); } if (Bilgewater.IsReady() && Vector2.Distance(PlayerServerPosition, targetServerPosition) <= Bilgewater.Range) { Bilgewater.Cast(target); } }
public Blade GetBlade(XmlNode node) { Blade blade = new Blade(); XmlNode theta = node.SelectSingleNode("theta"); if (theta != null) { blade.theta = Double.Parse(theta.InnerText); } XmlNode rho = node.SelectSingleNode("rho"); if (rho != null) { blade.rho = Double.Parse(rho.InnerText); } XmlNode diag = node.SelectSingleNode("diag"); if (diag != null) { blade.diag = Double.Parse(diag.InnerText); } return(blade); }
public object Render(Blade blade) { object PrepareBody(object body) { if (body is string strBody) { return(Typography.P(strBody)); } return(body); } Controls.Button RenderButton(AlertAction action) { return(new Controls.Button(action.Label, (_) => { blade.Manager.CloseSideBlade(action); }, theme: action.IsPrimary?Theme.Primary: Theme.Secondary)); } var primary = RenderButton(_builder._actions.Single(e => e.IsPrimary)); var buttons = new[] { primary }.Union(_builder._actions.Where(e => !e.IsPrimary).Select(RenderButton)); IContentFormatter formatter = new DefaultContentFormatter(); return(Layout.Vertical( formatter.Format(PrepareBody(_builder._body)), _builder._editor?.Render(primary), Layout.Horizontal(buttons) )); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Length,Position,DateInstalled")] Blade blade) { if (id != blade.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(blade); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BladeExists(blade.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(blade)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FactoryId,BladeName,Composite")] Blade blade) { if (id != blade.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(blade); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BladeExists(blade.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FactoryId"] = new SelectList(_context.Factory, "Id", "FactoryName", blade.FactoryId); return(View(blade)); }
public static void CallOnEnemyDeactive(Blade enemy) { if (OnEnemyDeactive != null) { OnEnemyDeactive(enemy); } }
public Control Render(Blade blade) { return(new MenuButton(_label, (_) => { blade.PushBlade(new MenuBlade(this)); }, Icons.ChevronRight)); }
public ActionResult DeleteConfirmed(int id) { Blade blade = db.Blades.Find(id); db.Blades.Remove(blade); db.SaveChanges(); return(RedirectToAction("Index")); }
private void VoiceR_SpeechDetected(object sender, SpeechDetectedEventArgs e) { //frac.MICBOX.BackgroundImage = Properties.Resources.mickickerk; Blade.Stop(); count = 0; frac.MICBOX.BackgroundImage = Properties.Resources.mic; Displayer("(/'ω')/にんしきちゅう!\('ω'\)"); }
private void Blade_Tick(object sender, EventArgs e) { if (++count >= 3) { Fractal.Start(); Blade.Stop(); } }
public BladeRecipe() { Blade CreatedBlade = new Blade(); CreatedBlade.itemRecipe = this; craftedItems.Add(CreatedBlade); itemsNeeded.Add(new Iron_Ore(), 3); }
// Use this for initialization void Start() { text_Drop = GameObject.Find("Text_Drop").GetComponent <Text>(); text_Throw = GameObject.Find("Text_Throw").GetComponent <Text>(); interaction = GetComponent <Interaction>(); globalState = GameObject.Find("RigidBodyFPSController").GetComponent <RigidbodyFirstPersonController>(); bladeScript = GameObject.Find("Blade").GetComponent <Blade>(); }
private void OnEnemyDeactive(Blade enemy) { activeEnemies.Remove(enemy); if (!generate && (activeEnemies.Count <= 0)) { EventManager.CallOnNoEnemyLeft(); } }
void Combo() { float range = 0; if (SpellSlot.R.IsReady()) { range = Spells[R].Range; } else if (Spells[Q2].IsReady()) { range = Spells[Q2].Range; } else if (Spells[E].IsReady()) { range = Spells[E].Range; } CurrentTarget = TargetSelector.GetTarget(range, DamageType.Physical); if (GetBool("Combo.UseEQ", YasuoMenu.ComboM)) { PerformEQ(); } CastQ(CurrentTarget); if (GetBool("Combo.UseE", YasuoMenu.ComboM)) { CastE(CurrentTarget); } if (GetBool("Items.Enabled", YasuoMenu.ComboM)) { if (GetBool("Items.UseTIA", YasuoMenu.ComboM)) { Tiamat.Cast(null); } if (GetBool("Items.UseHDR", YasuoMenu.ComboM)) { Hydra.Cast(null); } if (GetBool("Items.UseBRK", YasuoMenu.ComboM) && CurrentTarget != null) { Blade.Cast(CurrentTarget); } if (GetBool("Items.UseBLG", YasuoMenu.ComboM) && CurrentTarget != null) { Bilgewater.Cast(CurrentTarget); } if (GetBool("Items.UseYMU", YasuoMenu.ComboM)) { Youmu.Cast(null); } } }
private void OnTriggerEnter2D(Collider2D col) { // 블레이드 타입에 따라 자를 수 있는 과일이 다름 if (col.tag == "Blade") { switch (gameObject.tag) { case "Apple": if (Blade.getInstance().type != 1) { return; } break; case "Blueberry": if (Blade.getInstance().type != 4) { return; } break; case "Orange": if (Blade.getInstance().type != 3) { return; } break; case "WaterMelon": if (Blade.getInstance().type != 2) { return; } break; default: return; } ShowFloatingText(); // 잘린 과일 rotation 변경 Vector3 direction = (col.transform.position - transform.position).normalized; Quaternion rotation = Quaternion.LookRotation(direction); // 자르는 사운드 출력 SoundManager.instance.PlaySound(1); // 잘린 과일 생성 GameObject slicedFruit = Instantiate(fruitSlicedPrefab, transform.position, rotation); Destroy(slicedFruit, 3f); //Debug.Log("과일을 공격하셨습니다 !!"); Destroy(gameObject); } }
public void ModelShouldBeInvalid( double bladeLength, double handleLength, double handleBoreDiameter, double buttWidth, double bladeHeight, double grindHeight, double gripLength, double gripDiagonal) { var model = new Blade(bladeLength, handleLength, handleBoreDiameter, buttWidth, bladeHeight, grindHeight, gripLength, gripDiagonal); Assert.Throws <ValidationException>(() => ModelValidator.Validate(model)); }
public void LD_Panel() { //Debug.Log("L_"); Blade.getInstance().type = 4; // 노크 사운드 출력 SoundManager.instance.PlaySound(2); // 상태 색깔 변경 color_state.color = blue.color; }
public void LO_Panel() { //Debug.Log("LO"); Blade.getInstance().type = 3; // 노크 사운드 출력 SoundManager.instance.PlaySound(2); // 상태 색깔 변경 color_state.color = orange.color; }
public void RD_Panel() { //Debug.Log("R_"); Blade.getInstance().type = 2; // 노크 사운드 출력 SoundManager.instance.PlaySound(2); // 상태 색깔 변경 color_state.color = green.color; }
// 패널을 눌렀을 때 블레이드 타일 변경 public void RO_Panel() { //Debug.Log("RO"); Blade.getInstance().type = 1; // 노크 사운드 출력 SoundManager.instance.PlaySound(2); // 상태 색깔 변경 color_state.color = red.color; }
public void ModelShouldBeValid( double bladeLength, double handleLength, double handleBoreDiameter, double buttWidth, double bladeHeight, double grindHeight, double gripLength, double gripDiagonal) { var model = new Blade(bladeLength, handleLength, handleBoreDiameter, buttWidth, bladeHeight, grindHeight, gripLength, gripDiagonal); ModelValidator.Validate(model); }
public ActionResult EditBlade([Bind(Include = "ID, Name, PartNumber,Image,Weight,Price ")] Blade blades) { if (ModelState.IsValid) { _database.Entry(blades).State = EntityState.Modified; _database.SaveChanges(); return(RedirectToAction("Index")); } return(View(blades)); }
private GameObject GetBladeObject(Blade blade) { GameObject go = Instantiate(prefab); go.transform.parent = transform; go.transform.localPosition = blade.position; go.transform.localScale = new Vector3(1, blade.height, 1); return(go); }
public Sword(int _bladeWeaponSet, int _gripWeaponSet, int _guardWeaponSet, int _pommelWeaponSet) { // transform.gameObject.AddComponent<Blade> (); // transform.gameObject.AddComponent<Grip> (); // transform.gameObject.AddComponent<Guard> (); // transform.gameObject.AddComponent<Pommel> (); // // blade = transform.gameObject.GetComponent<Blade> (); // grip = transform.gameObject.GetComponent<Grip> (); // guard = transform.gameObject.GetComponent<Guard> (); // pommel = transform.gameObject.GetComponent<Pommel> (); blade = new Blade (_bladeWeaponSet); grip = new Grip (_gripWeaponSet); guard = new Guard (_guardWeaponSet); pommel = new Pommel (_pommelWeaponSet); }
public BaseItem GetItemByItemID(int itemID) { DbParameter itemIdParameter = _db.CreateParameter(DbNames.GETITEMBYITEMID_ITEMID_PARAMETER, itemID); itemIdParameter.DbType = DbType.Int32; BaseItem b = null; _db.Open(); DbDataReader reader = _db.ExcecuteReader(DbNames.GETITEMBYITEMID_STOREDPROC, CommandType.StoredProcedure, itemIdParameter); int ordinalITEM_ITEMID = reader.GetOrdinal(DbNames.ITEM_ITEMID); int ordinalITEM_OWNERID = reader.GetOrdinal(DbNames.ITEM_OWNERID); int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFERENCEID); 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_COST = reader.GetOrdinal(DbNames.ITEM_COST); int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS); int ordinalITEM_AMOUNT = reader.GetOrdinal(DbNames.ITEM_AMOUNT); 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_MAXIMBUES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES); int ordinalITEM_MAXDURA = reader.GetOrdinal(DbNames.ITEM_MAXDURA); int ordinalITEM_CURDURA = reader.GetOrdinal(DbNames.ITEM_CURDURA); 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_PLUS = reader.GetOrdinal(DbNames.ITEM_PLUS); int ordinalITEM_SLVL = reader.GetOrdinal(DbNames.ITEM_SLVL); int ordinalITEM_IMBUETRIES = reader.GetOrdinal(DbNames.ITEM_IMBUETRIES); int ordinalITEM_DRAGONSUCCESSIMBUETRIES = reader.GetOrdinal(DbNames.ITEM_DRAGONSUCCESSIMBUETRIES); int ordinalITEM_DISCOUNTREPAIRFEE = reader.GetOrdinal(DbNames.ITEM_DISCOUNTREPAIRFEE); int ordinalITEM_TOTALDRAGONIMBUES = reader.GetOrdinal(DbNames.ITEM_TOTALDRAGONIMBUES); int ordinalITEM_DRAGONDAMAGE = reader.GetOrdinal(DbNames.ITEM_DRAGONDAMAGE); int ordinalITEM_DRAGONDEFENCE = reader.GetOrdinal(DbNames.ITEM_DRAGONDEFENCE); int ordinalITEM_DRAGONATTACKRATING = reader.GetOrdinal(DbNames.ITEM_DRAGONATTACKRATING); int ordinalITEM_DRAGONLIFE = reader.GetOrdinal(DbNames.ITEM_DRAGONLIFE); int ordinalITEM_MAPPEDSTUFF = reader.GetOrdinal(DbNames.ITEM_MAPPEDSTUFF); int ordinalITEM_FORCENUMBER = reader.GetOrdinal(DbNames.ITEM_FORCENUMBER); int ordinalITEM_REBIRTHHOLE = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLE); int ordinalITEM_REBIRTHHOLEITEM = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLEITEM); int ordinalITEM_REBIRTHHOLESTAT = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLESTAT); 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_POLISHTRIES = reader.GetOrdinal(DbNames.ITEM_POLISHTRIES); int ordinalITEM_VIGISTAT1 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT1); int ordinalITEM_VIGISTAT2 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT2); int ordinalITEM_VIGISTAT3 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT3); int ordinalITEM_VIGISTAT4 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT4); int ordinalITEM_VIGISTATADD1 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD1); int ordinalITEM_VIGISTATADD2 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD2); int ordinalITEM_VIGISTATADD3 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD3); int ordinalITEM_VIGISTATADD4 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD4); 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()) { 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)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); c.PolishImbueTries = reader.GetByte(ordinalITEM_POLISHTRIES); c.VigiStat1 = reader.GetInt16(ordinalITEM_VIGISTAT1); c.VigiStatAdd1 = reader.GetInt16(ordinalITEM_VIGISTATADD1); c.VigiStat2 = reader.GetInt16(ordinalITEM_VIGISTAT2); c.VigiStatAdd2 = reader.GetInt16(ordinalITEM_VIGISTATADD2); c.VigiStat3 = reader.GetInt16(ordinalITEM_VIGISTAT3); c.VigiStatAdd3 = reader.GetInt16(ordinalITEM_VIGISTATADD3); c.VigiStat4 = reader.GetInt16(ordinalITEM_VIGISTAT4); c.VigiStatAdd4 = reader.GetInt16(ordinalITEM_VIGISTATADD4); } 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.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUES); e.Durability = reader.GetInt16(ordinalITEM_CURDURA); e.MaxDurability = reader.GetInt16(ordinalITEM_MAXDURA); 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.Plus = reader.GetByte(ordinalITEM_PLUS); e.Slvl = reader.GetByte(ordinalITEM_SLVL); e.ImbueTries = reader.GetByte(ordinalITEM_IMBUETRIES); e.DragonSuccessImbueTries = reader.GetInt16(ordinalITEM_DRAGONSUCCESSIMBUETRIES); e.DiscountRepairFee = reader.GetByte(ordinalITEM_DISCOUNTREPAIRFEE); e.TotalDragonImbueTries = reader.GetInt16(ordinalITEM_TOTALDRAGONIMBUES); e.DragonDamage = reader.GetInt16(ordinalITEM_DRAGONDAMAGE); e.DragonDefence = reader.GetInt16(ordinalITEM_DRAGONDEFENCE); e.DragonAttackRating = reader.GetInt16(ordinalITEM_DRAGONATTACKRATING); e.DragonLife = reader.GetInt16(ordinalITEM_DRAGONLIFE); e.MappedData = reader.GetByte(ordinalITEM_MAPPEDSTUFF); e.ForceSlot = reader.GetByte(ordinalITEM_FORCENUMBER); e.RebirthHole = reader.GetByte(ordinalITEM_REBIRTHHOLE); e.RebirthHoleItem = reader.GetByte(ordinalITEM_REBIRTHHOLEITEM); e.RebirthHoleStat = reader.GetInt16(ordinalITEM_REBIRTHHOLESTAT); } 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.ItemID = reader.GetInt32(ordinalITEM_ITEMID); b.OwnerID = reader.GetInt32(ordinalITEM_OWNERID); 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_COST); } reader.Close(); _db.Close(); return b; }
public BaseItem GetRebirthPillDrop(Monster m) { DbParameter levelParameter = _db.CreateParameter(DbNames.GETPILLDROPITEM_LEVEL_PARAMETER, m.Level); levelParameter.DbType = DbType.Int32; List<BaseItem> items = new List<BaseItem>(); _db.Open(); DbDataReader reader = _db.ExcecuteReader(DbNames.GETPILLDROPITEM_STOREDPROC, CommandType.StoredProcedure, levelParameter); int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFERENCEID); 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_COST = reader.GetOrdinal(DbNames.ITEM_COST); int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS); 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_MAXIMBUES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES); int ordinalITEM_MAXDURA = reader.GetOrdinal(DbNames.DROPITEM_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_POLISHTRIES = reader.GetOrdinal(DbNames.ITEM_POLISHTRIES); 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)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); c.PolishImbueTries = reader.GetByte(ordinalITEM_POLISHTRIES); } 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.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUES); e.Durability = reader.GetInt32(ordinalITEM_MAXDURA); e.MaxDurability = reader.GetInt32(ordinalITEM_MAXDURA); e.Damage = reader.GetInt32(ordinalITEM_DAMAGE); e.Defence = reader.GetInt32(ordinalITEM_DEFENCE); e.AttackRating = reader.GetInt32(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); } 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(); } if (BKind == (byte)bKindStones.RbItem) { b = new RbHoleItem(); } 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(); } if (BKind == (byte)bKindBooks.RebirdBook) { b = new RebirthBook(); } if (BKind == (byte)bKindBooks.FourthBook) { b = new FourthBook(); } if (BKind == (byte)bKindBooks.FeSkillBook) { b = new FeSkillBook(); } if (BKind == (byte)bKindBooks.FeBook) { b = new FiveElementBook(); } if (BKind == (byte)bKindBooks.FocusBook) { b = new FocusBook(); } 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); } if (BType == (byte)bType.StoreTag) { b = new StoreTag(); StoreTag tag = b as StoreTag; tag.TimeLeft = reader.GetInt16(ordinalITEM_MAXDURA); tag.TimeMax = reader.GetInt16(ordinalITEM_MAXDURA); } if (BType == (byte)bType.PetItem) { if (BKind == (byte)bKindPetItems.Taming) b = new TameItem(); if (BKind == (byte)bKindPetItems.Food) b = new PetFood(); if (BKind == (byte)bKindPetItems.Potion) b = new PetPotion(); if (BKind == (byte)bKindPetItems.Resurect) b = new PetResurrectItem(); PetItem p = b as PetItem; p.TameChance = reader.GetInt16(ordinalITEM_IMBUERATE); p.DecreaseWildness = reader.GetInt16(ordinalITEM_IMBUEINCREASE); p.HealLife = reader.GetInt16(ordinalITEM_INCMAXLIFE); } if (BType == (byte)bType.Pill) { if (BKind == (byte)bKindPills.Rebirth) b = new RebirthPill(); RebirthPill p = b as RebirthPill; p.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL); p.RequiredRebirth = reader.GetByte(ordinalITEM_CLASS); p.ToRebirth = (byte)(p.RequiredRebirth + 1); p.IncreaseSp = reader.GetInt16(ordinalITEM_DEX); } b.ItemID = 0; b.OwnerID = 0; b.ReferenceID = reader.GetInt16(ordinalITEM_REFERENCEID); b.VisualID = reader.GetInt16(ordinalITEM_VISUALID); b.Bag = 0; b.Slot = 0; b.bType = reader.GetByte(ordinalITEM_BTYPE); b.bKind = reader.GetByte(ordinalITEM_BKIND); b.RequiredClass = reader.GetByte(ordinalITEM_CLASS); b.Amount = 1; b.SizeX = reader.GetByte(ordinalITEM_SIZEX); b.SizeY = reader.GetByte(ordinalITEM_SIZEY); b.Price = reader.GetInt32(ordinalITEM_COST); items.Add(b); } reader.Close(); _db.Close(); if (items.Count > 0) { Random rand = new Random(); int itemPos = rand.Next(0, items.Count); return items[itemPos]; } else return null; }
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; }
public List<BaseItem> GetAllItemsInBag(byte bag, int characterId) { DbParameter bagIdParameter = _db.CreateParameter(DbNames.GETALLITEMSBYBAGID_BAGID_PARAMETER, bag); bagIdParameter.DbType = DbType.Byte; DbParameter characterIdParameter = _db.CreateParameter(DbNames.GETALLITEMSBYBAGID_CHARACTERID_PARAMETER, characterId); characterIdParameter.DbType = DbType.Int32; List<BaseItem> items = new List<BaseItem>(); _db.Open(); DbDataReader reader = _db.ExcecuteReader(DbNames.GETALLITEMSBYBAGID_STOREDPROC, CommandType.StoredProcedure, bagIdParameter, characterIdParameter); int ordinalITEM_ITEMID = reader.GetOrdinal(DbNames.ITEM_ITEMID); int ordinalITEM_OWNERID = reader.GetOrdinal(DbNames.ITEM_OWNERID); int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFERENCEID); 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_COST = reader.GetOrdinal(DbNames.ITEM_COST); int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS); int ordinalITEM_AMOUNT = reader.GetOrdinal(DbNames.ITEM_AMOUNT); 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_MAXIMBUES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES); int ordinalITEM_MAXDURA = reader.GetOrdinal(DbNames.ITEM_MAXDURA); int ordinalITEM_CURDURA = reader.GetOrdinal(DbNames.ITEM_CURDURA); 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_PLUS = reader.GetOrdinal(DbNames.ITEM_PLUS); int ordinalITEM_SLVL = reader.GetOrdinal(DbNames.ITEM_SLVL); int ordinalITEM_IMBUETRIES = reader.GetOrdinal(DbNames.ITEM_IMBUETRIES); int ordinalITEM_DRAGONSUCCESSIMBUETRIES = reader.GetOrdinal(DbNames.ITEM_DRAGONSUCCESSIMBUETRIES); int ordinalITEM_DISCOUNTREPAIRFEE = reader.GetOrdinal(DbNames.ITEM_DISCOUNTREPAIRFEE); int ordinalITEM_TOTALDRAGONIMBUES = reader.GetOrdinal(DbNames.ITEM_TOTALDRAGONIMBUES); int ordinalITEM_DRAGONDAMAGE = reader.GetOrdinal(DbNames.ITEM_DRAGONDAMAGE); int ordinalITEM_DRAGONDEFENCE = reader.GetOrdinal(DbNames.ITEM_DRAGONDEFENCE); int ordinalITEM_DRAGONATTACKRATING = reader.GetOrdinal(DbNames.ITEM_DRAGONATTACKRATING); int ordinalITEM_DRAGONLIFE = reader.GetOrdinal(DbNames.ITEM_DRAGONLIFE); int ordinalITEM_MAPPEDSTUFF = reader.GetOrdinal(DbNames.ITEM_MAPPEDSTUFF); int ordinalITEM_FORCENUMBER = reader.GetOrdinal(DbNames.ITEM_FORCENUMBER); int ordinalITEM_REBIRTHHOLE = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLE); int ordinalITEM_REBIRTHHOLESTAT = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLESTAT); 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_IMBUEDATA = reader.GetOrdinal(DbNames.ITEM_IMBUEDATA); 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_POLISHTRIES = reader.GetOrdinal(DbNames.ITEM_POLISHTRIES); int ordinalITEM_VIGISTAT1 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT1); int ordinalITEM_VIGISTAT2 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT2); int ordinalITEM_VIGISTAT3 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT3); int ordinalITEM_VIGISTAT4 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT4); int ordinalITEM_VIGISTATADD1 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD1); int ordinalITEM_VIGISTATADD2 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD2); int ordinalITEM_VIGISTATADD3 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD3); int ordinalITEM_VIGISTATADD4 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD4); int ordinalITEM_PETID = reader.GetOrdinal(DbNames.ITEM_PETID); int ordinalITEM_DAMAGEABSORB = reader.GetOrdinal(DbNames.ITEM_DAMAGEABSORB); int ordinalITEM_DEFENSEABSORB = reader.GetOrdinal(DbNames.ITEM_DEFENSEABSORB); int ordinalITEM_ATTACKRATINGABSORB = reader.GetOrdinal(DbNames.ITEM_ATTACKRATINGABSORB); int ordinalITEM_LIFEABSORB = reader.GetOrdinal(DbNames.ITEM_LIFEABSORB); 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 || BType == (byte)bType.Mirror) { 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)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); c.PolishImbueTries = reader.GetByte(ordinalITEM_POLISHTRIES); c.VigiStat1 = reader.GetInt16(ordinalITEM_VIGISTAT1); c.VigiStatAdd1 = reader.GetInt16(ordinalITEM_VIGISTATADD1); c.VigiStat2 = reader.GetInt16(ordinalITEM_VIGISTAT2); c.VigiStatAdd2 = reader.GetInt16(ordinalITEM_VIGISTATADD2); c.VigiStat3 = reader.GetInt16(ordinalITEM_VIGISTAT3); c.VigiStatAdd3 = reader.GetInt16(ordinalITEM_VIGISTATADD3); c.VigiStat4 = reader.GetInt16(ordinalITEM_VIGISTAT4); c.VigiStatAdd4 = reader.GetInt16(ordinalITEM_VIGISTATADD4); } if (BType == (byte)bType.Mirror) { // bkind 4 = mirror, 0 = jar b = new Mirror(); Mirror m = b as Mirror; m.PetID = reader.GetInt32(ordinalITEM_PETID); m.LifeAbsorb = reader.GetInt16(ordinalITEM_LIFEABSORB); m.DamageAbsorb = reader.GetInt16(ordinalITEM_DAMAGEABSORB); m.DefenseAbsorb = reader.GetInt16(ordinalITEM_DEFENSEABSORB); m.AttackRatingAbsorb = reader.GetInt16(ordinalITEM_ATTACKRATINGABSORB); } 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.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUES); e.Durability = reader.GetInt16(ordinalITEM_CURDURA); e.MaxDurability = reader.GetInt16(ordinalITEM_MAXDURA); e.Damage = reader.GetInt32(ordinalITEM_DAMAGE); e.Defence = reader.GetInt32(ordinalITEM_DEFENCE); e.AttackRating = reader.GetInt32(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.Plus = reader.GetByte(ordinalITEM_PLUS); e.Slvl = reader.GetByte(ordinalITEM_SLVL); e.ImbueTries = reader.GetByte(ordinalITEM_IMBUETRIES); e.DragonSuccessImbueTries = reader.GetInt16(ordinalITEM_DRAGONSUCCESSIMBUETRIES); e.DiscountRepairFee = reader.GetByte(ordinalITEM_DISCOUNTREPAIRFEE); e.TotalDragonImbueTries = reader.GetInt16(ordinalITEM_TOTALDRAGONIMBUES); e.DragonDamage = reader.GetInt32(ordinalITEM_DRAGONDAMAGE); e.DragonDefence = reader.GetInt32(ordinalITEM_DRAGONDEFENCE); e.DragonAttackRating = reader.GetInt32(ordinalITEM_DRAGONATTACKRATING); e.DragonLife = reader.GetInt16(ordinalITEM_DRAGONLIFE); e.MappedData = reader.GetByte(ordinalITEM_MAPPEDSTUFF); e.ForceSlot = reader.GetByte(ordinalITEM_FORCENUMBER); e.RebirthHole = reader.GetInt16(ordinalITEM_REBIRTHHOLE); e.RebirthHoleStat = reader.GetInt16(ordinalITEM_REBIRTHHOLESTAT); } 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(); } if (BKind == (byte)bKindStones.RbItem) { b = new RbHoleItem(); } ImbueItem im = b as ImbueItem; im.ImbueChance = reader.GetInt16(ordinalITEM_IMBUERATE); im.IncreaseValue = reader.GetInt16(ordinalITEM_IMBUEINCREASE); im.ImbueData = reader.GetByte(ordinalITEM_IMBUEDATA); } 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(); } if (BKind == (byte)bKindBooks.RebirdBook) { b = new RebirthBook(); } if (BKind == (byte)bKindBooks.FourthBook) { b = new FourthBook(); } if (BKind == (byte)bKindBooks.FeSkillBook) { b = new FeSkillBook(); } if (BKind == (byte)bKindBooks.FeBook) { b = new FiveElementBook(); } if (BKind == (byte)bKindBooks.FocusBook) { b = new FocusBook(); } 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); } if (BType == (byte)bType.StoreTag) { b = new StoreTag(); StoreTag tag = b as StoreTag; tag.TimeLeft = reader.GetInt16(ordinalITEM_CURDURA); tag.TimeMax = reader.GetInt16(ordinalITEM_MAXDURA); } if (BType == (byte)bType.PetItem) { if (BKind == (byte)bKindPetItems.Taming) b = new TameItem(); if (BKind == (byte)bKindPetItems.Food) b = new PetFood(); if (BKind == (byte)bKindPetItems.Potion) b = new PetPotion(); if (BKind == (byte)bKindPetItems.Resurect) b = new PetResurrectItem(); PetItem p = b as PetItem; p.TameChance = reader.GetInt16(ordinalITEM_IMBUERATE); p.DecreaseWildness = reader.GetInt16(ordinalITEM_IMBUEINCREASE); p.HealLife = reader.GetInt16(ordinalITEM_INCMAXLIFE); } if (BType == (byte)bType.Pill) { if (BKind == (byte)bKindPills.Rebirth) b = new RebirthPill(); RebirthPill p = b as RebirthPill; p.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL); p.RequiredRebirth = reader.GetByte(ordinalITEM_CLASS); p.ToRebirth = (byte)(p.RequiredRebirth + 1); p.IncreaseSp = reader.GetInt16(ordinalITEM_DEX); } b.ItemID = reader.GetInt32(ordinalITEM_ITEMID); b.OwnerID = reader.GetInt32(ordinalITEM_OWNERID); 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_COST); items.Add(b); } reader.Close(); _db.Close(); return items; }