コード例 #1
0
        public static int KnowsThisMany(Mobile m)
        {
            if (!BlueMageControl.IsBlueMage(m))
            {
                return(0);
            }

            int count = 0;

            bool[] known = BlueMageControl.GetBoolList(m);

            for (int i = 0; i < known.Length; i++)
            {
                if (known[i])
                {
                    ++count;
                }
            }

            return(count);
        }
コード例 #2
0
        public static bool KnowsAll(Mobile m, int type)
        {
            if (!BlueMageControl.IsBlueMage(m))
            {
                return(false);
            }

            bool spells = true, moves = true;

            bool[] known = BlueMageControl.GetBoolList(m);

            for (int i = 0; i < known.Length; i++)
            {
                if (known[i])
                {
                    continue;
                }
                else if (IsBlueMove(i))
                {
                    moves = false;
                }
                else
                {
                    spells = false;
                }
            }

            if (type == 1)
            {
                return(spells);
            }
            else if (type == 2)
            {
                return(moves);
            }
            else
            {
                return(spells && moves);
            }
        }
コード例 #3
0
        public override bool CheckCast()
        {
            if (Caster is BaseCreature)
            {
                BaseCreature bc = Caster as BaseCreature;
                bc.DebugSay("Blue Spell: CheckCast is returning base");
                return(base.CheckCast());
            }
            else if (Caster.AccessLevel == AccessLevel.Counselor)
            {
                // Counselors are blocked becuase counselors are not meant to have leet god powers. Lock the level down like you're supposed to and you can hire the position out as the advice giving only position as it's supposed to be.
                Caster.SendMessage("You are blocked from these spells.");
                return(false);
            }
            else if (Caster is PlayerMobile && !BlueMageControl.IsBlueMage(Caster) && Caster.AccessLevel == AccessLevel.Player)
            {
                Caster.SendMessage("Only a blue mage can cast this spell.");
                return(false);
            }

            // Not a real class system, because class systems suck, but you can't use higher levels of spells as part of an intended balence.
            if (BlueMageControl.SkillLock && Caster.AccessLevel == AccessLevel.Player)
            {
                if (Caster.Skills[SkillName.Magery].Base > 50.0)
                {
                    //Caster.SendMessage( "You study true magic and cannot mimic such a choatic spell." );
                    Caster.Skills[SkillName.Magery].Base = 50.0;
                }
                if (Caster.Skills[SkillName.Chivalry].Base > 50.0)
                {
                    //Caster.SendMessage( "Your oath prevents you from using such a dishonorable spell." );
                    Caster.Skills[SkillName.Chivalry].Base = 50.0;
                }
                if (Caster.Skills[SkillName.Necromancy].Base > 50.0)
                {
                    //Caster.SendMessage( "Your dark power prevents you from casting this spell." );
                    Caster.Skills[SkillName.Necromancy].Base = 50.0;
                }
                if (Caster.Skills[SkillName.AnimalTaming].Base > 0.0)
                {
                    //Caster.SendMessage( "You refuse to cast the spell, you believe monsters should be used, not studied." );
                    Caster.Skills[SkillName.AnimalTaming].Base = 0.0;
                }
                else if (Caster.Skills[SkillName.Spellweaving].Base > 50.0)
                {
                    Caster.Skills[SkillName.Spellweaving].Base = 50.0;
                }
                else if (Caster.Skills[SkillName.Mysticism].Base > 50.0)
                {
                    Caster.Skills[SkillName.Mysticism].Base = 50.0;
                }

                if (Caster is PlayerMobile && !BlueMageControl.CheckKnown(Caster, this, false))
                {
                    Caster.SendMessage("You do not know this spell");
                    return(false);
                }
            }

            if (!base.CheckCast())               //|| !base.CheckSequence() )
            {
                return(false);
            }
            else
            {
                //Caster.PublicOverheadMessage( MessageType.Regular, 1365, false, this.type.toString() );
                BaseAnimation();
                return(true);
            }
        }