Ejemplo n.º 1
0
            protected override void OnTick()
            {
                if (m_Spell.State != SpellState.Casting || m_Spell.m_Caster.Spell != m_Spell)
                {
                    Stop();
                    return;
                }

                if (!m_Spell.Caster.Mounted && m_Spell.Caster.Body.IsHuman && m_Spell.m_Info.Action >= 0)
                {
                    m_Spell.Caster.Animate(m_Spell.m_Info.Action, 7, 1, true, false, 0);
                }

                else if (m_Spell.Caster is BaseCreature && m_Spell.m_Info.Action >= 0)
                {
                    BaseCreature creature = m_Spell.Caster as BaseCreature;

                    CastingAnimationInfo.GetCastAnimationForBody(creature);

                    m_Spell.Caster.Animate(creature.SpellCastAnimation, creature.SpellCastFrameCount, 1, true, false, 0);
                }

                if (!Running)
                {
                    m_Spell.m_AnimTimer = null;
                }
            }
Ejemplo n.º 2
0
        public static bool DoCauseWounds(BaseCreature creature, Mobile target)
        {
            if (creature == null || target == null)
            {
                return(false);
            }

            if (!creature.Alive || !target.Alive)
            {
                return(false);
            }

            creature.Direction = creature.GetDirectionTo(target);
            creature.PlaySound(0x605);

            CastingAnimationInfo.GetCastAnimationForBody(creature);
            creature.Animate(creature.SpellCastAnimation, creature.SpellCastFrameCount, 1, true, false, 0);

            double actionsCooldown = 2.0;

            if (creature.AIObject != null)
            {
                creature.AIObject.NextMove = creature.AIObject.NextMove + TimeSpan.FromSeconds(actionsCooldown);
            }
            creature.LastSwingTime = creature.LastSwingTime + TimeSpan.FromSeconds(actionsCooldown);
            creature.NextSpellTime = creature.NextSpellTime + TimeSpan.FromSeconds(actionsCooldown);
            creature.NextCombatHealActionAllowed    = creature.NextCombatHealActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
            creature.NextCombatSpecialActionAllowed = creature.NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
            creature.NextCombatEpicActionAllowed    = creature.NextCombatEpicActionAllowed + TimeSpan.FromSeconds(actionsCooldown);

            target.FixedParticles(0x374A, 10, 30, 5038, 1149, 0, EffectLayer.Head);
            target.PlaySound(0x658);

            double magerySkill = creature.Skills[SkillName.Magery].Value;

            int baseDamage = (int)(magerySkill / 5);

            if (baseDamage < 1)
            {
                baseDamage = 1;
            }

            AOS.Damage(target, creature, baseDamage, 0, 100, 0, 0, 0);

            return(true);
        }