示例#1
0
        public override void OnThink()
        {
            base.OnThink();

            if (0.1 > Utility.RandomDouble() && DateTime.UtcNow > m_NextAbilityTime && Combatant != null && this.InRange(Combatant, RangePerception))                 // as per OSI, no check for LOS
            {
                Mobile to = Combatant;

                switch (Utility.Random(2))
                {
                case 0:                         // Niporailem's Treasure
                {
                    Effects.SendPacket(Location, Map, new HuedEffect(EffectType.Moving, this.Serial, to.Serial, 0xEEF, this.Location, to.Location, 10, 0, false, false, 0, 0));
                    Effects.PlaySound(to.Location, to.Map, 0x37);

                    int amount = Utility.RandomMinMax(2, 4);

                    for (int i = 0; i < amount; i++)
                    {
                        Item treasure = new NiporailemsTreasure();

                        if (!to.Player || !to.PlaceInBackpack(treasure))
                        {
                            treasure.MoveToWorld(to.Location, to.Map);
                            treasure.OnDroppedToWorld(this, to.Location);
                        }
                    }

                    BaseMount.Dismount(to);
                    to.Damage(Utility.Random(18, 27), this);

                    m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(MinAbilityTime, MaxAbilityTime));

                    break;
                }

                case 1:                         // Strangle
                {
                    if (!Spells.Necromancy.StrangleSpell.UnderEffect(to))
                    {
                        to.PlaySound(0x22F);
                        to.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
                        to.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255);

                        Spells.Necromancy.StrangleSpell.StartTimer(this, to);
                    }

                    break;
                }
                }
            }
        }
示例#2
0
        private void ThrowTreasure(Mobile m)
        {
            DoHarmful(m);

            this.MovingParticles(m, 0xEEF, 9, 0, false, true, 0, 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0);

            Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
            {
                var treasure = new NiporailemsTreasure(this);

                m.PlaySound(0x033);
                m.AddToBackpack(treasure);
                m.SendLocalizedMessage(1112111); // To steal my gold? To give it freely!
            });
        }
示例#3
0
        /// <summary>
        /// https://uo.com/wiki/ultima-online-wiki/world/dungeons/tomb-of-kings/
        /// Niporailem the thief, a formidable foe who will summon spectral armor and throw overweight,
        /// damaging gold piles which dismount an attacker. These piles turn into treasure sand after a period of time or when dropped. Dropping
        /// the gold piles, or being hidden when they are thrown, can result in a spawn of cursed metallic knights and mages.
        /// </summary>
        public override void OnThink()
        {
            base.OnThink();                                                                                                                      //     Fool’s Gold

            if (0.1 > Utility.RandomDouble() && DateTime.UtcNow > m_NextAbilityTime && Combatant != null && InRange(Combatant, RangePerception)) // as per OSI, no check for LOS
            {
                Mobile to = (Mobile)Combatant;

                switch (Utility.Random(1))
                {
                case 0:     // Niporailem's Treasure
                {
                    Effects.SendPacket(Location, Map, new HuedEffect(EffectType.Moving, Serial, to.Serial, 0xEEF, Location, to.Location, 10, 0, false, false, 0, 0));
                    Effects.PlaySound(to.Location, to.Map, 0x37);

                    int amount = Utility.RandomMinMax(2, 4);

                    for (int i = 0; i < amount; i++)
                    {
                        Item treasure = new NiporailemsTreasure();

                        if (!to.Player || !to.PlaceInBackpack(treasure))
                        {
                            treasure.MoveToWorld(to.Location, to.Map);
                            treasure.OnDroppedToWorld(this, to.Location);
                        }
                    }
                    to.SendLocalizedMessage(1112112);         // To carry the burden of greed!

                    BaseMount.BaseDismount(to);
                    to.Damage(Utility.Random(18, 27), this);

                    m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(MinAbilityTime, MaxAbilityTime));

                    break;
                }
                }
            }
        }
示例#4
0
 public InternalTimer( NiporailemsTreasure owner )
     : base(TimeSpan.FromSeconds( 60.0 ))
 {
     m_Owner = owner;
 }