Exemple #1
0
        public BlueQuitGump(Mobile from) : base(0, 0)
        {
            if (!BlueMageControl.IsBlueMage(from))
            {
                return;
            }

            Closable   = true;
            Disposable = true;
            Dragable   = true;

            AddPage(0);
            AddBackground(0, 0, 175, 290, 9270);                                // Background
            AddImage(0, 0, 50468, 2101);                                        // Cloak
            AddImage(0, 0, 12, 1008);                                           // Body
            AddImage(0, 0, 50434, 2101);                                        // Shirt
            AddImage(0, 0, 50431, 2101);                                        // Pants
            AddImage(0, 0, 50490, 2101);                                        // Sash
            AddImage(0, 0, 50556, 2101);                                        // Arms
            AddImage(0, 0, 50702, 1109);                                        // Hair
            AddImage(0, 0, 50804, 1109);                                        // Beard
            AddImage(0, 0, 50941, 2101);                                        // Boots
            AddImage(0, 0, 50943, 2101);                                        // Belt
            AddImage(0, 1, 50409, 2101);                                        // Hat
            AddButton(15, 235, 1147, 1148, 1, GumpButtonType.Reply, 0);         // OK Button
            AddButton(90, 235, 1144, 1145, 2, GumpButtonType.Reply, 0);         // Cancil Button
            AddTextEntry(20, 15, 132, 20, 1365, 0, @"Quit being a Blue Mage?"); // Text Entry
        }
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)o;

                    if (BlueMageControl.IsBlueMage(pm))
                    {
                        if (from.HasGump(typeof(BlueSpellsKnownGump)))
                        {
                            from.CloseGump(typeof(BlueSpellsKnownGump));
                        }

                        from.SendGump(new BlueSpellsKnownGump(pm));
                    }
                    else
                    {
                        from.SendMessage(1365, "They are not a blue mage.");
                    }
                }
                else
                {
                    from.SendMessage(1365, "You can only get a Player's list of spells known.");
                }
            }
        public override void OnDoubleClick(Mobile from)
        {
            if (Hue != 1150)
            {
                base.OnDoubleClick(from);
                return;
            }

            Container pack = from.Backpack;

            if (!(pack != null && Parent == pack))
            {
                from.SendLocalizedMessage(1080058);                   // This must be in your backpack to use it.
                return;
            }

            from.Animate(34, 5, 1, true, false, 0);
            from.PlaySound(Utility.Random(0x3A, 3));

            if (BlueMageControl.IsBlueMage(from))
            {
                BlueMageControl.CheckKnown(from, typeof(AngelsSnackSpell), true);
            }

            Hue  = Utility.RandomList(0, 0x66D, 0x53D, 0x8A5, 0x21, 0x5, 0x38, 0xD, 0x59B, 0x46F, 0x10, 0x42, 0x2B);
            Name = "grasses";
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(GetWorldLocation(), 2))
            {
                if (BlueMageControl.IsBlueMage(from))
                {
                    if (from.HasGump(typeof(BlueQuitGump)))
                    {
                        from.CloseGump(typeof(BlueQuitGump));
                    }

                    from.SendGump(new BlueQuitGump(from));
                }
                else
                {
                    if (from.AccessLevel == AccessLevel.Player)
                    {
                        from.SendMessage("Please speak to Ben in New Haven");
                    }
                    else
                    {
                        if (from.HasGump(typeof(BlueAcceptGump)))
                        {
                            from.CloseGump(typeof(BlueAcceptGump));
                        }

                        from.SendGump(new BlueAcceptGump(from));
                    }
                }
            }
        }
Exemple #5
0
        public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted)
        {
            if (!BlueMageControl.IsBlueMage(from) || !BlueMageControl.IsBlueMage(to))
            {
                return(false);
            }

            return(base.AllowSecureTrade(from, to, newOwner, accepted));
        }
Exemple #6
0
 public override bool VerifyMove(Mobile from)
 {
     if (BlueMageControl.IsBlueMage(from) || from.AccessLevel > AccessLevel.Counselor)
     {
         return(base.VerifyMove(from));
     }
     else
     {
         from.SendMessage(1365, "Only a Blue Mage can touch this.");
         return(false);
     }
 }
Exemple #7
0
 public override bool CanEquip(Mobile from)
 {
     if (BlueMageControl.IsBlueMage(from) || from is BaseVendor || from is BlueMonster || from.AccessLevel > AccessLevel.Counselor)
     {
         return(base.CanEquip(from));
     }
     else
     {
         from.SendMessage("You may not wear this.");
         return(false);
     }
 }
Exemple #8
0
        public BlueSpellsKnownGump(Mobile from) : base(0, 0)
        {
            m_From = from;

            if (!BlueMageControl.IsBlueMage(m_From))
            {
                return;
            }

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;

            bool[]           boollist = BlueMageControl.GetBoolList(m_From);
            int              count = 0, x = 0, y = 0;
            List <LabelInfo> labels = new List <LabelInfo>();

            for (int i = 0; i < boollist.Length; i++)
            {
                if (boollist[i])
                {
                    x = (count % 2) == 0 ? 15 : 140;
                    y = (((count / 2) - 1) * 25) + 125;
                    labels.Add(new LabelInfo(x, y, 1365, BlueSpellInfo.GetName(i), i));

                    count++;
                }
            }

            int knownY = labels.Count / 2 + 1;

            AddPage(0);

            AddBackground(0, 0, 190 + 80, 85, 9270);                            // Top layer
            AddBackground(0, 80, 190 + 80, (knownY * 25) + 30, 9270);           // Middle Layer
            AddBackground(0, 85 + (knownY * 25) + 30 - 10, 190 + 80, 85, 9270); // Bottem Layer

            AddImage(15, 15, 11013, 1365);                                      // Arms book
            AddLabel(60, 15, 1365, @"Blue Spells Known");

            AddLabel(28 + 40, 85 + (knownY * 25) + 25 + 12, 1365, @"Created By Peoharen");
            AddImage(75 + 40, 85 + (knownY * 25) + 25 + 32, 113, 1365);               // Virtue

            for (int i = 0; i < labels.Count; i++)
            {
                AddButton(labels[i].X, labels[i].Y + 5, 1209, 1210, labels[i].SpellNumber + 1, GumpButtonType.Reply, 0);
                AddButton(labels[i].X + 20, labels[i].Y + 3, 22153, 22154, labels[i].SpellNumber + 100, GumpButtonType.Reply, 0);
                AddLabel(labels[i].X + 40, labels[i].Y, labels[i].Hue, labels[i].Words);
            }
        }
 public override bool CheckVendorAccess(Mobile from)
 {
     if (!base.CheckVendorAccess(from))
     {
         return(false);
     }
     else if (!BlueMageControl.IsBlueMage(from))
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemple #10
0
        public BlueAcceptGump(Mobile from) : base(0, 0)
        {
            if (BlueMageControl.IsBlueMage(from))
            {
                return;
            }

            Closable   = true;
            Disposable = true;
            Dragable   = true;

            AddPage(0);
            AddBackground(0, 0, 175, 290, 9270);                            // Background
            AddImage(0, 0, 50468, 1365);                                    // Cloak
            AddImage(0, 0, 12, 1008);                                       // Body
            AddImage(0, 0, 50434, 1365);                                    // Shirt
            AddImage(0, 0, 50431, 1365);                                    // Pants
            AddImage(0, 0, 50490, 1365);                                    // Sash
            AddImage(0, 0, 50556, 1365);                                    // Arms
            AddImage(0, 0, 50702, 2223);                                    // Hair
            AddImage(0, 0, 50804, 2223);                                    // Beard
            AddImage(0, 0, 50941, 1365);                                    // Boots
            AddImage(0, 0, 50943, 1365);                                    // Belt
            AddImage(0, 1, 50409, 1365);                                    // Hat
            AddButton(15, 235, 1147, 1148, 1, GumpButtonType.Reply, 0);     // OK Button
            AddButton(90, 235, 1144, 1145, 2, GumpButtonType.Reply, 0);     // Cancil Button
            AddTextEntry(20, 15, 132, 20, 1365, 0, @"Become a Blue Mage?"); // Text Entry

            AddBackground(175, 0, 175, 290, 3600);                          //HTML Background

            if (BlueMageControl.SkillLock)
            {
                AddHtml(190, 15, 145, 260, @"The Blue Mage is a practitioner of Blue Magic, who learns to create a spell that replicates the special attacks of monsters through observation and contact.<br><br>Blue Magic can provide a variety of abilities not accessible to other spellcasters, but acquiring them can be difficult; the mage often must be strong enough to be hit and survive a monster's attack to try to learn it, assuming it can be learned at all.<br><br>!WARNING!<br>You cannot become a master in other spellcasting skills and if you already are your current values will be reduced to 50.0 and so long as you use blue magic you cannot remain higher than that total (you may however continue to use items).", (bool)true, (bool)true);                   //HTML
            }
            else
            {
                AddHtml(190, 15, 145, 260, @"The Blue Mage is a practitioner of Blue Magic, who learns to create a spell that replicates the special attacks of monsters through observation and contact.<br><br>Blue Magic can provide a variety of abilities not accessible to other spellcasters, but acquiring them can be difficult; the mage often must be strong enough to be hit and survive a monster's attack to try to learn it, assuming it can be learned at all.", (bool)true, (bool)true);                   //HTML
            }
        }
        public static void AddNPC(PlayerMobile pm)
        {
            if (!BlueMageControl.IsBlueMage(pm))
            {
                return;
            }

            if (NPCs.Keys.Count > 20)
            {
                return;
            }

            if (NPCs.ContainsKey(pm))
            {
                RemoveNPC(pm);
            }

            /*
             *      Vendor Code Here
             */

            Point3D point = new Point3D();
            bool    ok    = true;

            // Ten tries to find a place to put an NPC, makes it harder to fill up with the more you have in the place.
            for (int i = 0; i < 10; i++)
            {
                point    = StudentPoints[Utility.Random(StudentPoints.Length)];
                point.X += Tolaria.Home.X;
                point.Y += Tolaria.Home.Y;
                point.Z += Tolaria.Home.Z;

                foreach (BaseCreature bc in NPCs.Values)
                {
                    if (bc == null)
                    {
                        continue;
                    }

                    if (bc.Home == point)
                    {
                        ok = false;
                        break;
                    }
                }

                if (ok)
                {
                    break;
                }
            }

            if (!ok)
            {
                return;
            }

            NPCs.Add(pm, new TolariaNPC());
            NPCs[pm].Name             = pm.Name;
            NPCs[pm].Female           = pm.Female;
            NPCs[pm].Race             = pm.Race;
            NPCs[pm].Body             = pm.Body;
            NPCs[pm].HairItemID       = pm.HairItemID;
            NPCs[pm].HairHue          = pm.HairHue;
            NPCs[pm].FacialHairItemID = pm.FacialHairItemID;
            NPCs[pm].FacialHairHue    = pm.FacialHairHue;
            NPCs[pm].EquipItem(new Robe(2207));
            NPCs[pm].EquipItem(new Shoes(Utility.RandomNeutralHue()));
            Effects.SendLocationEffect(point, Map.Malas, 0x3709, 30, 9965, 0x501, 7);
            NPCs[pm].MoveToWorld(point, Map.Malas);
        }
Exemple #12
0
        public override void OnTalk(PlayerMobile player)
        {
            if (QuestHelper.DeliveryArrived(player, this))
            {
                return;
            }
            else if (QuestHelper.InProgress(player, this))
            {
                return;
            }
            else if (QuestHelper.QuestLimitReached(player))
            {
                return;
            }

            BlueSpellInfo.UpdateTitle(player);

            BaseQuest quest = null;

            if (player.Skills[SkillName.Forensics].Base < 51.0)
            {
                quest = QuestHelper.RandomQuest(player, new Type[] { typeof(BlueMageTrainingQuest) }, this);
            }
            else if (!BlueMageControl.IsBlueMage(player))
            {
                if (!QuestHelper.InProgress(player, this))
                {
                    player.CloseGump(typeof(BlueMageQuestionsGump));
                    player.SendGump(new BlueMageQuestionsGump(player, this));
                }
                else
                {
                    Say("You need to seek your mark.");
                }
            }
            else
            {
                List <Type> types = new List <Type>();
                types.Add(typeof(BlueMageTierOneSlayerQuest));
                types.Add(typeof(BlueMageTierTwoSlayerQuest));
                types.Add(typeof(BlueMageTierThreeSlayerQuest));
                //types.Add( typeof( FindingQuinaQuest ) );

                //if ( BlueSpellInfo.KnowsAllMoves( player ) )
                //{
                //types.Add( typeof( BattleKaysaQuest ) );
                //types.Add( typeof( BattleRakdosQuest ) );

                //if ( BlueSpellInfo.KnowsAllSpells( player ) )
                //{
                // types.Add( typeof( BattleTalimQuest ) );
                //}
                //}

                //if ( BlueSpellInfo.KnowsAllSpells( player ) )
                //{
                //types.Add( typeof( BattleMatoQuest ) );
                //types.Add( typeof( BattleMarkovQuest ) );
                //}

                quest = QuestHelper.RandomQuest(player, types.ToArray(), this);
            }

            if (quest != null)
            {
                player.CloseGump(typeof(MondainQuestGump));
                player.SendGump(new MondainQuestGump(quest));
            }
        }
        public static void BM_OnCommand(CommandEventArgs e)
        {
            if (e.Mobile.AccessLevel == AccessLevel.Counselor)
            {
                e.Mobile.SendMessage(1365, "Counselors are not allowed to use Blue Magic");
                return;
            }
            else if (!BlueMageControl.IsBlueMage(e.Mobile) && e.Mobile.AccessLevel == AccessLevel.Player)
            {
                e.Mobile.SendMessage("You must be a blue mage to use this command.");
                return;
            }
            else if (!Multis.DesignContext.Check(e.Mobile))
            {
                return;                 // They are customizing their house
            }
            string spellstring = e.GetString(0).ToLower();

            if (spellstring == null || spellstring == "")
            {
                if (e.Mobile.HasGump(typeof(BlueSpellsKnownGump)))
                {
                    e.Mobile.CloseGump(typeof(BlueSpellsKnownGump));
                }

                e.Mobile.SendGump(new BlueSpellsKnownGump(e.Mobile));
            }
            else if (spellstring == "help")
            {
                e.Mobile.SendMessage(1365, "\"[bm\" + spellname (lower or upper case, it don't matter) to cast the spell.");
                e.Mobile.SendMessage(1365, "\"[bm\" opens a menu listing details on the spells you know.");
                e.Mobile.SendMessage(1365, "\"[bm study\" Allows you to try and study a corpse to learn a blue spell [requires high forensics]");

                if (e.Mobile.AccessLevel >= AccessLevel.GameMaster)
                {
                    e.Mobile.SendMessage(1365, "[Seer+] \"[bm get\" allows you to target a player and get their list of spell's known.");
                    e.Mobile.SendMessage(1365, "[Seer+] \"[bm giveitem\" Gives you most of the items a blue mage would use.");
                }

                if (e.Mobile.AccessLevel > AccessLevel.Seer)
                {
                    e.Mobile.SendMessage(1365, "[Admin+] \"[bm log\" opens a gump containing the information of all registered blue mages and spells known by them.");
                }
            }
            else if (spellstring == "get" && e.Mobile.AccessLevel >= AccessLevel.GameMaster)
            {
                e.Mobile.SendMessage(1365, "Target a player you get their list of spells known.");
                e.Mobile.Target = new SpellKnownTarget();
            }
            else if (spellstring == "log" && e.Mobile.AccessLevel > AccessLevel.Seer)
            {
                if (e.Mobile.HasGump(typeof(BlueMageLogGump)))
                {
                    e.Mobile.CloseGump(typeof(BlueMageLogGump));
                }

                e.Mobile.SendGump(new BlueMageLogGump());
            }
            else if (spellstring == "learnall" && e.Mobile.AccessLevel > AccessLevel.GameMaster)
            {
                BlueMageControl.LearnAll(e.Mobile);
                e.Mobile.SendMessage(1365, "Learning all blue spells");
            }
            else if (spellstring == "giveitems" && e.Mobile.AccessLevel > AccessLevel.GameMaster)
            {
                GiveItems(e.Mobile);
                e.Mobile.SendMessage(1365, "Giving Items");
            }
            else if (spellstring == "cave" /*&& e.Mobile.AccessLevel > AccessLevel.Player*/)
            {
                e.Mobile.MoveToWorld(new Point3D(1704, 591, 9), Map.Ilshenar);
            }
            else if (spellstring == "study")
            {
                if (e.Mobile.Skills[SkillName.Forensics].Value < 100.0)
                {
                    e.Mobile.SendMessage(1365, "Your Forensics isn't high enough to use this.");
                }
                else
                {
                    e.Mobile.Target = new StudyTarget();
                    e.Mobile.SendMessage(1365, "Target the corpse of a monster you killed to study it.");
                }
            }
            else if (spellstring == "giveall" && e.Mobile.AccessLevel > AccessLevel.Counselor)
            {
                BlueMageControl.LearnAll(e.Mobile);
                e.Mobile.SendMessage(1365, "Learning all blue spells");

                string prams = e.ArgString;

                if (prams.Contains("skills"))
                {
                    if (e.Mobile.Backpack != null)
                    {
                        e.Mobile.Backpack.DropItem(new BlueSkillBall(-1));
                    }
                }
                if (prams.Contains("items"))
                {
                    GiveItems(e.Mobile);
                }
            }

            else
            {
                int number = 100;
                try { number = Convert.ToInt32(spellstring); }
                catch {}

                if (number != 100)
                {
                    BlueSpellInfo.UseBluePower(e.Mobile, number);
                }
                else
                {
                    if (BlueSpellInfo.UseBluePower(e.Mobile, spellstring) == false)
                    {
                        e.Mobile.SendMessage("No such spell can be found.");
                    }
                }
            }
        }