Пример #1
0
        public virtual double GetSlayerDamageScalar(Mobile defender)
        {
            // ==== Alan Mod =====
            if (defender is PlayerMobile || defender is HumanMob)             // there are no slayers that should slay them
            {
                return(1.0);
            }
            // first check for XmlSlayer attachments
            List <XmlSlayer> slayerattachments = XmlAttach.GetSlayerAttachments(m_Caster);

            if (slayerattachments != null)
            {
                foreach (XmlSlayer slayerattachment in slayerattachments)
                {
                    if (slayerattachment.Slayer == SlayerName.None)
                    {
                        continue;
                    }
                    if (slayerattachment.Slayer == SlayerName.All)
                    {
                        return(SpellDamageController._SlayerMultiplier);
                    }

                    SlayerEntry attachmentSlayer = SlayerGroup.GetEntryByName(slayerattachment.Slayer);

                    if (attachmentSlayer != null && attachmentSlayer.Slays(defender))
                    {
                        return(SpellDamageController._SlayerMultiplier);
                    }
                }
            }
            // ==== End Alan Mod ====

            Spellbook atkBook = Spellbook.FindEquippedSpellbook(m_Caster);

            if (atkBook != null)
            {
                if (atkBook.Slayer == SlayerName.All)
                {
                    return(SpellDamageController._SlayerMultiplier);
                }
                if (atkBook.Slayer2 == SlayerName.All)
                {
                    return(SpellDamageController._SlayerMultiplier);
                }

                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
                    return(SpellDamageController._SlayerMultiplier);
                }
            }

            /*
             * 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 = 1.1;
             * }
             */

            return(1.0);
        }