Пример #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
        /// <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;
                }
                }
            }
        }