コード例 #1
0
 public InternalTarget( PainSpikeSpell owner )
     : base(12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
コード例 #2
0
ファイル: MageAI.cs プロジェクト: greeduomacro/vivre-uo
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_Combo == 0)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new WeakenSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 2)
            {
                if (!c.Poisoned)
                    spell = new PoisonSpell(m_Mobile, null);
                else if (IsNecromancer)
                    spell = new StrangleSpell(m_Mobile, null);

                ++m_Combo; // Move to next spell
            }

            if (m_Combo == 3 && spell == null)
            {
                switch (Utility.Random(IsNecromancer ? 4 : 3))
                {
                    case 0:
                        {
                            if (c.Int < c.Dex)
                                spell = new FeeblemindSpell(m_Mobile, null);
                            else
                                spell = new ClumsySpell(m_Mobile, null);

                            ++m_Combo; // Move to next spell

                            break;
                        }
                    case 1:
                        {
                            spell = new EnergyBoltSpell(m_Mobile, null);
                            m_Combo = -1; // Reset combo state
                            break;
                        }
                    case 2:
                        {
                            spell = new FlameStrikeSpell(m_Mobile, null);
                            m_Combo = -1; // Reset combo state
                            break;
                        }
                    default:
                        {
                            spell = new PainSpikeSpell(m_Mobile, null);
                            m_Combo = -1; // Reset combo state
                            break;
                        }
                }
            }
            else if (m_Combo == 4 && spell == null)
            {
                spell = new MindBlastSpell(m_Mobile, null);
                m_Combo = -1;
            }

            return spell;
        }
コード例 #3
0
ファイル: PainSpike.cs プロジェクト: dpisanu/xrunuo
 public InternalTarget(PainSpikeSpell owner)
     : base(12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
コード例 #4
0
 public InternalTarget(PainSpikeSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     this.m_Owner = owner;
 }
コード例 #5
0
        public override bool DoActionCombat()
        {
            Mobile c = m_Mobile.Combatant;
            m_Mobile.Warmode = true;

            if ( c == null || c.Deleted || !c.Alive || c.IsDeadBondedPet || !m_Mobile.CanSee( c ) || !m_Mobile.CanBeHarmful( c, false ) || c.Map != m_Mobile.Map )
            {
                // Our combatant is deleted, dead, hidden, or we cannot hurt them
                // Try to find another combatant

                if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
                {
                    if ( m_Mobile.Debug )
                        m_Mobile.DebugSay( "Something happened to my combatant, so I am going to fight {0}", m_Mobile.FocusMob.Name );

                    m_Mobile.Combatant = c = m_Mobile.FocusMob;
                    m_Mobile.FocusMob = null;
                }
                else
                {
                    m_Mobile.DebugSay( "Something happened to my combatant, and nothing is around. I am on guard." );
                    Action = ActionType.Guard;
                    return true;
                }
            }

            if ( !m_Mobile.InLOS( c ) )
            {
                m_Mobile.DebugSay( "I can't see my target" );

                if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
                {
                    m_Mobile.DebugSay( "Nobody else is around" );
                    m_Mobile.Combatant = c = m_Mobile.FocusMob;
                    m_Mobile.FocusMob = null;
                }
            }

            if ( SmartAI && !m_Mobile.StunReady && m_Mobile.Skills[SkillName.Wrestling].Value >= 80.0 && m_Mobile.Skills[SkillName.Anatomy].Value >= 80.0 )
                EventSink.InvokeStunRequest( new StunRequestEventArgs( m_Mobile ) );

            if ( !m_Mobile.InRange( c, m_Mobile.RangePerception ) )
            {
                // They are somewhat far away, can we find something else?

                if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
                {
                    m_Mobile.Combatant = m_Mobile.FocusMob;
                    m_Mobile.FocusMob = null;
                }
                else if ( !m_Mobile.InRange( c, m_Mobile.RangePerception * 3 ) )
                {
                    m_Mobile.Combatant = null;
                }

                c = m_Mobile.Combatant;

                if ( c == null )
                {
                    m_Mobile.DebugSay( "My combatant has fled, so I am on guard" );
                    Action = ActionType.Guard;

                    return true;
                }
            }

            if ( !m_Mobile.Controlled && !m_Mobile.Summoned && !m_Mobile.IsParagon )
            {
                if ( m_Mobile.Hits < m_Mobile.HitsMax * 20/100 )
                {
                    // We are low on health, should we flee?

                    bool flee = false;

                    if ( m_Mobile.Hits < c.Hits )
                    {
                        // We are more hurt than them

                        int diff = c.Hits - m_Mobile.Hits;

                        flee = ( Utility.Random( 0, 100 ) > (10 + diff) ); // (10 + diff)% chance to flee
                    }
                    else
                    {
                        flee = Utility.Random( 0, 100 ) > 10; // 10% chance to flee
                    }

                    if ( flee )
                    {
                        if ( m_Mobile.Debug )
                            m_Mobile.DebugSay( "I am going to flee from {0}", c.Name );

                        Action = ActionType.Flee;
                        return true;
                    }
                }
            }

            if ( m_Mobile.Spell == null && DateTime.Now > m_NextCastTime && m_Mobile.InRange( c, 12 ) )
            {
                // We are ready to cast a spell

                Spell spell = null;

                if ( SmartAI && m_Combo != -1 ) // We are doing a spell combo
                {
                    spell = DoCombo( c );
                }
                else if ( SmartAI && (c.Spell is HealSpell || c.Spell is GreaterHealSpell) && !c.Poisoned ) // They have a heal spell out
                {
                    spell = new PainSpikeSpell( m_Mobile, null );
                }
                else
                {
                    spell = ChooseSpell( c );
                }

                // Now we have a spell picked
                // Move first before casting

                RunTo( c );

                if ( spell != null )
                    spell.Cast();

                TimeSpan delay;

                if ( SmartAI || ( spell is DispelSpell ) )
                    delay = TimeSpan.FromSeconds( m_Mobile.ActiveSpeed );
                else
                    delay = GetDelay();

                m_NextCastTime = DateTime.Now + delay;
            }
            else if ( m_Mobile.Spell == null || !m_Mobile.Spell.IsCasting )
            {
                RunTo( c );
            }

            return true;
        }
コード例 #6
0
        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

            if ( !SmartAI )
            {
                spell = CheckUseSpiritSpeak();

                if ( spell != null )
                    return spell;

                switch ( Utility.Random( 10 ) )
                {
                    case 0: // Curse them.
                    {
                        m_Mobile.DebugSay( "Attempting to curse" );
                        spell = GetRandomCurseSpell();
                        break;
                    }
                    default: // Damage them.
                    {
                        m_Mobile.DebugSay( "Just doing damage" );
                        spell = GetRandomDamageSpell(c);
                        break;
                    }
                }

                return spell;
            }

            spell = CheckUseSpiritSpeak();

            if ( spell != null )
                return spell;

            switch (Utility.Random(3))
            {
                default:
                case 0:
                case 1: // Deal some damage
                    {
                        spell = GetRandomDamageSpell(c);

                        break;
                    }
                case 2: // Set up a combo of attacks
                    {
                        if (m_Mobile.Mana < 30 && m_Mobile.Mana > 15)
                        {
                            if (c.Paralyzed && !c.Poisoned)
                            {
                                m_Mobile.DebugSay("I am going to meditate");

                                m_Mobile.UseSkill(SkillName.Meditation);
                            }

                        }
                        else if (m_Mobile.Mana > 30 && m_Mobile.Mana < 80)
                        {
                            if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned)
                            {
                                m_Combo = 0;
                                spell = new PainSpikeSpell(m_Mobile, null);
                            }
                            else
                            {
                                m_Combo = 1;
                                spell = new MindRotSpell(m_Mobile, null);
                            }

                        }
                        break;
                    }
            }

            return spell;
        }
コード例 #7
0
ファイル: NecroAI.cs プロジェクト: FreeReign/imaginenation
		public virtual Spell ChooseSpell( Mobile c )
		{
			if ( !SmartAI )
			{
				if ( !m_Mobile.Summoned && ScaleByNecromancy( HealChance ) > Utility.RandomDouble() )
				{
					if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
						m_Mobile.UseSkill( SkillName.SpiritSpeak );
					else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
						m_Mobile.UseSkill( SkillName.SpiritSpeak );
				}

				return GetRandomDamageSpell();
			}

			Spell spell = null;

			int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));

			if ( m_Mobile.Summoned )
				healChance = 0;

			switch ( Utility.Random( 5 + healChance ) )
			{
				case 0: // Heal  myself
				{
					if ( !m_Mobile.Summoned )
					{
						if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
							m_Mobile.UseSkill( SkillName.SpiritSpeak );
						else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
							m_Mobile.UseSkill( SkillName.SpiritSpeak );
					}

					break;
				}
				case 1: // PoisonStrike them
				{
					if ( !c.Poisoned )
						spell = new PoisonStrikeSpell( m_Mobile, null );

					break;
				}
				case 2: // Deal some damage
				{
					spell = GetRandomDamageSpell();

					break;
				}
				case 3: // Set up a combo of attacks
				{
					if ( m_Mobile.Mana < 30 && m_Mobile.Mana > 15 )
					{
						if ( c.Paralyzed && !c.Poisoned )
						{
							m_Mobile.DebugSay( "I am going to meditate" );

							m_Mobile.UseSkill( SkillName.Meditation );
						}
						else if ( !c.Poisoned )
						{
							spell = new PoisonStrikeSpell( m_Mobile, null );
						}
					}
					else if ( m_Mobile.Mana > 30 && m_Mobile.Mana < 80 )
					{
						if ( Utility.Random( 2 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned )
						{
							m_Combo = 0;
							spell = new PainSpikeSpell( m_Mobile, null );
						}
						else
						{
							m_Combo = 1;
							spell = new MindRotSpell( m_Mobile, null );
						}
					     
					}
				     break;
				}
				case 4: //Combo to soften our enemies with a powerful attack while we have max mana amounts
				{
					if ( m_Mobile.Mana > 80 )
					{
						if ( Utility.Random( 2 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned ) 
						{
							m_Combo = 0;
							spell = new VengefulSpiritSpell ( m_Mobile, null );
						}
						else
						{
							m_Combo = 1;
							spell = new PoisonStrikeSpell ( m_Mobile, null );
						}
					}
				    break;
				}
			
			}

			return spell;
		}
コード例 #8
0
ファイル: NecroMageAI.cs プロジェクト: Ravenwolfe/ServUO
        public override Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_NecroComboType == NecroComboType.None)
            {
                m_NecroComboType = (NecroComboType)Utility.RandomMinMax(1, 7);
                m_Combo = 0;
                m_Mobile.DebugSay("Doing {0} Combo", m_NecroComboType);
            }

            if (m_Combo == 0)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS:
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS:
                    case NecroComboType.Exp_FB_MA_PS:
                    case NecroComboType.Exp_Poison_FB_PS: spell = new ExplosionSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 1)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS: spell = new FlameStrikeSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_MB_Omen_Poison_PS: spell = new MindBlastSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_EB_Omen_Poison_PS: spell = new EnergyBoltSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS:
                    case NecroComboType.Exp_FB_MA_PS: spell = new FireballSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_Poison_FB_PS: spell = new PoisonSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 2)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS: spell = new EvilOmenSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_Poison_PS: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_Poison_PS: spell = new PoisonSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_PS: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_Poison_FB_PS: spell = new FireballSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 3)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS:
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS: spell = new PoisonSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_PS:
                    case NecroComboType.Exp_Poison_FB_PS:
                        if (Utility.RandomBool())
                            spell = new PoisonStrikeSpell(m_Mobile, null);
                        else
                            spell = new PainSpikeSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }

                ++m_Combo;
            }

            else if (m_Combo == 4)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS:
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS:
                    case NecroComboType.Exp_FB_MA_PS:
                    case NecroComboType.Exp_Poison_FB_PS:
                        if (Utility.RandomBool())
                            spell = new PoisonStrikeSpell(m_Mobile, null);
                        else
                            spell = new PainSpikeSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }
            }

            return spell;
        }
コード例 #9
0
ファイル: PainSpike.cs プロジェクト: Crome696/ServUO
 public InternalTarget(PainSpikeSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     this.m_Owner = owner;
 }
コード例 #10
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if ( m_Mobile.HitsMax > 0 && (m_Mobile.Hits / m_Mobile.HitsMax) < 0.1 && m_Mobile.Hits < 300 )
            {
                spell = CheckCastHealingSpell();
                m_Combo = -1;
                return spell;
            }
            if (m_Combo == 0)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Explosion" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new CorpseSkinSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Corpse skin" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 2)
            {
                if ( !c.Poisoned )
                {
                    spell = new PoisonSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Poison" );
                }
                else
                {
                    spell = new CurseSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Curse" );
                }

                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 3)
            {
                spell = new StrangleSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Strangle" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 4)
            {
                spell = new PainSpikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "pain spike" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 7)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Explosion" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 8)
            {
                if ( !c.Poisoned )
                {
                    spell = new PoisonSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Poison" );
                }
                else
                {
                    spell = new CurseSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Curse" );
                }

                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 9)
            {
                spell = new FlameStrikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Flamestrike" );
                m_Combo = -1;
            }
            else if (m_Combo == 10)
            {
                spell = new StrangleSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Strangle" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 11)
            {
                spell = new CorpseSkinSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Corpse skin" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 12)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Explosion" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 13)
            {
                spell = new PoisonStrikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Poison strike" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 14)
            {
                spell = new PoisonStrikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Poison strike" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 15)
            {
                spell = new PainSpikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Pain spike" );
                m_Combo = -1;
            }
            if (m_Combo == 5 && spell == null)
            {
                switch (Utility.Random(3))
                {
                    default:
                    case 0:
                        {
                            spell = new ExplosionSpell(m_Mobile, null);
                            m_Mobile.DebugSay( "Explosion" );
                            break;
                        }
                    case 1:
                        {
                            spell = new PoisonStrikeSpell(m_Mobile, null);
                            m_Mobile.DebugSay( "Poison strike" );
                            break;
                        }
                    case 2:
                        {
                            spell = new FlameStrikeSpell(m_Mobile, null);
                            m_Mobile.DebugSay( "Flamestrike" );
                            ++m_Combo; // Move to next spell
                            break;
                        }
                }
            }
            else if (m_Combo == 6 && spell == null)
            {
                spell = new VengefulSpiritSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Revenant" );
                m_Combo = -1;
            }

            return spell;
        }
コード例 #11
0
		public virtual Spell ChooseSpell( Mobile c )
		{
			Spell spell = CheckCastHealingSpell();

			if ( spell != null )
				return spell;
				
			double damage = ((m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30);
			
			if ( damage > c.Hits )
				spell = new PainSpikeSpell( m_Mobile, null );

			switch ( Utility.Random( 16 ) )
			{
				case 0:
				case 1:
				case 2:	// Poison them
				{
					m_Mobile.DebugSay( "Attempting to poison" );

					if ( !c.Poisoned )
						spell = new PoisonSpell( m_Mobile, null );

					break;
				}
				case 3:	// Bless ourselves.
				{
					m_Mobile.DebugSay( "Blessing myself" );

					spell = new BlessSpell( m_Mobile, null );
					break;
				}
				case 4:
				case 5:
				case 6: // Curse them.
				{
					m_Mobile.DebugSay( "Attempting to curse" );

					spell = GetRandomCurseSpell();
					break;
				}
				case 7:	// Paralyze them.
				{
					m_Mobile.DebugSay( "Attempting to paralyze" );

					if ( m_Mobile.Skills[SkillName.Magery].Value > 50.0 )
						spell = new ParalyzeSpell( m_Mobile, null );

					break;
				}
				case 8: // Drain mana
				{
					m_Mobile.DebugSay( "Attempting to drain mana" );

					spell = GetRandomManaDrainSpell();
					break;
				}
				case 9: // Blood oath them
				{
					m_Mobile.DebugSay( "Attempting to blood oath" );
										
					if ( m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath( c ) != m_Mobile )
						spell = new BloodOathSpell( m_Mobile, null );
						
					break;
				}
				default: // Damage them.
				{
					m_Mobile.DebugSay( "Just doing damage" );

					spell = GetRandomDamageSpell();
					break;
				}
			}

			return spell;
		}