本文整理匯總了C#中Server.Spells.Third.PoisonSpell類的典型用法代碼示例。如果您正苦於以下問題:C# PoisonSpell類的具體用法?C# PoisonSpell怎麽用?C# PoisonSpell使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PoisonSpell類屬於Server.Spells.Third命名空間,在下文中一共展示了PoisonSpell類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: InternalTarget
public InternalTarget(PoisonSpell owner)
: base(owner.Caster.EraML ? 10 : 12, false, TargetFlags.Harmful)
{
m_Owner = owner;
}
示例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;
//.........這裏部分代碼省略.........
示例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;
}
示例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();
}
示例5: InternalTarget
public InternalTarget( PoisonSpell owner ) : base( 12, false, TargetFlags.Harmful )
{
m_Owner = owner;
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
//.........這裏部分代碼省略.........
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
//.........這裏部分代碼省略.........
示例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;
}