private void FillChest() { int RaresDropped = 0; LogHelper Logger = new LogHelper("PirateChampChest.log", false); // 25 piles * 1200 = 30K gold for (int ix = 0; ix < 25; ix++) { // force the separate piles Gold gold = new Gold(800, 1200); gold.Stackable = false; m_MetalChest.DropItem(gold); gold.Stackable = true; } // "a smelly old mackerel" if (Utility.RandomChance(10)) { Item ii; ii = new BigFish(); ii.Name = "a smelly old mackerel"; ii.Weight = 5; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // single gold ingot weight 12 if (Utility.RandomChance(10 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(7145); } else { ii = new Item(7148); } ii.Weight = 12; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // 3 gold ingots 12*3 if (Utility.RandomChance(5 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(7146); } else { ii = new Item(7149); } ii.Weight = 12 * 3; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // 5 gold ingots 12*5 if (Utility.RandomChance(1 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(7147); } else { ii = new Item(7150); } ii.Weight = 12 * 5; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // single silver ingot weight 6 if (Utility.RandomChance(10 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(7157); } else { ii = new Item(7160); } ii.Weight = 6; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // 3 silver ingots 6*3 if (Utility.RandomChance(5 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(7158); } else { ii = new Item(7161); } ii.Weight = 6 * 3; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // 5 silver ingots 6*5 if (Utility.RandomChance(1 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(7159); } else { ii = new Item(7162); } ii.Weight = 6 * 5; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // rolled map w1 if (Utility.RandomChance(20 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(5357); } else { ii = new Item(5358); } ii.Weight = 1; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // ship plans if (Utility.RandomChance(10 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(5361); } else { ii = new Item(5362); } ii.Weight = 1; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // ship model if (Utility.RandomChance(5 * 2)) { Item ii; if (Utility.RandomBool()) { ii = new Item(5363); } else { ii = new Item(5364); } ii.Weight = 3; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // "scale shield" w6 if (Utility.RandomChance(1)) { Item ii; if (Utility.RandomBool()) { ii = new Item(7110); } else { ii = new Item(7111); } ii.Name = "scale shield"; ii.Weight = 6; m_MetalChest.DropItem(ii); RaresDropped++; Logger.Log(LogType.Item, ii); } // level 5 chest regs & gems TreasureMapChest.PackRegs(m_MetalChest, 5 * 10); TreasureMapChest.PackGems(m_MetalChest, 5 * 5); // level 5 magic items DungeonTreasureChest.PackMagicItem(m_MetalChest, 3, 3, 0.20); DungeonTreasureChest.PackMagicItem(m_MetalChest, 3, 3, 0.10); DungeonTreasureChest.PackMagicItem(m_MetalChest, 3, 3, 0.05); // an a level 5 treasure map m_MetalChest.DropItem(new TreasureMap(5, Map.Felucca)); Logger.Log(LogType.Text, string.Format("There were a total of {0} rares dropped.", RaresDropped)); Logger.Finish(); }
public void GunSetorGetFish(int ListID) { if (work.GetStack(ListID).Count != 0 && gun.Content() == null && work.GetStack(ListID)[work.GetStack(ListID).Count - 1].GetType() != new BigFish().GetType()) { if (work.GetStack(ListID)[work.GetStack(ListID).Count - 1].GetType() == new DestroyerFish().GetType()) { DestroyerFish(ListID); } else { gun.Set(work.GetStack(ListID)); } } else if (gun.Content() != null) { List <Fish> f = work.GetStack(ListID); if (f.Count == 0) { f.Add(gun.Get()); } else if (gun.Content() != null && f[f.Count - 1].GetType() == new BigFish().GetType() && gun.Content().GetType() == new MediumFish().GetType())// потрібен метод який повертає чи є рибка у gun і яка вона { BigFish b = (BigFish)f[f.Count - 1]; if (Perevirka((MediumFish)gun.Content())) { f.RemoveAt(f.Count - 1);// видаляю рибу gun.Get(); gun.Score += 3; } else if (b.IsSatisfied == 1) { f.RemoveAt(f.Count - 1);// видаляю рибу gun.Get(); gun.Score += 3; } else { b.Eat((MediumFish)gun.Get()); } } else if (f[f.Count - 1].GetType() == new MediumFish().GetType() && gun.Content().GetType() == new SmallFish().GetType()) { MediumFish b = (MediumFish)f[f.Count - 1]; if (b.IsSatisfied == 1) { f.RemoveAt(f.Count - 1); // видаляю рибу gun.Get(); gun.Score += 3; } else { b.Eat((SmallFish)gun.Get()); } } } }