Пример #1
0
        public void OnTargetKilled()
        {
            Cancel();

            int targetFame = Target.Fame;

            if (PerfectionDamageBonus > 0)
            {
                int restore = Math.Min(PerfectionDamageBonus * (targetFame + 5000) / 25000, 10);

                Source.Hits += restore;
                Source.Stam += restore;
                Source.Mana += restore;
            }

            if (Source.Virtues.Honor > targetFame)
            {
                return;
            }

            double dGain =
                targetFame / 100.0 * (m_HonorDamage / m_TotalDamage); // Initial honor gain is 100th of the monsters honor

            if (m_HonorDamage == m_TotalDamage && m_FirstHit == FirstHit.Granted)
            {
                dGain = dGain * 1.5; // honor gain is increased alot more if the combat was fully honorable
            }
            else
            {
                dGain = dGain * 0.9;
            }

            int gain = Math.Min((int)dGain, 200);

            if (gain < 1)
            {
                gain = 1; // Minimum gain of 1 honor when the honor is under the monsters fame
            }
            if (VirtueHelper.IsHighestPath(Source, VirtueName.Honor))
            {
                Source.SendLocalizedMessage(1063228); // You cannot gain more Honor.
                return;
            }

            bool gainedPath = false;

            if (VirtueHelper.Award(Source, VirtueName.Honor, gain, ref gainedPath))
            {
                if (gainedPath)
                {
                    Source.SendLocalizedMessage(1063226); // You have gained a path in Honor!
                }
                else
                {
                    Source.SendLocalizedMessage(1063225); // You have gained in Honor.
                }
            }
        }
Пример #2
0
        public void GiveValor(ArrayList toGive)
        {
            if (chance_valor_award >= Utility.RandomDouble())
            {
                for (int i = 0; i < toGive.Count; ++i)
                {
                    PlayerMobile pm = (PlayerMobile)toGive[i % toGive.Count];

                    if (VirtueHelper.IsHighestPath(pm, VirtueName.Valor))
                    {
                        pm.SendLocalizedMessage(1054031);                           // You have achieved the highest path in Valor and can no longer gain any further.
                    }
                    else
                    {
                        bool path = false;

                        VirtueHelper.Award(pm, VirtueName.Valor, ValorPoints, ref path);

                        pm.SendLocalizedMessage(1054030);                           // You have gained in Valor!
                    }
                }
            }
        }