Example #1
0
        public override void OnCast()
        {
            if (m_Table.ContainsKey(Caster))
            {
                Caster.SendLocalizedMessage(501775); // This spell is already in effect.
            }
            else if (CheckSequence())
            {
                Caster.PlaySound(0x5C1);

                int    level = GetFocusLevel(Caster);
                double skill = Caster.Skills[SkillName.Spellweaving].Value;

                TimeSpan duration = TimeSpan.FromSeconds(15 + (int)(skill / 24) + level * 2);
                int      bonus    = (int)Math.Floor(skill / 12) + level * 5;

                m_Table[Caster] = new EmpowermentInfo(Caster, duration, bonus, level);

                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ArcaneEmpowerment, 1031616, 1075808, duration, Caster, new TextDefinition($"{bonus.ToString()}\t10")));

                Caster.Delta(MobileDelta.WeaponDamage);
            }

            FinishSequence();
        }
Example #2
0
        public static void RemoveBonus(Mobile m)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            info?.Timer?.Stop();

            m_Table.Remove(m);
        }
Example #3
0
        public static void AddHealBonus(Mobile m, ref int toHeal)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info != null)
            {
                toHeal = (int)Math.Floor((1 + (10 + info.Bonus) / 100.0) * toHeal);
            }
        }
Example #4
0
        public static double GetDispellBonus(Mobile m)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info != null)
            {
                return(10.0 * info.Focus);
            }
            return(0.0);
        }
Example #5
0
        public static void RemoveBonus(Mobile m)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info != null && info.Timer != null)
            {
                info.Timer.Stop();
            }

            m_Table.Remove(m);
        }
Example #6
0
        public static int GetSpellBonus(Mobile m, bool playerVsPlayer)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info != null)
            {
                return(info.Bonus + (playerVsPlayer ? info.Focus : 0));
            }

            return(0);
        }
Example #7
0
        public static int GetSDIBonus(Mobile m)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info == null)
            {
                return(0);
            }

            return(info.m_SDIBonus);
        }
Example #8
0
        public static bool StopBuffing(Mobile m, bool message)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info == null || info.m_Timer == null)
            {
                return(false);
            }

            info.m_Timer.DoExpire(message);
            return(true);
        }
Example #9
0
        public static void ApplyHealBonus(Mobile m, ref int points)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info == null)
            {
                return;
            }

            double scalar = 1.0 + info.m_HealBonus;

            points = (int)Math.Floor(points * scalar);
        }
Example #10
0
        public static void RemoveBuff(Mobile m, bool effects)
        {
            EmpowermentInfo info = m_Table[m] as EmpowermentInfo;

            if (info != null)
            {
                info.m_Timer.Stop();

                if (effects)
                {
                    m.PlaySound(0x5C2);
                }

                m_Table.Remove(m);

                BuffInfo.RemoveBuff(m, BuffIcon.ArcaneEmpowerment);
            }
        }
Example #11
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                Caster.PlaySound(0x5C1);

                int focuslevel = GetFocusLevel(Caster);
                int skill      = Caster.Skills[SkillName.Spellweaving].Fixed;

                int    duration    = 15 + (int)(skill / 240) + (focuslevel * 2);
                int    sdiBonus    = (int)Math.Floor(skill / 120.0) + (focuslevel * 5);
                double healBonus   = 0.2 + (focuslevel / 10);
                int    hitsBonus   = 10;
                int    dispelBonus = (int)Math.Floor(skill / 120.0) + focuslevel;

                m_Table[Caster] = new EmpowermentInfo(Caster, sdiBonus, healBonus, hitsBonus, dispelBonus, TimeSpan.FromSeconds(duration));

                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ArcaneEmpowerment, 1031616, 1075808, TimeSpan.FromSeconds(duration), Caster, new TextDefinition(String.Format("{0}\t{1}", sdiBonus.ToString(), hitsBonus.ToString()))));
            }

            FinishSequence();
        }
Example #12
0
		public override void OnCast()
		{
			if ( m_Table.ContainsKey( Caster ) )
			{				
				Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
			}
			else if ( CheckSequence() )
			{
				Caster.PlaySound( 0x5C1 );
				
				int level = GetFocusLevel( Caster );
				double skill = Caster.Skills[ SkillName.Spellweaving ].Value;
				
				TimeSpan duration = TimeSpan.FromSeconds( 15 + (int) ( skill / 24 ) + level * 2 );
				int bonus = (int) Math.Floor( skill / 12 ) + level * 5;

				m_Table[ Caster ] = new EmpowermentInfo( Caster, duration, bonus, level );

				BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.ArcaneEmpowerment, 1031616, 1075808, duration, Caster, new TextDefinition( String.Format( "{0}\t10", bonus.ToString() ) ) ) );
			}

			FinishSequence();
		}
Example #13
0
        public override void OnCast()
        {
            if ( CheckSequence() )
            {
                Caster.PlaySound( 0x5C1 );

                int focuslevel = GetFocusLevel( Caster );
                int skill = Caster.Skills[SkillName.Spellweaving].Fixed;

                int duration = 15 + (int) ( skill / 240 ) + ( focuslevel * 2 );
                int sdiBonus = (int) Math.Floor( skill / 120.0 ) + ( focuslevel * 5 );
                double healBonus = 0.2 + ( focuslevel / 10 );
                int hitsBonus = 10;
                int dispelBonus = (int) Math.Floor( skill / 120.0 ) + focuslevel;

                m_Table[Caster] = new EmpowermentInfo( Caster, sdiBonus, healBonus, hitsBonus, dispelBonus, TimeSpan.FromSeconds( duration ) );

                BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.ArcaneEmpowerment, 1031616, 1075808, TimeSpan.FromSeconds( duration ), Caster, new TextDefinition( String.Format( "{0}\t{1}", sdiBonus.ToString(), hitsBonus.ToString() ) ) ) );
            }

            FinishSequence();
        }