public static void GiveArtifactTo(PlayerMobile pm) { Item item = (Item)Activator.CreateInstance(Artifacts[Utility.Random(Artifacts.Length)]); bool message = true; if (!pm.AddToBackpack(item)) { Container bank = pm.BankBox; if (!(bank != null && bank.TryDropItem(pm, item, false))) { pm.SendLocalizedMessage(1072523, "", 64); // You find an artifact, but your backpack and bank are too full to hold it. message = false; item.MoveToWorld(pm.Location, pm.Map); } } if (message) { pm.SendLocalizedMessage(1062317, "", 64); // For your valor in combating the fallen beast, a special artifact has been bestowed on you. } EffectPool.ArtifactDrop(pm); pm.DoomCredits = 0; }
public static void GiveArtifactTo(Mobile m, Item artifact) { bool message = true; if (!m.AddToBackpack(artifact)) { Container bank = m.BankBox; if (!(bank != null && bank.TryDropItem(m, artifact, false))) { m.SendLocalizedMessage(1072523, "", 64); // You find an artifact, but your backpack and bank are too full to hold it. message = false; artifact.MoveToWorld(m.Location, m.Map); } } if (message) { m.SendLocalizedMessage(1062317, "", 64); // For your valor in combating the fallen beast, a special artifact has been bestowed on you. } EffectPool.ArtifactDrop(m); }