Exemplo n.º 1
0
 public NiporailemsTreasureTimer(NiporailemsTreasure owner)
     : base(TimeSpan.FromSeconds(60.0))
 {
     m_Owner = owner;
 }
Exemplo n.º 2
0
        public override void OnThink()
        {
            base.OnThink();

            if ( 0.1 > Utility.RandomDouble() && DateTime.Now > 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.IsPlayer || !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.Now + 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;
                        }
                }
            }
        }