branch sync #2

This commit is contained in:
mark 2009-01-31 00:02:21 +00:00
parent 96a37544fd
commit 4e6256b8cd
39 changed files with 415 additions and 137 deletions

View file

@ -9,6 +9,7 @@ using Server.Targeting;
using Server.Engines.PartySystem;
using Server.Misc;
using Server.Spells.Bushido;
using Server.Spells.Necromancy;
using Server.Spells.Ninjitsu;
using System.Collections.Generic;
using Server.Spells.Seventh;
@ -920,7 +921,10 @@ namespace Server.Spells
((BaseCreature)target).AlterSpellDamageFrom( from, ref iDamage );
WeightOverloading.DFA = dfa;
AOS.Damage( target, from, iDamage, phys, fire, cold, pois, nrgy );
int damageGiven = AOS.Damage( target, from, iDamage, phys, fire, cold, pois, nrgy );
DoLeech( damageGiven, from, target );
WeightOverloading.DFA = DFAlgorithm.Standard;
}
else
@ -932,6 +936,24 @@ namespace Server.Spells
((BaseCreature)target).OnDamagedBySpell( from );
}
public static void DoLeech( int damageGiven, Mobile from, Mobile target )
{
TransformContext context = TransformationSpellHelper.GetContext( from );
if ( context != null && context.Type == typeof( WraithFormSpell ) )
{
int wraithLeech = ( 5 + (int)( ( 15 * from.Skills.SpiritSpeak.Value ) / 100 ) ); // Wraith form gives 5-20% mana leech
int manaLeech = AOS.Scale( damageGiven, wraithLeech );
if ( manaLeech != 0 )
{
// Mana leeched by the Wraith Form spell is actually stolen, not just leeched.
target.Mana -= manaLeech;
from.Mana += manaLeech;
from.PlaySound( 0x44D );
//from.SendMessage(String.Format("You Leeched {0} Mana", manaLeech));
}
}
}
public static void Heal( int amount, Mobile target, Mobile from )
{
Heal( amount, target, from, true );
@ -1012,7 +1034,10 @@ namespace Server.Spells
((BaseCreature)m_Target).AlterSpellDamageFrom( m_From, ref m_Damage );
WeightOverloading.DFA = m_DFA;
AOS.Damage( m_Target, m_From, m_Damage, m_Phys, m_Fire, m_Cold, m_Pois, m_Nrgy );
int damageGiven = AOS.Damage( m_Target, m_From, m_Damage, m_Phys, m_Fire, m_Cold, m_Pois, m_Nrgy );
DoLeech( damageGiven, m_From, m_Target );
WeightOverloading.DFA = DFAlgorithm.Standard;
if( m_Target is BaseCreature && m_From != null )

View file

@ -54,6 +54,12 @@ namespace Server.Spells.Bushido
return false;
}
if ( !Caster.CanBeginAction( typeof( Evasion ) ) )
{
Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
return false;
}
return true;
}
@ -98,6 +104,9 @@ namespace Server.Spells.Bushido
OnCastSuccessful( Caster );
BeginEvasion( Caster );
Caster.BeginAction( typeof( Evasion ) );
Timer.DelayCall( TimeSpan.FromSeconds( 20.0 ), delegate { Caster.EndAction( typeof( Evasion ) ); } );
}
FinishSequence();

View file

@ -80,6 +80,7 @@ namespace Server.Spells.Necromancy
Misc.WeightOverloading.DFA = Misc.DFAlgorithm.PainSpike;
m.Damage( (int) damage, Caster );
SpellHelper.DoLeech( (int)damage, Caster, m );
Misc.WeightOverloading.DFA = Misc.DFAlgorithm.Standard;
//SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Mobiles;
namespace Server.Spells.Spellweaving
{
@ -29,6 +30,12 @@ namespace Server.Spells.Spellweaving
return false;
}
if ( GetArcanists().Count < 2 )
{
Caster.SendLocalizedMessage( 1080452 ); //There are not enough spellweavers present to create an Arcane Focus.
return false;
}
return base.CheckCast();
}
@ -111,7 +118,7 @@ namespace Server.Spells.Spellweaving
//OSI Verified: Even enemies/combatants count
foreach( Mobile m in Caster.GetMobilesInRange( 1 ) ) //Range verified as 1
{
if( m != Caster && Caster.CanBeBeneficial( m, false ) && Math.Abs( Caster.Skills.Spellweaving.Value - m.Skills.Spellweaving.Value ) <= 20 ) //TODO: OSI check, aggressor/agressed? Visibility?
if ( m != Caster && Caster.CanBeBeneficial( m, false ) && Math.Abs( Caster.Skills.Spellweaving.Value - m.Skills.Spellweaving.Value ) <= 20 && !(m is Clone) )
{
weavers.Add( m );
}