ModernUO/Scripts/Spells/Necromancy/PoisonStrike.cs
asayre ce54fe8635 Bug fix for :
skillcaps and things that exceed it
Possible threading issue
Addition of Generic FindItemsByType  - List<T> findItemsByType<T>()
Change to make polymorph not have a timer and instead a toggle skill
KiAttack no longer works with ranged weapons
Poison strike speed and damage changed
Necro spells now affected by FC
Must have atleast 50 weapon skill if no shield equipped to use Evasion
Stalking bonus capped at 10 + skill/10
Stalking bonus now Clears
Bugfix w/Guilds
Crashguard Exception message moved closer to the top of the file.
Character creation of Pallys and necros using advanced skills now gives skill items 
Honor no longer works on Players
Pre-ML area HitArea attacks nolonger require LoS
Serialization fix for BladeOfTheRighteous
RidingSwipe now has paralyzation immunity as with NerveStrike and ParaBlow
AnkhEast renamed to AnkhNorth
LeggingsOfBane no longer have 510 HP
ElvenWashBasinEastAddon Fixed
AnsellaGryen won't be renamed each time the server Restarts
DiseasedCats are properly named
Localization fixes in DefBlacksmithy
BearMasks/DearMAsks and things that extend from them now can be repaired
2006-08-19 23:24:47 +00:00

105 lines
No EOL
2.9 KiB
C#

using System;
using System.Collections.Generic;
using Server.Network;
using Server.Items;
using Server.Targeting;
namespace Server.Spells.Necromancy
{
public class PoisonStrikeSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Poison Strike", "In Vas Nox",
(Core.ML ? SpellCircle.Fifth : // 0.5 + 1.25 = 1.75s base cast delay
SpellCircle.Fourth), // 0.5 + 1.0 = 1.5s base cast delay
203,
9031,
Reagent.NoxCrystal
);
public override double RequiredSkill{ get{ return 50.0; } }
public override int RequiredMana{ get{ return 17; } }
public PoisonStrikeSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public override bool DelayedDamage{ get{ return false; } }
public void Target( Mobile m )
{
if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
/* Creates a blast of poisonous energy centered on the target.
* The main target is inflicted with a large amount of Poison damage, and all valid targets in a radius of 2 tiles around the main target are inflicted with a lesser effect.
* One tile from main target receives 50% damage, two tiles from target receives 33% damage.
*/
CheckResisted( m ); // Check magic resist for skill, but do not use return value
Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x36B0, 1, 14, 63, 7, 9915, 0 );
Effects.PlaySound( m.Location, m.Map, 0x229 );
double damage = Utility.RandomMinMax( (Core.ML ? 32 : 36), 40 ) * ((300 + (GetDamageSkill( Caster ) * 9)) / 1000);
Map map = m.Map;
if ( map != null )
{
List<Mobile> targets = new List<Mobile>();
foreach ( Mobile targ in m.GetMobilesInRange( 2 ) )
if ( (Caster == targ || SpellHelper.ValidIndirectTarget( Caster, targ )) && Caster.CanBeHarmful( targ, false ) )
targets.Add( targ );
for ( int i = 0; i < targets.Count; ++i )
{
Mobile targ = targets[i];
int num;
if ( targ.InRange( m.Location, 0 ) )
num = 1;
else if ( targ.InRange( m.Location, 1 ) )
num = 2;
else
num = 3;
Caster.DoHarmful( targ );
SpellHelper.Damage( this, targ, damage / num, 0, 0, 0, 100, 0 );
}
}
}
FinishSequence();
}
private class InternalTarget : Target
{
private PoisonStrikeSpell m_Owner;
public InternalTarget( PoisonStrikeSpell owner ) : base( 12, false, TargetFlags.Harmful )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is Mobile )
m_Owner.Target( (Mobile) o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}