Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
                    }
            }
        }