Exemple #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 = TransformationSpellHelper.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);
        }
        public void OnTarget(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (Caster == m)
            {
                Caster.SendMessage("You cannot target yourself!");
            }
            else if (BardSpell.HasHarmfulEffects(m, this.GetType()))
            {
                Caster.SendLocalizedMessage(1115772); //Your target is already under the effect of this spellsong.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                Target = m;
                //Caster.SendLocalizedMessage(1234567); //TODO: Message?

                HarmfulSpell(m);

                m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);

                m_PropertyBonus = (int)Math.Max(5, ((BaseSkillBonus * 23) + (CollectiveBonus * 8))) * -1;
                m_DamageChance  = Math.Max(20.0, (Caster.Skills[DamageSkill].Value / 2.0)) / 100;
                m_SlayerBonus   = 1;

                string args = String.Format("{0}\t{1}\t{2}", m_PropertyBonus, m_PropertyBonus, (int)(m_DamageChance * 100));
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.TribulationTarget, 1115740, 1115743, args.ToString()));
                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.TribulationCaster, 1115740, 1115742, args.ToString()));

                ISlayer slayer = Instrument as ISlayer;

                if (slayer != null)
                {
                    SlayerEntry se1 = SlayerGroup.GetEntryByName(slayer.Slayer);
                    SlayerEntry se2 = SlayerGroup.GetEntryByName(slayer.Slayer2);

                    if ((se1 != null && se1.Slays(Target)) || (se2 != null && se2.Slays(Target)))
                    {
                        m_SlayerBonus = 1.5;
                    }
                }

                BeginTimer();
            }

            FinishSequence();
        }
Exemple #3
0
        public override void SetValue(Item item, int value)
        {
            if (value != 0)
            {
                ISlayer sl = item as ISlayer;

                if (sl.Slayer == SlayerName.None)
                {
                    sl.Slayer = Slayer;
                }
                else if (sl.Slayer2 == SlayerName.None)
                {
                    sl.Slayer2 = Slayer;
                }
            }
        }
Exemple #4
0
        public virtual double GetSlayerDamageScalar(Mobile defender)
        {
            var atkBook = Spellbook.FindEquippedSpellbook(Caster);

            var scalar = 1.0;

            if (atkBook != null)
            {
                var atkSlayer  = SlayerGroup.GetEntryByName(atkBook.OldSlayer);
                var atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.OldSlayer2);

                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;
                }


                if (scalar != 1.0)
                {
                    return(scalar);
                }
            }

            ISlayer defISlayer = Spellbook.FindEquippedSpellbook(defender);

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

            if (defISlayer != null)
            {
                var defSlayer  = SlayerGroup.GetEntryByName(defISlayer.OldSlayer);
                var defSlayer2 = SlayerGroup.GetEntryByName(defISlayer.OldSlayer2);

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

            return(scalar);
        }
Exemple #5
0
        public override void OnDoubleClick(Mobile m)
        {
            if (IsChildOf(m.Backpack))
            {
                m.SendLocalizedMessage(1155613); // Target the weapon, spellbook, or instrument you wish to apply this to...
                m.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (from, targeted) =>
                {
                    if (targeted is Item && targeted is ISlayer)
                    {
                        Item item      = (Item)targeted;
                        ISlayer slayer = (ISlayer)targeted;

                        SlayerSocket socket = item.GetSocket <SlayerSocket>();

                        if (socket == null || socket.Slayer != SlayerName.Silver)
                        {
                            if (slayer.Slayer != SlayerName.None && slayer.Slayer2 != SlayerName.None)
                            {
                                from.SendLocalizedMessage(1155680); // You cannot apply Tincture of Silver to items that are already slayers!
                            }
                            else
                            {
                                item.AttachSocket(new SlayerSocket(SlayerName.Silver, TimeSpan.FromHours(1)));

                                Delete();

                                from.SendLocalizedMessage(1155616); // You carefully apply Tincture of Silver to the item.  The effects will fade in one hour.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1155614); // This item is already treated with Tincture of Silver!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1155615); // You cannot apply Tincture of Silver to this item.
                    }
                });
            }
        }
Exemple #6
0
        public virtual double GetSlayerBonus()
        {
            if (Target == null)
            {
                return(1.0);
            }

            ISlayer slayer = Instrument as ISlayer;

            if (slayer != null)
            {
                SlayerEntry se1 = SlayerGroup.GetEntryByName(slayer.Slayer);
                SlayerEntry se2 = SlayerGroup.GetEntryByName(slayer.Slayer2);

                if ((se1 != null && se1.Slays(Target)) || (se2 != null && se2.Slays(Target)))
                {
                    return(SlayerBonus);
                }
            }

            return(1.0);
        }
Exemple #7
0
        public void OnTarget(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (Caster == m)
            {
                Caster.SendMessage("You cannot target yourself!");
            }
            else if (BardSpell.HasHarmfulEffects(m, this.GetType()))
            {
                Caster.SendLocalizedMessage(1115772); //Your target is already under the effect of this spellsong.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                Target = m;

                HarmfulSpell(m);

                m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);

                double cast = Caster.Skills[CastSkill].Value;
                double dam  = Caster.Skills[DamageSkill].Value;

                m_Rounds = (int)(5 + ((cast - 90) * .3667) + (14 * (int)CollectiveBonus));          // 5 - 11 (14)

                m_PropertyBonus = (int)((5 + ((cast - 90) * .567)) + (14 * (int)CollectiveBonus));  // 5 - 22 (36)
                m_DamageChance  = Math.Max(15, ((dam / 10) * 5)) + (24 * (int)CollectiveBonus);     // 15 - 60 (84)
                m_DamageFactor  = Math.Max(8, ((cast / 10) * 2.667)) + (18 * (int)CollectiveBonus); // 8 - 32 (50)
                m_SlayerBonus   = 1;

                ISlayer slayer = Instrument as ISlayer;

                if (slayer != null)
                {
                    SlayerEntry se1 = SlayerGroup.GetEntryByName(slayer.Slayer);
                    SlayerEntry se2 = SlayerGroup.GetEntryByName(slayer.Slayer2);

                    if ((se1 != null && se1.Slays(Target)) || (se2 != null && se2.Slays(Target)))
                    {
                        m_SlayerBonus = 1.5;
                    }
                }

                if (m.Player)
                {
                    // ~1_HCI~% Hit Chance.<br>~2_SDI~% Spell Damage.<br>Damage taken has a ~3_EXP~% chance to cause additional burst of physical damage.<br>
                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.TribulationTarget, 1115740, 1115742, String.Format("{0}\t{1}\t{2}", m_PropertyBonus, m_PropertyBonus, (int)m_DamageChance)));
                }

                // Target: ~1_val~ <br> Damage Factor: ~2_val~% <br> Damage Chance: ~3_val~%
                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.TribulationCaster, 1115740, 1151388, String.Format("{0}\t{1}\t{2}", m.Name, (int)m_DamageFactor, (int)m_DamageChance)));

                BeginTimer();
            }

            FinishSequence();
        }
Exemple #8
0
 public static IEnumerable <SlayerEntry> GetSlayerEntries(this ISlayer slayer)
 {
     return(new[] { slayer.Slayer, slayer.Slayer2 }
            .Select(name => SlayerGroup.GetEntryByName(name))
            .Where(entry => entry != null));
 }
Exemple #9
0
        public override int GetValue(Item item)
        {
            ISlayer sl = item as ISlayer;

            return((Slayer == sl.Slayer || Slayer == sl.Slayer2) ? 1 : 0);
        }
Exemple #10
0
 public static SlayerName GetSlayer(this ISlayer obj, List <ClilocItemRec> reader, int Index = 1)
 {
     return
         ((from SlayerName x in Enum.GetValues(typeof(SlayerName)) where !x.Equals(SlayerName.None) select x)
          .FirstOrDefault(x => ClilocHelper.Contains(reader, (uint)x)));
 }