This commit is contained in:
mark 2009-06-28 03:36:42 +00:00
parent c63a5f13fa
commit 2204d5fb86
86 changed files with 1077 additions and 257 deletions

View file

@ -21,9 +21,9 @@ namespace Server.Spells
public virtual bool BlockedByAnimalForm{ get{ return true; } }
public virtual bool DelayedContext{ get{ return false; } }
public virtual double GetAccuracyScalar( Mobile attacker )
public virtual int GetAccuracyBonus( Mobile attacker )
{
return 1.0;
return 0;
}
public virtual double GetDamageScalar( Mobile attacker, Mobile defender )

View file

@ -532,6 +532,9 @@ namespace Server.Spells
if ( ClearHandsOnCast )
m_Caster.ClearHands();
if ( Core.ML )
WeaponAbility.ClearCurrentAbility( m_Caster );
m_CastTimer = new CastTimer( this, castDelay );
m_CastTimer.Start();

View file

@ -18,14 +18,6 @@ namespace Server.Spells.Bushido
public override TextDefinition AbilityMessage{ get{ return new TextDefinition( 1063122 ); } } // You better kill your enemy with your next hit or you'll be rather sorry...
public override double GetAccuracyScalar( Mobile attacker )
{
double bushido = attacker.Skills[SkillName.Bushido].Value;
// TODO: 4 -> Perfection / 5
return 1.0 + ( bushido / 10.0 + 4 ) / 100.0;
}
public override double GetDamageScalar( Mobile attacker, Mobile defender )
{
double bushido = attacker.Skills[SkillName.Bushido].Value;

View file

@ -20,12 +20,9 @@ namespace Server.Spells.Bushido
public override bool DelayedContext{ get{ return true; } }
public override double GetAccuracyScalar( Mobile attacker )
public override int GetAccuracyBonus( Mobile attacker )
{
if ( GetContext( attacker, typeof( Bushido.LightningStrike ) ) )
return 1.1;
return 1.5;
return 50;
}
public override bool IgnoreArmor( Mobile attacker )

View file

@ -41,6 +41,8 @@ namespace Server.Spells.Bushido
public override bool CheckCast()
{
int mana = ScaleMana ( RequiredMana );
if ( !base.CheckCast() )
return false;
@ -56,9 +58,9 @@ namespace Server.Spells.Bushido
Caster.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}
else if ( Caster.Mana < ScaleMana( RequiredMana ) )
else if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, RequiredMana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}

View file

@ -52,6 +52,8 @@ namespace Server.Spells.Chivalry
m_Table[Caster] = t = Timer.DelayCall( TimeSpan.FromSeconds( delay ), new TimerStateCallback( Expire_Callback ), Caster );
Caster.Delta( MobileDelta.WeaponDamage );
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.DivineFury, 1060589, 1075634, TimeSpan.FromSeconds(delay), Caster));
}
FinishSequence();

View file

@ -56,6 +56,8 @@ namespace Server.Spells.Chivalry
{
((PlayerMobile)Caster).EnemyOfOneType = null;
((PlayerMobile)Caster).WaitingForEnemy = true;
BuffInfo.AddBuff ( Caster, new BuffInfo ( BuffIcon.EnemyOfOne, 1075653, 1044111, TimeSpan.FromMinutes ( delay ), Caster ) );
}
}

View file

@ -26,6 +26,8 @@ namespace Server.Spells.Chivalry
public override bool CheckCast()
{
int mana = ScaleMana( RequiredMana );
if ( !base.CheckCast() )
return false;
@ -39,9 +41,9 @@ namespace Server.Spells.Chivalry
Caster.SendLocalizedMessage( 1060173, RequiredTithing.ToString() ); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
else if ( Caster.Mana < ScaleMana( RequiredMana ) )
else if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, RequiredMana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
@ -69,7 +71,7 @@ namespace Server.Spells.Chivalry
}
else if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, RequiredMana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}

View file

@ -86,12 +86,16 @@ namespace Server.Spells.Chivalry
CorpseSkinSpell.RemoveCurse( m );
CurseSpell.RemoveEffect( m );
MortalStrike.EndWound( m );
if (Core.ML) { BloodOathSpell.RemoveCurse ( m ); }
MindRotSpell.ClearMindRotScalar ( m );
BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
BuffInfo.RemoveBuff ( m, BuffIcon.Curse );
BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
BuffInfo.RemoveBuff ( m, BuffIcon.Mindrot );
// TODO: Should this remove blood oath? Pain spike?
}

View file

@ -79,6 +79,11 @@ namespace Server.Spells.First
for ( int i = 0; i < mods.Length; ++i )
targ.AddResistanceMod( mods[i] );
int physresist = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", physresist, 5, 5, 5, 5);
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args.ToString()));
}
else
{
@ -89,6 +94,8 @@ namespace Server.Spells.First
for ( int i = 0; i < mods.Length; ++i )
targ.RemoveResistanceMod( mods[i] );
BuffInfo.RemoveBuff(Caster, BuffIcon.ReactiveArmor);
}
}

View file

@ -75,6 +75,13 @@ namespace Server.Spells.Fourth
m.FixedParticles( 0x374A, 10, 15, 5028, EffectLayer.Waist );
m.PlaySound( 0x1EA );
int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
TimeSpan length = SpellHelper.GetDuration(Caster, m);
string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", percentage, percentage, percentage, 10, 10, 10, 10);
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, 1075836, length, m, args.ToString()));
}
FinishSequence();

View file

@ -58,6 +58,10 @@ namespace Server.Spells.Necromancy
* ((ss-rm)/8)+8
*/
ExpireTimer timer = (ExpireTimer)m_Table[m];
if ( timer != null )
timer.DoExpire();
m_OathTable[Caster] = Caster;
m_OathTable[m] = Caster;
@ -72,13 +76,32 @@ namespace Server.Spells.Necromancy
TimeSpan duration = TimeSpan.FromSeconds( ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 8) + 8 );
m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain
new ExpireTimer( Caster, m, duration ).Start();
timer = new ExpireTimer ( Caster, m, duration );
timer.Start ();
BuffInfo.AddBuff ( Caster, new BuffInfo ( BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name.ToString () ) );
BuffInfo.AddBuff ( m, new BuffInfo ( BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name.ToString () ) );
m_Table[m] = timer;
}
FinishSequence();
}
public static bool RemoveCurse( Mobile m )
{
ExpireTimer t = (ExpireTimer)m_Table[m];
if ( t == null )
return false;
t.DoExpire();
return true;
}
private static Hashtable m_OathTable = new Hashtable();
private static Hashtable m_Table = new Hashtable ();
public static Mobile GetBloodOath( Mobile m )
{
@ -112,15 +135,24 @@ namespace Server.Spells.Necromancy
{
if ( m_Caster.Deleted || m_Target.Deleted || !m_Caster.Alive || !m_Target.Alive || DateTime.Now >= m_End )
{
m_Caster.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
m_Target.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
m_OathTable.Remove( m_Caster );
m_OathTable.Remove( m_Target );
Stop();
DoExpire ();
}
}
public void DoExpire()
{
m_Caster.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
m_Target.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
m_OathTable.Remove ( m_Caster );
m_OathTable.Remove ( m_Target );
Stop ();
BuffInfo.RemoveBuff ( m_Caster, BuffIcon.BloodOathCaster );
BuffInfo.RemoveBuff ( m_Target, BuffIcon.BloodOathCurse );
m_Table.Remove ( m_Caster );
}
}
private class InternalTarget : Target

View file

@ -66,56 +66,42 @@ namespace Server.Spells.Necromancy
public static void ClearMindRotScalar( Mobile m )
{
m_Table.Remove( m );
if (!m_Table.ContainsKey(m))
return;
BuffInfo.RemoveBuff( m, BuffIcon.Mindrot );
MRBucket tmpB = (MRBucket)m_Table[m];
MRExpireTimer tmpT = (MRExpireTimer)tmpB.m_MRExpireTimer;
tmpT.Stop();
m_Table.Remove(m);
m.SendLocalizedMessage(1060872); // Your mind feels normal again.
}
public static bool HasMindRotScalar( Mobile m )
{
return m_Table.Contains( m );
return m_Table.ContainsKey(m);
}
public static bool GetMindRotScalar( Mobile m, ref double scalar )
{
object obj = m_Table[m];
if ( obj == null )
if (!m_Table.ContainsKey(m))
return false;
scalar = (double)obj;
MRBucket tmpB = (MRBucket)m_Table[m];
scalar = tmpB.m_Scalar;
return true;
}
public static void SetMindRotScalar( Mobile caster, Mobile target, double scalar, TimeSpan duration )
{
m_Table[target] = scalar;
BuffInfo.AddBuff( target, new BuffInfo( BuffIcon.Mindrot, 1075665, duration, target ) );
new ExpireTimer( caster, target, duration ).Start();
}
private class ExpireTimer : Timer
{
private Mobile m_Caster;
private Mobile m_Target;
private DateTime m_End;
public ExpireTimer( Mobile caster, Mobile target, TimeSpan delay ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) )
if (!m_Table.ContainsKey(target))
{
m_Caster = caster;
m_Target = target;
m_End = DateTime.Now + delay;
Priority = TimerPriority.TwoFiftyMS;
}
protected override void OnTick()
{
if ( m_Target.Deleted || !m_Target.Alive || DateTime.Now >= m_End )
{
m_Target.SendLocalizedMessage( 1060872 ); // Your mind feels normal again.
ClearMindRotScalar( m_Target );
Stop();
}
m_Table.Add(target, new MRBucket(scalar, new MRExpireTimer(caster, target, duration)));
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Mindrot, 1075665, duration, target));
MRBucket tmpB = (MRBucket)m_Table[target];
MRExpireTimer tmpT = (MRExpireTimer)tmpB.m_MRExpireTimer;
tmpT.Start();
target.SendLocalizedMessage(1074384);
}
}
@ -142,4 +128,50 @@ namespace Server.Spells.Necromancy
}
}
}
public class MRExpireTimer : Timer
{
private Mobile m_Caster;
private Mobile m_Target;
private DateTime m_End;
public MRExpireTimer( Mobile caster, Mobile target, TimeSpan delay ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) )
{
m_Caster = caster;
m_Target = target;
m_End = DateTime.Now + delay;
Priority = TimerPriority.TwoFiftyMS;
}
public void RenewDelay(TimeSpan delay)
{
m_End = DateTime.Now + delay;
}
public void Halt()
{
Stop();
}
protected override void OnTick()
{
if ( m_Target.Deleted || !m_Target.Alive || DateTime.Now >= m_End )
{
MindRotSpell.ClearMindRotScalar( m_Target );
Stop();
}
}
}
public class MRBucket
{
public MRBucket(double theScalar, MRExpireTimer theTimer)
{
m_Scalar = theScalar;
m_MRExpireTimer = theTimer;
}
public double m_Scalar;
public MRExpireTimer m_MRExpireTimer;
}
}

View file

@ -74,9 +74,7 @@ namespace Server.Spells.Necromancy
new InternalTimer( m, damage ).Start();
}
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.PainSpike, 1075667, buffTime, m, (int)damage ) );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.PainSpike, 1075667, buffTime, m, Convert.ToString( (int)damage ) ) );
Misc.WeightOverloading.DFA = Misc.DFAlgorithm.PainSpike;
m.Damage( (int) damage, Caster );

View file

@ -49,6 +49,13 @@ namespace Server.Spells.Necromancy
Effects.PlaySound( m.Location, m.Map, 0x229 );
double damage = Utility.RandomMinMax( (Core.ML ? 32 : 36), 40 ) * ((300 + (GetDamageSkill( Caster ) * 9)) / 1000);
double sdiBonus = (double)AosAttributes.GetValue( Caster, AosAttribute.SpellDamage )/100;
double pvmDamage = damage * (1 + sdiBonus);
if ( Core.ML && sdiBonus > 0.15 )
sdiBonus = 0.15;
double pvpDamage = damage * (1 + sdiBonus);
Map map = m.Map;
@ -57,7 +64,7 @@ namespace Server.Spells.Necromancy
List<Mobile> targets = new List<Mobile>();
foreach( Mobile targ in m.GetMobilesInRange( 2 ) )
if( (Caster == targ || SpellHelper.ValidIndirectTarget( Caster, targ )) && Caster.CanBeHarmful( targ, false ) )
if( (Caster == targ || m == targ || SpellHelper.ValidIndirectTarget( Caster, targ )) && Caster.CanBeHarmful( targ, false ) )
targets.Add( targ );
for( int i = 0; i < targets.Count; ++i )
@ -74,7 +81,7 @@ namespace Server.Spells.Necromancy
num = 3;
Caster.DoHarmful( targ );
SpellHelper.Damage( this, targ, damage / num, 0, 0, 0, 100, 0 );
SpellHelper.Damage( this, targ, ((m.Player && Caster.Player) ? pvpDamage : pvmDamage) / num, 0, 0, 0, 100, 0 );
}
}
}

View file

@ -135,6 +135,9 @@ namespace Server.Spells.Ninjitsu
// This bonus is 8 at most. That brings the cap up to 70/30.
damage += info.m_DamageBonus;
if ( info.m_Attacker.Weapon is BaseWeapon && ((BaseWeapon)info.m_Attacker.Weapon).MaxRange > 1 )
damage /= 2;
// Damage is direct.
//info.m_Target.Damage( damage, info.m_Attacker );

View file

@ -43,6 +43,8 @@ namespace Server.Spells.Ninjitsu
public override bool CheckCast()
{
int mana = ScaleMana( RequiredMana );
if ( !base.CheckCast() )
return false;
@ -58,9 +60,9 @@ namespace Server.Spells.Ninjitsu
Caster.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}
else if ( Caster.Mana < ScaleMana( RequiredMana ) )
else if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, RequiredMana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}

View file

@ -49,8 +49,8 @@ namespace Server.Spells.Second
public static void Toggle( Mobile caster, Mobile target )
{
/* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
* Players under the protection spell have decreased physical resistance stat value,
* a decreased "resisting spells" skill value by -35,
* Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20),
* a decreased "resisting spells" skill value by -35 + (Inscription/20),
* and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
* The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
* Reactive Armor, Protection, and Magic Reflection will stay oneven after logging out,
@ -75,6 +75,11 @@ namespace Server.Spells.Second
target.AddResistanceMod( (ResistanceMod)mods[0] );
target.AddSkillMod( (SkillMod)mods[1] );
int physloss = -15 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
int resistloss = -35 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
string args = String.Format("{0}\t{1}", physloss, resistloss);
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()));
}
else
{
@ -86,6 +91,8 @@ namespace Server.Spells.Second
target.RemoveResistanceMod( (ResistanceMod)mods[0] );
target.RemoveSkillMod( (SkillMod)mods[1] );
BuffInfo.RemoveBuff(target, BuffIcon.Protection);
}
}

View file

@ -130,7 +130,7 @@ namespace Server.Spells.Spellweaving
public virtual bool CheckResisted( Mobile m )
{
double percent = (50 + 2*(GetResistSkill( m ) - GetDamageSkill( m )))/100; //TODO: According to the guide this is it.. but.. is it correct per OSI?
double percent = (50 + 2*(GetResistSkill( m ) - GetDamageSkill( Caster )))/100; //TODO: According to the guide this is it.. but.. is it correct per OSI?
if( percent <= 0 )
return false;

View file

@ -70,6 +70,13 @@ namespace Server.Spells.Spellweaving
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
//say "Target can not be seen" if you target directly a mobile, like in OSI
if (m != null)
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if( SpellHelper.CheckTown( p, Caster ) && (m_MobileTarg ? CheckHSequence( m ) : CheckSequence()) )
{
TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills.Spellweaving.Value/24 + 25 + FocusLevel*2 );

View file

@ -27,8 +27,22 @@ namespace Server.Spells.Spellweaving
{
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;
int damage = 15 + FocusLevel;
TimeSpan duration = TimeSpan.FromSeconds( 5 + FocusLevel );
List<Mobile> targets = new List<Mobile>();
@ -47,7 +61,7 @@ namespace Server.Spells.Spellweaving
Spell oldSpell = m.Spell as Spell;
SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
SpellHelper.Damage( this, m, ( m.Player && Caster.Player ) ? pvpDamage : pvmDamage, 0, 0, 0, 0, 100 );
if( oldSpell != null && oldSpell != m.Spell )
{

View file

@ -41,6 +41,13 @@ namespace Server.Spells.Third
m.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
m.PlaySound( 0x1EA );
int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
TimeSpan length = SpellHelper.GetDuration(Caster, m);
string args = String.Format("{0}\t{1}\t{2}", percentage, percentage, percentage);
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bless, 1075847, 1075848, length, m, args.ToString()));
}
FinishSequence();