• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Third.PoisonSpell类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Spells.Third.PoisonSpell的典型用法代码示例。如果您正苦于以下问题:C# PoisonSpell类的具体用法?C# PoisonSpell怎么用?C# PoisonSpell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PoisonSpell类属于Server.Spells.Third命名空间,在下文中一共展示了PoisonSpell类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InternalTarget

 public InternalTarget(PoisonSpell owner)
     : base(owner.Caster.EraML ? 10 : 12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:5,代码来源:Poison.cs


示例2: ChooseSpell

        public virtual Spell ChooseSpell(Mobile c)
        {
            Spell spell = null;

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

                if (spell != null)
                    return spell;

                if (IsNecromancer)
                {
                    double psDamage = ((m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30);

                    if (psDamage > c.Hits)
                        return new PainSpikeSpell(m_Mobile, null);
                }

                switch (Utility.Random(16))
                {
                    case 0:
                    case 1:	// Poison them
                        {
                            if (c.Poisoned)
                                goto default;

                            m_Mobile.DebugSay("Attempting to poison");

                            spell = new PoisonSpell(m_Mobile, null);
                            break;
                        }
                    case 2:	// Bless ourselves
                        {
                            m_Mobile.DebugSay("Blessing myself");

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

                            spell = GetRandomCurseSpell();
                            break;
                        }
                    case 5:	// Paralyze them
                        {
                            if (c.Paralyzed || m_Mobile.Skills[SkillName.Magery].Value <= 50.0)
                                goto default;

                            m_Mobile.DebugSay("Attempting to paralyze");

                            spell = new ParalyzeSpell(m_Mobile, null);
                            break;
                        }
                    case 6: // Drain mana
                        {
                            m_Mobile.DebugSay("Attempting to drain mana");

                            spell = GetRandomManaDrainSpell();
                            break;
                        }
                    case 7: // Invis ourselves
                        {
                            if (Utility.RandomBool())
                                goto default;

                            m_Mobile.DebugSay("Attempting to invis myself");

                            spell = new InvisibilitySpell(m_Mobile, null);
                            break;
                        }
                    default: // Damage them
                        {
                            m_Mobile.DebugSay("Just doing damage");

                            spell = GetRandomDamageSpell();
                            break;
                        }
                }

                return spell;
            }

            spell = CheckCastHealingSpell();

            if (spell != null)
                return spell;

            switch (Utility.Random(3))
            {
                case 0: // Poison them
                    {
                        if (c.Poisoned)
                            goto case 1;

                        spell = new PoisonSpell(m_Mobile, null);
                        break;
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:101,代码来源:MageAI.cs


示例3: DoActionCombat


//.........这里部分代码省略.........
                    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.CanFlee)
            {
                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)
                    {
                        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, Core.ML ? 10 : 12))
            {
                // We are ready to cast a spell

                Spell spell = null;
                Mobile toDispel = FindDispelTarget(true);

                if (m_Mobile.Poisoned) // Top cast priority is cure
                {
                    m_Mobile.DebugSay("I am going to cure myself");

                    spell = new CureSpell(m_Mobile, null);
                }
                else if (toDispel != null) // Something dispellable is attacking us
                {
                    m_Mobile.DebugSay("I am going to dispel {0}", toDispel);

                    spell = DoDispel(toDispel);
                }
                else 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 PoisonSpell(m_Mobile, null);
                }
                else
                {
                    spell = ChooseSpell(c);
                }

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

                if (SmartAI && toDispel != null)
                {
                    if (m_Mobile.InRange(toDispel, 10))
                        RunFrom(toDispel);
                    else if (!m_Mobile.InRange(toDispel, Core.ML ? 10 : 12))
                        RunTo(toDispel);
                }
                else
                {
                    RunTo(c);
                }

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

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

            m_LastTarget = c;
            m_LastTargetLoc = c.Location;

            return true;
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:101,代码来源:MageAI.cs


示例4: GetMagerySpell

		public Spell GetMagerySpell()
		{
			Spell spell = null;

			// always check for bless, per OSI
			spell = CheckBless();

			if ( spell != null )
			{
				if ( m_Mobile.Debug )
					m_Mobile.Say( 1156, "Blessing my self" );

				return spell;
			}

			// always check for curse, per OSI
			spell = CheckCurse();

			if ( spell != null )
			{
				if ( m_Mobile.Debug )
					m_Mobile.Say( 1156, "Cursing my opponent" );

				return spell;
			}

			// 25% chance to cast poison if needed
			if ( m_Mobile.Combatant != null && !m_Mobile.Combatant.Poisoned && Utility.RandomDouble() > 0.75 )
			{
				if ( m_Mobile.Debug )
					m_Mobile.Say( 1156, "Casting Poison" );

				spell = new PoisonSpell( m_Mobile, null );
			}

			// scaling chance to drain mana based on how much of a caster the opponent is
			if ( CheckManaDrain() > 0.75 )
			{
				if ( m_Mobile.Skills[SkillName.Magery].Value > 80.0 )
					spell = new ManaVampireSpell( m_Mobile, null );
				else if ( m_Mobile.Skills[SkillName.Magery].Value > 40.0 )
					spell = new ManaDrainSpell( m_Mobile, null );

				if ( spell != null )
				{
					if ( m_Mobile.Debug )
						m_Mobile.Say( 1156, "Draining mana" );

					return spell;
				}
			}

			// 10% chance to summon help
			if ( m_CanUseMagerySummon && Utility.RandomDouble() > 0.90 )
			{
				spell = CheckMagerySummon();

				if ( spell != null )
				{
					if ( m_Mobile.Debug )
						m_Mobile.Say( 1156, "Summoning help" );
					return spell;
				}
			}

			// Let's just blast the hell out of them.
			return GetRandomMageryDamageSpell();
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:68,代码来源:OmniAI+Magery.cs


示例5: InternalTarget

			public InternalTarget( PoisonSpell owner ) : base( 12, false, TargetFlags.Harmful )
			{
				m_Owner = owner;
			}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:4,代码来源:Poison.cs


示例6: ChooseSpell

        public virtual Spell ChooseSpell(Mobile c)
        {
            Spell spell = this.CheckCastHealingSpell();

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

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

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

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

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

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

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

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

                        spell = this.GetRandomManaDrainSpell();
                        break;
                    }
                case 9:
                case 10: // Blood oath them
                    {
                        this.m_Mobile.DebugSay("Attempting to blood oath");
										
                        if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath(c) != this.m_Mobile)
                            spell = new BloodOathSpell(this.m_Mobile, null);
						
                        break;
                    }
                case 11:
                case 12: // Animate dead
                    {
                        this.m_Mobile.DebugSay("Attempting to animate dead");

                        if ((this.m_Animated == null || !this.m_Animated.Alive) && this.m_Mobile.Skills[SkillName.Necromancy].Value > 40)
                            spell = new AnimateDeadSpell(this.m_Mobile, null);

                        break;
                    }
                case 13:
                case 14:
                    {
                        this.m_Mobile.DebugSay("Attempting to cast vengeful spirit");

                        if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 80 && (this.m_Mobile.Followers + 3) < this.m_Mobile.FollowersMax)
                            spell = new VengefulSpiritSpell(this.m_Mobile, null);

                        break;
                    }
                default: // Damage them.
                    {
                        this.m_Mobile.DebugSay("Just doing damage");

                        spell = this.GetRandomDamageSpell();
                        break;
                    }
            }

            return spell;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:98,代码来源:NecroMageAI.cs


示例7: DoCombo

        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_ComboType == ComboType.None)
                m_ComboType = (ComboType)Utility.RandomMinMax(1, 7);

            if (m_Combo == 1)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                    case ComboType.Exp_FB_MA_Poison:
                    case ComboType.Exp_FB_Poison_Light:
                    case ComboType.Exp_FB_MA_Light:
                    case ComboType.Exp_Poison_FB_Light: spell = new ExplosionSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 2)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison: spell = new FlameStrikeSpell(m_Mobile, null); break;
                    case ComboType.Exp_MB_Poison: spell = new MindBlastSpell(m_Mobile, null); break;
                    case ComboType.Exp_EB_Poison: spell = new EnergyBoltSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_MA_Poison: spell = new FireballSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_Poison_Light: spell = new FireballSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_MA_Light: spell = new FireballSpell(m_Mobile, null); break;
                    case ComboType.Exp_Poison_FB_Light: spell = new PoisonSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 3)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                        spell = new PoisonSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                    case ComboType.Exp_FB_MA_Poison: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_Poison_Light: spell = new PoisonSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_MA_Light: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case ComboType.Exp_Poison_FB_Light: spell = new FireballSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 4)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                        spell = new LightningSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                    case ComboType.Exp_FB_MA_Poison: spell = new PoisonSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_Poison_Light:
                    case ComboType.Exp_FB_MA_Light:
                    case ComboType.Exp_Poison_FB_Light: spell = new LightningSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }
            }
            else if (m_Combo == 5)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                    case ComboType.Exp_FB_MA_Poison:
                    case ComboType.Exp_FB_Poison_Light:
                    case ComboType.Exp_FB_MA_Light:
                    case ComboType.Exp_Poison_FB_Light:
                        spell = new LightningSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }
            }

            m_Combo++; // Move to next spell

            if (spell == null)
                spell = new PoisonSpell(m_Mobile, null);

            return spell;
        }
开发者ID:Ravenwolfe,项目名称:ServUO,代码行数:91,代码来源:MageAI.cs


示例8: DoCombo

		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 ( !( ( m_Mobile is IEvoCreature || m_Mobile is EvolutionDragon ) && c is PlayerMobile ) && !c.Poisoned )
					spell = new PoisonSpell( m_Mobile, null );

				++m_Combo; // Move to next spell
			}

			if ( m_Combo == 3 && spell == null )
			{
				switch ( Utility.Random( 3 ) )
				{
					default:
					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;
					}
				}
			}
			else if ( m_Combo == 4 && spell == null )
			{
				spell = new MindBlastSpell( m_Mobile, null );
				m_Combo = -1;
			}

			return spell;
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:60,代码来源:MageAI.cs


示例9: DoCombo

        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
            }
//.........这里部分代码省略.........
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:101,代码来源:NecroMageAI.cs


示例10: DoActionCombat


//.........这里部分代码省略.........
                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.CanFlee )
            {
                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;
                Mobile toDispel = FindDispelTarget( true );

                if ( m_Mobile.Poisoned ) // Top cast priority is cure
                {
                    m_Mobile.DebugSay( "I am going to cure myself" );

                    spell = new CureSpell( m_Mobile, null );
                }
                else if ( toDispel != null ) // Something dispellable is attacking us
                {
                    m_Mobile.DebugSay( "I am going to dispel {0}", toDispel );

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

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

                RunTo( c );

                TimeSpan delay = TimeSpan.FromSeconds( m_Mobile.ActiveSpeed );

                if ( spell != null )
                {
                    spell.Cast();
                    delay += spell.GetCastRecovery();
                }

                if ( m_Mobile.Mana < 20 )
                    m_NextCastTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 ); // Let mana raise...
                else
                    m_NextCastTime = DateTime.Now + delay;
            }
            else if ( m_Mobile.Spell == null || !m_Mobile.Spell.IsCasting )
            {
                RunTo( c );
            }

            return true;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:101,代码来源:MageAI.cs


示例11: ChooseSpell

        public override Spell ChooseSpell( Mobile c )
        {
            Spell spell = CheckCastHealingSpell();

            if ( spell != null )
                return spell;

            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" );

                        if ( Utility.RandomBool() && !ArcaneEmpowermentSpell.IsBuffed( m_Mobile ) )
                            spell = new ArcaneEmpowermentSpell( m_Mobile, null );
                        else
                            spell = new BlessSpell( m_Mobile, null );

                        break;
                    }
                case 4: // Wildfire
                    {
                        m_Mobile.DebugSay( "Incendio!" );

                        spell = new WildfireSpell( m_Mobile, null );

                        break;
                    }
                case 5: // Reduce their cast speed
                    {
                        if ( c.InRange( m_Mobile.Location, 6 ) )
                        {
                            if ( m_Mobile.Skills[SkillName.Spellweaving].Value >= 90.0 )
                                spell = new EssenceOfWindSpell( m_Mobile, null );
                            else if ( c.InRange( m_Mobile.Location, 2 ) )
                                spell = new ThunderstormSpell( m_Mobile, null );
                        }

                        m_Mobile.DebugSay( "Attempting to reduce their cast speed" );

                        break;
                    }
                case 6: // Curse them.
                    {
                        m_Mobile.DebugSay( "Attempting to curse" );

                        spell = GetRandomCurseSpell( c );
                        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( c );
                        break;
                    }

                default: // Damage them.
                    {
                        m_Mobile.DebugSay( "Just doing damage" );

                        spell = GetRandomDamageSpell( c );
                        break;
                    }
            }

            return spell;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:88,代码来源:ArcanistAI.cs


示例12: DoActionCombat


//.........这里部分代码省略.........
					{
						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;
				Mobile toDispel = FindDispelTarget(true);

				if (m_Mobile.Poisoned) // Top cast priority is cure
				{
					spell = new CureSpell(m_Mobile, null);
					try
					{
						if ((((m_Mobile.Skills[SkillName.Magery].Value / (m_Mobile.Poison.Level + 1)) - 20) * 7.5) > 50)
						{
							spell = new CureSpell(m_Mobile, null);
						}
						else
						{
							spell = new ArchCureSpell(m_Mobile, null);
						}
					}
					catch
					{
						spell = new CureSpell(m_Mobile, null);
					}
				}
				else if (toDispel != null) // Something dispellable is attacking us
				{
					spell = DoDispel(toDispel);
				}
				else if (m_Combo != -1) // We are doing a spell combo
				{
					spell = DoCombo(c);
				}
				else if ((c.Spell is HealSpell || c.Spell is GreaterHealSpell) && !c.Poisoned) // They have a heal spell out
				{
					spell = new PoisonSpell(m_Mobile, null);
				}
				else
				{
					spell = ChooseSpell(c);
				}

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

				if (SmartAI && toDispel != null)
				{
					if (m_Mobile.InRange(toDispel, 10))
						RunFrom(toDispel);
					else if (!m_Mobile.InRange(toDispel, 12))
						RunTo(toDispel);
				}
				else
				{
					RunTo(c);
				}

				if (spell != null && spell.Cast())
				{
					TimeSpan delay;

					if (SmartAI || (spell is DispelSpell))
					{
						delay = TimeSpan.FromSeconds(m_Mobile.ActiveSpeed);
					}
					if (spell is HarmSpell)
					{
						delay = TimeSpan.FromSeconds(m_Mobile.ActiveSpeed);
					}

					else
					{
						double del = ScaleByMagery(4.3);
						double min = 6.0 - (del * 0.75);
						double max = 6.0 - (del * 1.25);

						delay = TimeSpan.FromSeconds(min + ((max - min) * Utility.RandomDouble()));
					}

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

			return true;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:EvilMageAI.cs


示例13: DoCombo

		public virtual Spell DoCombo(Mobile c)
		{
			Spell spell = null;

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

				++m_Combo; // Move to next spell
			}

			else if (m_Combo == 3)
			{

				//m_Mobile.Say( "combo phase 3" );
				if (c.Poisoned)
					spell = new WeakenSpell(m_Mobile, null);

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

				++m_Combo; // Move to next spell
			}

			else if (m_Combo == 4)
			{
				//	m_Mobile.Say( "combo phase 4 ebolt" );
				spell = new EnergyBoltSpell(m_Mobile, null);

				++m_Combo; // Move to next spell
			}

			else if (m_Combo == 5)
			{
				//m_Mobile.Say( "combo phase 5" );
				if (c.Poisoned && c.Alive)
				{
					spell = new HarmSpell(m_Mobile, null);

					m_Combo = 5; // Move to next spell
				}

				if (!c.Poisoned)
				{
					if (m_Mobile.Mana > 20)
						spell = new EnergyBoltSpell(m_Mobile, null);

					if (m_Mobile.Mana < 19)
						spell = new LightningSpell(m_Mobile, null);
					m_Combo = -1; // Reset combo state
				}

			}

			return spell;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:70,代码来源:EvilMageAI.cs


示例14: ChooseSpell

        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

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

                if( spell != null )
                    return spell;

                switch( Utility.Random(16) )
                {
                    case 0:
                        {
                            spell = new FireballSpell(m_Mobile, null);
                            break;
                        }
                    case 1:
                        {
                            m_Mobile.DebugSay("Protecting myself");

                            spell = new ProtectionSpell(m_Mobile, null);
                            break;
                        }
                    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:
                        {
                            m_Mobile.DebugSay("Summoning FIRE FIELD!!!");

                            spell = new FireFieldSpell(m_Mobile, null);
                            break;
                        }
                    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;
                        }

                    default: // Damage them.
                        {
                            m_Mobile.DebugSay("Just doing damage");

                            spell = GetRandomDamageSpell();
                            break;
                        }
                }

                return spell;
            }

            spell = CheckCastHealingSpell();

            if( spell != null )
                return spell;

            if( !c.Poisoned && c.Spell != null && c.Mana > (c.ManaMax / 2) )
                return GetRandomManaDrainSpell();

            if( m_Mobile.Hits < (m_Mobile.HitsMax / 2) && 0.30 > Utility.RandomDouble() )
            {
                spell = new ProtectionSpell(m_Mobile, null);

                if( spell == null )
                    spell = new BlessSpell(m_Mobile, null);

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:MageAI.cs


示例15: DoCombo

		public virtual Spell DoCombo( Mobile c )
		{
			Spell spell = null;

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

				++m_Combo; // Move to next spell
			}

			if ( m_Combo == 3 && spell == null )
			{
				switch ( Utility.Random( 3 ) )
				{
					default:
					case 0:
					{
						if ( c.Int < c.Dex )
							spell = new MindRotSpell( m_Mobile, null );
						else
							spell = new WitherSpell( m_Mobile, null );

						++m_Combo; // Move to next spell

						break;
					}
					case 1:
					{
						spell = new StrangleSpell( m_Mobile, null );
						m_Combo = -1; // Reset combo state
						break;
					}
					case 2:
					{
						spell = new WitherSpell( m_Mobile, null );
						m_Combo = -1; // Reset combo state
						break;
					}
				}
			}
			else if ( m_Combo == 4 && spell == null )
			{
				spell = new VengefulSpiritSpell( m_Mobile, null );
				m_Combo = -1;
			}

			return spell;
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:60,代码来源:NecroMageAI.cs


示例16: ChooseSpell

        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

            spell = CheckCastHealingSpell();

            if ( spell != null )
                return spell;

            switch (Utility.Random(5))
            {
                default:
                case 0: case 1: case 2: // Deal some damage
                    {
                        spell = GetRandomDamageSpell(c);
                        break;
                    }
                case 3: // Curse it
                    {
                        spell = GetRandomCurseSpell();
                        break;
                    }
                case 4: // Set up a combo of attacks
                    {
                        switch ( Utility.Random( 6 ) )
                        {
                            default: case  0:
                            {
                                m_Combo = 0;
                                spell = new PoisonSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Poison" );
                                break;
                            }
                            case  1:
                            {
                                m_Combo = 0;
                                spell = new EvilOmenSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Evil Omen" );
                                break;
                            }
                            case  2:
                            {
                                m_Combo = 7;
                                spell = new CorpseSkinSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Corpse Skin" );
                                break;
                            }
                            case  3:
                            {
                                m_Combo = 7;
                                spell = new CurseSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Curse" );
                                break;
                            }
                            case  4:
                            {
                                m_Combo = 10;
                                spell = new CurseSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Curse" );
                                break;
                            }
                            case  5:
                            {
                                m_Combo = 10;
                                spell = new ExplosionSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Explosion" );
                                break;
                            }
                        }
                        break;
                    }
            }

            return spell;
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:75,代码来源:NecroMageAI.cs


示例17: ChooseSpell

        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

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

                if ( spell != null )
                    return spell;

                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( "B 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Targeting.LandTarget类代码示例发布时间:2022-05-26
下一篇:
C# Fifth.ParalyzeSpell类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap