Esempio n. 1
0
        public static int GetSoulsInSymbol(Mobile from)
        {
            int souls = 0;

            ArrayList targets = new ArrayList();

            foreach (Item item in World.Items.Values)
            {
                if (item is HolySymbol)
                {
                    HolySymbol symbol = (HolySymbol)item;
                    if (symbol.owner == from)
                    {
                        souls = symbol.BanishedEvil;
                    }
                }
            }

            return(souls);
        }
Esempio n. 2
0
        public static void DrainSoulsInSymbol(Mobile from, int tithing)
        {
            ArrayList targets = new ArrayList();

            foreach (Item item in World.Items.Values)
            {
                if (item is HolySymbol)
                {
                    HolySymbol symbol = (HolySymbol)item;
                    if (symbol.owner == from)
                    {
                        symbol.BanishedEvil = symbol.BanishedEvil - tithing;
                        if (symbol.BanishedEvil < 1)
                        {
                            symbol.BanishedEvil = 0;
                        }
                        symbol.InvalidateProperties();
                    }
                }
            }
        }
Esempio n. 3
0
        ///////////////////////////////////////////////////////////////////////////

        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            int hasSymbol = 0;
            int hasBook   = 0;
            int isPriest  = 0;

            if (dropped is MalletStake)
            {
                MalletStake stake = (MalletStake)dropped;

                int reward = stake.VampiresSlain;

                if (reward > 0)
                {
                    from.AddToBackpack(new Gold(reward));

                    string sMessage = "Thank you. Here is " + reward + " gold for your bravery.";

                    if (reward >= 1000 && from.Karma >= 2500 && from.Skills[SkillName.SpiritSpeak].Base > 0 && from.Skills[SkillName.Healing].Base > 0)
                    {
                        foreach (Item item in World.Items.Values)
                        {
                            if (item is HolySymbol)
                            {
                                HolySymbol symbol = (HolySymbol)item;
                                if (symbol.owner == from)
                                {
                                    from.AddToBackpack(symbol);
                                    hasSymbol = 1;
                                }
                            }
                            else if (item is HolyManSpellbook)
                            {
                                HolyManSpellbook book = (HolyManSpellbook)item;
                                if (book.owner == from)
                                {
                                    from.AddToBackpack(book);
                                    hasBook = 1;
                                }
                            }
                        }

                        if (hasSymbol == 0)
                        {
                            from.AddToBackpack(new HolySymbol(from));
                        }
                        if (hasBook == 0)
                        {
                            HolyManSpellbook tome = new HolyManSpellbook((ulong)0, from); from.AddToBackpack(tome);
                        }

                        from.SendMessage("You have been given your holy symbol and prayer book.");

                        if (hasSymbol + hasBook == 0)
                        {
                            isPriest = 1;
                            LoggingFunctions.LogGenericQuest(from, "has become a priest");
                            from.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
                            from.PlaySound(0x1EA);
                            sMessage = from.Name + ", take the gold and these as well. You may be a good priest one day.";
                        }
                    }

                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState);
                    if (isPriest == 0)
                    {
                        from.SendSound(0x3D);
                    }
                    dropped.Delete();
                    return(true);
                }

                return(false);
            }
            else if (dropped is Gold && dropped.Amount >= 5 && Server.Misc.GetPlayerInfo.isJedi(from, false))
            {
                int crystals = (int)(dropped.Amount / 5);
                this.Say("Bring light to the world with these, Jedi.");
                from.AddToBackpack(new KaranCrystal(crystals));
                dropped.Delete();
            }

            return(base.OnDragDrop(from, dropped));
        }