public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else { if (from != null && from.Backpack != null) { Item item = ArtifactList.RandomArtifact(); if (item != null) { from.Backpack.DropItem(item); this.Delete(); } else { from.SendMessage("There was an issue with artifact generation, therefore the scroll does nothing"); } } else if (from != null) { from.SendMessage("You do not seem to have a backpack, therefore the scroll does nothing."); } } }
public static void GiveArtifact(BaseCreature bc) { //**Begin Artifact Randomness**\\ if (percent > Utility.RandomDouble()) // 0.7 = 70% = chance to drop { bc.PackItem(ArtifactList.RandomArtifact()); } }
public static void GiveArtifact(Mobile m, PlayerMobile pm) { //**Begin Artifact Randomness**\\ if (percent >= Utility.RandomDouble() && pm != null && !pm.Deleted) { Container artybag = GetArtifactBag(m); //bc.PackItem(ArtifactList.RandomArtifact()); m.SendMessage(87, "For your valor in combating the fallen beast, a special artifact has been bestowed on you."); if (m.Backpack != null && m.Backpack.Items != null && m.Backpack.Items.Count < 125) // randomize the drop if pack isn't full. { artybag.DropItem(ArtifactList.RandomArtifact()); } else { artybag.AddItem(ArtifactList.RandomArtifact()); } } }