Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,179 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Misc;
using Server.Items;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidBlendWithForestSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Blend With Forest", "Kes Ohm",
//SpellCircle.Sixth,
206,
9002,
false,
Reagent.Bloodmoss,
Reagent.Nightshade
);
public override SpellCircle Circle
{
get { return SpellCircle.Sixth; }
}
public override double CastDelay{ get{ return 2.0; } }
public override double RequiredSkill{ get{ return 75.0; } }
public override int RequiredMana{ get{ return 60; } }
private bool speak;
public DruidBlendWithForestSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
speak=m.Squelched;
m.PlaySound( 0x19 );
m.Paralyze( TimeSpan.FromSeconds( 20.0 ) );
m.FixedParticles( 0x375A, 2, 10, 5027, 0x3D, 2, EffectLayer.Waist );
m.Hidden = true;
m.Squelched = true;
Point3D loc = new Point3D( m.X, m.Y, m.Z );
Item item = new InternalItem( loc, Caster.Map, Caster,m , speak );
}
FinishSequence();
}
private class InternalItem : Item
{
private Timer m_Timer;
private DateTime m_End;
private Mobile m_Owner;
private bool squeltched;
public InternalItem( Point3D loc, Map map, Mobile caster, Mobile m, bool talk ) : base( 0xC9E )
{
Visible = false;
Movable = false;
m_Owner=m;
squeltched = talk;
MoveToWorld( loc, map );
if ( caster.InLOS( this ) )
Visible = true;
else
Delete();
if ( Deleted )
return;
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 20.0 ), m_Owner, squeltched );
m_Timer.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
}
public InternalItem( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_End - DateTime.Now );
writer.Write(m_Owner);
writer.Write(squeltched);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_Owner = reader.ReadMobile();
squeltched=reader.ReadBool();
if(m_Owner!=null)
{
m_Owner.Hidden=false;
m_Owner.Squelched=squeltched;
}
this.Delete();
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
if(m_Owner!=null)
m_Owner.Squelched=squeltched;
}
private class InternalTimer : Timer
{
private InternalItem m_Item;
private Mobile m_Owner;
private bool speak;
public InternalTimer( InternalItem item, TimeSpan duration, Mobile caster, bool talk ) : base( duration )
{
m_Item = item;
m_Owner=caster;
speak=talk;
}
protected override void OnTick()
{
m_Item.Delete();
m_Owner.Squelched=speak;
m_Owner.Hidden=false;
}
}
}
private class InternalTarget : Target
{
private DruidBlendWithForestSpell m_Owner;
public InternalTarget( DruidBlendWithForestSpell owner ) : base( 12, true, TargetFlags.None )
{
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();
}
}
}
}

View File

@@ -0,0 +1,210 @@
using System;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Targeting;
using Server.Gumps;
using Server.Mobiles;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidFamiliarSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Summon Familiar", "Lore Sec En Sepa Ohm",
//SpellCircle.Sixth,
203,
9031,
Reagent.MandrakeRoot,
CReagent.SpringWater,
CReagent.PetrafiedWood
);
public override SpellCircle Circle
{
get { return SpellCircle.Sixth; }
}
public override double CastDelay{ get{ return 3.0; } }
public override double RequiredSkill{ get{ return 30.0; } }
public override int RequiredMana{ get{ return 17; } }
public DruidFamiliarSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
private static Hashtable m_Table = new Hashtable();
public static Hashtable Table{ get{ return m_Table; } }
public override bool CheckCast()
{
BaseCreature check = (BaseCreature)m_Table[Caster];
if ( check != null && !check.Deleted )
{
Caster.SendLocalizedMessage( 1061605 ); // You already have a familiar.
return false;
}
return base.CheckCast();
}
public override void OnCast()
{
if ( CheckSequence() )
{
Caster.CloseGump( typeof( DruidFamiliarGump ) );
Caster.SendGump( new DruidFamiliarGump( Caster, m_Entries ) );
}
FinishSequence();
}
private static DruidFamiliarEntry[] m_Entries = new DruidFamiliarEntry[]
{
new DruidFamiliarEntry( typeof( SkitteringHopperFamiliar ), "Skittering Hopper", 30.0, 30.0 ),
new DruidFamiliarEntry( typeof( PixieFamiliar ), "Pixie", 50.0, 50.0 ),
new DruidFamiliarEntry( typeof( EagleFamiliar ), "Spirit Eagle", 60.0, 60.0 ),
new DruidFamiliarEntry( typeof( QuagmireFamiliar ), "Quagmire", 80.0, 80.0 ),
new DruidFamiliarEntry( typeof( SummonedTreefellow ), "Treefellow", 100.0, 100.0 ),
new DruidFamiliarEntry( typeof( DryadFamiliar ), "Dryad", 115.0, 115.0 )
};
public static DruidFamiliarEntry[] Entries{ get{ return m_Entries; } }
}
public class DruidFamiliarEntry
{
private Type m_Type;
private object m_Name;
private double m_ReqAnimalLore;
private double m_ReqAnimalTaming;
public Type Type{ get{ return m_Type; } }
public object Name{ get{ return m_Name; } }
public double ReqAnimalLore{ get{ return m_ReqAnimalLore; } }
public double ReqAnimalTaming{ get{ return m_ReqAnimalTaming; } }
public DruidFamiliarEntry( Type type, object name, double reqAnimalLore, double reqAnimalTaming )
{
m_Type = type;
m_Name = name;
m_ReqAnimalLore = reqAnimalLore;
m_ReqAnimalTaming = reqAnimalTaming;
}
}
public class DruidFamiliarGump : Gump
{
private Mobile m_From;
private DruidFamiliarEntry[] m_Entries;
private const int EnabledColor16 = 0x0F20;
private const int DisabledColor16 = 0x262A;
private const int EnabledColor32 = 0x18CD00;
private const int DisabledColor32 = 0x4A8B52;
public DruidFamiliarGump( Mobile from, DruidFamiliarEntry[] entries ) : base( 200, 100 )
{
m_From = from;
m_Entries = entries;
AddPage( 0 );
AddBackground( 10, 10, 250, 178, 9270 );
AddAlphaRegion( 20, 20, 230, 158 );
AddImage( 220, 20, 10464 );
AddImage( 220, 72, 10464 );
AddImage( 220, 124, 10464 );
AddItem( 188, 16, 6883 );
AddItem( 198, 168, 6881 );
AddItem( 8, 15, 6882 );
AddItem( 2, 168, 6880 );
AddHtmlLocalized( 30, 26, 200, 20, 1060147, EnabledColor16, false, false ); // Chose thy familiar...
double lore = from.Skills[SkillName.AnimalLore].Base;
double taming = from.Skills[SkillName.AnimalTaming].Base;
for ( int i = 0; i < entries.Length; ++i )
{
object name = entries[i].Name;
bool enabled = ( lore >= entries[i].ReqAnimalLore && taming >= entries[i].ReqAnimalTaming );
AddButton( 27, 53 + (i * 21), 9702, 9703, i + 1, GumpButtonType.Reply, 0 );
if ( name is int )
AddHtmlLocalized( 50, 51 + (i * 21), 150, 20, (int)name, enabled ? EnabledColor16 : DisabledColor16, false, false );
else if ( name is string )
AddHtml( 50, 51 + (i * 21), 150, 20, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", enabled ? EnabledColor32 : DisabledColor32, name ), false, false );
}
}
private static Hashtable m_Table = new Hashtable();
public override void OnResponse( NetState sender, RelayInfo info )
{
int index = info.ButtonID - 1;
if ( index >= 0 && index < m_Entries.Length )
{
DruidFamiliarEntry entry = m_Entries[index];
double lore = m_From.Skills[SkillName.AnimalLore].Base;
double taming = m_From.Skills[SkillName.AnimalTaming].Base;
BaseCreature check = (BaseCreature)DruidFamiliarSpell.Table[m_From];
if ( check != null && !check.Deleted )
{
m_From.SendLocalizedMessage( 1061605 ); // You already have a familiar.
}
else if ( lore < entry.ReqAnimalLore || taming < entry.ReqAnimalTaming )
{
// That familiar requires ~1_NECROMANCY~ Necromancy and ~2_SPIRIT~ Spirit Speak.
m_From.SendMessage( String.Format( "That familiar requires {0:F1} Animal Lore and {1:F1} Animal Taming.", entry.ReqAnimalLore, entry.ReqAnimalTaming ) );
m_From.CloseGump( typeof( DruidFamiliarGump ) );
m_From.SendGump( new DruidFamiliarGump( m_From, DruidFamiliarSpell.Entries ) );
}
else if ( entry.Type == null )
{
m_From.SendMessage( "That familiar has not yet been defined." );
m_From.CloseGump( typeof( DruidFamiliarGump ) );
m_From.SendGump( new DruidFamiliarGump( m_From, DruidFamiliarSpell.Entries ) );
}
else
{
try
{
BaseCreature bc = (BaseCreature)Activator.CreateInstance( entry.Type );
bc.Skills.MagicResist = m_From.Skills.MagicResist;
if ( BaseCreature.Summon( bc, m_From, m_From.Location, -1, TimeSpan.FromDays( 1.0 ) ) )
{
m_From.FixedParticles( 0x3728, 1, 10, 9910, EffectLayer.Head );
bc.PlaySound( bc.GetIdleSound() );
DruidFamiliarSpell.Table[m_From] = bc;
}
}
catch
{
}
}
}
else
{
m_From.SendLocalizedMessage( 1061825 ); // You decide not to summon a familiar.
}
}
}
}

View File

@@ -0,0 +1,351 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Misc;
using Server.Items;
using System.Collections;
using Server.Mobiles;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidEnchantedGroveSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Enchanted Grove", "En Ante Ohm Sepa",
//SpellCircle.Eighth,
266,
9040,
false,
Reagent.MandrakeRoot,
CReagent.PetrafiedWood,
CReagent.SpringWater
);
public override SpellCircle Circle
{
get { return SpellCircle.Eighth; }
}
public override double CastDelay{ get{ return 7.0; } }
public override double RequiredSkill{ get{ return 95.0; } }
public override int RequiredMana{ get{ return 60; } }
public DruidEnchantedGroveSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( IPoint3D p )
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
{
if(this.Scroll!=null)
Scroll.Consume();
SpellHelper.Turn( Caster, p );
SpellHelper.GetSurfaceTop( ref p );
Effects.PlaySound( p, Caster.Map, 0x2 );
Point3D loc = new Point3D( p.X, p.Y, p.Z );
int grovex;
int grovey;
int grovez;
InternalItem groveStone = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X;
grovey=loc.Y;
grovez=loc.Z;
groveStone.ItemID=0x08E3;
groveStone.Name="sacred stone";
Point3D stonexyz = new Point3D(grovex,grovey,grovez);
groveStone.MoveToWorld( stonexyz, Caster.Map );
InternalItem grovea = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X-2;
grovey=loc.Y-2;
grovez=loc.Z;
grovea.ItemID=3290;
Point3D grovexyz = new Point3D(grovex,grovey,grovez);
grovea.MoveToWorld( grovexyz, Caster.Map );
InternalItem grovec = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X;
grovey=loc.Y-3;
grovez=loc.Z;
grovec.ItemID=3293;
Point3D grovexyzb = new Point3D(grovex,grovey,grovez);
grovec.MoveToWorld( grovexyzb, Caster.Map );
InternalItem groved = new InternalItem( Caster.Location, Caster.Map, Caster );
groved.ItemID=3290;
grovex=loc.X+2;
grovey=loc.Y-2;
grovez=loc.Z;
Point3D grovexyzc = new Point3D(grovex,grovey,grovez);
groved.MoveToWorld( grovexyzc, Caster.Map );
InternalItem grovee = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X+3;
grovee.ItemID=3290;
grovey=loc.Y;
grovez=loc.Z;
Point3D grovexyzd = new Point3D(grovex,grovey,grovez);
grovee.MoveToWorld( grovexyzd, Caster.Map );
InternalItem grovef = new InternalItem( Caster.Location, Caster.Map, Caster );
grovef.ItemID=3293;
grovex=loc.X+2;
grovey=loc.Y+2;
grovez=loc.Z;
Point3D grovexyze = new Point3D(grovex,grovey,grovez);
grovef.MoveToWorld( grovexyze, Caster.Map );
InternalItem groveg = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X;
groveg.ItemID=3290;
grovey=loc.Y+3;
grovez=loc.Z;
Point3D grovexyzf = new Point3D(grovex,grovey,grovez);
groveg.MoveToWorld( grovexyzf, Caster.Map );
InternalItem groveh = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X-2;
groveh.ItemID=3293;
grovey=loc.Y+2;
grovez=loc.Z;
Point3D grovexyzg = new Point3D(grovex,grovey,grovez);
groveh.MoveToWorld( grovexyzg, Caster.Map );
InternalItem grovei = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X-3;
grovei.ItemID=3293;
grovey=loc.Y;
grovez=loc.Z;
Point3D grovexyzh = new Point3D(grovex,grovey,grovez);
grovei.MoveToWorld( grovexyzh, Caster.Map );
InternalItem leavesa = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X-2;
grovey=loc.Y-2;
grovez=loc.Z;
leavesa.ItemID=3291;
Point3D leafxyz = new Point3D(grovex,grovey,grovez);
leavesa.MoveToWorld( leafxyz, Caster.Map );
InternalItem leavesc = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X;
grovey=loc.Y-3;
grovez=loc.Z;
leavesc.ItemID=3294;
Point3D leafxyzb = new Point3D(grovex,grovey,grovez);
leavesc.MoveToWorld( leafxyzb, Caster.Map );
InternalItem leavesd = new InternalItem( Caster.Location, Caster.Map, Caster );
leavesd.ItemID=3291;
grovex=loc.X+2;
grovey=loc.Y-2;
grovez=loc.Z;
Point3D leafxyzc = new Point3D(grovex,grovey,grovez);
leavesd.MoveToWorld( leafxyzc, Caster.Map );
InternalItem leavese = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X+3;
leavese.ItemID=3291;
grovey=loc.Y;
grovez=loc.Z;
Point3D leafxyzd = new Point3D(grovex,grovey,grovez);
leavese.MoveToWorld( leafxyzd, Caster.Map );
InternalItem leavesf = new InternalItem( Caster.Location, Caster.Map, Caster );
leavesf.ItemID=3294;
grovex=loc.X+2;
grovey=loc.Y+2;
grovez=loc.Z;
Point3D leafxyze = new Point3D(grovex,grovey,grovez);
leavesf.MoveToWorld( leafxyze, Caster.Map );
InternalItem leavesg = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X;
leavesg.ItemID=3291;
grovey=loc.Y+3;
grovez=loc.Z;
Point3D leafxyzf = new Point3D(grovex,grovey,grovez);
leavesg.MoveToWorld( leafxyzf, Caster.Map );
InternalItem leavesh = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X-2;
leavesh.ItemID=3294;
grovey=loc.Y+2;
grovez=loc.Z;
Point3D leafxyzg = new Point3D(grovex,grovey,grovez);
leavesh.MoveToWorld( leafxyzg, Caster.Map );
InternalItem leavesi = new InternalItem( Caster.Location, Caster.Map, Caster );
grovex=loc.X-3;
leavesi.ItemID=3294;
grovey=loc.Y;
grovez=loc.Z;
Point3D leafxyzh = new Point3D(grovex,grovey,grovez);
leavesi.MoveToWorld( leafxyzh, Caster.Map );
}
FinishSequence();
}
[DispellableField]
private class InternalItem : Item
{
private Timer m_Timer;
private Timer m_Bless;
private DateTime m_End;
private Mobile m_Caster;
public override bool BlocksFit{ get{ return true; } }
public InternalItem( Point3D loc, Map map, Mobile caster ) : base( 0x3274 )
{
Visible = false;
Movable = false;
MoveToWorld( loc, map );
m_Caster=caster;
if ( caster.InLOS( this ) )
Visible = true;
else
Delete();
if ( Deleted )
return;
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 30.0 ) );
m_Timer.Start();
m_Bless = new BlessTimer( this, m_Caster );
m_Bless.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
}
public InternalItem( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_End - DateTime.Now );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
}
private class InternalTimer : Timer
{
private InternalItem m_Item;
public InternalTimer( InternalItem item, TimeSpan duration ) : base( duration )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private DruidEnchantedGroveSpell m_Owner;
public InternalTarget( DruidEnchantedGroveSpell owner ) : base( 12, true, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is IPoint3D )
m_Owner.Target( (IPoint3D)o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
private class BlessTimer : Timer
{
private Item m_DruidEnchantedGrove;
private Mobile m_Caster;
private DateTime m_Duration;
private static Queue m_Queue = new Queue();
public BlessTimer( Item ap, Mobile ca ) : base( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 1.0 ) )
{
Priority = TimerPriority.FiftyMS;
m_DruidEnchantedGrove = ap;
m_Caster=ca;
m_Duration = DateTime.Now + TimeSpan.FromSeconds( 15.0 + ( Utility.RandomDouble() * 15.0 ) );
}
protected override void OnTick()
{
if ( m_DruidEnchantedGrove.Deleted )
return;
if ( DateTime.Now > m_Duration )
{
Stop();
}
else
{
ArrayList list = new ArrayList();
foreach ( Mobile m in m_DruidEnchantedGrove.GetMobilesInRange( 5 ) )
{
if ( m.Player && m.Karma >= 0 && m.Alive )
list.Add( m );
}
for ( int i = 0; i < list.Count; ++i )
{
Mobile m = (Mobile)list[i];
bool friendly = true;
for ( int j = 0; friendly && j < m_Caster.Aggressors.Count; ++j )
friendly = ( ((AggressorInfo)m_Caster.Aggressors[j]).Attacker != m );
for ( int j = 0; friendly && j < m_Caster.Aggressed.Count; ++j )
friendly = ( ((AggressorInfo)m_Caster.Aggressed[j]).Defender != m );
if ( friendly )
{
m.FixedEffect( 0x37C4, 1, 12, 1109, 3 ); // At player
m.Mana += (1 + (m_Caster.Karma / 1000));
m.Hits += (1 + (m_Caster.Karma / 1000));
}
}
}
}
}
}
}

View File

@@ -0,0 +1,175 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Misc;
using Server.Items;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidGraspingRootsSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Grasping Roots", "En Ohm Sepa Tia Kes",
//SpellCircle.Fifth,
218,
9012,
false,
CReagent.SpringWater,
Reagent.Bloodmoss,
Reagent.SpidersSilk
);
public override SpellCircle Circle
{
get { return SpellCircle.Fifth; }
}
public override double CastDelay{ get{ return 1.5; } }
public override double RequiredSkill{ get{ return 40.0; } }
public override int RequiredMana{ get{ return 40; } }
public DruidGraspingRootsSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
double duration;
// Algorithm: ((20% of AnimalTamin) + 7) seconds [- 50% if resisted] seems to work??
duration = 7.0 + (Caster.Skills[DamageSkill].Value * 0.2);
// Resist if Str + Dex / 2 is greater than CastSkill eg. AnimalLore seems to work??
if ( ( Caster.Skills[CastSkill].Value ) < ( ( m.Str + m.Dex ) * 0.5 ) )
duration *= 0.5;
// no less than 0 seconds no more than 9 seconds
if ( duration < 0.0 )
duration = 0.0;
if ( duration > 9.0 )
duration = 9.0;
m.PlaySound( 0x2A1 );
m.Paralyze( TimeSpan.FromSeconds( duration ) );
m.FixedParticles( 0x375A, 2, 10, 5027, 0x3D, 2, EffectLayer.Waist );
{
Point3D loc = new Point3D( m.X, m.Y, m.Z );
Item item = new InternalItem( loc, Caster.Map, Caster );
}
}
FinishSequence();
}
private class InternalItem : Item
{
private Timer m_Timer;
private DateTime m_End;
public InternalItem( Point3D loc, Map map, Mobile caster ) : base( 0xC5F )
{
Visible = false;
Movable = false;
MoveToWorld( loc, map );
if ( caster.InLOS( this ) )
Visible = true;
else
Delete();
if ( Deleted )
return;
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 30.0 ) );
m_Timer.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
}
public InternalItem( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_End - DateTime.Now );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
}
private class InternalTimer : Timer
{
private InternalItem m_Item;
public InternalTimer( InternalItem item, TimeSpan duration ) : base( duration )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private DruidGraspingRootsSpell m_Owner;
public InternalTarget( DruidGraspingRootsSpell owner ) : base( 12, true, TargetFlags.None )
{
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();
}
}
}
}

View File

@@ -0,0 +1,81 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidHollowReedSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Hollow Reed", "En Crur Aeta Sec En Ess ",
//SpellCircle.Second,
203,
9061,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
public override SpellCircle Circle
{
get { return SpellCircle.Second; }
}
public override double CastDelay{ get{ return 1.0; } }
public override double RequiredSkill{ get{ return 30.0; } }
public override int RequiredMana{ get{ return 30; } }
public DruidHollowReedSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckBSequence( m ) )
{
SpellHelper.Turn( Caster, m );
SpellHelper.AddStatBonus( Caster, m,true, StatType.Str );
SpellHelper.AddStatBonus( Caster, m,true, StatType.Dex );
m.PlaySound( 0x15 );
m.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
}
FinishSequence();
}
private class InternalTarget : Target
{
private DruidHollowReedSpell m_Owner;
public InternalTarget( DruidHollowReedSpell owner ) : base( 12, false, TargetFlags.Beneficial )
{
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();
}
}
}
}

View File

@@ -0,0 +1,103 @@
using System;
using Server.Items;
using Server.Targeting;
using Server.Network;
using Server.Regions;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidLeafWhirlwindSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Leaf Whirlwind", "Ess Lore En Ohm",
//SpellCircle.Sixth,
218,
9002,
CReagent.SpringWater,
CReagent.PetrafiedWood,
CReagent.DestroyingAngel
);
public override SpellCircle Circle
{
get { return SpellCircle.Sixth; }
}
public override double CastDelay{ get{ return 3.0; } }
public override int RequiredMana{ get{ return 25; } }
public override double RequiredSkill{ get{ return 50; } }
public DruidLeafWhirlwindSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public override bool CheckCast()
{
if ( !base.CheckCast() )
return false;
return SpellHelper.CheckTravel( Caster, TravelCheckType.Mark );
}
public void Target( RecallRune rune )
{
if ( !Caster.CanSee( rune ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
{
}
else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, !Core.AOS ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( !rune.IsChildOf( Caster.Backpack ) )
{
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1062422 ); // You must have this rune in your backpack in order to mark it.
}
else if ( CheckSequence() )
{
rune.Mark( Caster );
Effects.SendLocationEffect( Caster, Caster.Map, 14186, 16 );
Caster.PlaySound( 0x1FA );
Effects.SendLocationEffect( Caster, Caster.Map, 14186, 16 );
}
FinishSequence();
}
private class InternalTarget : Target
{
private DruidLeafWhirlwindSpell m_Owner;
public InternalTarget( DruidLeafWhirlwindSpell owner ) : base( 12, false, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is RecallRune )
{
m_Owner.Target( (RecallRune) o );
}
else
{
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501797, from.Name, "" ) ); // I cannot mark that object.
}
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,279 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Misc;
using Server.Items;
using Server.Mobiles;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidLureStoneSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Lure Stone", "En Kes Ohm Crur",
//SpellCircle.Second,
269,
9020,
false,
Reagent.BlackPearl,
CReagent.SpringWater
);
public override SpellCircle Circle
{
get { return SpellCircle.Second; }
}
public DruidLureStoneSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override double CastDelay{ get{ return 1.0; } }
public override double RequiredSkill{ get{ return 15.0; } }
public override int RequiredMana{ get{ return 30; } }
public override bool CheckCast()
{
if ( !base.CheckCast() )
return false;
return true;
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( IPoint3D p )
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
{
SpellHelper.Turn( Caster, p );
SpellHelper.GetSurfaceTop( ref p );
Effects.PlaySound( p, Caster.Map, 0x243 );
int stonex;
int stoney;
int stonez;
Point3D loc = new Point3D( p.X, p.Y, p.Z );
Item item = new InternalItema( loc, Caster.Map, Caster );
stonex=p.X;
stoney=p.Y-1;
stonez=p.Z;
Point3D loca = new Point3D( stonex, stoney, stonez );
Item itema = new InternalItemb( loca, Caster.Map, Caster );
}
FinishSequence();
}
[DispellableField]
private class InternalItema : Item
{
private Timer m_Timer;
private DateTime m_End;
private Mobile m_Owner;
public override bool BlocksFit{ get{ return true; } }
public InternalItema( Point3D loc, Map map, Mobile caster ) : base( 0x1355 )
{
m_Owner=caster;
Visible = false;
Movable = false;
Name="Lure Stone";
MoveToWorld( loc, map );
if ( caster.InLOS( this ) )
Visible = true;
else
Delete();
if ( Deleted )
return;
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 30.0 ) );
m_Timer.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
}
public InternalItema( Serial serial ) : base( serial )
{
}
public override bool HandlesOnMovement{ get{ return true;} }
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_End - DateTime.Now );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
}
public override void OnMovement(Mobile m, Point3D oldLocation )
{
if(m_Owner!=null)
{
if ( m.InRange( this, 600 ) )
{
double tamer = m_Owner.Skills[SkillName.AnimalLore].Value;
double bonus = m_Owner.Skills[SkillName.AnimalTaming].Value/100;
BaseCreature cret = m as BaseCreature;
if(cret!=null)
if(tamer>=99.9&&(cret.Combatant==null||!cret.Combatant.Alive||cret.Combatant.Deleted))
{
cret.TargetLocation = new Point2D( this.X,this.Y );
}
else if(cret.Tamable&&(cret.Combatant==null||!cret.Combatant.Alive||cret.Combatant.Deleted))
{
if(cret.MinTameSkill<=(tamer+bonus)+0.1)
cret.TargetLocation = new Point2D( this.X,this.Y );
}
}
}
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
}
private class InternalTimer : Timer
{
private InternalItema m_Item;
public InternalTimer( InternalItema item, TimeSpan duration ) : base( duration )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
[DispellableField]
private class InternalItemb : Item
{
private Timer m_Timer;
private DateTime m_End;
public override bool BlocksFit{ get{ return true; } }
public InternalItemb( Point3D loc, Map map, Mobile caster ) : base( 0x1356 )
{
Visible = false;
Movable = false;
MoveToWorld( loc, map );
if ( caster.InLOS( this ) )
Visible = true;
else
Delete();
if ( Deleted )
return;
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 30.0 ) );
m_Timer.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
}
public InternalItemb( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_End - DateTime.Now );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
}
private class InternalTimer : Timer
{
private InternalItemb m_Item;
public InternalTimer( InternalItemb item, TimeSpan duration ) : base( duration )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private DruidLureStoneSpell m_Owner;
public InternalTarget( DruidLureStoneSpell owner ) : base( 12, true, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is IPoint3D )
m_Owner.Target( (IPoint3D)o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,310 @@
using System;
using Server.Network;
using Server.Multis;
using Server.Items;
using Server.Targeting;
using Server.Misc;
using Server.Regions;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidMushroomGatewaySpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Mushroom Gateway", "Vauk Sepa Ohm",
//SpellCircle.Seventh,
263,
9032,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
CReagent.SpringWater
);
public override SpellCircle Circle
{
get { return SpellCircle.Seventh; }
}
public override double CastDelay{ get{ return 3.0; } }
public override double RequiredSkill{ get{ return 70.0; } }
public override int RequiredMana{ get{ return 40; } }
private RunebookEntry m_Entry;
public DruidMushroomGatewaySpell( Mobile caster, Item scroll ) : this( caster, scroll, null )
{
}
public DruidMushroomGatewaySpell( Mobile caster, Item scroll, RunebookEntry entry ) : base( caster, scroll, m_Info )
{
m_Entry = entry;
}
public override void OnCast()
{
if ( m_Entry == null )
Caster.Target = new InternalTarget( this );
else
Effect( m_Entry.Location, m_Entry.Map, true );
}
public override bool CheckCast()
{
if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
return SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom );
}
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( CheckSequence() )
{
Caster.SendMessage( "You open a mystical portal in a mushroom circle" ); // You open a magical gate to another location
Effects.PlaySound( Caster.Location, Caster.Map, 0x1 );
int mushx;
int mushy;
int mushz;
InternalItem firstGatea = new InternalItem( loc, map );
mushx=Caster.X;
mushy=Caster.Y;
mushz=Caster.Z;
firstGatea.ItemID=0xD10;
Point3D mushxyz = new Point3D(mushx,mushy,mushz);
firstGatea.MoveToWorld( mushxyz, Caster.Map );
InternalItem firstGateb = new InternalItem( loc, map );
mushx=Caster.X;
mushy=Caster.Y;
firstGateb.ItemID=0x373A;
mushz=Caster.Z+1;
Point3D mushxyza = new Point3D(mushx,mushy,mushz);
firstGateb.MoveToWorld( mushxyza, Caster.Map );
InternalItem firstGatec = new InternalItem( loc, map );
mushx=Caster.X-1;
firstGatec.ItemID=0xD11;
mushy=Caster.Y+1;
mushz=Caster.Z;
Point3D mushxyzb = new Point3D(mushx,mushy,mushz);
firstGatec.MoveToWorld( mushxyzb, Caster.Map );
InternalItem firstGated = new InternalItem( loc, map);
firstGated.ItemID=0xD0C;
mushx=Caster.X;
mushy=Caster.Y+2;
mushz=Caster.Z;
Point3D mushxyzc = new Point3D(mushx,mushy,mushz);
firstGated.MoveToWorld( mushxyzc, Caster.Map );
InternalItem firstGatee = new InternalItem( loc, map );
mushx=Caster.X+1;
firstGatee.ItemID=0xD0D;
mushy=Caster.Y+1;
mushz=Caster.Z;
Point3D mushxyzd = new Point3D(mushx,mushy,mushz);
firstGatee.MoveToWorld( mushxyzd, Caster.Map );
InternalItem firstGatef = new InternalItem( loc, map );
firstGatef.ItemID=0xD0E;
mushx=Caster.X+2;
mushy=Caster.Y;
mushz=Caster.Z;
Point3D mushxyze = new Point3D(mushx,mushy,mushz);
firstGatef.MoveToWorld( mushxyze, Caster.Map );
InternalItem firstGateg = new InternalItem( loc, map );
mushx=Caster.X+1;
firstGateg.ItemID=0xD0F;
mushy=Caster.Y-1;
mushz=Caster.Z;
Point3D mushxyzf = new Point3D(mushx,mushy,mushz);
firstGateg.MoveToWorld( mushxyzf, Caster.Map );
Effects.PlaySound( loc, map, 0x1 );
InternalItem secondGatea = new InternalItem( Caster.Location, Caster.Map );
mushx=loc.X;
mushy=loc.Y;
mushz=loc.Z;
secondGatea.ItemID=0xD10;
Point3D mushaxyz = new Point3D(mushx,mushy,mushz);
secondGatea.MoveToWorld( mushaxyz, map);
InternalItem secondGateb = new InternalItem( Caster.Location, Caster.Map );
mushx=loc.X;
mushy=loc.Y;
secondGateb.ItemID=0x373A;
mushz=loc.Z+1;
Point3D mushaxyza = new Point3D(mushx,mushy,mushz);
secondGateb.MoveToWorld( mushaxyza, map);
InternalItem secondGatec = new InternalItem( Caster.Location, Caster.Map );
mushx=loc.X-1;
secondGatec.ItemID=0xD11;
mushy=loc.Y+1;
mushz=loc.Z-1;
Point3D mushaxyzb = new Point3D(mushx,mushy,mushz);
secondGatec.MoveToWorld( mushaxyzb, map);
InternalItem secondGated = new InternalItem( Caster.Location, Caster.Map);
mushx=loc.X;
mushy=loc.Y+2;
secondGated.ItemID=0xD0C;
mushz=loc.Z;
Point3D mushaxyzc = new Point3D(mushx,mushy,mushz);
secondGated.MoveToWorld( mushaxyzc, map);
InternalItem secondGatee = new InternalItem( Caster.Location, Caster.Map );
mushx=loc.X+1;
mushy=loc.Y+1;
mushz=loc.Z;
secondGatee.ItemID=0xD0D;
Point3D mushaxyzd = new Point3D(mushx,mushy,mushz);
secondGatee.MoveToWorld( mushaxyzd, map);
InternalItem secondGatef = new InternalItem( Caster.Location, Caster.Map );
mushx=loc.X+2;
mushy=loc.Y;
mushz=loc.Z;
secondGatef.ItemID=0xD0E;
Point3D mushaxyze = new Point3D(mushx,mushy,mushz);
secondGatef.MoveToWorld( mushaxyze, map);
InternalItem secondGateg = new InternalItem( Caster.Location, Caster.Map );
mushx=loc.X+1;
secondGateg.ItemID=0xD0F;
mushy=loc.Y-1;
mushz=loc.Z;
Point3D mushaxyzf = new Point3D(mushx,mushy,mushz);
secondGateg.MoveToWorld( mushaxyzf, map);
}
FinishSequence();
}
[DispellableField]
private class InternalItem : Moongate
{
public override bool ShowFeluccaWarning{ get{ return Core.AOS; } }
public InternalItem( Point3D target, Map map ) : base( target, map )
{
Map = map;
if ( ShowFeluccaWarning && map == Map.Felucca )
ItemID = 0xDDA;
Dispellable = true;
InternalTimer t = new InternalTimer( this );
t.Start();
}
public InternalItem( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
Delete();
}
private class InternalTimer : Timer
{
private Item m_Item;
public InternalTimer( Item item ) : base( TimeSpan.FromSeconds( 30.0 ) )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private DruidMushroomGatewaySpell m_Owner;
public InternalTarget( DruidMushroomGatewaySpell owner ) : base( 12, false, TargetFlags.None )
{
m_Owner = owner;
owner.Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501029 ); // Select Marked item.
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is RecallRune )
{
RecallRune rune = (RecallRune)o;
if ( rune.Marked )
m_Owner.Effect( rune.Target, rune.TargetMap, true );
else
from.SendLocalizedMessage( 501803 ); // That rune is not yet marked.
}
else if ( o is Runebook )
{
RunebookEntry e = ((Runebook)o).Default;
if ( e != null )
m_Owner.Effect( e.Location, e.Map, true );
else
from.SendLocalizedMessage( 502354 ); // Target is not marked.
}
else
{
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "" ) ); // I can not gate travel from that object.
}
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,183 @@
using System;
using Server.Items;
using Server.Multis;
using Server.Network;
using Server.Targeting;
using Server.Regions;
using Server.Mobiles;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidNaturesPassageSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Nature's Passage", "Kes Sec Vauk",
//SpellCircle.Fourth,
239,
9031,
Reagent.BlackPearl,
Reagent.Bloodmoss,
Reagent.MandrakeRoot
);
public override SpellCircle Circle
{
get { return SpellCircle.Fourth; }
}
public override double CastDelay{ get{ return 0.5; } }
public override double RequiredSkill{ get{ return 15.0; } }
public override int RequiredMana{ get{ return 10; } }
private RunebookEntry m_Entry;
private Runebook m_Book;
public DruidNaturesPassageSpell( Mobile caster, Item scroll ) : this( caster, scroll, null, null )
{
}
public DruidNaturesPassageSpell( Mobile caster, Item scroll, RunebookEntry entry, Runebook book ) : base( caster, scroll, m_Info )
{
m_Entry = entry;
m_Book = book;
}
public override void OnCast()
{
if ( m_Entry == null )
Caster.Target = new InternalTarget( this );
else
Effect( m_Entry.Location, m_Entry.Map, true );
}
public override bool CheckCast()
{
if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
return SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom );
}
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005569 ); // You can not recall to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( m_Book != null && m_Book.CurCharges <= 0 )
{
Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
}
else if ( CheckSequence() )
{
BaseCreature.TeleportPets( Caster, loc, map, true );
if ( m_Book != null )
--m_Book.CurCharges;
Caster.PlaySound( 0x19 );
Effects.SendLocationParticles( Caster, 0xC87, 9, 10, 5025 );
Caster.Map = map;
Caster.Location = loc;
Caster.PlaySound( 0x19 );
Effects.SendLocationParticles( Caster, 0xC87, 9, 10, 5025 );
}
FinishSequence();
}
private class InternalTarget : Target
{
private DruidNaturesPassageSpell m_Owner;
public InternalTarget( DruidNaturesPassageSpell owner ) : base( 12, false, TargetFlags.None )
{
m_Owner = owner;
owner.Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501029 ); // Select Marked item.
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is RecallRune )
{
RecallRune rune = (RecallRune)o;
if ( rune.Marked )
m_Owner.Effect( rune.Target, rune.TargetMap, true );
else
from.SendLocalizedMessage( 501805 ); // That rune is not yet marked.
}
else if ( o is Runebook )
{
RunebookEntry e = ((Runebook)o).Default;
if ( e != null )
m_Owner.Effect( e.Location, e.Map, true );
else
from.SendLocalizedMessage( 502354 ); // Target is not marked.
}
else if ( o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat )
{
BaseBoat boat = ((Key)o).Link as BaseBoat;
if ( !boat.Deleted && boat.CheckKey( ((Key)o).KeyValue ) )
m_Owner.Effect( boat.GetMarkedLocation(), boat.Map, false );
else
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "" ) ); // I can not recall from that object.
}
else
{
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "" ) ); // I can not recall from that object.
}
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,92 @@
using System;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidPackOfBeastSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Pack Of Beast", "En Sec Ohm Ess Sepa",
//SpellCircle.Third,
266,
9040,
false,
Reagent.BlackPearl,
Reagent.Bloodmoss,
CReagent.PetrafiedWood
);
public override SpellCircle Circle
{
get { return SpellCircle.Third; }
}
public override double CastDelay{ get{ return 1.0; } }
public override double RequiredSkill{ get{ return 40.0; } }
public override int RequiredMana{ get{ return 45; } }
public DruidPackOfBeastSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
private static Type[] m_Types = new Type[]
{
typeof( BrownBear ),
typeof( TimberWolf ),
typeof( Panther ),
typeof( GreatHart ),
typeof( Hind ),
typeof( Alligator ),
typeof( Boar ),
typeof( GiantRat )
};
public override void OnCast()
{
if ( CheckSequence() )
{
try
{
Type beasttype = ( m_Types[Utility.Random( m_Types.Length )] );
BaseCreature creaturea = (BaseCreature)Activator.CreateInstance( beasttype );
BaseCreature creatureb = (BaseCreature)Activator.CreateInstance( beasttype );
BaseCreature creaturec = (BaseCreature)Activator.CreateInstance( beasttype );
BaseCreature creatured = (BaseCreature)Activator.CreateInstance( beasttype );
SpellHelper.Summon( creaturea, Caster, 0x215, TimeSpan.FromSeconds( 4.0 * Caster.Skills[CastSkill].Value ), false, false );
SpellHelper.Summon( creatureb, Caster, 0x215, TimeSpan.FromSeconds( 4.0 * Caster.Skills[CastSkill].Value ), false, false );
Double morebeast = 0 ;
morebeast = Utility.Random( 10 ) + ( Caster.Skills[CastSkill].Value * 0.1 );
if ( morebeast > 11 )
{
SpellHelper.Summon( creaturec, Caster, 0x215, TimeSpan.FromSeconds( 4.0 * Caster.Skills[CastSkill].Value ), false, false );
}
if ( morebeast > 18 )
{
SpellHelper.Summon( creatured, Caster, 0x215, TimeSpan.FromSeconds( 4.0 * Caster.Skills[CastSkill].Value ), false, false );
}
}
catch
{
}
}
FinishSequence();
}
public override TimeSpan GetCastDelay()
{
return TimeSpan.FromSeconds( 7.5 );
}
}
}

View File

@@ -0,0 +1,189 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Misc;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidRestorativeSoilSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Restorative Soil", "Ohm Sepa Ante",
//SpellCircle.Eighth,
269,
9020,
Reagent.Garlic,
Reagent.Ginseng,
CReagent.SpringWater
);
public override SpellCircle Circle
{
get { return SpellCircle.Eighth; }
}
public override double CastDelay { get { return 2.0; } }
public override double RequiredSkill { get { return 89.0; } }
public override int RequiredMana { get { return 55; } }
public DruidRestorativeSoilSpell(Mobile caster, Item scroll)
: base(caster, scroll, m_Info)
{
}
public override bool CheckCast()
{
if (!base.CheckCast())
return false;
return true;
}
public override void OnCast()
{
Caster.Target = new InternalTarget(this);
}
public void Target(IPoint3D p)
{
if (!Caster.CanSee(p))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckSequence())
{
SpellHelper.Turn(Caster, p);
SpellHelper.GetSurfaceTop(ref p);
Effects.PlaySound(p, Caster.Map, 0x382);
Point3D loc = new Point3D(p.X, p.Y, p.Z);
Item item = new InternalItem(loc, Caster.Map, Caster);
}
FinishSequence();
}
[DispellableField]
private class InternalItem : Item
{
private Timer m_Timer;
private DateTime m_End;
private Mobile m_Owner;
public override bool BlocksFit { get { return true; } }
public InternalItem(Point3D loc, Map map, Mobile caster)
: base(0x913)
{
m_Owner = caster;
Visible = false;
Movable = false;
Name = "restorative soil";
MoveToWorld(loc, map);
if (caster.InLOS(this))
Visible = true;
else
Delete();
if (Deleted)
return;
m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(30.0));
m_Timer.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds(30.0);
}
public InternalItem(Serial serial)
: base(serial)
{
}
public override bool HandlesOnMovement { get { return true; } }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
writer.Write(m_End - DateTime.Now);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer(this, duration);
m_Timer.Start();
m_End = DateTime.Now + duration;
}
public override bool OnMoveOver(Mobile m)
{
if (m is PlayerMobile && !m.Alive)
{
m.SendGump(new ResurrectGump(m));
m.SendMessage("The power of the soil surges through you!");
}
else
m.PlaySound(0x339);
return true;
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if (m_Timer != null)
m_Timer.Stop();
}
private class InternalTimer : Timer
{
private InternalItem m_Item;
public InternalTimer(InternalItem item, TimeSpan duration)
: base(duration)
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private DruidRestorativeSoilSpell m_Owner;
public InternalTarget(DruidRestorativeSoilSpell owner)
: base(12, true, TargetFlags.None)
{
m_Owner = owner;
}
protected override void OnTarget(Mobile from, object o)
{
if (o is IPoint3D)
m_Owner.Target((IPoint3D)o);
}
protected override void OnTargetFinish(Mobile from)
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,213 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Misc;
using Server.Items;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidShieldOfEarthSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Shield Of Earth", "Kes En Sepa Ohm",
//SpellCircle.First,
227,
9011,
false,
Reagent.Ginseng,
CReagent.SpringWater
);
public override SpellCircle Circle
{
get { return SpellCircle.First; }
}
public override double CastDelay{ get{ return 1.0; } }
public override double RequiredSkill{ get{ return 20.0; } }
public override int RequiredMana{ get{ return 15; } }
public DruidShieldOfEarthSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( IPoint3D p )
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
{
SpellHelper.Turn( Caster, p );
SpellHelper.GetSurfaceTop( ref p );
int dx = Caster.Location.X - p.X;
int dy = Caster.Location.Y - p.Y;
int rx = (dx - dy) * 44;
int ry = (dx + dy) * 44;
bool eastToWest;
if ( rx >= 0 && ry >= 0 )
{
eastToWest = false;
}
else if ( rx >= 0 )
{
eastToWest = true;
}
else if ( ry >= 0 )
{
eastToWest = true;
}
else
{
eastToWest = false;
}
Effects.PlaySound( p, Caster.Map, 0x50 );
for ( int i = -2; i <= 2; ++i )
{
Point3D loc = new Point3D( eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z );
bool canFit = SpellHelper.AdjustField( ref loc, Caster.Map, 22, true );
if ( !canFit )
continue;
Item item = new InternalItem( loc, Caster.Map, Caster );
Effects.SendLocationParticles( item, 0x376A, 9, 10, 5025 );
}
}
FinishSequence();
}
[DispellableField]
private class InternalItem : Item
{
private Timer m_Timer;
private DateTime m_End;
public override bool BlocksFit{ get{ return true; } }
public InternalItem( Point3D loc, Map map, Mobile caster ) : base( 0x0C92 )
{
Visible = false;
Movable = false;
MoveToWorld( loc, map );
if ( caster.InLOS( this ) )
Visible = true;
else
Delete();
if ( Deleted )
return;
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 30.0 ) );
m_Timer.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
}
public InternalItem( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_End - DateTime.Now );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
break;
}
case 0:
{
TimeSpan duration = TimeSpan.FromSeconds( 10.0 );
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
break;
}
}
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
}
private class InternalTimer : Timer
{
private InternalItem m_Item;
public InternalTimer( InternalItem item, TimeSpan duration ) : base( duration )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private DruidShieldOfEarthSpell m_Owner;
public InternalTarget( DruidShieldOfEarthSpell owner ) : base( 12, true, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is IPoint3D )
m_Owner.Target( (IPoint3D)o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,143 @@
using System;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Targeting;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidSpringOfLifeSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Spring Of Life", "En Sepa Aete",
//SpellCircle.Fourth,
204,
9061,
false,
CReagent.SpringWater
);
public override SpellCircle Circle
{
get { return SpellCircle.Fourth; }
}
public override double CastDelay { get { return 1.0; } }
public override double RequiredSkill { get { return 40.0; } }
public override int RequiredMana { get { return 40; } }
public DruidSpringOfLifeSpell(Mobile caster, Item scroll)
: base(caster, scroll, m_Info)
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget(this);
}
public void Target(IPoint3D p)
{
if (!Caster.CanSee(p))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckSequence())
{
SpellHelper.Turn(Caster, p);
SpellHelper.GetSurfaceTop(ref p);
ArrayList targets = new ArrayList();
IPooledEnumerable eable = Caster.Map.GetMobilesInRange(new Point3D(p), 3);
foreach (Mobile m in eable)
{
if (Caster.CanBeBeneficial(m, false))
targets.Add(m);
}
eable.Free();
Effects.PlaySound(p, Caster.Map, 0x11);
int val = (int)(Caster.Skills[CastSkill].Value / 20.0 + 5);
if (targets.Count > 0)
{
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
if (m.BeginAction(typeof(DruidSpringOfLifeSpell)))
{
Caster.DoBeneficial(m);
m.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Head);
int toHeal = (int)(Caster.Skills[DamageSkill].Value * 0.6);
toHeal += Utility.Random(1, 10);
m.Heal(toHeal);
new InternalTimer(m, Caster, val).Start();
m.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Waist);
m.PlaySound(0xAF);
}
}
}
}
FinishSequence();
}
private class InternalTimer : Timer
{
private Mobile m_Owner;
private int m_Val;
public InternalTimer(Mobile target, Mobile caster, int val)
: base(TimeSpan.FromSeconds(0))
{
double time = caster.Skills[SkillName.AnimalLore].Value * 1.2;
if (time > 300)
time = 300;
Delay = TimeSpan.FromSeconds(time);
Priority = TimerPriority.TwoFiftyMS;
m_Owner = target;
m_Val = val;
}
protected override void OnTick()
{
m_Owner.EndAction(typeof(DruidSpringOfLifeSpell));
}
}
private class InternalTarget : Target
{
private DruidSpringOfLifeSpell m_Owner;
public InternalTarget(DruidSpringOfLifeSpell owner)
: base(12, true, TargetFlags.None)
{
m_Owner = owner;
}
protected override void OnTarget(Mobile from, object o)
{
IPoint3D p = o as IPoint3D;
if (p != null)
m_Owner.Target(p);
}
protected override void OnTargetFinish(Mobile from)
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,294 @@
using System;
using System.Collections;
using Server.Misc;
using Server.Network;
using Server.Items;
using Server.Targeting;
using Server.Mobiles;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidStoneCircleSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Stone Circle", "En Ess Ohm",
//SpellCircle.Sixth,
266,
9040,
false,
Reagent.BlackPearl,
Reagent.Ginseng,
CReagent.SpringWater
);
public override SpellCircle Circle
{
get { return SpellCircle.Sixth; }
}
public override double CastDelay{ get{ return 3.0; } }
public override double RequiredSkill{ get{ return 60.0; } }
public override int RequiredMana{ get{ return 45; } }
public DruidStoneCircleSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( IPoint3D p )
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
{
SpellHelper.Turn( Caster, p );
SpellHelper.GetSurfaceTop( ref p );
Effects.PlaySound( p, Caster.Map, 0x222 );
Point3D loc = new Point3D( p.X, p.Y, p.Z );
int mushx;
int mushy;
int mushz;
InternalItem firstFlamea = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X-2;
mushy=loc.Y-2;
mushz=loc.Z;
Point3D mushxyz = new Point3D(mushx,mushy,mushz);
firstFlamea.MoveToWorld( mushxyz, Caster.Map );
InternalItem firstFlamec = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X;
mushy=loc.Y-3;
mushz=loc.Z;
Point3D mushxyzb = new Point3D(mushx,mushy,mushz);
firstFlamec.MoveToWorld( mushxyzb, Caster.Map );
InternalItem firstFlamed = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X+2;
mushy=loc.Y-2;
mushz=loc.Z;
Point3D mushxyzc = new Point3D(mushx,mushy,mushz);
firstFlamed.MoveToWorld( mushxyzc, Caster.Map );
InternalItem hiddenflame = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X+2;
mushy=loc.Y-1;
mushz=loc.Z;
Point3D mushxyzhid = new Point3D(mushx,mushy,mushz);
hiddenflame.MoveToWorld( mushxyzhid, Caster.Map );
InternalItem hiddenrock = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X+2;
mushy=loc.Y+1;
mushz=loc.Z;
Point3D rockaxyz = new Point3D(mushx,mushy,mushz);
hiddenrock.MoveToWorld( rockaxyz, Caster.Map );
InternalItem hiddenflamea = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X-2;
mushy=loc.Y-1;
mushz=loc.Z;
Point3D mushxyzhida = new Point3D(mushx,mushy,mushz);
hiddenflamea.MoveToWorld( mushxyzhida, Caster.Map );
InternalItem hiddenrocks = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X-2;
mushy=loc.Y+1;
mushz=loc.Z;
Point3D rocksaxyz = new Point3D(mushx,mushy,mushz);
hiddenrocks.MoveToWorld( rocksaxyz, Caster.Map );
InternalItem hiddenrocka = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X+1;
mushy=loc.Y+2;
mushz=loc.Z;
Point3D rockbxyz = new Point3D(mushx,mushy,mushz);
hiddenrocka.MoveToWorld( rockbxyz, Caster.Map );
InternalItem hiddenrockb = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X+1;
mushy=loc.Y-2;
mushz=loc.Z;
Point3D rockcxyz = new Point3D(mushx,mushy,mushz);
hiddenrockb.MoveToWorld( rockcxyz, Caster.Map );
InternalItem hiddenrockc = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X-1;
mushy=loc.Y-2;
mushz=loc.Z;
Point3D rockdxyz = new Point3D(mushx,mushy,mushz);
hiddenrockc.MoveToWorld( rockdxyz, Caster.Map );
InternalItem hiddenrockd = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X-1;
mushy=loc.Y+2;
mushz=loc.Z;
Point3D rockexyz = new Point3D(mushx,mushy,mushz);
hiddenrockd.MoveToWorld( rockexyz, Caster.Map );
InternalItem firstFlamee = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X+3;
mushy=loc.Y;
mushz=loc.Z;
Point3D mushxyzd = new Point3D(mushx,mushy,mushz);
firstFlamee.MoveToWorld( mushxyzd, Caster.Map );
InternalItem firstFlamef = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X+2;
mushy=loc.Y+2;
mushz=loc.Z;
Point3D mushxyze = new Point3D(mushx,mushy,mushz);
firstFlamef.MoveToWorld( mushxyze, Caster.Map );
InternalItem firstFlameg = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X;
mushy=loc.Y+3;
mushz=loc.Z;
Point3D mushxyzf = new Point3D(mushx,mushy,mushz);
firstFlameg.MoveToWorld( mushxyzf, Caster.Map );
InternalItem firstFlameh = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X-2;
mushy=loc.Y+2;
mushz=loc.Z;
Point3D mushxyzg = new Point3D(mushx,mushy,mushz);
firstFlameh.MoveToWorld( mushxyzg, Caster.Map );
InternalItem firstFlamei = new InternalItem( Caster.Location, Caster.Map, Caster );
mushx=loc.X-3;
mushy=loc.Y;
mushz=loc.Z;
Point3D mushxyzh = new Point3D(mushx,mushy,mushz);
firstFlamei.MoveToWorld( mushxyzh, Caster.Map );
}
FinishSequence();
}
[DispellableField]
private class InternalItem : Item
{
private Timer m_Timer;
private DateTime m_End;
private Mobile m_Caster;
public override bool BlocksFit{ get{ return true; } }
public InternalItem( Point3D loc, Map map, Mobile caster ) : base( 0x08E2 )
{
Visible = false;
Movable = false;
ItemID=Utility.RandomList(2274,2275,2272,2273,2279,2280);
Name="stone";
MoveToWorld( loc, map );
m_Caster=caster;
if ( caster.InLOS( this ) )
Visible = true;
else
Delete();
if ( Deleted )
return;
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 30.0 ) );
m_Timer.Start();
m_End = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
}
public InternalItem( Serial serial ) : base( serial )
{
}
public override bool OnMoveOver( Mobile m )
{
m.SendMessage("The magic of the stones prevents you from crossing.");
return false;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_End - DateTime.Now );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
break;
}
case 0:
{
TimeSpan duration = TimeSpan.FromSeconds( 10.0 );
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
break;
}
}
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
}
private class InternalTimer : Timer
{
private InternalItem m_Item;
public InternalTimer( InternalItem item, TimeSpan duration ) : base( duration )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private DruidStoneCircleSpell m_Owner;
public InternalTarget( DruidStoneCircleSpell owner ) : base( 12, true, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is IPoint3D )
m_Owner.Target( (IPoint3D)o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,119 @@
using System;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Targeting;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidSwarmOfInsectsSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Swarm Of Insects", "Ess Ohm En Sec Tia",
//SpellCircle.Seventh,
263,
9032,
false,
Reagent.Garlic,
Reagent.Nightshade,
CReagent.DestroyingAngel
);
public override SpellCircle Circle
{
get { return SpellCircle.Seventh; }
}
public override double CastDelay{ get{ return 2.0; } }
public override double RequiredSkill{ get{ return 85.0; } }
public override int RequiredMana{ get{ return 70; } }
public DruidSwarmOfInsectsSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( Mobile m )
{
if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
SpellHelper.CheckReflect( 7, Caster, ref m );
CheckResisted( m ); // Check magic resist for skill, but do not use return value
m.FixedParticles( 0x91B, 1, 240, 9916, 1159, 3, EffectLayer.Head );
// m.FixedParticles( 0x91B, 1, 240, 9916, 0, 3, EffectLayer.Head );
m.PlaySound( 0x1E5 );
double damage = ((Caster.Skills[CastSkill].Value - m.Skills[SkillName.AnimalLore].Value) / 10) + 30;
if ( damage < 1 )
damage = 1;
if ( m_Table.Contains( m ) )
damage /= 10;
else
new InternalTimer( m, damage * 0.5 ).Start();
SpellHelper.Damage( this, m, damage );
}
FinishSequence();
}
private static Hashtable m_Table = new Hashtable();
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private int m_ToRestore;
public InternalTimer( Mobile m, double toRestore ) : base( TimeSpan.FromSeconds( 20.0 ) )
{
Priority = TimerPriority.OneSecond;
m_Mobile = m;
m_ToRestore = (int)toRestore;
m_Table[m] = this;
}
protected override void OnTick()
{
m_Table.Remove( m_Mobile );
if ( m_Mobile.Alive )
m_Mobile.Hits += m_ToRestore;
}
}
private class InternalTarget : Target
{
private DruidSwarmOfInsectsSpell m_Owner;
public InternalTarget( DruidSwarmOfInsectsSpell 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();
}
}
}
}

View File

@@ -0,0 +1,122 @@
using System;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Targeting;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidVolcanicEruptionSpell : DruidSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Volcanic Eruption", "Vauk Ohm En Tia Crur",
//SpellCircle.Eighth,
245,
9042,
false,
Reagent.SulfurousAsh,
CReagent.DestroyingAngel
);
public override SpellCircle Circle
{
get { return SpellCircle.Eighth; }
}
public override double CastDelay{ get{ return 2.0; } }
public override double RequiredSkill{ get{ return 98.0; } }
public override int RequiredMana{ get{ return 85; } }
public DruidVolcanicEruptionSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( IPoint3D p )
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
{
SpellHelper.Turn( Caster, p );
if ( p is Item )
p = ((Item)p).GetWorldLocation();
double damage = Utility.Random( 27, 22 );
ArrayList targets = new ArrayList();
IPooledEnumerable eable = Caster.Map.GetMobilesInRange( new Point3D( p ), 1 + (int)(Caster.Skills[DamageSkill].Value / 10.0) );
foreach ( Mobile m in eable )
{
if ( SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) )
targets.Add( m );
}
eable.Free();
if ( targets.Count > 0 )
{
//damage /= targets.Count; // ~ divides damage between targets, kinda sux
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
double toDeal = damage;
if ( CheckResisted( m ) )
{
toDeal *= 0.7;
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
}
Caster.DoHarmful( m );
SpellHelper.Damage( this, m, toDeal, 50, 100, 0, 0, 0 );
m.FixedParticles( 0x3709, 20, 10, 5044, EffectLayer.RightFoot );
m.PlaySound( 0x21F );
m.FixedParticles( 0x36BD, 10, 30, 5052, EffectLayer.Head );
m.PlaySound( 0x208 );
}
}
}
FinishSequence();
}
private class InternalTarget : Target
{
private DruidVolcanicEruptionSpell m_Owner;
public InternalTarget( DruidVolcanicEruptionSpell owner ) : base( 12, true, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
IPoint3D p = o as IPoint3D;
if ( p != null )
m_Owner.Target( p );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}