コード例 #1
0
        public virtual double GetSlayerDamageScalar(Mobile defender)
        {
            Spellbook atkBook = Spellbook.FindEquippedSpellbook(m_Caster);

            double scalar = 1.0;

            if (atkBook != null)
            {
                SlayerEntry atkSlayer  = SlayerGroup.GetEntryByName(atkBook.Slayer);
                SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2);

                if (atkSlayer != null && atkSlayer.Slays(defender) || atkSlayer2 != null && atkSlayer2.Slays(defender))
                {
                    defender.FixedEffect(0x37B9, 10, 5);                        //TODO: Confirm this displays on OSIs
                    scalar = 2.0;
                }


                TransformContext context = TransformationSpell.GetContext(defender);

                if ((atkBook.Slayer == SlayerName.Silver || atkBook.Slayer2 == SlayerName.Silver) && context != null && context.Type != typeof(HorrificBeastSpell))
                {
                    scalar += .25;                    // Every necromancer transformation other than horrific beast take an additional 25% damage
                }
                if (scalar != 1.0)
                {
                    return(scalar);
                }
            }

            ISlayer defISlayer = Spellbook.FindEquippedSpellbook(defender);

            if (defISlayer == null)
            {
                defISlayer = defender.Weapon as ISlayer;
            }

            if (defISlayer != null)
            {
                SlayerEntry defSlayer  = SlayerGroup.GetEntryByName(defISlayer.Slayer);
                SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName(defISlayer.Slayer2);

                if (defSlayer != null && defSlayer.Group.OppositionSuperSlays(m_Caster) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays(m_Caster))
                {
                    scalar = 2.0;
                }
            }

            return(scalar);
        }
コード例 #2
0
ファイル: SpellHelper.cs プロジェクト: nogu3ira/xrunuo
        public static void DoLeech(int damageGiven, Mobile from, Mobile target)
        {
            TransformContext context = TransformationSpell.GetContext(from);

            if (context != null && context.Type == typeof(WraithFormSpell))
            {
                int wraithLeech = (5 + (int)((15 * from.Skills.SpiritSpeak.Value) / 100));                        // Wraith form gives 5-20% mana leech
                int manaLeech   = Math.Min(target.Mana, AOS.Scale(damageGiven, wraithLeech));

                if (manaLeech != 0)
                {
                    // Mana leeched by the Wraith Form spell is actually stolen, not just leeched.
                    target.Mana -= manaLeech;
                    from.Mana   += manaLeech;
                    from.PlaySound(0x44D);
                }
            }
        }
コード例 #3
0
ファイル: Spell.cs プロジェクト: dpisanu/xrunuo
        public virtual double GetSlayerDamageScalar(Mobile defender)
        {
            Spellbook atkBook = Spellbook.FindEquippedSpellbook(Caster);

            double scalar = 1.0;

            if (atkBook != null)
            {
                SlayerEntry atkSlayer  = SlayerGroup.GetEntryByName(atkBook.Slayer);
                SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2);

                if (atkSlayer != null && atkSlayer.Slays(defender))
                {
                    defender.FixedEffect(0x37B9, 10, 5);
                    scalar = Math.Max(scalar, SlayerGroup.IsSuperSlayer(atkSlayer.Name) ? 2.0 : 3.0);
                }

                if (atkSlayer2 != null && atkSlayer2.Slays(defender))
                {
                    defender.FixedEffect(0x37B9, 10, 5);
                    scalar = Math.Max(scalar, SlayerGroup.IsSuperSlayer(atkSlayer2.Name) ? 2.0 : 3.0);
                }

                TransformContext context = TransformationSpell.GetContext(defender);

                if ((atkBook.Slayer == SlayerName.Undead || atkBook.Slayer2 == SlayerName.Undead) && context != null && context.Type != typeof(HorrificBeastSpell))
                {
                    scalar += .25;                     // Every necromancer transformation other than horrific beast take an additional 25% damage
                }
                if (scalar != 1.0)
                {
                    return(scalar);
                }
            }

            #region Opposite Slayer
            if (defender.GetSlayerEntries().Any(e => e.Group.OppositionSuperSlays(Caster)))
            {
                scalar = 2.0;
            }
            #endregion

            return(scalar);
        }
コード例 #4
0
        public static void DoLeech(int damageGiven, Mobile from, Mobile target)
        {
            TransformContext context = TransformationSpell.GetContext(from);

            if (context != null)               /* cleanup */
            {
                if (context.Type == typeof(WraithFormSpell))
                {
                    int wraithLeech = (5 + (int)((15 * from.Skills.SpiritSpeak.Value) / 100));                           // Wraith form gives 5-20% mana leech
                    int manaLeech   = AOS.Scale(damageGiven, wraithLeech);
                    if (manaLeech != 0)
                    {
                        from.Mana += manaLeech;
                        from.PlaySound(0x44D);
                    }
                }
                else if (context.Type == typeof(VampiricEmbraceSpell))
                {
                    from.Hits += AOS.Scale(damageGiven, 20);
                    from.PlaySound(0x44D);
                }
            }
        }