コード例 #1
0
        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);
        }
コード例 #2
0
        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();
                    }
                }
            }
        }