#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
101
Scripts/Spells/Spellweaving/Thunderstorm.cs
Normal file
101
Scripts/Spells/Spellweaving/Thunderstorm.cs
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Spells.Spellweaving
|
||||
{
|
||||
public class ThunderstormSpell : ArcanistSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Thunderstorm", "Erelonia",
|
||||
-1
|
||||
);
|
||||
|
||||
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.5 ); } }
|
||||
|
||||
public override double RequiredSkill { get { return 10.0; } }
|
||||
public override int RequiredMana { get { return 32; } }
|
||||
|
||||
public ThunderstormSpell( Mobile caster, Item scroll )
|
||||
: base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if( CheckSequence() )
|
||||
{
|
||||
Caster.PlaySound( 0x5CE );
|
||||
|
||||
double skill = Caster.Skills[SkillName.Spellweaving].Value;
|
||||
|
||||
int damage = Math.Max( 11, 10 + (int)(skill / 24) ) + FocusLevel;
|
||||
|
||||
int sdiBonus = AosAttributes.GetValue( Caster, AosAttribute.SpellDamage );
|
||||
|
||||
int pvmDamage = damage * ( 100 + sdiBonus );
|
||||
pvmDamage /= 100;
|
||||
|
||||
if ( sdiBonus > 15 )
|
||||
sdiBonus = 15;
|
||||
|
||||
int pvpDamage = damage * ( 100 + sdiBonus );
|
||||
pvpDamage /= 100;
|
||||
|
||||
int range = 2 + FocusLevel;
|
||||
TimeSpan duration = TimeSpan.FromSeconds( 5 + FocusLevel );
|
||||
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
|
||||
foreach( Mobile m in Caster.GetMobilesInRange( range ) )
|
||||
{
|
||||
if( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && Caster.InLOS( m ) )
|
||||
targets.Add( m );
|
||||
}
|
||||
|
||||
for( int i = 0; i < targets.Count; i++ )
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
|
||||
Caster.DoHarmful( m );
|
||||
|
||||
Spell oldSpell = m.Spell as Spell;
|
||||
|
||||
SpellHelper.Damage( this, m, ( m.Player && Caster.Player ) ? pvpDamage : pvmDamage, 0, 0, 0, 0, 100 );
|
||||
|
||||
if( oldSpell != null && oldSpell != m.Spell )
|
||||
{
|
||||
if( !CheckResisted( m ) )
|
||||
{
|
||||
m_Table[m] = Timer.DelayCall<Mobile>( duration, DoExpire, m );
|
||||
|
||||
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Thunderstorm, 1075800, duration, m, GetCastRecoveryMalus( m ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
|
||||
|
||||
public static int GetCastRecoveryMalus( Mobile m )
|
||||
{
|
||||
return m_Table.ContainsKey( m ) ? 6 : 0;
|
||||
}
|
||||
|
||||
public static void DoExpire( Mobile m )
|
||||
{
|
||||
Timer t;
|
||||
|
||||
if( m_Table.TryGetValue( m, out t ) )
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove( m );
|
||||
|
||||
BuffInfo.RemoveBuff( m, BuffIcon.Thunderstorm );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue