From fa1df8eae5f1977430b0af4bf80db5ffb35ca719 Mon Sep 17 00:00:00 2001 From: Mark Sturgill Date: Sat, 2 Nov 2013 16:21:12 -0700 Subject: [PATCH] more gargoyle additions from servuo --- Scripts/Misc/BuffIcons.cs | 11 +- Scripts/Mobiles/PlayerMobile.cs | 80 +++++++++++++- .../Gargoyle/SpellDefinitions/FlySpell.cs | 101 ++++++++++++++++++ 3 files changed, 188 insertions(+), 4 deletions(-) create mode 100644 Scripts/Spells/Gargoyle/SpellDefinitions/FlySpell.cs diff --git a/Scripts/Misc/BuffIcons.cs b/Scripts/Misc/BuffIcons.cs index df103dd3b..6da805726 100644 --- a/Scripts/Misc/BuffIcons.cs +++ b/Scripts/Misc/BuffIcons.cs @@ -222,7 +222,13 @@ namespace Server Agility, //* Cunning, //* Strength, //* - Bless //* + Bless, //* + Sleep, + StoneForm, + SpellPlague, + SpellTrigger, + NetherBolt, + Fly } public sealed class AddBuffPacket : Packet @@ -231,6 +237,7 @@ namespace Server : this( m, info.ID, info.TitleCliloc, info.SecondaryCliloc, info.Args, (info.TimeStart != DateTime.MinValue) ? ((info.TimeStart + info.TimeLength) - DateTime.UtcNow) : TimeSpan.Zero ) { } + public AddBuffPacket( Mobile mob, BuffIcon iconID, int titleCliloc, int secondaryCliloc, TextDefinition args, TimeSpan length ) : base( 0xDF ) { @@ -292,12 +299,10 @@ namespace Server this.EnsureCapacity( 13 ); m_Stream.Write( (int)mob.Serial ); - m_Stream.Write( (short)iconID ); //ID m_Stream.Write( (short)0x0 ); //Type 0 for removal. 1 for add 2 for Data m_Stream.Fill( 4 ); } } - } diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 91df97c9b..77d77c2e4 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -86,6 +86,76 @@ namespace Server.Mobiles public partial class PlayerMobile : Mobile, IHonorTarget { + #region Stygian Abyss + public override void ToggleFlying() + { + if (Race != Race.Gargoyle) + { + return; + } + else if (Flying) + { + Freeze(TimeSpan.FromSeconds(1)); + Animate(61, 10, 1, true, false, 0); + Flying = false; + BuffInfo.RemoveBuff(this, BuffIcon.Fly); + SendMessage("You have landed."); + + BaseMount.Dismount(this); + return; + } + + BlockMountType type = MountBlockReason; + + if (!Alive) + { + SendLocalizedMessage(1113082); // You may not fly while dead. + } + else if (IsBodyMod && !(BodyMod == 666 || BodyMod == 667)) + { + SendLocalizedMessage(1112453); // You can't fly in your current form! + } + else if (type != BlockMountType.None) + { + switch (type) + { + case BlockMountType.Dazed: + SendLocalizedMessage(1112457); + break; // You are still too dazed to fly. + case BlockMountType.BolaRecovery: + SendLocalizedMessage(1112455); + break; // You cannot fly while recovering from a bola throw. + case BlockMountType.DismountRecovery: + SendLocalizedMessage(1112456); + break; // You cannot fly while recovering from a dismount maneuver. + } + return; + } + else if (Hits < 25) // TODO confirm + { + SendLocalizedMessage(1112454); // You must heal before flying. + } + else + { + if (!Flying) + { + // No message? + if (Spell is FlySpell) + { + FlySpell spell = (FlySpell)Spell; + spell.Stop(); + } + new FlySpell(this).Cast(); + } + else + { + Flying = false; + BuffInfo.RemoveBuff(this, BuffIcon.Fly); + } + } + } + #endregion + private class CountAndTimeStamp { private int m_Count; @@ -123,7 +193,7 @@ namespace Server.Mobiles private int m_ExecutesLightningStrike; // move to Server.Mobiles?? private DateTime m_LastOnline; - private Server.Guilds.RankDefinition m_GuildRank; + private Guilds.RankDefinition m_GuildRank; private int m_GuildMessageHue, m_AllianceMessageHue; @@ -2757,6 +2827,14 @@ namespace Server.Mobiles MeerMage.StopEffect( this, false ); + #region Stygian Abyss + if (Flying) + { + Flying = false; + BuffInfo.RemoveBuff(this, BuffIcon.Fly); + } + #endregion + SkillHandlers.StolenItem.ReturnOnDeath( this, c ); if ( m_PermaFlags.Count > 0 ) diff --git a/Scripts/Spells/Gargoyle/SpellDefinitions/FlySpell.cs b/Scripts/Spells/Gargoyle/SpellDefinitions/FlySpell.cs new file mode 100644 index 000000000..f0ef5e3ea --- /dev/null +++ b/Scripts/Spells/Gargoyle/SpellDefinitions/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