Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
[CorpseName( "a corpse" )]
|
||||
public class CharmedMobile : BaseCreature
|
||||
{
|
||||
private BaseCreature m_Owner;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public BaseCreature Owner
|
||||
{
|
||||
get{ return m_Owner; }
|
||||
set{ m_Owner= value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CharmedMobile( BaseCreature owner ) : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
|
||||
{
|
||||
m_Owner = owner;
|
||||
Body = 777;
|
||||
Title = " The Mystic Lama Herder";
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public override bool ClickTitle{ get{ return false; } }
|
||||
|
||||
public CharmedMobile( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
list.Add( 1042971,this.Name );
|
||||
list.Add( 1049644,"charmed" );
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
if( m_Owner != null )
|
||||
{
|
||||
m_Owner.MoveToWorld( this.Location, this.Map );
|
||||
m_Owner.Blessed = false;
|
||||
m_Owner.RevealingAction();
|
||||
}
|
||||
|
||||
Delete();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if( m_Owner != null )
|
||||
{
|
||||
m_Owner.MoveToWorld( this.Location, this.Map );
|
||||
m_Owner.Blessed = false;
|
||||
m_Owner.RevealingAction();
|
||||
}
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
writer.Write( m_Owner);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
m_Owner = reader.ReadMobile() as BaseCreature;
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class FalseCoin : Item
|
||||
{
|
||||
|
||||
public int m_Amount;
|
||||
[Constructable]
|
||||
public FalseCoin( ) : base( 0xEEF )
|
||||
{
|
||||
Weight = 0.0;
|
||||
Name = ""+m_Amount+" Gold Coins";
|
||||
|
||||
}
|
||||
|
||||
public FalseCoin( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override int GetDropSound()
|
||||
{
|
||||
if ( m_Amount <= 1 )
|
||||
return 0x2E4;
|
||||
else if ( m_Amount <= 5 )
|
||||
return 0x2E5;
|
||||
else
|
||||
return 0x2E6;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
writer.Write(m_Amount);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
m_Amount=reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueBag : ScrollBag
|
||||
{
|
||||
[Constructable]
|
||||
public RogueBag()
|
||||
{
|
||||
Hue = 0x20;
|
||||
PlaceItemIn( 30, 35, new RogueCharmScroll() );
|
||||
PlaceItemIn( 50, 35, new RogueFalseCoinScroll() );
|
||||
PlaceItemIn( 70, 35, new RogueIntimidationScroll() );
|
||||
PlaceItemIn( 90, 35, new RogueShadowScroll() );
|
||||
PlaceItemIn( 30, 55, new RogueSlyFoxScroll() );
|
||||
}
|
||||
|
||||
public RogueBag( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueList : BaseInitializer
|
||||
{
|
||||
public static void Configure()
|
||||
{
|
||||
Register( typeof( RogueFalseCoinSpell ), "False Coin", "The Rogue produces false gold with the trick of the hand.", "Sulfurous Ash; Nightshade", null, 20481, 5100, School.Rogue );
|
||||
Register( typeof( RogueCharmSpell ), "Charm", "The Rogue mesmerize's a target with his evil eyes.", "Black Pearl; Nightshade; Spider's Silk", null, 21282, 5100, School.Rogue );
|
||||
Register( typeof( RogueSlyFoxSpell ), "Sly Fox", "The Rogue changes shape into a stealthly Sly Fox.", "Petrafied Wood; Nox Crystal; Nightshade", null, 20491, 5100, School.Rogue );
|
||||
Register( typeof( RogueShadowSpell ), "Shadow", "The Rogue slips into the shadows.", "Spider's Silk; Daemon Blood; Black Pearl", null, 21003, 5100, School.Rogue );
|
||||
Register( typeof( RogueIntimidationSpell ), "Intimidation", "The Rogue begins to look angry and mean at the loss of his skills.", null, null, 20485, 5100, School.Rogue );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public abstract class RogueSpell : CSpell
|
||||
{
|
||||
public RogueSpell(Mobile caster, Item scroll, SpellInfo info)
|
||||
: base(caster, scroll, info)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract SpellCircle Circle { get; }
|
||||
|
||||
public override SkillName CastSkill { get { return SkillName.Stealing; } }
|
||||
public override SkillName DamageSkill { get { return SkillName.Hiding; } }
|
||||
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(3 * CastDelaySecondsPerTick); } }
|
||||
public override bool ClearHandsOnCast { get { return false; } }
|
||||
|
||||
public override void GetCastSkills(out double min, out double max)
|
||||
{
|
||||
min = RequiredSkill;
|
||||
max = RequiredSkill;
|
||||
}
|
||||
|
||||
public override int GetMana()
|
||||
{
|
||||
return RequiredMana;
|
||||
}
|
||||
|
||||
public override bool ConsumeReagents()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override TimeSpan GetCastDelay()
|
||||
{
|
||||
return TimeSpan.FromSeconds(CastDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueSpellbook : CSpellbook
|
||||
{
|
||||
public override School School{ get{ return School.Rogue; } }
|
||||
|
||||
[Constructable]
|
||||
public RogueSpellbook() : this( (ulong)0, CSSettings.FullSpellbooks )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RogueSpellbook( bool full ) : this( (ulong)0, full )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RogueSpellbook( ulong content, bool full ) : base( content, 0xEFA, full )
|
||||
{
|
||||
Hue = 0x20;
|
||||
Name = "Rogue Abilities";
|
||||
}
|
||||
|
||||
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( RogueSpellbookGump ) );
|
||||
from.SendGump( new RogueSpellbookGump( this ) );
|
||||
}
|
||||
|
||||
public RogueSpellbook( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueSpellbookGump : CSpellbookGump
|
||||
{
|
||||
public override string TextHue { get{ return "660066"; } }
|
||||
public override int BGImage { get{ return 2203; } }
|
||||
public override int SpellBtn { get{ return 2362; } }
|
||||
public override int SpellBtnP{ get{ return 2361; } }
|
||||
public override string Label1 { get{ return "Rogue"; } }
|
||||
public override string Label2 { get{ return "Abilities"; } }
|
||||
public override Type GumpType { get{ return typeof( RogueSpellbookGump ); } }
|
||||
|
||||
public RogueSpellbookGump( CSpellbook book ) : base( book )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueCharmScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public RogueCharmScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RogueCharmScroll( int amount ) : base( typeof( RogueCharmSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "Charm";
|
||||
Hue = 0x20;
|
||||
}
|
||||
|
||||
public RogueCharmScroll( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueFalseCoinScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public RogueFalseCoinScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RogueFalseCoinScroll( int amount ) : base( typeof( RogueFalseCoinSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "False Coin";
|
||||
Hue = 0x20;
|
||||
}
|
||||
|
||||
public RogueFalseCoinScroll( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueIntimidationScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public RogueIntimidationScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RogueIntimidationScroll( int amount ) : base( typeof( RogueIntimidationSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "Intimidation";
|
||||
Hue = 0x20;
|
||||
}
|
||||
|
||||
public RogueIntimidationScroll( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueShadowScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public RogueShadowScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RogueShadowScroll( int amount ) : base( typeof( RogueShadowSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "Shadow";
|
||||
Hue = 0x20;
|
||||
}
|
||||
|
||||
public RogueShadowScroll( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueSlyFoxScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public RogueSlyFoxScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RogueSlyFoxScroll( int amount ) : base( typeof( RogueSlyFoxSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "Sly Fox";
|
||||
Hue = 0x20;
|
||||
}
|
||||
|
||||
public RogueSlyFoxScroll( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,391 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueCharmSpell : RogueSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Charm", "Look into my eyes!",
|
||||
//SpellCircle.Fourth,
|
||||
218,
|
||||
9012,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fourth; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0; } }
|
||||
public override double RequiredSkill { get { return 0; } }
|
||||
public override int RequiredMana { get { return 0; } }
|
||||
|
||||
private Timer m_Timer;
|
||||
|
||||
public RogueCharmSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(Mobile ma)
|
||||
{
|
||||
BaseCreature m = ma as BaseCreature;
|
||||
if (ma is CharmedMobile)
|
||||
{
|
||||
ma.Kill();
|
||||
Caster.SendMessage("You free them from their charm!");
|
||||
}
|
||||
else if (m != null)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (m.Controlled || m.Summoned)
|
||||
{
|
||||
Caster.SendMessage("That target is already under somone's control!");
|
||||
}
|
||||
else if (!m.Alive)
|
||||
{
|
||||
Caster.SendMessage("The dead are beyond your charms.");
|
||||
}
|
||||
else if (!m.Tamable || m.Blessed)
|
||||
{
|
||||
|
||||
Caster.SendMessage("You have no chance of charming that!");
|
||||
|
||||
}
|
||||
else if (Caster.Followers >= 1)
|
||||
{
|
||||
Caster.SendMessage("You couldn't control that if you did charm it!");
|
||||
}
|
||||
else if (CheckHSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
|
||||
if (!m.Controlled && m != null && !m.Deleted)
|
||||
{
|
||||
double taming;
|
||||
if (m.MinTameSkill <= 1.0)
|
||||
taming = 1.0;
|
||||
else
|
||||
taming = m.MinTameSkill;
|
||||
|
||||
double charmchance = (Caster.Skills[SkillName.Stealing].Value / taming);
|
||||
if (charmchance <= 0.5)
|
||||
{
|
||||
Caster.SendMessage("You have no chance of charming them.");
|
||||
}
|
||||
else if (charmchance >= 0.9)
|
||||
{
|
||||
Caster.SendMessage("You charm them!");
|
||||
Point3D mloc = new Point3D(m.X, m.Y, m.Z);
|
||||
CharmedMobile dg = new CharmedMobile(m);
|
||||
dg.Owner = m;
|
||||
|
||||
dg.Body = m.Body;
|
||||
dg.AI = m.AI;
|
||||
dg.Hue = m.Hue;
|
||||
dg.Name = m.Name;
|
||||
dg.SpeechHue = m.SpeechHue;
|
||||
dg.Fame = m.Fame;
|
||||
dg.Karma = m.Karma;
|
||||
dg.EmoteHue = m.EmoteHue;
|
||||
dg.Title = m.Title;
|
||||
dg.Criminal = (m.Criminal);
|
||||
dg.Str = m.Str;
|
||||
dg.Int = m.Int;
|
||||
dg.Hits = m.Hits;
|
||||
dg.Dex = m.Dex;
|
||||
dg.Mana = m.Mana;
|
||||
dg.Stam = m.Stam;
|
||||
|
||||
dg.VirtualArmor = (m.VirtualArmor);
|
||||
dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
|
||||
dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
|
||||
dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
|
||||
dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
|
||||
dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
|
||||
dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
|
||||
dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
|
||||
dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
|
||||
dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
|
||||
dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
|
||||
dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
|
||||
dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
|
||||
dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
|
||||
dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
|
||||
dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
|
||||
dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
|
||||
dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
|
||||
dg.Kills = (m.Kills);
|
||||
|
||||
|
||||
// Clear Items
|
||||
RemoveFromAllLayers(dg);
|
||||
|
||||
// Then copy
|
||||
CopyFromLayer(m, dg, Layer.FirstValid);
|
||||
CopyFromLayer(m, dg, Layer.TwoHanded);
|
||||
CopyFromLayer(m, dg, Layer.Shoes);
|
||||
CopyFromLayer(m, dg, Layer.Pants);
|
||||
CopyFromLayer(m, dg, Layer.Shirt);
|
||||
CopyFromLayer(m, dg, Layer.Helm);
|
||||
CopyFromLayer(m, dg, Layer.Gloves);
|
||||
CopyFromLayer(m, dg, Layer.Ring);
|
||||
CopyFromLayer(m, dg, Layer.Neck);
|
||||
CopyFromLayer(m, dg, Layer.Hair);
|
||||
CopyFromLayer(m, dg, Layer.Waist);
|
||||
CopyFromLayer(m, dg, Layer.InnerTorso);
|
||||
CopyFromLayer(m, dg, Layer.Bracelet);
|
||||
//CopyFromLayer(m, dg, Layer.Unused_xF);
|
||||
CopyFromLayer(m, dg, Layer.FacialHair);
|
||||
CopyFromLayer(m, dg, Layer.MiddleTorso);
|
||||
CopyFromLayer(m, dg, Layer.Earrings);
|
||||
CopyFromLayer(m, dg, Layer.Arms);
|
||||
CopyFromLayer(m, dg, Layer.Cloak);
|
||||
CopyFromLayer(m, dg, Layer.OuterTorso);
|
||||
CopyFromLayer(m, dg, Layer.OuterLegs);
|
||||
CopyFromLayer(m, dg, Layer.LastUserValid);
|
||||
CopyFromLayer(m, dg, Layer.Mount);
|
||||
dg.ControlSlots = 5;
|
||||
dg.Controlled = true;
|
||||
dg.ControlMaster = Caster;
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Stealing].Value * 1.2); // 120% of Stealing
|
||||
m_Timer = new InternalTimer(dg, duration);
|
||||
m_Timer.Start();
|
||||
dg.Map = m.Map;
|
||||
dg.Location = m.Location;
|
||||
m.Blessed = true;
|
||||
m.Hidden = true;
|
||||
|
||||
m.Location = new Point3D(m.X, m.Y, m.Z - 95);
|
||||
}
|
||||
else if (charmchance >= Utility.RandomDouble())
|
||||
{
|
||||
Caster.SendMessage("You charm them!");
|
||||
CharmedMobile dg = new CharmedMobile(m);
|
||||
dg.Owner = m;
|
||||
|
||||
dg.Body = m.Body;
|
||||
|
||||
dg.Hue = m.Hue;
|
||||
dg.Name = m.Name;
|
||||
dg.SpeechHue = m.SpeechHue;
|
||||
dg.Fame = m.Fame;
|
||||
dg.Karma = m.Karma;
|
||||
dg.EmoteHue = m.EmoteHue;
|
||||
dg.Title = m.Title;
|
||||
dg.Criminal = (m.Criminal);
|
||||
dg.Str = m.Str;
|
||||
dg.Int = m.Int;
|
||||
dg.Hits = m.Hits;
|
||||
dg.Dex = m.Dex;
|
||||
dg.Mana = m.Mana;
|
||||
dg.Stam = m.Stam;
|
||||
dg.AI = m.AI;
|
||||
|
||||
dg.VirtualArmor = (m.VirtualArmor);
|
||||
dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
|
||||
dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
|
||||
dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
|
||||
dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
|
||||
dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
|
||||
dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
|
||||
dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
|
||||
dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
|
||||
dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
|
||||
dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
|
||||
dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
|
||||
dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
|
||||
dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
|
||||
dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
|
||||
dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
|
||||
dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
|
||||
dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
|
||||
dg.Kills = (m.Kills);
|
||||
|
||||
|
||||
// Clear Items
|
||||
RemoveFromAllLayers(dg);
|
||||
|
||||
// Then copy
|
||||
CopyFromLayer(m, dg, Layer.FirstValid);
|
||||
CopyFromLayer(m, dg, Layer.TwoHanded);
|
||||
CopyFromLayer(m, dg, Layer.Shoes);
|
||||
CopyFromLayer(m, dg, Layer.Pants);
|
||||
CopyFromLayer(m, dg, Layer.Shirt);
|
||||
CopyFromLayer(m, dg, Layer.Helm);
|
||||
CopyFromLayer(m, dg, Layer.Gloves);
|
||||
CopyFromLayer(m, dg, Layer.Ring);
|
||||
CopyFromLayer(m, dg, Layer.Neck);
|
||||
CopyFromLayer(m, dg, Layer.Hair);
|
||||
CopyFromLayer(m, dg, Layer.Waist);
|
||||
CopyFromLayer(m, dg, Layer.InnerTorso);
|
||||
CopyFromLayer(m, dg, Layer.Bracelet);
|
||||
//CopyFromLayer(m, dg, Layer.Unused_xF);
|
||||
CopyFromLayer(m, dg, Layer.FacialHair);
|
||||
CopyFromLayer(m, dg, Layer.MiddleTorso);
|
||||
CopyFromLayer(m, dg, Layer.Earrings);
|
||||
CopyFromLayer(m, dg, Layer.Arms);
|
||||
CopyFromLayer(m, dg, Layer.Cloak);
|
||||
CopyFromLayer(m, dg, Layer.OuterTorso);
|
||||
CopyFromLayer(m, dg, Layer.OuterLegs);
|
||||
CopyFromLayer(m, dg, Layer.LastUserValid);
|
||||
CopyFromLayer(m, dg, Layer.Mount);
|
||||
dg.ControlSlots = 5;
|
||||
dg.Controlled = true;
|
||||
dg.ControlMaster = Caster;
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Stealing].Value * 1.2); // 120% of Stealing
|
||||
m_Timer = new InternalTimer(dg, duration);
|
||||
dg.Map = m.Map;
|
||||
dg.Location = m.Location;
|
||||
m.Blessed = true;
|
||||
m.Hidden = true;
|
||||
m.Location = new Point3D(m.X, m.Y, m.Z - 95);
|
||||
}
|
||||
else
|
||||
Caster.SendMessage("You fail to charm them.");
|
||||
}
|
||||
}
|
||||
else
|
||||
Caster.SendMessage("You have no chance of charming them.");
|
||||
}
|
||||
FinishSequence();
|
||||
}
|
||||
private void CopyFromLayer(Mobile from, Mobile mimic, Layer layer)
|
||||
{
|
||||
Item newItem;
|
||||
Item oldItem = from.FindItemOnLayer(layer);
|
||||
if (oldItem != null)
|
||||
{
|
||||
Type t = oldItem.GetType();
|
||||
ConstructorInfo c = t.GetConstructor(Type.EmptyTypes);
|
||||
if (c != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
object o = c.Invoke(null);
|
||||
|
||||
if (o != null && o is Item)
|
||||
{
|
||||
newItem = (Item)o;
|
||||
Dupe.CopyProperties(newItem, oldItem);//copy.Dupe( item, copy.Amount );
|
||||
mimic.AddItem(newItem);
|
||||
newItem.LootType = LootType.Newbied;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.SendMessage("Error! Please check Charm.cs!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteFromLayer(Mobile from, Layer layer)
|
||||
{
|
||||
if (from.FindItemOnLayer(layer) != null)
|
||||
from.RemoveItem(from.FindItemOnLayer(layer));
|
||||
}
|
||||
private void RemoveFromAllLayers(Mobile from)
|
||||
{
|
||||
DeleteFromLayer(from, Layer.FirstValid);
|
||||
DeleteFromLayer(from, Layer.TwoHanded);
|
||||
DeleteFromLayer(from, Layer.Shoes);
|
||||
DeleteFromLayer(from, Layer.Pants);
|
||||
DeleteFromLayer(from, Layer.Shirt);
|
||||
DeleteFromLayer(from, Layer.Helm);
|
||||
DeleteFromLayer(from, Layer.Gloves);
|
||||
DeleteFromLayer(from, Layer.Ring);
|
||||
DeleteFromLayer(from, Layer.Neck);
|
||||
DeleteFromLayer(from, Layer.Hair);
|
||||
DeleteFromLayer(from, Layer.Waist);
|
||||
DeleteFromLayer(from, Layer.InnerTorso);
|
||||
DeleteFromLayer(from, Layer.Bracelet);
|
||||
//DeleteFromLayer(from, Layer.Unused_xF);
|
||||
DeleteFromLayer(from, Layer.FacialHair);
|
||||
DeleteFromLayer(from, Layer.MiddleTorso);
|
||||
DeleteFromLayer(from, Layer.Earrings);
|
||||
DeleteFromLayer(from, Layer.Arms);
|
||||
DeleteFromLayer(from, Layer.Cloak);
|
||||
DeleteFromLayer(from, Layer.OuterTorso);
|
||||
DeleteFromLayer(from, Layer.OuterLegs);
|
||||
DeleteFromLayer(from, Layer.LastUserValid);
|
||||
DeleteFromLayer(from, Layer.Mount);
|
||||
}
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private CharmedMobile m_Item;
|
||||
|
||||
public InternalTimer(CharmedMobile item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Item != null)
|
||||
m_Item.Delete();
|
||||
|
||||
}
|
||||
}
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private RogueCharmSpell m_Owner;
|
||||
|
||||
public InternalTarget(RogueCharmSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueFalseCoinSpell : RogueSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"False Coin", "Jingle Jingle",
|
||||
//SpellCircle.Fourth,
|
||||
218,
|
||||
9002,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fourth; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0; } }
|
||||
public override double RequiredSkill { get { return 0; } }
|
||||
public override int RequiredMana { get { return 0; } }
|
||||
|
||||
private FalseCoin m_Fake;
|
||||
|
||||
public RogueFalseCoinSpell(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(Gold gold)
|
||||
{
|
||||
if (!Caster.CanSee(gold))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
|
||||
else if (CheckSequence())
|
||||
{
|
||||
if (Caster.BeginAction(typeof(RogueFalseCoinSpell)))
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
FalseCoin fake = new FalseCoin();
|
||||
fake.m_Amount = gold.Amount * 5;
|
||||
fake.Name = "" + (gold.Amount * 5) + " Gold Coins";
|
||||
m_Fake = fake;
|
||||
Caster.AddToBackpack(fake);
|
||||
Caster.PlaySound(0x2E6);
|
||||
|
||||
IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
|
||||
IEntity to = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
|
||||
Effects.SendMovingParticles(from, to, 0x1EC6, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
|
||||
StopTimer(Caster);
|
||||
|
||||
Timer t = new InternalTimer(Caster, m_Fake);
|
||||
|
||||
m_Timers[Caster] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private RogueFalseCoinSpell m_Owner;
|
||||
|
||||
public InternalTarget(RogueFalseCoinSpell owner)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is Gold)
|
||||
{
|
||||
m_Owner.Target((Gold)o);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("That cannot be copied."); // I cannot mark that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
private static Hashtable m_Timers = new Hashtable();
|
||||
|
||||
public static bool StopTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove(m);
|
||||
}
|
||||
|
||||
return (t != null);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private FalseCoin m_Weapon;
|
||||
|
||||
|
||||
public InternalTimer(Mobile owner, FalseCoin weapon)
|
||||
: base(TimeSpan.FromSeconds(0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_Weapon = weapon;
|
||||
|
||||
|
||||
int val = (int)owner.Skills[SkillName.Magery].Value;
|
||||
|
||||
if (val > 100)
|
||||
val = 100;
|
||||
|
||||
Delay = TimeSpan.FromSeconds(val);
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (!m_Owner.CanBeginAction(typeof(RogueFalseCoinSpell)))
|
||||
{
|
||||
if (m_Weapon != null)
|
||||
{
|
||||
m_Weapon.Delete();
|
||||
m_Owner.SendMessage("The forged coins fade away!");
|
||||
}
|
||||
m_Owner.EndAction(typeof(RogueFalseCoinSpell));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Seventh;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueIntimidationSpell : RogueSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Intimidation", " ",
|
||||
//SpellCircle.Fourth,
|
||||
212,
|
||||
9041
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fourth; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0; } }
|
||||
public override double RequiredSkill { get { return 0; } }
|
||||
public override int RequiredMana { get { return 0; } }
|
||||
|
||||
private static Dictionary<Mobile, object[]> m_Table = new Dictionary<Mobile, object[]>();
|
||||
|
||||
public RogueIntimidationSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (!TransformationSpellHelper.CheckCast(Caster, this))
|
||||
return false;
|
||||
|
||||
return base.CheckCast();
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (Caster.CanBeginAction(typeof(RogueSlyFoxSpell)) && CheckSequence())
|
||||
{
|
||||
Caster.BeginAction(typeof(RogueIntimidationScroll));
|
||||
new InternalTimer(Caster, TimeSpan.FromMinutes(1)).Start();
|
||||
|
||||
object[] mods = new object[]
|
||||
{
|
||||
new StatMod( StatType.Dex, "RogueIntimidationSpellDexMod", -20, TimeSpan.Zero ),
|
||||
new StatMod( StatType.Str, "RogueIntimidationSpellStrMod", 20, TimeSpan.Zero ),
|
||||
new DefaultSkillMod( SkillName.Hiding, true, -20 ),
|
||||
new DefaultSkillMod( SkillName.Stealth, true, -20 ),
|
||||
new DefaultSkillMod( SkillName.Swords, true, 20 ),
|
||||
new DefaultSkillMod( SkillName.Macing, true, 20 ),
|
||||
new DefaultSkillMod( SkillName.Fencing, true, -20 )
|
||||
|
||||
};
|
||||
|
||||
m_Table[Caster] = mods;
|
||||
|
||||
Caster.AddStatMod((StatMod)mods[0]);
|
||||
Caster.AddStatMod((StatMod)mods[1]);
|
||||
Caster.AddSkillMod((SkillMod)mods[2]);
|
||||
Caster.AddSkillMod((SkillMod)mods[3]);
|
||||
Caster.AddSkillMod((SkillMod)mods[4]);
|
||||
Caster.AddSkillMod((SkillMod)mods[5]);
|
||||
Caster.AddSkillMod((SkillMod)mods[6]);
|
||||
}
|
||||
else
|
||||
Caster.SendMessage("You cannot intimidate someone in that state!");
|
||||
}
|
||||
public static void RemoveEffect(Mobile m)
|
||||
{
|
||||
if (m_Table.ContainsKey(m))
|
||||
{
|
||||
object[] mods = (object[])m_Table[m];
|
||||
|
||||
if (mods != null)
|
||||
{
|
||||
m.RemoveStatMod(((StatMod)mods[0]).Name);
|
||||
m.RemoveStatMod(((StatMod)mods[1]).Name);
|
||||
m.RemoveSkillMod((SkillMod)mods[2]);
|
||||
m.RemoveSkillMod((SkillMod)mods[3]);
|
||||
m.RemoveSkillMod((SkillMod)mods[4]);
|
||||
m.RemoveSkillMod((SkillMod)mods[5]);
|
||||
m.RemoveSkillMod((SkillMod)mods[6]);
|
||||
}
|
||||
|
||||
m_Table.Remove(m);
|
||||
|
||||
m.EndAction(typeof(RogueIntimidationSpell));
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private DateTime m_Expire;
|
||||
|
||||
public InternalTimer(Mobile owner, TimeSpan duration)
|
||||
: base(TimeSpan.Zero, TimeSpan.FromSeconds(1))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_Expire = DateTime.Now + duration;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (DateTime.Now >= m_Expire)
|
||||
{
|
||||
RogueIntimidationSpell.RemoveEffect(m_Owner);
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Seventh;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueShadowSpell : RogueSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Shadow", " ",
|
||||
//SpellCircle.Fourth,
|
||||
212,
|
||||
9041,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.DaemonBlood,
|
||||
Reagent.BlackPearl
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fourth; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0; } }
|
||||
public override double RequiredSkill { get { return 0; } }
|
||||
public override int RequiredMana { get { return 0; } }
|
||||
|
||||
private static Dictionary<Mobile, SkillMod> m_Table = new Dictionary<Mobile, SkillMod>();
|
||||
|
||||
public RogueShadowSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public static void Remove(Mobile m)
|
||||
{
|
||||
if (m_Table.ContainsKey(m))
|
||||
{
|
||||
m.RemoveSkillMod(m_Table[m]);
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
|
||||
m.EndAction(typeof(RogueShadowSpell));
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Hidden = true;
|
||||
if (Caster.CanBeginAction(typeof(RogueShadowSpell)))
|
||||
{
|
||||
Caster.BeginAction(typeof(RogueShadowSpell));
|
||||
DefaultSkillMod mod = new DefaultSkillMod(SkillName.Stealth, true, 50.0);
|
||||
m_Table.Add(Caster, mod);
|
||||
Caster.AddSkillMod(mod);
|
||||
|
||||
new InternalTimer(Caster, DateTime.Now.AddSeconds(15*(Caster.Skills[DamageSkill].Base / 10))).Start();
|
||||
}
|
||||
else
|
||||
Caster.SendMessage("You are already in the shadows!");
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private DateTime m_ExpiresAt;
|
||||
|
||||
public InternalTimer(Mobile owner, DateTime expiresAt)
|
||||
: base(TimeSpan.Zero, TimeSpan.FromSeconds(15))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_ExpiresAt = expiresAt;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (DateTime.Now >= m_ExpiresAt)
|
||||
{
|
||||
RogueShadowSpell.Remove(m_Owner);
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Seventh;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Rogue
|
||||
{
|
||||
public class RogueSlyFoxSpell : RogueSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Sly Fox", " ",
|
||||
//SpellCircle.Fourth,
|
||||
212,
|
||||
9041,
|
||||
CReagent.PetrafiedWood,
|
||||
Reagent.NoxCrystal,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fourth; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0; } }
|
||||
public override double RequiredSkill { get { return 0; } }
|
||||
public override int RequiredMana { get { return 0; } }
|
||||
|
||||
private static Dictionary<Mobile, object[]> m_Table = new Dictionary<Mobile, object[]>();
|
||||
|
||||
public RogueSlyFoxSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (!TransformationSpellHelper.CheckCast(Caster, this))
|
||||
return false;
|
||||
|
||||
return base.CheckCast();
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (Caster.CanBeginAction(typeof(RogueSlyFoxSpell)) && CheckSequence())
|
||||
{
|
||||
Caster.BeginAction(typeof(RogueSlyFoxSpell));
|
||||
new InternalTimer(Caster, TimeSpan.FromMinutes(1)).Start();
|
||||
|
||||
object[] mods = new object[]
|
||||
{
|
||||
new StatMod( StatType.Dex, "SlyFoxSpellStatMod", 20, TimeSpan.Zero ),
|
||||
new DefaultSkillMod( SkillName.Hiding, true, 20 ),
|
||||
new DefaultSkillMod( SkillName.Stealth, true, 20 )
|
||||
};
|
||||
|
||||
m_Table[Caster] = mods;
|
||||
|
||||
Caster.AddStatMod((StatMod)mods[0]);
|
||||
Caster.AddSkillMod((SkillMod)mods[1]);
|
||||
Caster.AddSkillMod((SkillMod)mods[2]);
|
||||
|
||||
|
||||
IMount mount = Caster.Mount;
|
||||
|
||||
if (mount != null)
|
||||
mount.Rider = null;
|
||||
|
||||
Caster.BodyMod = 225;
|
||||
Caster.PlaySound(0xE5);
|
||||
Caster.FixedParticles(0x3728, 1, 13, 0x480, 92, 3, EffectLayer.Head);
|
||||
}
|
||||
else
|
||||
Caster.SendMessage("You cannot become a sly fox in that state!");
|
||||
}
|
||||
|
||||
public static void RemoveEffect(Mobile m)
|
||||
{
|
||||
if (m_Table.ContainsKey(m))
|
||||
{
|
||||
object[] mods = m_Table[m];
|
||||
|
||||
if (mods != null)
|
||||
{
|
||||
m.RemoveStatMod(((StatMod)mods[0]).Name);
|
||||
m.RemoveSkillMod((SkillMod)mods[1]);
|
||||
m.RemoveSkillMod((SkillMod)mods[2]);
|
||||
}
|
||||
|
||||
m_Table.Remove(m);
|
||||
|
||||
m.BodyMod = 0;
|
||||
|
||||
m.EndAction(typeof(RogueSlyFoxSpell));
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private DateTime m_Expire;
|
||||
|
||||
public InternalTimer(Mobile owner, TimeSpan duration)
|
||||
: base(TimeSpan.Zero, TimeSpan.FromSeconds(1))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_Expire = DateTime.Now + duration;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (DateTime.Now >= m_Expire)
|
||||
{
|
||||
RogueSlyFoxSpell.RemoveEffect(m_Owner);
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user