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(); }
public static void RemoveBonus(Mobile m) { EmpowermentInfo info = m_Table[m] as EmpowermentInfo; info?.Timer?.Stop(); m_Table.Remove(m); }
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); } }
public static double GetDispellBonus(Mobile m) { EmpowermentInfo info = m_Table[m] as EmpowermentInfo; if (info != null) { return(10.0 * info.Focus); } return(0.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); }
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); }
public static int GetSDIBonus(Mobile m) { EmpowermentInfo info = m_Table[m] as EmpowermentInfo; if (info == null) { return(0); } return(info.m_SDIBonus); }
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); }
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); }
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); } }
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(); }
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(); }
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(); }