From e319713571f3176aa23de8d3c3987fe2c072864e Mon Sep 17 00:00:00 2001 From: Mark Sturgill Date: Tue, 5 Nov 2013 12:15:29 -0700 Subject: [PATCH] gargoyle flyspell --- Scripts/Scripts.csproj | 1 + Scripts/Spells/FlySpell.cs | 101 +++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Scripts/Spells/FlySpell.cs diff --git a/Scripts/Scripts.csproj b/Scripts/Scripts.csproj index c2733ea5e..7ade42180 100644 --- a/Scripts/Scripts.csproj +++ b/Scripts/Scripts.csproj @@ -3157,6 +3157,7 @@ + diff --git a/Scripts/Spells/FlySpell.cs b/Scripts/Spells/FlySpell.cs new file mode 100644 index 000000000..f0ef5e3ea --- /dev/null +++ b/Scripts/Spells/FlySpell.cs @@ -0,0 +1,101 @@ +using System; + +namespace Server.Spells +{ + public class FlySpell : Spell + { + private static readonly SpellInfo m_Info = new SpellInfo("Gargoyle Flight", null, -1, 9002); + private bool m_Stop; + public FlySpell(Mobile caster) + : base(caster, null, m_Info) + { + } + + public override bool ClearHandsOnCast + { + get + { + return false; + } + } + public override bool RevealOnCast + { + get + { + return false; + } + } + public override double CastDelayFastScalar + { + get + { + return 0; + } + } + public override TimeSpan CastDelayBase + { + get + { + return TimeSpan.FromSeconds(.25); + } + } + public override TimeSpan GetCastRecovery() + { + return TimeSpan.Zero; + } + + public override int GetMana() + { + return 0; + } + + public override bool ConsumeReagents() + { + return true; + } + + public override bool CheckFizzle() + { + return true; + } + + public void Stop() + { + this.m_Stop = true; + this.Disturb(DisturbType.Hurt, false, false); + } + + public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable) + { + if (type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/) + return false; + + return true; + } + + public override void DoHurtFizzle() + { + } + + public override void DoFizzle() + { + } + + public override void OnDisturb(DisturbType type, bool message) + { + if (message && !this.m_Stop) + this.Caster.SendLocalizedMessage(1113192); // You have been disrupted while attempting to fly! + } + + public override void OnCast() + { + this.Caster.Flying = false; + BuffInfo.RemoveBuff(this.Caster, BuffIcon.Fly); + this.Caster.Animate(60, 10, 1, true, false, 0); + this.Caster.SendLocalizedMessage(1112567); // You are flying. + this.Caster.Flying = true; + BuffInfo.AddBuff(this.Caster, new BuffInfo(BuffIcon.Fly, 1112567)); + this.FinishSequence(); + } + } +} \ No newline at end of file