public static int GetSoulsInLantern(Mobile from) { int souls = 0; ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is SoulLantern) { SoulLantern lantern = (SoulLantern)item; if (lantern.owner == from) { souls = lantern.TrappedSouls; } } } return(souls); }
public static void DrainSoulsInLantern(Mobile from, int tithing) { ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is SoulLantern) { SoulLantern lantern = (SoulLantern)item; if (lantern.owner == from) { lantern.TrappedSouls = lantern.TrappedSouls - tithing; if (lantern.TrappedSouls < 1) { lantern.TrappedSouls = 0; } lantern.InvalidateProperties(); } } } }