Example #1
0
 public void SetNext(SpellPlagueContext context)
 {
     if (m_Next == null)
     {
         m_Next = context;
     }
     else
     {
         m_Next.SetNext(context);
     }
 }
Example #2
0
        public void Target(Mobile targeted)
        {
            if (!Caster.CanSee(targeted))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(targeted))
            {
                SpellHelper.Turn(Caster, targeted);

                SpellHelper.CheckReflect(6, Caster, ref targeted);

                /* The target is hit with an explosion of chaos damage and then inflicted
                 * with the spell plague curse. Each time the target is damaged while under
                 * the effect of the spell plague, they may suffer an explosion of chaos
                 * damage. The initial chance to trigger the explosion starts at 90% and
                 * reduces by 30% every time an explosion occurs. Once the target is
                 * afflicted by 3 explosions or 8 seconds have passed, that spell plague
                 * is removed from the target. Spell Plague will stack with other spell
                 * plagues so that they are applied one after the other.
                 */

                VisualEffect(targeted);

                /* Deal the damage */
                var damage = GetNewAosDamage(33, 1, 5, targeted);

                var types = new int[4];
                types[Utility.Random(types.Length)] = 100;

                SpellHelper.Damage(this, targeted, damage, 0, types[0], types[1], types[2], types[3]);

                /* Plague */
                SpellPlagueContext context = new SpellPlagueContext(this, targeted);

                if (m_Table.ContainsKey(targeted))
                {
                    SpellPlagueContext oldContext = m_Table[targeted];
                    oldContext.SetNext(context);
                }
                else
                {
                    m_Table[targeted] = context;
                    context.Start();
                }
            }

            FinishSequence();
        }