示例#1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted, m_Bandage is EnhancedBandage) != null)
                        {
                            NegativeAttributes.OnCombatAction(from);
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                         // You are too far away to do that.
                    }
                }
                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        NegativeAttributes.OnCombatAction(from);
                        m_Bandage.Consume();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                     // Bandages can not be used on that.
                }
            }
示例#2
0
        public virtual bool OnTick()
        {
            UpdateParty();

            if (RevealOnTick)
            {
                Caster.RevealingAction();
            }

            int upkeep = ScaleUpkeep();

            if (0.10 > Utility.RandomDouble())
            {
                NegativeAttributes.OnCombatAction(Caster);
            }

            if ((Caster is PlayerMobile && Caster.NetState == null) || Expires < DateTime.UtcNow || !Caster.Alive || Caster.IsDeadBondedPet)
            {
                Expire();
            }
            else if (Target != null && !Target.Alive)
            {
                Expire();
            }
            else if (Target != null && !Caster.InRange(Target.Location, PartyRange))
            {
                Expire();

                if (OutOfRangeMessage > 0)
                {
                    Caster.SendLocalizedMessage(OutOfRangeMessage);
                }
            }
            else if (Caster.Mana < upkeep)
            {
                if (UpkeepCancelMessage > 0)
                {
                    Caster.SendLocalizedMessage(UpkeepCancelMessage);
                }

                Expire();
            }
            else if (Caster.Player && Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                Expire();
            }
            else
            {
                DoEffects();

                if (upkeep > 0)
                {
                    Caster.Mana -= upkeep;
                }

                return(true);
            }

            return(false);
        }
示例#3
0
        public void HarmfulSpell(IDamageable d)
        {
            if (d is BaseCreature)
            {
                ((BaseCreature)d).OnHarmfulSpell(m_Caster);
            }
            else if (d is IDamageableItem)
            {
                ((IDamageableItem)d).OnHarmfulSpell(m_Caster);
            }

            NegativeAttributes.OnCombatAction(Caster);

            if (d is Mobile && (Mobile)d != m_Caster)
            {
                NegativeAttributes.OnCombatAction((Mobile)d);
            }
        }
示例#4
0
        public void Target(Point3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                int    level = GetFocusLevel(Caster);
                double skill = Caster.Skills[CastSkill].Value;

                int tiles    = 5 + level;
                int damage   = 10 + (int)Math.Max(1, (skill / 24)) + level;
                int duration = (int)Math.Max(1, skill / 24) + level;

                for (int x = p.X - tiles; x <= p.X + tiles; x += tiles)
                {
                    for (int y = p.Y - tiles; y <= p.Y + tiles; y += tiles)
                    {
                        if (p.X == x && p.Y == y)
                        {
                            continue;
                        }

                        Point3D p3d = new Point3D(x, y, Caster.Map.GetAverageZ(x, y));

                        if (CanFitFire(p3d, Caster))
                        {
                            new FireItem(duration).MoveToWorld(p3d, Caster.Map);
                        }
                    }
                }

                Effects.PlaySound(p, Caster.Map, 0x5CF);

                NegativeAttributes.OnCombatAction(Caster);

                new InternalTimer(this, Caster, p, damage, tiles, duration).Start();
            }

            FinishSequence();
        }
示例#5
0
        public void HarmfulSpell(IDamageable d)
        {
            if (d is BaseCreature)
            {
                ((BaseCreature)d).OnHarmfulSpell(Caster);
            }
            else if (d is IDamageableItem)
            {
                ((IDamageableItem)d).OnHarmfulSpell(Caster);
            }

            NegativeAttributes.OnCombatAction(Caster);

            if (d is Mobile)
            {
                if ((Mobile)d != Caster)
                {
                    NegativeAttributes.OnCombatAction((Mobile)d);
                }

                EvilOmenSpell.TryEndEffect((Mobile)d);
            }
        }
示例#6
0
文件: Spell.cs 项目: tflynt91/TrueUO
        public void HarmfulSpell(IDamageable d)
        {
            if (d is BaseCreature creature)
            {
                creature.OnHarmfulSpell(m_Caster);
            }
            else if (d is IDamageableItem item)
            {
                item.OnHarmfulSpell(m_Caster);
            }

            NegativeAttributes.OnCombatAction(Caster);

            if (d is Mobile mobile)
            {
                if (mobile != m_Caster)
                {
                    NegativeAttributes.OnCombatAction(mobile);
                }

                EvilOmenSpell.TryEndEffect(mobile);
            }
        }