public override void GiveSpecialItems(List<Mobile> eligibleMobs, List<double> eligibleMobScores, double totalScores) { double currentTestValue = 0.0; double roll = Utility.RandomDouble() * totalScores; for (int i = 0; i < eligibleMobScores.Count; i++) { currentTestValue += eligibleMobScores[i]; if (roll > currentTestValue) { continue; } HeartofRikktor heart = new HeartofRikktor(); if (eligibleMobs[i] is PlayerMobile && eligibleMobs[i].Backpack != null) { eligibleMobs[i].Backpack.DropItem(heart); eligibleMobs[i].SendMessage(54, "You have received the smouldering heart of Rikktor!"); break; } } currentTestValue = 0.0; roll = Utility.RandomDouble() * totalScores; if (0.2 > Utility.RandomDouble()) { for (int i = 0; i < eligibleMobScores.Count; i++) { currentTestValue += eligibleMobScores[i]; if (roll > currentTestValue) { continue; } Random rand = new Random(); int value = rand.Next(0, 3); Item item = null; switch (value) { case 0: { item = new RikktorsHead(); } break; case 1: { item = new RocksAnimatedArtifact(); } break; case 2: { item = new StoneFaceTrapNoDamageArtifact(); } break; } if (eligibleMobs[i] is PlayerMobile && eligibleMobs[i].Backpack != null && item != null) { eligibleMobs[i].Backpack.DropItem(item); eligibleMobs[i].SendMessage(54, "You have received " + item.Name + "."); break; } } } if (0.2 > Utility.RandomDouble()) { for (int i = 0; i < eligibleMobScores.Count; i++) { currentTestValue += eligibleMobScores[i]; if (roll > currentTestValue) { continue; } if (eligibleMobs[i] is PlayerMobile && eligibleMobs[i].Backpack != null) { eligibleMobs[i].Backpack.DropItem(new TitleScroll("The Dragoon")); eligibleMobs[i].SendMessage(54, "You have received a title scroll."); return; } } } }
public override void GiveSpecialItems(List <Mobile> eligibleMobs, List <double> eligibleMobScores, double totalScores) { double currentTestValue = 0.0; double roll = Utility.RandomDouble() * totalScores; for (int i = 0; i < eligibleMobScores.Count; i++) { currentTestValue += eligibleMobScores[i]; if (roll > currentTestValue) { continue; } HeartofRikktor heart = new HeartofRikktor(); if (eligibleMobs[i] is PlayerMobile && eligibleMobs[i].Backpack != null) { eligibleMobs[i].Backpack.DropItem(heart); eligibleMobs[i].SendMessage(54, "You have received the smouldering heart of Rikktor!"); break; } } currentTestValue = 0.0; roll = Utility.RandomDouble() * totalScores; if (0.2 > Utility.RandomDouble()) { for (int i = 0; i < eligibleMobScores.Count; i++) { currentTestValue += eligibleMobScores[i]; if (roll > currentTestValue) { continue; } Random rand = new Random(); int value = rand.Next(0, 3); Item item = null; switch (value) { case 0: { item = new RikktorsHead(); } break; case 1: { item = new RocksAnimatedArtifact(); } break; case 2: { item = new StoneFaceTrapNoDamageArtifact(); } break; } if (eligibleMobs[i] is PlayerMobile && eligibleMobs[i].Backpack != null && item != null) { eligibleMobs[i].Backpack.DropItem(item); eligibleMobs[i].SendMessage(54, "You have received " + item.Name + "."); break; } } } if (0.2 > Utility.RandomDouble()) { for (int i = 0; i < eligibleMobScores.Count; i++) { currentTestValue += eligibleMobScores[i]; if (roll > currentTestValue) { continue; } if (eligibleMobs[i] is PlayerMobile && eligibleMobs[i].Backpack != null) { eligibleMobs[i].Backpack.DropItem(new TitleScroll("The Dragoon")); eligibleMobs[i].SendMessage(54, "You have received a title scroll."); return; } } } }