Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using Server.Network;
  4. using Server.Items;
  5. using Server.Targeting;
  6.  
  7. namespace Server.Spells.Chivalry
  8. {
  9. public class DivineFurySpell : PaladinSpell
  10. {
  11. private static SpellInfo m_Info = new SpellInfo(
  12. "Divine Fury", "Divinum Furis",
  13. -1,
  14. 9002
  15. );
  16.  
  17. public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.0 ); } }
  18.  
  19. public override double RequiredSkill{ get{ return 25.0; } }
  20. public override int RequiredMana{ get{ return 15; } }
  21. public override int RequiredTithing{ get{ return 10; } }
  22. public override int MantraNumber{ get{ return 1060722; } } // Divinum Furis
  23. public override bool BlocksMovement{ get{ return false; } }
  24.  
  25. public DivineFurySpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
  26. {
  27. }
  28.  
  29. public override void OnCast()
  30. {
  31. if ( CheckSequence() )
  32. {
  33. Caster.PlaySound( 0x20F );
  34. Caster.PlaySound( Caster.Female ? 0x338 : 0x44A );
  35. Caster.FixedParticles( 0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist );
  36. Caster.FixedParticles( 0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist );
  37.  
  38. Caster.Stam = Caster.StamMax;
  39.  
  40. Timer t = (Timer)m_Table[Caster];
  41.  
  42. if ( t != null )
  43. t.Stop();
  44.  
  45. int delay = ComputePowerValue( 10 );
  46.  
  47. // TODO: Should caps be applied?
  48. if ( delay < 7 )
  49. delay = 7;
  50. else if ( delay > 24 )
  51. delay = 24;
  52.  
  53. m_Table[Caster] = t = Timer.DelayCall( TimeSpan.FromSeconds( delay ), new TimerStateCallback( Expire_Callback ), Caster );
  54. Caster.Delta( MobileDelta.WeaponDamage );
  55.  
  56. BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.DivineFury, 1060589, 1075634, TimeSpan.FromSeconds(delay), Caster));
  57. }
  58.  
  59. FinishSequence();
  60. }
  61.  
  62. private static Hashtable m_Table = new Hashtable();
  63.  
  64. public static bool UnderEffect( Mobile m )
  65. {
  66. return m_Table.Contains( m );
  67. }
  68.  
  69. private static void Expire_Callback( object state )
  70. {
  71. Mobile m = (Mobile)state;
  72.  
  73. m_Table.Remove( m );
  74.  
  75. m.Delta( MobileDelta.WeaponDamage );
  76. m.PlaySound( 0xF8 );
  77. }
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement