예제 #1
0
        public static void BandageLastTarg()
        {
            Item pack = World.Player.Backpack;

            if (pack != null)
            {
                if (!UseItem(pack, 3617))
                {
                    World.Player.SendMessage(MsgLevel.Warning, LocString.NoBandages);
                }
                else
                {
                    Targeting.LastTarget(true);                      //force a targetself to be queued
                    BandageTimer.Start();
                }
            }
        }
예제 #2
0
 public override void OnDamage(int amount, Mobile m, bool willKill)
 {
     if (this.Hits < this.HitsMax && m_Bandage == false && this.Hidden == false)
     {
         m_Bandage = true;
         Container backpack = this.Backpack;
         Bandage   bandage  = (Bandage)backpack.FindItemByType(typeof(Bandage));
         if (bandage != null)
         {
             if (BandageContext.BeginHeal(this, this) != null)
             {
                 bandage.Consume();
             }
             BandageTimer bt = new BandageTimer(this);
             bt.Start();
         }
     }
 }
//               public override bool CanHeal { get { return true; } }

        public override void OnThink()
        {
            base.OnThink();

            // Use bandages
            if ((this.IsHurt() || this.Poisoned) && m_Bandaging == false)
            {
                Bandage m_Band = (Bandage)this.Backpack.FindItemByType(typeof(Bandage));

                if (m_Band != null)
                {
                    m_Bandaging = true;

                    if (BandageContext.BeginHeal(this, this) != null)
                    {
                        m_Band.Consume();
                    }
                    BandageTimer bt = new BandageTimer(this);
                    bt.Start();
                }
            }
        }
예제 #4
0
        //*---------------->	BANDAGE
        public override void OnDamage( int amount, Mobile m, bool willKill )
        {
            if ( this.Hits < this.HitsMax && m_Bandage == false && this.Hidden == false )
                   {
                           m_Bandage = true;

                           Container backpack = this.Backpack;

                           Bandage bandage = (Bandage) backpack.FindItemByType( typeof( Bandage ) );

                           if ( bandage != null )
               {

               				if ( BandageContext.BeginHeal( this, this ) != null )
                    bandage.Consume();

                                BandageTimer bt = new BandageTimer( this );
                                        bt.Start();
                           }
                   }
        }
예제 #5
0
		public override void OnThink()
		{
			base.OnThink();
			
			// Use bandages
			if ( (this.IsHurt() || this.Poisoned) && m_Bandaging == false )
			{
				Bandage m_Band = (Bandage)this.Backpack.FindItemByType( typeof ( Bandage ) );
				
				if ( m_Band != null )
				{
					m_Bandaging = true;
					
					if ( BandageContext.BeginHeal( this, this ) != null )
						m_Band.Consume();
					BandageTimer bt = new BandageTimer( this );
					bt.Start();
				}
			}
		}
예제 #6
0
        public override void OnThink()
        {
            if ( !m_HasTeleportedAway && Hits < (HitsMax / 2) && Poisoned == false )
               {
               Map map = this.Map;

               if ( map != null )
               {
                for ( int i = 0; i < 10; ++i )
                {
                    int x = X + (Utility.RandomMinMax( 5, 10 ) * (Utility.RandomBool() ? 1 : -1));
                    int y = Y + (Utility.RandomMinMax( 5, 10 ) * (Utility.RandomBool() ? 1 : -1));
                    int z = Z;

                    if ( !map.CanFit( x, y, z, 16, false, false ) )
                    continue;

                    Point3D from = this.Location;
                    Point3D to = new Point3D( x, y, z );

                    this.Location = to;
                    this.ProcessDelta();
                    this.Hidden = true;
                    this.Combatant = null;

                    Effects.SendLocationParticles( EffectItem.Create( from, map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
                    Effects.SendLocationParticles( EffectItem.Create(   to, map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );

                    Effects.PlaySound( to, map, 0x1FE );

                    m_HasTeleportedAway = true;
                    m_SoundTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 2.5 ), new TimerCallback( SendTrackingSound ) );

                        this.UseSkill( SkillName.Stealth );
                                        AIObject.Action = ActionType.Flee;

             					break;
                }
               }
               }

                   if ( this.Hits < ( this.HitsMax - 10) && m_Bandage == false )
               {
                           m_Bandage = true;

                           Container backpack = this.Backpack;

                           Bandage bandage = (Bandage) backpack.FindItemByType( typeof( Bandage ) );

                           if ( bandage != null )
               {
                 if ( BandageContext.BeginHeal( this, this ) != null )
                    bandage.Consume();

                                 BandageTimer bt = new BandageTimer( this );
                                 bt.Start();
                           }
               }

              	   base.OnThink();
        }
예제 #7
0
        public override void OnThink()
        {
            if (!m_HasTeleportedAway && Hits < (HitsMax / 2) && Poisoned == false)
            {
                Map map = this.Map;

                if (map != null)
                {
                    for (int i = 0; i < 10; ++i)
                    {
                        int x = X + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
                        int y = Y + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
                        int z = Z;

                        if (!map.CanFit(x, y, z, 16, false, false))
                        {
                            continue;
                        }

                        Point3D from = this.Location;
                        Point3D to   = new Point3D(x, y, z);

                        this.Location = to;
                        this.ProcessDelta();
                        this.Hidden    = true;
                        this.Combatant = null;

                        Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                        Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        Effects.PlaySound(to, map, 0x1FE);

                        m_HasTeleportedAway = true;
                        m_SoundTimer        = Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(2.5), new TimerCallback(SendTrackingSound));

                        this.UseSkill(SkillName.Stealth);
                        AIObject.Action = ActionType.Flee;

                        break;
                    }
                }
            }

            if (this.Hits < (this.HitsMax - 10) && m_Bandage == false)
            {
                m_Bandage = true;

                Container backpack = this.Backpack;

                Bandage bandage = (Bandage)backpack.FindItemByType(typeof(Bandage));

                if (bandage != null)
                {
                    if (BandageContext.BeginHeal(this, this) != null)
                    {
                        bandage.Consume();
                    }

                    BandageTimer bt = new BandageTimer(this);
                    bt.Start();
                }
            }

            base.OnThink();
        }