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,47 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidBag : ScrollBag
{
[Constructable]
public DruidBag()
{
Hue = 0x48C;
PlaceItemIn( 30, 35, new DruidBlendWithForestScroll() );
PlaceItemIn( 50, 35, new DruidEnchantedGroveScroll() );
PlaceItemIn( 70, 35, new DruidFamiliarScroll() );
PlaceItemIn( 90, 35, new DruidGraspingRootsScroll() );
PlaceItemIn( 30, 55, new DruidHollowReedScroll() );
PlaceItemIn( 50, 55, new DruidLureStoneScroll() );
PlaceItemIn( 70, 55, new DruidMushroomGatewayScroll() );
PlaceItemIn( 90, 55, new DruidNaturesPassageScroll() );
PlaceItemIn( 30, 75, new DruidPackOfBeastScroll() );
PlaceItemIn( 50, 75, new DruidRestorativeSoilScroll() );
PlaceItemIn( 70, 75, new DruidShieldOfEarthScroll() );
PlaceItemIn( 90, 75, new DruidSpringOfLifeScroll() );
PlaceItemIn( 30, 95, new DruidStoneCircleScroll() );
PlaceItemIn( 50, 95, new DruidSwarmOfInsectsScroll() );
PlaceItemIn( 70, 95, new DruidLeafWhirlwindScroll() );
PlaceItemIn( 90, 95, new DruidVolcanicEruptionScroll() );
}
public DruidBag( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using Server;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidInitializer : BaseInitializer
{
public static void Configure()
{
Register( typeof( DruidLeafWhirlwindSpell ), "Leaf Whirlwind", "A gust of wind blows picking up magic leaves that memorize where they have come from, marking a rune for the caster.", "Spring Water; Petrafied Wood; Destroying Angel", "Mana: 25; Skill: 50", 2271, 5120, School.Druid );
Register( typeof( DruidHollowReedSpell ), "Hollow Reed", "Increases both the Strength and the Intelligence of the Druid.", "Bloodmoss; Mandrake Root; Nightshade", "Mana: 30; Skill: 30", 2255, 5120, School.Druid );
Register( typeof( DruidPackOfBeastSpell ), "Pack of Beasts", "Summons a pack of beasts to fight for the Druid. Spell length increases with skill.", "Bloodmoss; Black Pearl; Petrafied Wood", "Mana: 45; Skill: 40", 20491, 5120, School.Druid );
Register( typeof( DruidSpringOfLifeSpell ), "Spring of Life", "Creates a magical spring that heals the Druid and their party.", "Spring Water", "Mana: 40; Skill: 40", 2268, 5120, School.Druid );
Register( typeof( DruidGraspingRootsSpell ), "Grasping Roots", "Summons roots from the ground to entangle a single target.", "Spring Water; Bloodmoss; Spider's Silk", "Mana: 40; Skill: 40", 2293, 5120, School.Druid );
Register( typeof( DruidBlendWithForestSpell ), "Blend With Forest", "The Druid blends seamlessly with the background, becoming invisible to their foes.", "Bloodmoss; Nightshade", "Mana: 60; Skill: 75", 2249, 5120, School.Druid );
Register( typeof( DruidSwarmOfInsectsSpell ), "Swarm of Instects", "Summons a swarm of insects that bite and sting the Druid's enemies.", "Garlic; Nightshade; DestroyingAngel", "Mana: 70; Skill: 85", 2272, 5120, School.Druid );
Register( typeof( DruidVolcanicEruptionSpell ), "Volcanic Eruption", "A blast of molten lava bursts from the ground, hitting every enemy nearby.", "Sulfurous Ash; Destroying Angel", "Mana: 85; Skill: 98", 2296, 5120, School.Druid );
Register( typeof( DruidFamiliarSpell ), "Summon Familiar", "Summons a choice of diffrent familiars that can aid the druid.", "Mandrake Root; Spring Water; Petrafied Wood", "Mana: 17; Skill: 30", 2295, 5120, School.Druid );
Register( typeof( DruidStoneCircleSpell ), "Stone Circle", "Forms an impassable circle of stones, ideal for trapping enemies.", "Black Pearl; Ginseng; Spring Water", "Mana: 45; Skill: 60", 2263, 5120, School.Druid );
Register( typeof( DruidEnchantedGroveSpell ), "Enchanted Grove", "Creates a grove of trees to grow around the Druid, restoring vitality.", "Mandrake Root; Petrafied Wood; Spring Water", "Mana: 60; Skill: 95", 2280, 5120, School.Druid );
Register( typeof( DruidLureStoneSpell ), "Lure Stone", "Creates a magical stone that calls all nearby animals to it.", "Black Pearl; Spring Water", "Mana: 30; Skill: 15", 2294, 5120, School.Druid );
Register( typeof( DruidNaturesPassageSpell ), "Nature's Passage", "The Druid is turned into flower petals and carried on the wind to their destination.", "Black Pearl; Bloodmoss; Mandrake Root", "Mana: 10; Skill: 15", 2297, 5120, School.Druid );
Register( typeof( DruidMushroomGatewaySpell ), "Mushroom Gateway", "A magical circle of mushrooms opens, allowing the Druid to step through it to another location.", "Black Pearl; Spring Water; Mandrake Root", "Mana: 40; Skill: 70", 2291, 5120, School.Druid );
Register( typeof( DruidRestorativeSoilSpell ), "Restorative Soil", "Saturates a patch of land with power, causing life giving mud to seep through.", "Garlic; Ginseng; Spring Water", "Mana: 55; Skill: 89", 2298, 5120, School.Druid );
Register( typeof( DruidShieldOfEarthSpell ), "Shield of Earth", "A quick-growning wall of foliage springs up at the bidding of the Druid.", "Ginseng; Spring Water", "Mana: 15; Skill: 20", 2254, 5120, School.Druid );
}
}
}

View File

@@ -0,0 +1,74 @@
using System;
using Server;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public abstract class DruidSpell : CSpell
{
public DruidSpell(Mobile caster, Item scroll, SpellInfo info)
: base(caster, scroll, info)
{
}
public abstract SpellCircle Circle { get; }
public override bool ClearHandsOnCast { get { return false; } }
public override SkillName CastSkill { get { return SkillName.AnimalLore; } }
public override SkillName DamageSkill { get { return SkillName.AnimalTaming; } }
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(3 * CastDelaySecondsPerTick); } }
public override void GetCastSkills(out double min, out double max)
{
min = RequiredSkill;
max = RequiredSkill + 30.0;
}
public override int GetMana()
{
return RequiredMana;
}
public override TimeSpan GetCastDelay()
{
return TimeSpan.FromSeconds(CastDelay);
}
public virtual bool CheckResisted(Mobile target)
{
double n = GetResistPercent(target);
n /= 100.0;
if (n <= 0.0)
return false;
if (n >= 1.0)
return true;
int maxSkill = (1 + (int)Circle) * 10;
//int maxSkill = 40;
maxSkill += (1 + ((int)Circle / 6)) * 25;
//maxSkill += (1 + (4 / 6)) * 25;
if (target.Skills[SkillName.MagicResist].Value < maxSkill)
target.CheckSkill(SkillName.MagicResist, 0.0, 120.0);
return (n >= Utility.RandomDouble());
}
public virtual double GetResistPercent(Mobile target)
{
return GetResistPercentForCircle(target, Circle);
//return GetResistPercentForCircle(target, SpellCircle.Fourth);
}
public virtual double GetResistPercentForCircle(Mobile target, SpellCircle circle)
{
double firstPercent = target.Skills[SkillName.MagicResist].Value / 5.0;
double secondPercent = target.Skills[SkillName.MagicResist].Value - (((Caster.Skills[CastSkill].Value - 20.0) / 5.0) + (1 + (int)circle) * 5.0);
return (firstPercent > secondPercent ? firstPercent : secondPercent) / 2.0; // Seems should be about half of what stratics says.
}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using Server.Items;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidSpellbook : CSpellbook
{
public override School School{ get{ return School.Druid; } }
[Constructable]
public DruidSpellbook() : this( (ulong)0, CSSettings.FullSpellbooks )
{
}
[Constructable]
public DruidSpellbook( bool full ) : this( (ulong)0, full )
{
}
[Constructable]
public DruidSpellbook( ulong content, bool full ) : base( content, 0xEFA, full )
{
Hue = 0x48C;
Name = "Tome of Nature";
}
public override void OnDoubleClick( Mobile from )
{
if ( from.AccessLevel == AccessLevel.Player )
{
Container pack = from.Backpack;
if( !(Parent == from || (pack != null && Parent == pack)) )
{
from.SendMessage( "The spellbook must be in your backpack [and not in a container within] to open." );
return;
}
else if( SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions( from, this.School ) )
{
return;
}
}
from.CloseGump( typeof( DruidSpellbookGump ) );
from.SendGump( new DruidSpellbookGump( this ) );
}
public DruidSpellbook( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,72 @@
using System;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidSpellbookGump : CSpellbookGump
{
public override string TextHue { get{ return "006600"; } }
public override int BGImage { get{ return 2203; } }
public override int SpellBtn { get{ return 2224; } } //95?
public override int SpellBtnP{ get{ return 2224; } } //97?
public override string Label1 { get{ return "Druid"; } }
public override string Label2 { get{ return "Spells"; } }
public override Type GumpType { get{ return typeof( DruidSpellbookGump ); } }
public DruidSpellbookGump( CSpellbook book ) : base( book )
{
}
/*
public override void AddBorderDeco()
{
AddItem( 243, 215, 3307 );
for( int i = 0; i < 6; i++ ) //Outer Left
AddItem( 75, 75+i*42, 6024 );
for( int i = 0; i < 6; i++ ) //Outer Right
AddItem( 430, 75+i*42, 6022 );
for( int i = 0; i < 9; i++ ) //Outer Top
AddItem( 85+i*42, 75, 6025 );
for( int i = 0; i < 9; i++ ) //Outer Bottom
AddItem( 75+i*42, 310, 6023 );
for( int i = 0; i < 5; i++ ) //Inner Left
AddItem( 100, 100+i*42, 6022 );
for( int i = 0; i < 5; i++ ) //Inner Right
AddItem( 405, 100+i*42, 6024 );
for( int i = 0; i < 8; i++ ) //Inner Top
AddItem( 100+i*42, 85, 6023 );
for( int i = 0; i < 8; i++ ) //Inner Bottom
AddItem( 100+i*42, 299, 6025 );
AddItem( 243, 130, 3307 );
AddItem( 223, 60, 3310 );
}
public override void AddIndiDeco( bool leftside )
{
}
public override void AddButtonDeco( int offset )
{
AddItem( (offset > 7 ? 255 : 95), (130 + (offset > 7 ? (offset - 8) * 20 : offset * 20)), 6020 );
}
public override void AddPrevPageDeco()
{
AddItem( 128, 112, 6021 );
}
public override void AddNextPageDeco()
{
AddItem( 380, 108, 6020 );
}
*/
}
}

View File

@@ -0,0 +1,90 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
[CorpseName( "a dryad corpse" )]
public class DryadFamiliar : BaseCreature
{
[Constructable]
public DryadFamiliar () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a dryad";
Body = 401;
Hue = 33770;
BaseSoundID = 0x4B0;
SetStr( 200 );
SetDex( 200 );
SetInt( 100 );
SetHits( 175 );
SetStam( 50 );
SetDamage( 6, 9 );
SetDamageType( ResistanceType.Physical, 50 );
SetDamageType( ResistanceType.Energy, 50 );
SetResistance( ResistanceType.Physical, 40, 50 );
SetResistance( ResistanceType.Fire, 30, 40 );
SetResistance( ResistanceType.Cold, 35, 45 );
SetResistance( ResistanceType.Poison, 50, 60 );
SetResistance( ResistanceType.Energy, 70, 80 );
SetSkill( SkillName.Meditation, 110.0 );
SetSkill( SkillName.EvalInt, 110.0 );
SetSkill( SkillName.Magery, 110.0 );
SetSkill( SkillName.MagicResist, 110.0 );
SetSkill( SkillName.Tactics, 110.0 );
SetSkill( SkillName.Wrestling, 110.0 );
VirtualArmor = 45;
ControlSlots = 2;
Item hair = new Item( Utility.RandomList( 0x203B, 0x203C, 0x203D, 0x2044, 0x2045, 0x2047, 0x2049, 0x204A ) );
hair.Hue = Utility.RandomHairHue();
hair.Layer = Layer.Hair;
hair.Movable = false;
AddItem( hair );
Item sash = new BodySash();
sash.Hue = Utility.RandomList( 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172 );
sash.Movable = false;
AddItem( sash );
Item shoes = new Sandals();
shoes.Hue = Utility.RandomList( 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172 );
shoes.Movable = false;
AddItem( shoes );
Item skirt = new LeatherSkirt();
skirt.Hue = Utility.RandomList( 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172 );
skirt.Movable = false;
AddItem( skirt );
Item garland = new FlowerGarland();
garland.Hue = Utility.RandomList( 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172 );
garland.Movable = false;
AddItem( garland );
}
public DryadFamiliar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,117 @@
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
[CorpseName( "a pixie corpse" )]
public class PixieFamiliar : BaseFamiliar
{
public PixieFamiliar()
{
Name = "a pixie";
Body = 128;
Hue = Utility.RandomList( 0, 1176, 1174, 1172, 1171, 1170, 1164, 1159, 1152, 0 );
BaseSoundID = 0x467;
SetStr( 50 );
SetDex( 60 );
SetInt( 100 );
SetHits( 50 );
SetStam( 60 );
SetMana( 0 );
SetDamage( 5, 10 );
SetDamageType( ResistanceType.Energy, 100 );
SetResistance( ResistanceType.Physical, 10, 15 );
SetResistance( ResistanceType.Fire, 10, 15 );
SetResistance( ResistanceType.Cold, 10, 15 );
SetResistance( ResistanceType.Poison, 10, 15 );
SetResistance( ResistanceType.Energy, 99 );
SetSkill( SkillName.Wrestling, 40.0 );
SetSkill( SkillName.Tactics, 40.0 );
ControlSlots = 1;
AddItem( new LightSource() );
}
private DateTime m_NextFlare;
public override void OnThink()
{
base.OnThink();
if ( DateTime.Now < m_NextFlare )
return;
m_NextFlare = DateTime.Now + TimeSpan.FromSeconds( 5.0 + (25.0 * Utility.RandomDouble()) );
this.FixedEffect( 0x37C4, 1, 12, 1109, 6 );
this.PlaySound( 0x1D3 );
Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), new TimerCallback( Flare ) );
}
private void Flare()
{
Mobile caster = this.ControlMaster;
if ( caster == null )
caster = this.SummonMaster;
if ( caster == null )
return;
ArrayList list = new ArrayList();
foreach ( Mobile m in this.GetMobilesInRange( 5 ) )
{
if ( m.Player && m.Alive && !m.IsDeadBondedPet && m.Karma <= 0 )
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 < caster.Aggressors.Count; ++j )
friendly = ( ((AggressorInfo)caster.Aggressors[j]).Attacker != m );
for ( int j = 0; friendly && j < caster.Aggressed.Count; ++j )
friendly = ( ((AggressorInfo)caster.Aggressed[j]).Defender != m );
if ( friendly )
{
m.FixedEffect( 0x37C4, 1, 12, 1109, 3 ); // At player
m.Mana += 1 - (m.Karma / 1000);
}
}
}
public PixieFamiliar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,59 @@
using System;
using System.Collections;
using Server;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
[CorpseName( "a quagmire corpse" )]
public class QuagmireFamiliar : BaseFamiliar
{
public QuagmireFamiliar()
{
Name = "a quagmire";
Body = 789;
BaseSoundID = 352;
SetStr( 120 );
SetDex( 120 );
SetInt( 100 );
SetHits( 90 );
SetStam( 120 );
SetMana( 0 );
SetDamage( 5, 10 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 10, 15 );
SetResistance( ResistanceType.Fire, 10, 15 );
SetResistance( ResistanceType.Cold, 10, 15 );
SetResistance( ResistanceType.Poison, 10, 15 );
SetResistance( ResistanceType.Energy, 10, 15 );
SetSkill( SkillName.Wrestling, 95.1, 100.0 );
SetSkill( SkillName.Tactics, 50.0 );
ControlSlots = 1;
}
public QuagmireFamiliar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,201 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.ContextMenus;
using Server.Items;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
namespace Server.ACC.CSS.Systems.Druid
{
[CorpseName( "a skittering hopper corpse" )]
public class SkitteringHopperFamiliar : BaseFamiliar
{
public SkitteringHopperFamiliar()
{
Name = "a skittering hopper";
Body = 302;
BaseSoundID = 959;
SetStr( 41, 65 );
SetDex( 91, 115 );
SetInt( 26, 50 );
SetHits( 31, 45 );
SetDamage( 3, 5 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 5, 10 );
SetResistance( ResistanceType.Cold, 10, 20 );
SetResistance( ResistanceType.Energy, 5, 10 );
SetSkill( SkillName.MagicResist, 30.1, 45.0 );
SetSkill( SkillName.Tactics, 45.1, 70.0 );
SetSkill( SkillName.Wrestling, 40.1, 60.0 );
Fame = 300;
Karma = 0;
ControlSlots = 1;
Container pack = Backpack;
if ( pack != null )
pack.Delete();
pack = new StrongBackpack();
pack.Movable = false;
AddItem( pack );
}
private DateTime m_NextPickup;
public override void OnThink()
{
base.OnThink();
if ( DateTime.Now < m_NextPickup )
return;
m_NextPickup = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 10 ) );
Container pack = this.Backpack;
if ( pack == null )
return;
ArrayList list = new ArrayList();
foreach ( Item item in this.GetItemsInRange( 2 ) )
{
if ( item.Movable && item.Stackable )
list.Add( item );
}
int pickedUp = 0;
for ( int i = 0; i < list.Count; ++i )
{
Item item = (Item)list[i];
if ( !pack.CheckHold( this, item, false, true ) )
return;
bool rejected;
LRReason reject;
NextActionTime = Core.TickCount;
Lift( item, item.Amount, out rejected, out reject );
if ( rejected )
continue;
Drop( this, Point3D.Zero );
if ( ++pickedUp == 3 )
break;
}
}
private void ConfirmRelease_Callback( Mobile from, bool okay, object state )
{
if ( okay )
EndRelease( from );
}
public override void BeginRelease( Mobile from )
{
Container pack = this.Backpack;
if ( pack != null && pack.Items.Count > 0 )
from.SendGump( new WarningGump( 1060635, 30720, 1061672, 32512, 420, 280, new WarningGumpCallback( ConfirmRelease_Callback ), null ) );
else
EndRelease( from );
}
#region Pack Animal Methods
public override bool OnBeforeDeath()
{
if ( !base.OnBeforeDeath() )
return false;
PackAnimal.CombineBackpacks( this );
return true;
}
public override DeathMoveResult GetInventoryMoveResultFor( Item item )
{
return DeathMoveResult.MoveToCorpse;
}
public override bool IsSnoop( Mobile from )
{
if ( PackAnimal.CheckAccess( this, from ) )
return false;
return base.IsSnoop( from );
}
public override bool OnDragDrop( Mobile from, Item item )
{
if ( CheckFeed( from, item ) )
return true;
if ( PackAnimal.CheckAccess( this, from ) )
{
AddToBackpack( item );
return true;
}
return base.OnDragDrop( from, item );
}
public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
{
return PackAnimal.CheckAccess( this, from );
}
public override bool CheckNonlocalLift( Mobile from, Item item )
{
return PackAnimal.CheckAccess( this, from );
}
public override void OnDoubleClick( Mobile from )
{
PackAnimal.TryPackOpen( this, from );
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries( from, list );
PackAnimal.GetContextMenuEntries( this, from, list );
}
#endregion
public SkitteringHopperFamiliar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,82 @@
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
[CorpseName( "a dark wolf corpse" )]
public class EagleFamiliar : BaseFamiliar
{
public EagleFamiliar()
{
Name = "a spirit eagle";
Name = "an eagle";
Body = 5;
BaseSoundID = 0x2EE;
Hue = 2213;
SetStr( 100 );
SetDex( 90 );
SetInt( 90 );
SetHits( 60 );
SetStam( 90 );
SetMana( 0 );
SetDamage( 5, 10 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 40, 50 );
SetResistance( ResistanceType.Fire, 25, 40 );
SetResistance( ResistanceType.Cold, 25, 40 );
SetResistance( ResistanceType.Poison, 25, 40 );
SetResistance( ResistanceType.Energy, 25, 40 );
SetSkill( SkillName.Wrestling, 85.1, 90.0 );
SetSkill( SkillName.Tactics, 50.0 );
ControlSlots = 1;
}
private DateTime m_NextRestore;
public override void OnThink()
{
base.OnThink();
if ( DateTime.Now < m_NextRestore )
return;
m_NextRestore = DateTime.Now + TimeSpan.FromSeconds( 2.0 );
Mobile caster = ControlMaster;
if ( caster == null )
caster = SummonMaster;
if ( caster != null )
++caster.Stam;
}
public EagleFamiliar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,57 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
[CorpseName( "a treefellow corpse" )]
public class SummonedTreefellow : BaseCreature
{
[Constructable]
public SummonedTreefellow() : base( AIType.AI_Melee, FightMode.Evil, 10, 1, 0.2, 0.4 )
{
Name = "a treefellow";
Body = 301;
BaseSoundID = 442;
SetStr( 196, 220 );
SetDex( 31, 55 );
SetInt( 66, 90 );
SetHits( 118, 132 );
SetDamage( 12, 16 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 20, 25 );
SetResistance( ResistanceType.Cold, 50, 60 );
SetResistance( ResistanceType.Poison, 30, 35 );
SetResistance( ResistanceType.Energy, 20, 30 );
SetSkill( SkillName.MagicResist, 65.0 );
SetSkill( SkillName.Tactics, 100.0 );
SetSkill( SkillName.Wrestling, 90.0 );
VirtualArmor = 34;
ControlSlots = 2;
}
public SummonedTreefellow( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,55 @@
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
public class LureStone : Item
{
private Mobile m_Owner;
[Constructable]
public LureStone(Mobile owner): base (0x1355)
{
m_Owner=owner;
Movable = false;
Name="Lure Stone";
}
public LureStone( Serial serial ) : base( serial )
{
}
public override bool HandlesOnMovement{ get{ return true;} }
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
Delete();
}
public override void OnMovement(Mobile m, Point3D oldLocation )
{
if(m_Owner!=null)
{
if ( m.InRange( this, 600 ) )
{
BaseCreature cret = m as BaseCreature;
if(cret!=null)
if(cret.Tamable&&(cret.Combatant==null||!cret.Combatant.Alive||cret.Combatant.Deleted))
{
double tamer = m_Owner.Skills[SkillName.AnimalLore].Value;
double bonus = m_Owner.Skills[SkillName.AnimalTaming].Value/100;
if(cret.MinTameSkill<=(tamer+bonus)+0.1)
cret.TargetLocation = new Point2D( this.X,this.Y );
}
}
}
}
}
}

View File

@@ -0,0 +1,48 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
public class MushroomCircle : Item
{
private Timer m_Timer;
[Constructable]
public MushroomCircle ()
{
}
public MushroomCircle( 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 OnAfterDelete()
{
if ( m_Timer != null )
m_Timer.Stop();
m_Timer = null;
base.OnAfterDelete();
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
Delete();
}
}
}

View File

@@ -0,0 +1,57 @@
using System;
using Server.Items;
using Server.Mobiles;
using Server.Misc;
namespace Server.ACC.CSS.Systems.Druid
{
[DispellableField]
public class MushroomGateCircle : Moongate
{
private int m_ItemID;
public MushroomGateCircle (Point3D target, Map map, int item)
{
m_ItemID=item;
if ( ShowFeluccaWarning && map == Map.Felucca )
{
Hue = 1175;
ItemID=m_ItemID;
}
InternalTimer t = new InternalTimer( this );
t.Start();
}
public MushroomGateCircle( 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();
}
}
}
}

View File

@@ -0,0 +1,164 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Druid
{
public class SacredStone : Item
{
private Mobile m_Owner;
private bool m_campSecure = false;
private Timer m_campSecureTimer;
private Timer m_Timer;
public override bool HandlesOnMovement{ get{ return true; } }
public static int CampingRange{ get{ return 5; } }
[Constructable]
public SacredStone( Mobile owner ) : base ( 0x8E3 )
{
Movable = false;
Name="Sacred Stone";
m_Owner = owner;
m_Timer = new DecayTimer( this );
m_Timer.Start();
m_campSecureTimer = new SecureTimer( m_Owner, this );
m_campSecureTimer.Start();
}
public SacredStone( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_Owner );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch( version )
{
case 0:
{
m_Owner = reader.ReadMobile();
m_Timer = new DecayTimer( this );
m_Timer.Start();
m_campSecureTimer = new SecureTimer( m_Owner, this );
m_campSecureTimer.Start();
break;
}
}
}
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if( ( m is PlayerMobile ) && ( m == m_Owner ) )
{
bool inOldRange = Utility.InRange( oldLocation, Location, CampingRange );
bool inNewRange = Utility.InRange( m.Location, Location, CampingRange );
if ( inNewRange && !inOldRange )
OnEnter( m );
else if ( inOldRange && !inNewRange )
OnExit( m );
}
}
public virtual void OnEnter( Mobile m )
{
StartSecureTimer();
}
public virtual void OnExit( Mobile m )
{
StopSecureTimer();
m.SendMessage( "You have left the grove." );
}
public override void OnAfterDelete()
{
if( m_Timer != null )
m_Timer.Stop();
}
private class DecayTimer : Timer
{
private SacredStone m_Owner;
public DecayTimer( SacredStone owner ) : base( TimeSpan.FromMinutes( 2.0 ) )
{
Priority = TimerPriority.FiveSeconds;
m_Owner = owner;
}
protected override void OnTick()
{
m_Owner.Delete();
}
}
[CommandProperty( AccessLevel.GameMaster )]
public bool CampSecure
{
get { return m_campSecure; }
set { m_campSecure = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public Mobile Camper{ get { return m_Owner; } }
public void StartSecureTimer()
{
Camper.SendMessage( "You start to feel secure" ); // You feel it would take a few moments to secure your camp.
if( m_campSecureTimer.Running == false )
{
m_campSecure = false;
m_campSecureTimer.Start();
}
}
public void StopSecureTimer()
{
m_campSecure = false;
m_campSecureTimer.Stop();
}
public override void OnDelete()
{
base.OnDelete();
if( m_campSecureTimer != null )
StopSecureTimer();
}
private class SecureTimer : Timer
{
private Mobile m_Owner;
private SacredStone m_SacredStone;
public SecureTimer( Mobile owner , SacredStone SacredStone ) : base( TimeSpan.FromSeconds( 30.0 ) )
{
Priority = TimerPriority.FiveSeconds;
m_SacredStone = SacredStone;
m_Owner = owner;
}
protected override void OnTick()
{
m_SacredStone.CampSecure = true;
m_Owner.SendMessage( "The power of the grove washes over you." );
}
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidBlendWithForestScroll : CSpellScroll
{
[Constructable]
public DruidBlendWithForestScroll() : this( 1 )
{
}
[Constructable]
public DruidBlendWithForestScroll( int amount ) : base( typeof( DruidBlendWithForestSpell ), 0xE39, amount )
{
Name = "Blend With Forest";
Hue = 0x58B;
}
public DruidBlendWithForestScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidFamiliarScroll : CSpellScroll
{
[Constructable]
public DruidFamiliarScroll() : this( 1 )
{
}
[Constructable]
public DruidFamiliarScroll( int amount ) : base( typeof( DruidFamiliarSpell ), 0xE39, amount )
{
Name = "Druid Familiar";
Hue = 0x58B;
}
public DruidFamiliarScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidEnchantedGroveScroll : CSpellScroll
{
[Constructable]
public DruidEnchantedGroveScroll() : this( 1 )
{
}
[Constructable]
public DruidEnchantedGroveScroll( int amount ) : base( typeof( DruidEnchantedGroveSpell ), 0xE39, amount )
{
Name = "Enchanted Grove";
Hue = 0x58B;
}
public DruidEnchantedGroveScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidGraspingRootsScroll : CSpellScroll
{
[Constructable]
public DruidGraspingRootsScroll() : this( 1 )
{
}
[Constructable]
public DruidGraspingRootsScroll( int amount ) : base( typeof( DruidGraspingRootsSpell ), 0xE39, amount )
{
Name = "Grasping Roots";
Hue = 0x58B;
}
public DruidGraspingRootsScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidHollowReedScroll : CSpellScroll
{
[Constructable]
public DruidHollowReedScroll() : this( 1 )
{
}
[Constructable]
public DruidHollowReedScroll( int amount ) : base( typeof( DruidHollowReedSpell ), 0xE39, amount )
{
Name = "Hollow Reed";
Hue = 0x58B;
}
public DruidHollowReedScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidLeafWhirlwindScroll : CSpellScroll
{
[Constructable]
public DruidLeafWhirlwindScroll() : this( 1 )
{
}
[Constructable]
public DruidLeafWhirlwindScroll( int amount ) : base( typeof( DruidLeafWhirlwindSpell ), 0xE39 )
{
Name = "Leaf Whirlwind";
Hue = 0x58B;
}
public DruidLeafWhirlwindScroll( Serial serial ) : base( serial )
{
ItemID=0xE39;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidLureStoneScroll : CSpellScroll
{
[Constructable]
public DruidLureStoneScroll() : this( 1 )
{
}
[Constructable]
public DruidLureStoneScroll( int amount ) : base( typeof( DruidLureStoneSpell ), 0xE39, amount )
{
Name = "Lure Stone";
Hue = 0x58B;
}
public DruidLureStoneScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidMushroomGatewayScroll : CSpellScroll
{
[Constructable]
public DruidMushroomGatewayScroll() : this( 1 )
{
}
[Constructable]
public DruidMushroomGatewayScroll( int amount ) : base( typeof( DruidMushroomGatewaySpell ), 0xE39, amount )
{
Name = "Mushroom Gateway";
Hue = 0x58B;
}
public DruidMushroomGatewayScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidNaturesPassageScroll : CSpellScroll
{
[Constructable]
public DruidNaturesPassageScroll() : this( 1 )
{
}
[Constructable]
public DruidNaturesPassageScroll( int amount ) : base( typeof( DruidNaturesPassageSpell ), 0xE39, amount )
{
Name = "Nature's Passage";
Hue = 0x58B;
}
public DruidNaturesPassageScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidPackOfBeastScroll : CSpellScroll
{
[Constructable]
public DruidPackOfBeastScroll() : this( 1 )
{
}
[Constructable]
public DruidPackOfBeastScroll( int amount ) : base( typeof( DruidPackOfBeastSpell ), 0xE39, amount )
{
Name = "Pack Of Beast";
Hue = 0x58B;
}
public DruidPackOfBeastScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidRestorativeSoilScroll : CSpellScroll
{
[Constructable]
public DruidRestorativeSoilScroll() : this( 1 )
{
}
[Constructable]
public DruidRestorativeSoilScroll( int amount ) : base( typeof( DruidRestorativeSoilSpell ), 0xE39, amount )
{
Name = "Restorative Soil";
Hue = 0x58B;
}
public DruidRestorativeSoilScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidShieldOfEarthScroll : CSpellScroll
{
[Constructable]
public DruidShieldOfEarthScroll() : this( 1 )
{
}
[Constructable]
public DruidShieldOfEarthScroll( int amount ) : base( typeof( DruidShieldOfEarthSpell ), 0xE39, amount )
{
Name = "Shield Of Earth";
Hue = 0x58B;
}
public DruidShieldOfEarthScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,38 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidSpringOfLifeScroll : CSpellScroll
{
[Constructable]
public DruidSpringOfLifeScroll() : this( 1 )
{
}
[Constructable]
public DruidSpringOfLifeScroll( int amount ) : base( typeof( DruidSpringOfLifeSpell ), 0xE39, amount )
{
Name = "Spring Of Life";
Hue = 0x58B;
}
public DruidSpringOfLifeScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidStoneCircleScroll : CSpellScroll
{
[Constructable]
public DruidStoneCircleScroll() : this( 1 )
{
}
[Constructable]
public DruidStoneCircleScroll( int amount ) : base( typeof( DruidStoneCircleSpell ), 0xE39, amount )
{
Name = "Stone Circle";
Hue = 0x58B;
}
public DruidStoneCircleScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidSwarmOfInsectsScroll : CSpellScroll
{
[Constructable]
public DruidSwarmOfInsectsScroll() : this( 1 )
{
}
[Constructable]
public DruidSwarmOfInsectsScroll( int amount ) : base( typeof( DruidSwarmOfInsectsSpell ), 0xE39 )
{
Name = "Swarm Of Insects";
Hue = 0x58B;
}
public DruidSwarmOfInsectsScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidVolcanicEruptionScroll : CSpellScroll
{
[Constructable]
public DruidVolcanicEruptionScroll() : this( 1 )
{
}
[Constructable]
public DruidVolcanicEruptionScroll( int amount ) : base( typeof( DruidVolcanicEruptionSpell ), 0xE39, amount )
{
Name = "Volcanic Eruption";
Hue = 0x58B;
}
public DruidVolcanicEruptionScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

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();
}
}
}
}