コード例 #1
0
ファイル: BaseCurePotion.cs プロジェクト: avatar21/runuo
        public void DoCure(Mobile from)
        {
            bool cure = false;

            CureLevelInfo[] info = LevelInfo;

            for (int i = 0; i < info.Length; ++i)
            {
                CureLevelInfo li = info[i];

                if (li.Poison == from.Poison && Scale(from, li.Chance) > Utility.RandomDouble())
                {
                    cure = true;
                    break;
                }
            }

            if (cure && from.CurePoison(from))
            {
                from.SendLocalizedMessage(500231);                   // You feel cured of poison!

                from.FixedEffect(0x373A, 10, 15);
                from.PlaySound(0x1E0);
            }
            else if (!cure)
            {
                from.SendLocalizedMessage(500232);                   // That potion was not strong enough to cure your ailment!
            }
        }
コード例 #2
0
        public void DoCure(Mobile from)
        {
            bool cure = false;

            CureLevelInfo[] info = LevelInfo;

            for (int i = 0; i < info.Length; ++i)
            {
                CureLevelInfo li = info[i];

                if (li.Poison == from.Poison && Scale(from, li.Chance) > Utility.RandomDouble())
                {
                    cure = true;
                    break;
                }
            }

            if (!cure)
            {
                AspectArmorProfile aspectArmorProfile = AspectGear.GetAspectArmorProfile(from);

                //Poison Aspect
                if (aspectArmorProfile != null)
                {
                    if (aspectArmorProfile.m_Aspect == AspectEnum.Poison)
                    {
                        double extraCureChance = AspectGear.PoisonCureChanceBonus * (AspectGear.PoisonCureChanceBonusPerTier * (double)aspectArmorProfile.m_TierLevel);

                        if (Utility.RandomDouble() <= extraCureChance)
                        {
                            cure = true;

                            //TEST: Add Aspect Visuals
                        }
                    }
                }
            }

            if (cure && from.CurePoison(from))
            {
                from.SendLocalizedMessage(500231);                   // You feel cured of poison!

                from.FixedEffect(0x373A, 10, 15);
                from.PlaySound(0x1E0);
            }

            else if (!cure)
            {
                from.SendLocalizedMessage(500232);                   // That potion was not strong enough to cure your ailment!
            }
        }