Beispiel #1
0
 public static void InvokeSpellCast(SpellCastEventArgs args)
 {
     if (SpellCast != null)
     {
         SpellCast(args);
     }
 }
        private void FoundryActionsSpellCastComplete(object sender, SpellCastEventArgs e)
        {
            try
            {
                if(!FoundryActionsPending) {return;}
                if(FoundryActionList.Any(x => x.Action == FoundryActionTypes.Portal && x.ToDoList.Contains(e.SpellId)))
                {
                    FoundryActionList.Find(x => x.Action == FoundryActionTypes.Portal && x.ToDoList.Contains(e.SpellId)).ToDoList.RemoveAll(x => x == e.SpellId);
                }

            }catch(Exception ex){LogError(ex);}
        }
 private void CombatHud_SpellCast(object sender, SpellCastEventArgs e)
 {
     try
     {
         switch(SpellIndex[e.SpellId].spellschool.ToLower())
         {
             case "item enchantment":
                 if(gtSettings.bCombatHudTrackItemDebuffs)
                 {
                     if(SpellIndex[e.SpellId].isdebuff)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             case "creature enchantment":
                 if(gtSettings.bCombatHudTrackCreatureDebuffs)
                 {
                     if(SpellIndex[e.SpellId].isdebuff)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             case "life magic":
                 if(gtSettings.bCombatHudTrackLifeDebuffs)
                 {
                     if(SpellIndex[e.SpellId].isdebuff)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             case "void magic":
                 if(gtSettings.bCombatHudTrackVoidDebuffs)
                 {
                     if(SpellIndex[e.SpellId].duration > 0)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             default:
                 return;
         }
     }catch(Exception ex){LogError(ex);}
 }
Beispiel #4
0
 void CharacterFilter_SpellCast(object sender, SpellCastEventArgs e)
 {
     // DO STUFF HERE
 }
 public static void InvokeSpellCast( SpellCastEventArgs args )
 {
     if( SpellCast != null )
         SpellCast(args);
 }
Beispiel #6
0
 private void CharacterFilter_SpellCast(object sender, SpellCastEventArgs e)
 {
     // DO STUFF HERE
 }
Beispiel #7
0
		private void CharacterFilter_SpellCast(object sender, SpellCastEventArgs e)
		{
			try
			{
				mLastSpellId = e.SpellId;
				mLastSpellTarget = e.TargetId;
				if (e.SpellId == Spells.PrimaryPortalRecall)
				{
					mRecallingToPrimaryPortal = RecallStep.RecallStarted;
					if (mRecallTimeout.Enabled)
						RecallTimeout_Tick(null, null);
					mRecallTimeout.Interval = 30000; // 30 seconds
					mRecallTimeout.Start();
				}
				else if (e.SpellId == Spells.SecondaryPortalRecall)
				{
					mRecallingToSecondaryPortal = RecallStep.RecallStarted;
					if (mRecallTimeout.Enabled)
						RecallTimeout_Tick(null, null);
					mRecallTimeout.Interval = 30000; // 30 seconds
					mRecallTimeout.Start();
				}
				else if (e.SpellId == Spells.LifestoneRecall)
				{
					mRecallingToLSTie = RecallStep.RecallStarted;
					if (mRecallTimeout.Enabled)
						RecallTimeout_Tick(null, null);
					mRecallTimeout.Interval = 30000; // 30 seconds
					mRecallTimeout.Start();
				}
			}
			catch (Exception ex) { Util.HandleException(ex); }
		}
Beispiel #8
0
        public bool Cast()
        {
            m_StartCastTime = DateTime.Now;

            if (Core.AOS && m_Caster.Spell is Spell && ((Spell)m_Caster.Spell).State == SpellState.Sequencing)
            {
                ((Spell)m_Caster.Spell).Disturb(DisturbType.NewCast);
            }

            if (!m_Caster.CheckAlive())
            {
                return(false);
            }
            else if (m_Caster.Spell != null && m_Caster.Spell.IsCasting)
            {
                m_Caster.SendLocalizedMessage(502642); // You are already casting a spell.
            }

            else if (BlockedByHorrificBeast && TransformationSpellHelper.UnderTransformation(m_Caster, typeof(HorrificBeastSpell)) || (BlockedByAnimalForm && AnimalForm.UnderTransformation(m_Caster)))
            {
                m_Caster.SendLocalizedMessage(1061091);   // You cannot cast that spell in this form.
            }
            else if (!(m_Scroll is BaseWand) && (m_Caster.Paralyzed || m_Caster.Frozen))
            {
                m_Caster.SendLocalizedMessage(502643); // You can not cast a spell while frozen.
            }
            else if (CheckNextSpellTime && DateTime.Now < m_Caster.NextSpellTime)
            {
                m_Caster.SendLocalizedMessage(502644); // You have not yet recovered from casting a spell.
            }
            else if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).PeacedUntil > DateTime.Now)
            {
                m_Caster.SendLocalizedMessage(1072060); // You cannot cast a spell while calmed.
            }
            else if (m_Caster.Mana >= ScaleMana(GetMana()))
            {
                if (m_Caster.Spell == null && m_Caster.CheckSpellCast(this) && CheckCast() && m_Caster.Region.OnBeginSpellCast(m_Caster, this))
                {
                    if (m_Caster.Player)
                    {
                        SpellCastEventArgs args = new SpellCastEventArgs((Player)Caster, this);
                        EventDispatcher.InvokeSpellCast(args);

                        if (args.Blocked)
                        {
                            return(false);
                        }
                    }

                    m_State        = SpellState.Casting;
                    m_Caster.Spell = this;

                    if (!(m_Scroll is BaseWand) && RevealOnCast)
                    {
                        m_Caster.RevealingAction();
                    }

                    SayMantra();

                    TimeSpan castDelay = this.GetCastDelay();

                    if (ShowHandMovement && (m_Caster.Body.IsHuman || (m_Caster.Player && m_Caster.Body.IsMonster)))
                    {
                        int  count   = (int)Math.Ceiling(castDelay.TotalSeconds / AnimateDelay.TotalSeconds);
                        bool animate = true;

                        if (m_Caster is Player)
                        {
                            Arcanite arc = Perk.GetByType <Arcanite>((Player)m_Caster);

                            if (arc != null)
                            {
                                if (arc.EtherealKenetics())
                                {
                                    animate = false;
                                }
                            }
                        }

                        if (count != 0 && animate)
                        {
                            m_AnimTimer = new AnimTimer(this, count);
                            m_AnimTimer.Start();
                        }

                        if (m_Info.LeftHandEffect > 0)
                        {
                            Caster.FixedParticles(0, 10, 5, m_Info.LeftHandEffect, EffectLayer.LeftHand);
                        }

                        if (m_Info.RightHandEffect > 0)
                        {
                            Caster.FixedParticles(0, 10, 5, m_Info.RightHandEffect, EffectLayer.RightHand);
                        }
                    }

                    if (ClearHandsOnCast)
                    {
                        m_Caster.ClearHands();
                    }

                    m_CastTimer = new CastTimer(this, castDelay);
                    //m_CastTimer.Start();

                    OnBeginCast();

                    if (castDelay > TimeSpan.Zero)
                    {
                        m_CastTimer.Start();
                    }
                    else
                    {
                        m_CastTimer.Tick();
                    }

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502625); // Insufficient mana
            }

            return(false);
        }
        internal void WriteObject(SpellCastEventArgs obj)
        {
            if (ActiveSettings.Instance.DebugLevel == DebugLevel.None)
                return;

            lock (this._writeLock)
            {
                using (StreamWriter stream = new StreamWriter(this._currentPath, true))
                {
                    this.LogRawMessage(this.FormatWithPrefix("SpellCastEventArgs"), stream);
                    this.LogRawMessage(string.Format("  SpellId = {0}", obj.SpellId), stream);
                    this.LogRawMessage(string.Format("  TargetId = {0}", obj.TargetId), stream);
                    this.LogRawMessage(string.Format("  CastEventType = {0}", obj.EventType), stream);

                    //this.WriteCurrentStateStuff(stream, false);

                    this.LogRawMessage("", stream);
                }
            }
        }
Beispiel #10
0
 void CharacterFilter_SpellCast(object sender, SpellCastEventArgs e)
 {
 }