Пример #1
0
        private static void OnLocalizedMessage(Packet p, PacketHandlerEventArgs args)
        {
            Serial      ser    = p.ReadUInt32();
            ushort      body   = p.ReadUInt16();
            MessageType spell  = (MessageType)p.ReadByte();
            ushort      hue    = p.ReadUInt16();
            ushort      font   = p.ReadUInt16();
            int         num    = p.ReadInt32();
            string      name   = p.ReadStringSafe(30);
            string      argstr = p.ReadUnicodeStringLESafe();

            if (((((num >= 0x2dce9b) && (num < 0x2dcedb)) || ((num >= 0x102e9d) && (num < 0x102ead))) || (((num >= 0x102ee9) && (num < 0x102ef3)) || ((num >= 0x102e8d) && (num < 0x102e97)))) || (((num >= 0x102ef3) && (num < 0x102ef9)) || ((num >= 0x102f02) && (num < 0x102f0a))))
            {
                spell = MessageType.Spell;
            }

            BandageTimer.OnLocalizedMessage(num);
            try
            {
                if (enabled && Array.IndexOf(filter, num) != -1)
                {
                    args.Block = true;
                }
                else
                {
                    PacketHandlers.HandleSpeech(p, args, ser, body, spell, hue, font, Language.CliLocName.ToUpper(), name, Language.ClilocFormat(num, argstr));
                }
            }
            catch (Exception exception)
            { Engine.LogCrash(new Exception(string.Format("Exception in Ultima.dll cliloc: {0}, {1}", num, argstr), exception)); }
        }
Пример #2
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();
                }
            }
        }
Пример #3
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();
                }
            }
        }
Пример #5
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();
                           }
                   }
        }
Пример #6
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();
				}
			}
		}
Пример #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();
        }
Пример #8
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();
        }