예제 #1
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;
                }
                }
            }
        }