Esempio n. 1
0
        private static void EventSink_BeforeDamage(BeforeDamageEventArgs e)
        {
            Perseverance spellsong = Spellsong.GetEffectSpellsong <Perseverance>(e.Mobile);

            if (spellsong != null)
            {
                e.Amount = (int)(e.Amount * (100 - spellsong.DamageTaken) / 100);
            }
        }
Esempio n. 2
0
        public override int GetMana()
        {
            Spellsong song = GetActiveSpellsong(Caster, this.GetType());

            if (song != null)
            {
                return(0);
            }

            return(RequiredMana - ComputeManaBonus());
        }
Esempio n. 3
0
        private static void Mobile_Damaged(Mobile m, DamagedEventArgs args)
        {
            bool isFromPlayer = args.From != null && args.From.IsPlayer;

            foreach (Spellsong spellsong in Spellsong.GetAllActiveSpellsongs(m).ToArray())
            {
                if (isFromPlayer || args.Amount > Utility.Random(50))
                {
                    // Your spell song has been interrupted.
                    spellsong.InterruptSong(1115710);
                }
            }
        }
Esempio n. 4
0
        private static void Mobile_Damaged(Mobile sender, DamagedEventArgs e)
        {
            if (!sender.Alive)
            {
                return;
            }

            var spellsong = Spellsong.GetEffectSpellsong <Tribulation>(sender);

            if (spellsong != null)
            {
                spellsong.OnDamage(sender, e.Amount);
            }
        }
Esempio n. 5
0
        private static void EventSink_BeforeDamage(BeforeDamageEventArgs e)
        {
            if (e.From == null)
            {
                return;
            }

            Inspire spellsong = Spellsong.GetEffectSpellsong <Inspire>(e.From);

            if (spellsong != null)
            {
                e.Amount = (int)(e.Amount * (100 + spellsong.DamageModifier) / 100);
            }
        }
Esempio n. 6
0
        public override void OnCast()
        {
            Spellsong song = GetActiveSpellsong(Caster, this.GetType());

            if (song != null)
            {
                // You halt your spellsong.
                song.InterruptSong(1115774);
            }
            else
            {
                Caster.Target = new InternalTarget(this);
            }
        }
Esempio n. 7
0
        protected void RemoveTarget(Mobile m)
        {
            Type type = this.GetType();

            Spellsong song = GetEffectSpellsong(m, type);

            if (song != null && song.Caster == Caster)
            {
                m_EffectTable[m].Remove(type);

                if (m_EffectTable[m].IsEmpty())
                {
                    m_EffectTable.Remove(m);
                }

                OnTargetRemoved(m);
            }
        }
Esempio n. 8
0
        public override void OnCast()
        {
            Spellsong song = GetActiveSpellsong(Caster, this.GetType());

            if (song != null)
            {
                // You halt your spellsong.
                song.InterruptSong(1115774);
            }
            else if (CheckSequence())
            {
                m_Targets = new HashSet <Mobile>();

                StartSong();
            }

            FinishSequence();
        }
Esempio n. 9
0
 public UpkeepTimer(Spellsong owner)
     : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0))
 {
     m_Owner = owner;
 }