D4rkh0bb1T

Member
I have an issue where all my custom OnCast spells retain me from using skill or entering gates.
As soon as the spell is casted, the only way to get rid of that is by double clicking an object.
Else it says "you must wait a few moment to use another skill"
By entering a gate it will say "You are too busy to do that at the moment"

As if there is an invisible target, waiting for me to take action, but the spells use no target method.
Anyone know something about this issue?

Thanks for reading.
 
Sure, this is the Hammer of Faith from the Cleric class. The "invisible target" (or whatever we call it) happens even if I fizzle the spell. Not sure if it helps track the problem here, but this is it :

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

namespace Server.ACC.CSS.Systems.Cleric
{
    public class ClericHammerOfFaithSpell : ClericSpell
    {
        private static SpellInfo m_Info = new SpellInfo(
                                                        "Hammer of Faith", "Malleus Terum",
                                                        //SpellCircle.Fifth,
                                                        212,
                                                        9041
                                                       );

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

        public override int RequiredTithing{ get{ return 20; } }
        public override double RequiredSkill{ get{ return 40.0; } }
        public override int RequiredMana{ get{ return 14; } }

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

        public override void OnCast()
        {
            if ( CheckSequence() )
            {
                Item weap = new HammerOfFaith( Caster );

                Caster.AddToBackpack( weap );
                Caster.SendMessage( "You create a magical hammer and place it in your backpack." );

                Caster.PlaySound( 0x212 );
                Caster.PlaySound( 0x206 );

                Effects.SendLocationParticles( EffectItem.Create( Caster.Location, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
                Effects.SendLocationParticles( EffectItem.Create( new Point3D( Caster.X, Caster.Y, Caster.Z - 7 ), Caster.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );
            }
        }

        [FlipableAttribute( 0x1439, 0x1438 )]
        private class HammerOfFaith : BaseBashing
        {
            private Mobile m_Owner;
            private DateTime m_Expire;
            private Timer m_Timer;

            public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.WhirlwindAttack; } }
            public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.CrushingBlow; } }

            public override int AosStrengthReq{ get{ return 10; } }
            public override int AosMinDamage{ get{ return 17; } }
            public override int AosMaxDamage{ get{ return 18; } }
            public override int AosSpeed{ get{ return 28; } }

            public override int OldStrengthReq{ get{ return 40; } }
            public override int OldMinDamage{ get{ return 8; } }
            public override int OldMaxDamage{ get{ return 36; } }
            public override int OldSpeed{ get{ return 31; } }

            public override int InitMinHits{ get{ return 255; } }
            public override int InitMaxHits{ get{ return 255; } }

            public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.Bash2H; } }

            [Constructable]
            public HammerOfFaith( Mobile owner ) : base( 0x1439 )
            {
                m_Owner = owner;
                Weight = 10.0;
                Layer = Layer.TwoHanded;
                Hue = 0x481;
                BlessedFor = owner;
                Slayer = SlayerName.Silver;
                Name = "Hammer of Faith";
                Attributes.SpellChanneling = 1;

                double time = ( owner.Skills[SkillName.DetectHidden].Value / 40.0 ) * ClericDivineFocusSpell.GetScalar( owner );
                m_Expire = DateTime.Now + TimeSpan.FromMinutes( (int)time );
                m_Timer = new InternalTimer( this, m_Expire );

                m_Timer.Start();
            }

            public override void GetDamageTypes( Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct )
            {
                phys = 0; fire = 100; cold = 0; pois = 0;
                nrgy = 0; chaos = 0; direct = 0;
            }

            public override void OnDelete()
            {
                if ( m_Timer != null )
                    m_Timer.Stop();

                base.OnDelete();
            }

            public override bool CanEquip( Mobile m )
            {
                if ( m != m_Owner )
                    return false;

                return true;
            }

            public void Remove()
            {
                m_Owner.SendMessage( "Your hammer slowly dissipates." );
                Delete();
            }

            public HammerOfFaith( Serial serial ) : base( serial )
            {
            }

            public override void Serialize( GenericWriter writer )
            {
                base.Serialize( writer );

                writer.Write( (int) 0 ); // version
                writer.Write( m_Owner );
                writer.Write( m_Expire );
            }

            public override void Deserialize( GenericReader reader )
            {
                base.Deserialize( reader );

                int version = reader.ReadInt();
                m_Owner = reader.ReadMobile();
                m_Expire = reader.ReadDeltaTime();

                m_Timer = new InternalTimer( this, m_Expire );
                m_Timer.Start();
            }
        }

        private class InternalTimer : Timer
        {
            private HammerOfFaith m_Hammer;
            private DateTime m_Expire;

            public InternalTimer( HammerOfFaith hammer, DateTime expire ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 0.1 ) )
            {
                m_Hammer = hammer;
                m_Expire = expire;
            }

            protected override void OnTick()
            {
                if ( DateTime.Now >= m_Expire )
                {
                    m_Hammer.Remove();
                    Stop();
                }
            }
        }
    }
}

Thank you for helping, hope we get it fixed ^^
 
Hi, here you go :

C#:
using System;
using Server;
using Server.Spells;
using Server.Network;

namespace Server.ACC.CSS.Systems.Cleric
{
    public abstract class ClericSpell : CSpell
    
    {
        public abstract SpellCircle Circle { get; }
        
        public ClericSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
        {
        }

        public override SkillName CastSkill { get { return SkillName.Fishing; } }
        public override SkillName DamageSkill { get { return SkillName.DetectHidden; } }
        public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(3 * CastDelaySecondsPerTick); } }
        public override bool ClearHandsOnCast { get { return true; } }
        public override bool RevealOnCast{ get{ return true; } }

        public override int GetMana()
        {
            return RequiredMana;
        }
        
        public override bool CheckCast()
        {
            if ( !base.CheckCast() )
                return false;

            if ( Caster.Skills[CastSkill].Value < RequiredSkill )
            {
                Caster.SendMessage( "You must have at least " + RequiredSkill + " Fishing to invoke this prayer" );
                return false;
            }
            else if ( Caster.TithingPoints < RequiredTithing )
            {
                Caster.SendMessage( "You must have at least " + RequiredTithing + " Piety to invoke this prayer." );
                return false;
            }
            else if ( Caster.Mana < ScaleMana( GetMana() ) )
            {
                Caster.SendMessage( "You must have at least " + GetMana() + " Mana to invoke this prayer." );
                return false;
            }

            return true;
        }

        public override bool CheckFizzle()
        {
            if ( !base.CheckFizzle() )
                return false;

            int tithing = RequiredTithing;
            double min, max;

            GetCastSkills( out min, out max );

            if ( AosAttributes.GetValue( Caster, AosAttribute.LowerRegCost ) > Utility.Random( 100 ) )
                tithing = 0;

            int mana = ScaleMana( GetMana() );

            if ( Caster.Skills[CastSkill].Value < RequiredSkill )
            {
                Caster.SendMessage( "You must have at least " + RequiredSkill + " Fishing to invoke this prayer." );
                return false;
            }
            else if ( Caster.TithingPoints < tithing )
            {
                Caster.SendMessage( "You must have at least " + tithing + " Piety to invoke this prayer." );
                return false;
            }
            else if ( Caster.Mana < mana )
            {
                Caster.SendMessage( "You must have at least " + mana + " Mana to invoke this prayer." );
                return false;
            }

            Caster.TithingPoints -= tithing;

            return true;
        }

        public override void SayMantra()
        {
            Caster.PublicOverheadMessage( MessageType.Regular, 0x3B2, false, Info.Mantra );
            Caster.PlaySound( 0x24A );
        }

        public override void DoFizzle()
        {
            Caster.PlaySound( 0x1D6 );
            Caster.NextSpellTime = DateTime.Now;
        }

        public override void DoHurtFizzle()
        {
            Caster.PlaySound( 0x1D6 );
        }

        public override void OnDisturb( DisturbType type, bool message )
        {
            base.OnDisturb( type, message );

            if ( message )
                Caster.PlaySound( 0x1D6 );
        }

        public override void OnBeginCast()
        {
            base.OnBeginCast();

            Caster.FixedEffect( 0x37C4, 10, 42, 4, 3 );
        }

        public override void GetCastSkills( out double min, out double max )
        {
            min = RequiredSkill;
            max = RequiredSkill + 40.0;
        }
    }
}
 
C#:
using System;
using Server;
using Server.Misc;
using Server.Spells;

namespace Server.ACC.CSS
{
    public abstract class CSpell : Spell
    {
        public virtual double RequiredSkill  { get{ return  0.0; } }
        public virtual int    RequiredMana   { get{ return    0; } }
        public virtual int    RequiredHealth { get{ return    0; } }
        public virtual int    RequiredTithing{ get{ return    0; } }
        public virtual double CastDelay      { get{ return -1.0; } }

        public CSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
        {
        }

        public override bool CheckCast()
        {
            if( SpellRestrictions.UseRestrictions )
                return SpellRestrictions.CheckRestrictions( Caster, this.GetType() );
            return true;
        }

        public override bool CheckFizzle()
        {
            if( CSkillCheck.UseDefaultSkills )
                return CSkillCheck.CheckSkill( Caster, this.GetType() ) ? base.CheckFizzle() : false;
            else
                return CSkillCheck.CheckSkill( Caster, this.GetType() );
        }

        public override TimeSpan GetCastDelay()
        {
            return CastDelay == -1 ? base.GetCastDelay() : TimeSpan.FromSeconds( CastDelay );
        }
    }
}
 
The HammerOfFaithSpell.cs is missing FinishSequence();
try changing it's OncCast method to:

C#:
        public override void OnCast()
        {
            if ( CheckSequence() )
            {
                Item weap = new HammerOfFaith( Caster );

                Caster.AddToBackpack( weap );
                Caster.SendMessage( "You create a magical hammer and place it in your backpack." );

                Caster.PlaySound( 0x212 );
                Caster.PlaySound( 0x206 );

                Effects.SendLocationParticles( EffectItem.Create( Caster.Location, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
                Effects.SendLocationParticles( EffectItem.Create( new Point3D( Caster.X, Caster.Y, Caster.Z - 7 ), Caster.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );
            }
            FinishSequence();
        }
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back