コード例 #1
0
        private static void MageSpell1_OnCommand(CommandEventArgs e)
        {
            TeiravonMobile m_Player = (TeiravonMobile)e.Mobile;

            if (!MGSPA.Contains(m_Player))
            {
                if (m_Player.IsMage() && !m_Player.IsNecromancer())
                {
                    if (m_Player.Paralyzed || m_Player.Frozen)
                    {
                        m_Player.SendMessage("You cannot cast a spell while frozen.");
                    }
                    else
                    {
                        if (m_Player.Mana >= 30)
                        {
                            m_Player.Target = new MageSpell1Target(m_Player);
                        }
                        else
                        {
                            m_Player.SendMessage("You must have 30 mana to cast this!");
                        }
                    }
                }
                else
                {
                    m_Player.SendMessage("Only Elemental Mages can use this command");
                }
            }
            else
            {
                m_Player.SendMessage("You must wait before using this abilitiy again.");
            }
        }
コード例 #2
0
        private static void MageSpell2_OnCommand(CommandEventArgs e)
        {
            TeiravonMobile m_Player = (TeiravonMobile)e.Mobile;

            if (m_Player.IsMage() && !m_Player.IsNecromancer())
            {
                if (m_Player.Paralyzed || m_Player.Frozen)
                {
                    m_Player.SendMessage("You cannot cast a spell while frozen.");
                }
                else
                {
                    if (m_Player.Mana >= 5 + (5 * (int)(m_Player.PlayerLevel / 3)))
                    {
                        m_Player.Target = new MageSpell2Target(m_Player);
                    }
                    else
                    {
                        m_Player.SendMessage("You must have {0} mana to cast this!", 5 + (5 * (int)(m_Player.PlayerLevel / 3)));
                    }
                }
            }
            else
            {
                m_Player.SendMessage("Only Elemental Mages can use this command");
            }
        }
コード例 #3
0
        private static void MageSpell4_OnCommand(CommandEventArgs e)
        {
            TeiravonMobile m_Player = (TeiravonMobile)e.Mobile;

            if (m_Player.IsMage() && !m_Player.IsNecromancer())
            {
                if (m_Player.Paralyzed || m_Player.Frozen)
                {
                    m_Player.SendMessage("You cannot cast a spell while frozen.");
                }
                else
                {
                    if (m_Player.Mana >= 125)
                    {
                        MageAOEEffect(m_Player);
                    }
                    else
                    {
                        m_Player.SendMessage("You must have 125 mana to cast this!");
                    }
                }
            }
            else
            {
                m_Player.SendMessage("Only Elemental Mages can use this command");
            }
        }
コード例 #4
0
 public MageGemTarget(Item mgem, TeiravonMobile from) : base(-1, false, TargetFlags.None)
 {
     m_Player = from;
     m_MGem   = (MageStaffGem)mgem;
     if (from.IsAquamancer())
     {
         MageClass = 1;
     }
     else if (from.IsAeromancer())
     {
         MageClass = 2;
     }
     else if (from.IsPyromancer())
     {
         MageClass = 3;
     }
     else if (from.IsNecromancer())
     {
         MageClass = 4;
     }
     else if (from.IsGeomancer())
     {
         MageClass = 5;
     }
 }
コード例 #5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from is TeiravonMobile)
            {
                TeiravonMobile player = (TeiravonMobile)from;

                if (player.IsMage() && !player.IsNecromancer())
                {
                    player.SendGump(new BOEGump(player));
                }
                else
                {
                    player.SendMessage("Only Elemental Mages can use this.");
                }
            }
        }
コード例 #6
0
        private static void MageSpell3_OnCommand(CommandEventArgs e)
        {
            TeiravonMobile m_Player = (TeiravonMobile)e.Mobile;

            if (m_Player.IsMage() && !m_Player.IsNecromancer())
            {
                if (m_Player.Paralyzed || m_Player.Frozen)
                {
                    m_Player.SendMessage("You cannot cast a spell while frozen.");
                }
                else
                {
                    if (m_Player.Mana >= 10 * (int)(m_Player.PlayerLevel / 2))
                    {
                        if (m_Player.OBody == 0)
                        {
                            if (!m_Player.Mounted)
                            {
                                EleTransform(m_Player);
                            }
                            else
                            {
                                m_Player.SendMessage("You cannot cast this while mounted.");
                            }
                        }
                        else
                        {
                            m_Player.SendMessage("You are already transformed!");
                        }
                    }
                    else
                    {
                        m_Player.SendMessage("You must have {0} mana to cast this!", 10 * (int)(m_Player.PlayerLevel / 2));
                    }
                }
            }
            else
            {
                m_Player.SendMessage("Only Elemental Mages can use this command");
            }
        }
コード例 #7
0
        private static TimeSpan Mobile_ManaRegenRate(Mobile from)
        {
            if (from.Skills == null)
            {
                return(Mobile.DefaultManaRate);
            }

            if (!from.Meditating)
            {
                CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Meditation);
            }

            double rate;
            double armorPenalty = GetArmorOffset(from);
            double hungermod;

            if (from.Hunger > 12)
            {
                hungermod = 1.0;
            }
            else
            {
                hungermod = (from.Hunger * .08);
            }

            if (Core.AOS)
            {
                double medPoints = from.Int + (from.Skills[SkillName.Meditation].Value * 2);

                medPoints *= (from.Skills[SkillName.Meditation].Value < 150.0) ? (from.Skills[SkillName.Meditation].Value < 100.0 ? 0.025 : .0275) : 0.03;

                CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Focus);

                double focusPoints = (int)(from.Skills[SkillName.Focus].Value * 0.05);

                if (armorPenalty > 0)
                {
                    medPoints = 0; // In AOS, wearing any meditation-blocking armor completely removes meditation bonus
                }
                double totalPoints = AosAttributes.GetValue(from, AosAttribute.RegenMana) +
                                     focusPoints + medPoints + (from.Meditating ? medPoints : 0.0);

                if (CheckTransform(from, typeof(VampiricEmbraceSpell)))
                {
                    totalPoints += 3;
                }
                else if (CheckTransform(from, typeof(LichFormSpell)))
                {
                    totalPoints += 13;
                }

                if (from is Mobiles.BaseCreature && ((Mobiles.BaseCreature)from).IsParagon)
                {
                    totalPoints += 40;
                }

                if (from is TeiravonMobile)
                {
                    TeiravonMobile tav = from as TeiravonMobile;
                    if (tav.IsUndead() && tav.Shapeshifted && (tav.IsDarkCleric() || tav.IsNecromancer()))
                    {
                        totalPoints += tav.PlayerLevel;
                    }
                }

                if (totalPoints < -1)
                {
                    totalPoints = -1;
                }

                rate = 1.0 / (0.1 * (2 + (int)totalPoints));
            }
            else
            {
                double medPoints = (from.Int + from.Skills[SkillName.Meditation].Value) * 0.5;

                if (medPoints <= 0)
                {
                    rate = 7.0;
                }
                else if (medPoints <= 100)
                {
                    rate = 7.0 - (239 * medPoints / 2400) + (19 * medPoints * medPoints / 48000);
                }
                else if (medPoints < 120)
                {
                    rate = 1.0;
                }
                else
                {
                    rate = 0.75;
                }

                rate += armorPenalty;

                if (from.Meditating)
                {
                    rate *= 0.5;
                }

                if (rate < 0.5)
                {
                    rate = 0.5;
                }
                else if (rate > 7.0)
                {
                    rate = 7.0;
                }
            }

            if (from is TeiravonMobile)
            {
                if (hungermod > 0)
                {
                    rate = rate / hungermod;
                }
                else
                {
                    rate = 30;
                }

                TeiravonMobile m_Player = (TeiravonMobile)from;

                if (m_Player.HasFeat(TeiravonMobile.Feats.WholenessOfSelf))
                {
                    rate *= .75;
                }
            }


            return(TimeSpan.FromSeconds(rate));
        }
コード例 #8
0
        public MSGemGump(Mobile from, Item msgem, MageStaff mstaff) : base(0, 0)
        {
            m_Player = (TeiravonMobile)from;
            gem      = (MageStaffGem)msgem;
            staff    = (MageStaff)mstaff;

            m_Player.CloseGump(typeof(MSGemGump));

            int x  = 140;
            int y  = 170;
            int x2 = 116;
            int y2 = 173;
            int i  = 1;

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

            AddPage(0);
            AddBackground(70, 80, 350, 325, 3600);
            AddBackground(95, 125, 300, 255, 9350);

            AddHtml(200, 100, 600, 20, "<basefont size=\"8\" color=\"#ffffff\">Mage Staff Gem</basefont>", false, false);
            AddLabel(155, 135, 150, "Choose your Mage Staff Power:");

            AddLabel(x, y + (20 * i), 150, "Mana Reneration");
            AddButton(x2, y2 + (20 * i), 2224, 2224, 1, GumpButtonType.Reply, 0);
            i++;
            AddLabel(x, y + (20 * i), 150, "Increased Spell Damage");
            AddButton(x2, y2 + (20 * i), 2224, 2224, 2, GumpButtonType.Reply, 0);
            i++;
            if (staff.WeaponAttributes.MageWeapon < 30)
            {
                AddLabel(x, y + (20 * i), 150, "Mage Weapon");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 3, GumpButtonType.Reply, 0);
                i++;
            }
            AddLabel(x, y + (20 * i), 150, "Faster Casting");
            AddButton(x2, y2 + (20 * i), 2224, 2224, 4, GumpButtonType.Reply, 0);
            i++;
            AddLabel(x, y + (20 * i), 150, "Faster Cast Recovery");
            AddButton(x2, y2 + (20 * i), 2224, 2224, 5, GumpButtonType.Reply, 0);
            i++;
            if (m_Player.IsAquamancer())
            {
                AddLabel(x, y + (20 * i), 150, "Hit Harm");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 6, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Hit Cold Area");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 7, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Cold Resist");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 8, GumpButtonType.Reply, 0);
                i++;
            }
            else if (m_Player.IsAeromancer())
            {
                AddLabel(x, y + (20 * i), 150, "Hit Lightning");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 9, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Hit Energy Area");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 10, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Energy Resist");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 11, GumpButtonType.Reply, 0);
                i++;
            }
            else if (m_Player.IsPyromancer())
            {
                AddLabel(x, y + (20 * i), 150, "Hit Fireball");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 12, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Hit Fire Area");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 13, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Fire Resist");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 14, GumpButtonType.Reply, 0);
                i++;
            }
            else if (m_Player.IsNecromancer())
            {
                AddLabel(x, y + (20 * i), 150, "Hit Dispel");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 15, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Hit Poison Area");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 16, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Poison Resist");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 17, GumpButtonType.Reply, 0);
                i++;
            }
            else if (m_Player.IsGeomancer())
            {
                AddLabel(x, y + (20 * i), 150, "Hit Magic Arrow");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 18, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Hit Physical Area");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 19, GumpButtonType.Reply, 0);
                i++;
                AddLabel(x, y + (20 * i), 150, "Physical Resist");
                AddButton(x2, y2 + (20 * i), 2224, 2224, 20, GumpButtonType.Reply, 0);
                i++;
            }
        }