public static void TurnOtherOrbsOff(Mobile from, EssenceOrb orb) { ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is EssenceOrb && item != orb) { if (((EssenceOrb)item).m_Owner == from) { item.Name = ((EssenceOrb)item).m_MorphName; item.Hue = ((EssenceOrb)item).m_MorphHue; ((EssenceOrb)item).m_Status = 0; } } } }
public override void OnComponentUsed(AddonComponent ac, Mobile from) { if (!from.InRange(GetWorldLocation(), 2)) { from.SendMessage("You will have to get closer to take that."); } else { ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is EssenceOrb) { if (((EssenceOrb)item).m_Owner == from && ((EssenceOrb)item).m_Type == ItemType) { targets.Add(item); } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; item.Delete(); } EssenceOrb orbI = new EssenceOrb(); orbI.m_Owner = from; orbI.m_Type = ItemType; orbI.m_MorphHue = ItemColor; orbI.m_MorphHairHue = ItemHairColor; orbI.m_MorphName = ItemName; orbI.m_OriginalName = "Essence of " + from.Name; orbI.m_Status = 0; orbI.Hue = ItemColor; orbI.Name = ItemName; from.AddToBackpack(orbI); EssenceBaseEmpty Pedul = new EssenceBaseEmpty(); Pedul.ItemType = ItemType; Pedul.MoveToWorld(new Point3D(this.X, this.Y, this.Z), this.Map); from.SendMessage("You have taken the " + ItemName + "!"); this.Delete(); } }