I followed the posts on the forum where they talked about this problem, but not everything that I could not solve the problem I still have the buff icon and I don't reflect the damage to the opponent where and how can I modify the magicreflection.cs script? sorry for the google translation
 
Magic reflection doesn't work like that anymore its just raises resisantces. I do miss the old Magic reflect spell.
Post automatically merged:

/* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances.
* Physical decrease = 25 - (Inscription/20).
* Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription)
* The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
* Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
*/
 
Here is a copy of my spell that bounces back the spells...well...bounces back magery spells and not necromancy spells.

C#:
using System;
using System.Collections;
using Server;
using Server.Targeting;
using Server.Network;
using Server.Items;

namespace Server.Spells.Fifth
{
    public class MagicReflectSpell : MagerySpell
    {
        private static SpellInfo m_Info = new SpellInfo(
                "Magic Reflection", "In Jux Sanct",
                242,
                9012,
                Reagent.Garlic,
                Reagent.MandrakeRoot,
                Reagent.SpidersSilk
            );

        public override SpellCircle Circle { get { return SpellCircle.Fifth; } }

        public MagicReflectSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
        {
        }

        public override bool CheckCast()
        {
            if ( Caster.MagicDamageAbsorb > 0 )
            {
                Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
                return false;
            }
            else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
            {
                Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
                return false;
            }

            return true;
        }

        private static Hashtable m_Table = new Hashtable();

        public override void OnCast()
        {
            if ( Caster.MagicDamageAbsorb > 0 )
            {
                Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
            }
            else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
            {
                Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
            }
            else if ( Caster.Backpack.FindItemByType( typeof ( Diamond ) ) == null )
            {
                Caster.SendMessage( "You need a diamond to cast this spell!" );
            }
            else if ( CheckSequence() )
            {
                if ( Caster.BeginAction( typeof( DefensiveSpell ) ) )
                {
                    int value = (int)( ( Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.EvalInt].Value ) / 4 );
                    Caster.MagicDamageAbsorb = value;
                    Caster.PlaySound( 0x1ED );
                    Caster.FixedParticles( 0x375A, 10, 15, 5037, 0, 0, EffectLayer.Waist );
                }
                else
                {
                    Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
                }

                FinishSequence();
            }
        }
    }
}
 
Could it be by any chance that the way we are swapping memory references between the caster and the target using `out` is handled differently in different .net frameworkv versions ?
 
I am very interested. Can you explain the mods I have to do to files for using it?

Code:
Errors:
 + Spells/Mysticism/SpellDefinitions/PurgeMagicSpell.cs:
    CS0117: Line 93: 'MagicReflectSpell' does not contain a definition for 'EndReflect'
    CS0117: Line 172: 'MagicReflectSpell' does not contain a definition for 'HasReflect'
 + Items/Equipment/Talismans/BaseTalisman.cs:
    CS0117: Line 1656: 'MagicReflectSpell' does not contain a definition for 'EndReflect'
Scripts: One or more scripts failed to compile or no script files were found.
 
Back