private AStuff <TModuleType> GenerateStuff(e_stuffInstantiate whichPartOfStuff) { AStuff <TModuleType> itemGenerated = null; switch (whichPartOfStuff) { case e_stuffInstantiate.ARMOR: itemGenerated = this.GenerateClothe(); break; case e_stuffInstantiate.WEAPON: itemGenerated = this.GenerateWeapon(); break; case e_stuffInstantiate.Axe_One_Handed: itemGenerated = new WeaponOneHandedAxe <TModuleType>(); break; case e_stuffInstantiate.Sword_One_Handed: itemGenerated = new WeaponOneHandedSword <TModuleType>(); break; case e_stuffInstantiate.Mass_One_Handed: itemGenerated = new WeaponOneHandedMass <TModuleType>(); break; case e_stuffInstantiate.Scepter_One_Handed: itemGenerated = new WeaponOneHandedScepter <TModuleType>(); break; case e_stuffInstantiate.Axe_Both_Handed: itemGenerated = new WeaponTwoHandedAxe <TModuleType>(); break; case e_stuffInstantiate.Sword_Both_Handed: itemGenerated = new WeaponTwoHandedSword <TModuleType>(); break; case e_stuffInstantiate.Mass_Both_Handed: itemGenerated = new WeaponTwoHandedMass <TModuleType>(); break; case e_stuffInstantiate.Scepter_Both_Handed: itemGenerated = new WeaponTwoHandedScepter <TModuleType>(); break; case e_stuffInstantiate.Lance: itemGenerated = new WeaponTwoHandedLance <TModuleType>(); break; case e_stuffInstantiate.Spear: itemGenerated = new WeaponTwoHandedSpear <TModuleType>(); break; case e_stuffInstantiate.Staff: itemGenerated = new WeaponTwoHandedStaff <TModuleType>(); break; case e_stuffInstantiate.Wand: itemGenerated = new WeaponOneHandedWand <TModuleType>(); break; case e_stuffInstantiate.Bow: itemGenerated = new WeaponTwoHandedBow <TModuleType>(); break; case e_stuffInstantiate.Crossbow: itemGenerated = new WeaponTwoHandedCrossbow <TModuleType>(); break; case e_stuffInstantiate.Armor: itemGenerated = new ClotheArmor <TModuleType>(); break; case e_stuffInstantiate.Helmet: itemGenerated = new ClotheHelmet <TModuleType>(); break; case e_stuffInstantiate.Belt: itemGenerated = new ClotheBelt <TModuleType>(); break; case e_stuffInstantiate.Trousers: itemGenerated = new ClotheTrousers <TModuleType>(); break; case e_stuffInstantiate.Glove: itemGenerated = new ClotheGlove <TModuleType>(); break; case e_stuffInstantiate.Shoes: itemGenerated = new ClotheShoes <TModuleType>(); break; case e_stuffInstantiate.Shield: itemGenerated = new ClotheShield <TModuleType>(); break; default: break; } return(itemGenerated); }
public void GenerateRandomItems(AItemContainer <TModuleType> itemContainer) { int number = MathExtension.GenerateRandomIntBetweenFloat(NumberOfItemGenerated); for (byte i = 0; i < number; i++) { if (this.probabilities.Length > 0) { e_stuffInstantiate whichPartOfStuff = (e_stuffInstantiate)ServiceLocator.Instance.ProbabilityManager.GetProbabilityIndex(this.probabilities); AStuff <TModuleType> itemGenerated = GenerateStuff(whichPartOfStuff); if (null != itemGenerated) { itemGenerated.levelRequiered = this.levelRequired.RandomBetweenValues(); itemGenerated.equipmentQuality = this.GenerateStuffQuality(); this.GenerateStuffName(itemGenerated); itemContainer.AddItem(itemGenerated); } } } }