コード例 #1
0
 public override void OnDamage( int amount, Mobile from, bool willKill )
 {
     if ( this.Hits - amount < 30 && !willKill && !this.Mounted )
     {
         if ( this is VampireNecro ) {
             this.AI = AIType.AI_Stealth;
         }
         AIObject.Action = ActionType.Flee;
         this.Combatant = null;
         Effects.SendLocationParticles( EffectItem.Create( this.Location, this.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
         this.Body = 165;
         this.Hidden = true;
         this.SetSkill( SkillName.Hiding, 100 );
         this.SetSkill( SkillName.Stealth, 100 );
         this.SetSkill( SkillName.SpiritSpeak, 0 );
         this.AllowedStealthSteps = 24;
     }
     else
     {
         Item toCurse = this.FindItemOnLayer( Layer.OneHanded );
         if ( toCurse == null )
             toCurse = this.FindItemOnLayer( Layer.TwoHanded );
         if ( (toCurse != null) && !(toCurse is BaseShield) && !((BaseWeapon)toCurse).Cursed && this.Combatant != null )
         {
             Spell spell = null;
             spell = new CurseWeaponSpell( this, null );
             if ( spell != null )
                 spell.Cast();
         }
     }
 }
コード例 #2
0
ファイル: Creatures.cs プロジェクト: Ravenwolfe/ServUO
        public override void OnThink()
        {
            base.OnThink();

            if (Combatant == null)
                return;

            if (CanDoSpecial && InRange(Combatant, 4) && 0.1 > Utility.RandomDouble() && _NextSpecial < DateTime.UtcNow)
            {
                DoSpecial();

                _NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));
            }
            else if (_Sampire)
            {
                if (0.1 > Utility.RandomDouble() && Weapon is BaseWeapon && !(Weapon is Fists) && !((BaseWeapon)Weapon).Cursed)
                {
                    CurseWeaponSpell spell = new CurseWeaponSpell(this, null);
                    spell.Cast();
                }
                else if (!TransformationSpellHelper.UnderTransformation(this, typeof(VampiricEmbraceSpell)))
                {
                    VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null);
                    spell.Cast();
                }
            }
        }