public void CastCustomFaithSpell(Mobile m, CustomFaithSpell spell) { if (m is PlayerMobile) { if (!(m as PlayerMobile).CanBeFaithful) return; } else return; CustomFaithSpell prayer = CustomFaithSpell.DupeCustomFaithSpell(spell); prayer.Caster = m; BaseCustomSpell.SpellInitiator(prayer); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { m_Prayer = new CustomFaithSpell(); CustomFaithSpell.Deserialize(reader, m_Prayer); break; } } }
public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.Write((int)0); //version if (m_Prayer == null) m_Prayer = new CustomFaithSpell(); CustomFaithSpell.Serialize(writer, m_Prayer); }
public PrayerTarget(PlayerMobile pm, CustomFaithSpell prayer) : base(prayer.Range, true, TargetFlags.None) { m_Prayer = prayer; }
public static void Serialize(GenericWriter writer, CustomFaithSpell spell) { writer.Write((int)0); // version writer.Write((string)spell.Name); writer.Write((int)spell.Effect); writer.Write((int)spell.Intensity); writer.Write((int)spell.Duration); writer.Write((int)spell.Range); writer.Write((int)spell.Area); writer.Write((int)spell.Repetitions); writer.Write((int)spell.RepetitionDelay); if (spell.Component == null) writer.Write((bool)false); else { writer.Write((bool)true); writer.Write((string)spell.Component.GetType().ToString()); } writer.Write((string)spell.Emote); writer.Write((string)spell.Speech); writer.Write((string)spell.Message); writer.Write((int)spell.SoundID); }
public static CustomFaithSpell DupeCustomFaithSpell(CustomFaithSpell spell) { CustomFaithSpell prayer = new CustomFaithSpell(); prayer.SetName(spell.Name); prayer.Effect = spell.Effect; prayer.Intensity = spell.Intensity; prayer.Duration = spell.Duration; prayer.Range = spell.Range; prayer.Area = spell.Area; prayer.Repetitions = spell.Repetitions; prayer.RepetitionDelay = spell.RepetitionDelay; prayer.Component = spell.Component; prayer.Emote = spell.Emote; prayer.Speech = spell.Speech; prayer.Message = spell.Message; prayer.SoundID = spell.SoundID; return prayer; }
public static void Deserialize(GenericReader reader, CustomFaithSpell spell) { int version = reader.ReadInt(); switch (version) { case 0: { spell.SetName(reader.ReadString()); spell.Effect = (PrayerEffect)reader.ReadInt(); spell.Intensity = reader.ReadInt(); spell.Duration = reader.ReadInt(); spell.Range = reader.ReadInt(); spell.Area = reader.ReadInt(); spell.Repetitions = reader.ReadInt(); spell.RepetitionDelay = reader.ReadInt(); bool hasComponent = reader.ReadBool(); if (hasComponent) spell.Component = ScriptCompiler.FindTypeByName(reader.ReadString()); else spell.Component = null; spell.Emote = reader.ReadString(); spell.Speech = reader.ReadString(); spell.Message = reader.ReadString(); spell.SoundID = reader.ReadInt(); break; } } }
public RecurrentPrayerTimer(PlayerMobile from, Mobile to, CustomFaithSpell prayer) : base(TimeSpan.FromSeconds(prayer.RepetitionDelay), TimeSpan.FromSeconds(prayer.RepetitionDelay)) { m_Caster = from; m_Target = to; m_Prayer = prayer; }