private void InitByStatSlot(Asda2Profession proff) { if (this.StatSlot == ItemStatsSlots.Any) { this.InitByItemType(ItemStatsSlots.Common, proff); this.InitByItemType(ItemStatsSlots.Craft, proff); this.InitByItemType(ItemStatsSlots.Enchant, proff); this.InitByItemType(ItemStatsSlots.Advanced, proff); } else { this.InitByItemType(this.StatSlot, proff); } }
private void InitByStatSlot(Asda2Profession proff) { switch (StatSlot) { case ItemStatsSlots.Any: InitByItemType(ItemStatsSlots.Common, proff); InitByItemType(ItemStatsSlots.Craft, proff); InitByItemType(ItemStatsSlots.Enchant, proff); InitByItemType(ItemStatsSlots.Advanced, proff); break; default: InitByItemType(StatSlot, proff); break; } }
private void Init(Asda2EquipmentSlots itemType, ItemStatsSlots statSlot, Asda2Profession proffession) { if (!Asda2ItemMgr.ItemStatsInfos.ContainsKey(proffession)) { Asda2ItemMgr.ItemStatsInfos.Add(proffession, new Dictionary <ItemStatsSlots, Dictionary <Asda2EquipmentSlots, List <ItemStatsInfo> > >()); } if (!Asda2ItemMgr.ItemStatsInfos[proffession].ContainsKey(statSlot)) { Asda2ItemMgr.ItemStatsInfos[proffession] .Add(statSlot, new Dictionary <Asda2EquipmentSlots, List <ItemStatsInfo> >()); } if (!Asda2ItemMgr.ItemStatsInfos[proffession][statSlot].ContainsKey(itemType)) { Asda2ItemMgr.ItemStatsInfos[proffession][statSlot].Add(itemType, new List <ItemStatsInfo>()); } Asda2ItemMgr.ItemStatsInfos[proffession][statSlot][itemType].Add(this); }
private void InitByItemType(ItemStatsSlots statSlot, Asda2Profession proffession) { switch (this.ItemType) { case Asda2EquipmentSlots.AnyArmor: this.Init(Asda2EquipmentSlots.Head, statSlot, proffession); this.Init(Asda2EquipmentSlots.Shirt, statSlot, proffession); this.Init(Asda2EquipmentSlots.Boots, statSlot, proffession); this.Init(Asda2EquipmentSlots.Gloves, statSlot, proffession); this.Init(Asda2EquipmentSlots.Pans, statSlot, proffession); break; case Asda2EquipmentSlots.AnyAvatar: this.Init(Asda2EquipmentSlots.AvatarBoots, statSlot, proffession); this.Init(Asda2EquipmentSlots.AvatarGloves, statSlot, proffession); this.Init(Asda2EquipmentSlots.AvatarHead, statSlot, proffession); this.Init(Asda2EquipmentSlots.AvatarPans, statSlot, proffession); this.Init(Asda2EquipmentSlots.AvatarShirt, statSlot, proffession); break; case Asda2EquipmentSlots.Jevelery: this.Init(Asda2EquipmentSlots.RightRing, statSlot, proffession); this.Init(Asda2EquipmentSlots.LeftRing, statSlot, proffession); this.Init(Asda2EquipmentSlots.Nackles, statSlot, proffession); break; case Asda2EquipmentSlots.AnyAvatarAccecory: this.Init(Asda2EquipmentSlots.AvaratRightHead, statSlot, proffession); this.Init(Asda2EquipmentSlots.Wings, statSlot, proffession); this.Init(Asda2EquipmentSlots.Cape, statSlot, proffession); this.Init(Asda2EquipmentSlots.Accessory, statSlot, proffession); break; default: this.Init(this.ItemType, statSlot, proffession); break; } }
/// <summary>Set custom fields etc</summary> public void FinalizeDataHolder() { if (this.Id == uint.MaxValue) { return; } this.CheckId(); this.Template.IsAccessory = this.Category == Asda2ItemCategory.RingMaxAtack || this.Category == Asda2ItemCategory.RingMaxMAtack || (this.Category == Asda2ItemCategory.RingMaxDef || this.Category == Asda2ItemCategory.NacklessCriticalChance) || (this.Category == Asda2ItemCategory.NacklessHealth || this.Category == Asda2ItemCategory.NacklessMana || this.Category == Asda2ItemCategory.RingMDef) || this.Category == Asda2ItemCategory.NacklessMDef; this.Template.IsWeapon = this.Category == Asda2ItemCategory.OneHandedSword || this.Category == Asda2ItemCategory.TwoHandedSword || (this.Category == Asda2ItemCategory.Spear || this.Category == Asda2ItemCategory.Crossbow) || (this.Category == Asda2ItemCategory.Bow || this.Category == Asda2ItemCategory.Ballista || this.Category == Asda2ItemCategory.Staff) || this.Category == Asda2ItemCategory.Showel; this.Template.IsArmor = this.Category == Asda2ItemCategory.Helmet || this.Category == Asda2ItemCategory.Shield || (this.Category == Asda2ItemCategory.Shirt || this.Category == Asda2ItemCategory.Pants) || this.Category == Asda2ItemCategory.Gloves || this.Category == Asda2ItemCategory.Boots; this.Template.IsAvatar = this.Category == Asda2ItemCategory.AvatarCloses || this.Category == Asda2ItemCategory.AvatarAccesory || (this.Category == Asda2ItemCategory.AvatarCape || this.Category == Asda2ItemCategory.AvatarGloves) || (this.Category == Asda2ItemCategory.AvatarHemlet || this.Category == Asda2ItemCategory.AvatarPants || (this.Category == Asda2ItemCategory.AvatarShirt || this.Category == Asda2ItemCategory.AvatarShoes)) || (this.Category == Asda2ItemCategory.AvatarWings || this.EquipmentSlot == Asda2EquipmentSlots.AvatarHead || (this.EquipmentSlot == Asda2EquipmentSlots.AvatarBoots || this.EquipmentSlot == Asda2EquipmentSlots.AvatarGloves) || this.EquipmentSlot == Asda2EquipmentSlots.AvatarPans) || this.EquipmentSlot == Asda2EquipmentSlots.AvatarShirt; this.Template.IsEquipment = this.Template.IsWeapon || this.Template.IsArmor; this.IsRangedWeapon = this.Category == Asda2ItemCategory.Crossbow || this.Category == Asda2ItemCategory.Bow || this.Category == Asda2ItemCategory.Ballista; this.IsMeleeWeapon = this.Category == Asda2ItemCategory.OneHandedSword || this.Category == Asda2ItemCategory.TwoHandedSword || this.Category == Asda2ItemCategory.Spear || this.Category == Asda2ItemCategory.Staff; this.IsTwoHandWeapon = this.Category == Asda2ItemCategory.TwoHandedSword || this.Category == Asda2ItemCategory.Spear || (this.Category == Asda2ItemCategory.Staff || this.Category == Asda2ItemCategory.Crossbow) || this.Category == Asda2ItemCategory.Bow || this.Category == Asda2ItemCategory.Ballista; this.IsAmmo = this.Category == Asda2ItemCategory.BowAmmo || this.Category == Asda2ItemCategory.Crossbow; this.IsRod = this.Category == Asda2ItemCategory.PremiumFishRod || this.Category == Asda2ItemCategory.RodFishingSkill || this.Category == Asda2ItemCategory.RodGauge || this.Category == Asda2ItemCategory.RodFishingSkillAndGauge; this.IsBait = this.Category == Asda2ItemCategory.BaitAnchous || this.Category == Asda2ItemCategory.BaitElite || this.Category == Asda2ItemCategory.BaitPorridge || this.Category == Asda2ItemCategory.BaitWorm; if (this.IsWeapon && this.RequiredLevel >= 10U) { switch (this.Category) { case Asda2ItemCategory.OneHandedSword: this.RequiredProfession = Asda2Profession.Warrior; break; case Asda2ItemCategory.TwoHandedSword: this.RequiredProfession = Asda2Profession.Warrior; break; case Asda2ItemCategory.Staff: this.RequiredProfession = Asda2Profession.Mage; break; case Asda2ItemCategory.Crossbow: this.RequiredProfession = Asda2Profession.Archer; break; case Asda2ItemCategory.Bow: this.RequiredProfession = Asda2Profession.Archer; break; case Asda2ItemCategory.Ballista: this.RequiredProfession = Asda2Profession.Archer; break; case Asda2ItemCategory.Spear: this.RequiredProfession = Asda2Profession.Warrior; break; } } if (Asda2ItemMgr.AvalibleRegularShopItems.ContainsKey((int)this.Id)) { this.CanBuyInRegularShop = true; } this.SowelSocketsCount = this.RequiredLevel >= 38U ? (byte)3 : (byte)2; if (!this.IsWeapon && !this.IsArmor && !this.IsAvatar) { this.SowelSocketsCount = (byte)0; } AuctionLevelCriterion alc; this.AuctionCategory = this.CalcAuctionCategory(out alc); this.AuctionLevelCriterion = alc; this.AtackRange += (short)2; this.InitializeStatBonuses(); ArrayUtil.Set <Asda2ItemTemplate>(ref Asda2ItemMgr.Templates, this.Id, this); }
/// <summary> /// Set custom fields etc /// </summary> public void FinalizeDataHolder() { if (Id == uint.MaxValue) { return; } CheckId(); Template.IsWeapon = Category == Asda2ItemCategory.OneHandedSword || Category == Asda2ItemCategory.TwoHandedSword || Category == Asda2ItemCategory.Spear || Category == Asda2ItemCategory.Crossbow || Category == Asda2ItemCategory.Bow || Category == Asda2ItemCategory.Ballista || Category == Asda2ItemCategory.Staff || Category == Asda2ItemCategory.Showel; Template.IsArmor = Category == Asda2ItemCategory.Helmet || Category == Asda2ItemCategory.Shield || Category == Asda2ItemCategory.Shirt || Category == Asda2ItemCategory.Pants || Category == Asda2ItemCategory.Gloves || Category == Asda2ItemCategory.Boots; Template.IsAvatar = Category == Asda2ItemCategory.AvatarCloses || Category == Asda2ItemCategory.AvatarAccesory || Category == Asda2ItemCategory.AvatarCape || Category == Asda2ItemCategory.AvatarGloves || Category == Asda2ItemCategory.AvatarHemlet || Category == Asda2ItemCategory.AvatarPants || Category == Asda2ItemCategory.AvatarShirt || Category == Asda2ItemCategory.AvatarShoes || Category == Asda2ItemCategory.AvatarWings || EquipmentSlot == Asda2EquipmentSlots.AvatarHead || EquipmentSlot == Asda2EquipmentSlots.AvatarBoots || EquipmentSlot == Asda2EquipmentSlots.AvatarGloves || EquipmentSlot == Asda2EquipmentSlots.AvatarPans || EquipmentSlot == Asda2EquipmentSlots.AvatarShirt; Template.IsEquipment = Template.IsWeapon || Template.IsArmor; IsRangedWeapon = Category == Asda2ItemCategory.Crossbow || Category == Asda2ItemCategory.Bow || Category == Asda2ItemCategory.Ballista; IsMeleeWeapon = Category == Asda2ItemCategory.OneHandedSword || Category == Asda2ItemCategory.TwoHandedSword || Category == Asda2ItemCategory.Spear || Category == Asda2ItemCategory.Staff; IsTwoHandWeapon = Category == Asda2ItemCategory.TwoHandedSword || Category == Asda2ItemCategory.Spear || Category == Asda2ItemCategory.Staff || Category == Asda2ItemCategory.Crossbow || Category == Asda2ItemCategory.Bow || Category == Asda2ItemCategory.Ballista; IsAmmo = Category == Asda2ItemCategory.BowAmmo || Category == Asda2ItemCategory.Crossbow; IsRod = Category == Asda2ItemCategory.PremiumFishRod || Category == Asda2ItemCategory.RodFishingSkill || Category == Asda2ItemCategory.RodGauge || Category == Asda2ItemCategory.RodFishingSkillAndGauge; IsBait = Category == Asda2ItemCategory.BaitAnchous || Category == Asda2ItemCategory.BaitElite || Category == Asda2ItemCategory.BaitPorridge || Category == Asda2ItemCategory.BaitWorm; IsPotion = Category == Asda2ItemCategory.HealthPotion || Category == Asda2ItemCategory.ManaPotion || Category == Asda2ItemCategory.ManaElixir || Category == Asda2ItemCategory.HealthElixir; IsAccessories = EquipmentSlot == Asda2EquipmentSlots.Accessory || EquipmentSlot == Asda2EquipmentSlots.RightRing || EquipmentSlot == Asda2EquipmentSlots.LeftRing; if (IsWeapon && RequiredLevel >= 10) { switch (Category) { case Asda2ItemCategory.Staff: RequiredProfession = Asda2Profession.Mage; break; case Asda2ItemCategory.OneHandedSword: RequiredProfession = Asda2Profession.Warrior; break; case Asda2ItemCategory.TwoHandedSword: RequiredProfession = Asda2Profession.Warrior; break; case Asda2ItemCategory.Spear: RequiredProfession = Asda2Profession.Warrior; break; case Asda2ItemCategory.Bow: RequiredProfession = Asda2Profession.Archer; break; case Asda2ItemCategory.Crossbow: RequiredProfession = Asda2Profession.Archer; break; case Asda2ItemCategory.Ballista: RequiredProfession = Asda2Profession.Archer; break; } } if (Asda2ItemMgr.AvalibleRegularShopItems.ContainsKey((int)Id)) { CanBuyInRegularShop = true; } if (RequiredLevel < 38) { SowelSocketsCount = 2; } else { SowelSocketsCount = 3; } if (!IsWeapon && !IsArmor && !IsAvatar) { SowelSocketsCount = 0; } AuctionLevelCriterion alc; AuctionCategory = CalcAuctionCategory(out alc); AuctionLevelCriterion = alc; AtackRange += 2; InitializeStatBonuses(); ArrayUtil.Set(ref Asda2ItemMgr.Templates, Id, this); }