本文整理汇总了C#中Server.Mobile.GetTalentEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.GetTalentEffect方法的具体用法?C# Mobile.GetTalentEffect怎么用?C# Mobile.GetTalentEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.GetTalentEffect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RangedHit
//.........这里部分代码省略.........
if (!pass)
{
float dodgeChance = RangedDodgeChanceCalculation(m,dif);
#region Dodge test
roll = Utility.Random( 100 );
if (dodgeChance >= roll)
{
lastAttack = AttackStatus.Dodge;
m.lastAttackToMe = AttackStatus.Dodge;
return 0;
}
#endregion
}
float damage = RangedDamageDoneCalculation(m,dmgBonus,criticalStrike,weapon);
float blockChance = RangedBlockChanceCalculation(m,dif);
if (!pass)
{
#region Block test + block reduction
roll = Utility.Random( 100 );
if (blockChance >= roll)
{
lastAttack = AttackStatus.Block;
m.lastAttackToMe = AttackStatus.Block;
amountBlocked = m.Block + m.Str/30;
damage -= amountBlocked;
#region talents
// shield specialization
if ( m.HaveTalent(Talents.ShieldSpecialization) )
{
AuraEffect af = (AuraEffect)m.GetTalentEffect(Talents.ShieldSpecialization);
roll = Utility.Random( 100 );
if ( roll < af.H )
{
m.GainMana(m,(Abilities.abilities[af.AdditionalSpell] as SpellTemplate).S1);
}
}
#endregion
}
#endregion
}
#region Armor reduction
float armor = ArmorReductionCalculation(m);
damage = damage * (1 - armor);
#endregion
#region immune
if (m.ImmunePhysicalDamage)
{
lastAttack = AttackStatus.Immune;
m.lastAttackToMe = AttackStatus.Immune;
return 0;
}
#endregion
#region absorb
damage =(int)m.DamageAbsorbCombat(damage);
if ( damage < 0 )
{
this.lastAttack = AttackStatus.Absorb;
m.lastAttackToMe = AttackStatus.Absorb;
return 0;
示例2: CastingTime
public override int CastingTime( Mobile from )
{
int ct = castingTime;
AuraEffect ae = null;
switch(from.Classe)
{
#region warrior
case Classes.Warrior:
// Improved Slam
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 1464 ] )// Slam
if ( from.HaveTalent( Talents.ImprovedSlam ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedSlam );
ct += ae.S1;
}
break;
#endregion
#region warlock
case Classes.Warlock:
// bane
if (SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 686 ] || // Shadow bolt
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 348 ] ) // Immolate
if ( from.HaveTalent( Talents.Bane ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.Bane );
ct += ae.S1;
}
//improved corruption
if (SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 172 ] ) // Corruption
if ( from.HaveTalent( Talents.ImprovedCorruption ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedCorruption );
ct += ae.S1;
}
//master summoner
if (SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 688 ] ||// summon imp
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 712 ] ||// succubus
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 691 ] ||// summon felhunter
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 597 ] ) // summon voidwalker
if ( from.HaveTalent( Talents.MasterSummoner ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.MasterSummoner );
ct += ae.S1;
}
// nightfall
if ( from.ShadowTrance && SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 686 ] )
{
from.ReleaseAura( (AuraEffect)Abilities.abilities[ 17941 ] );
return 10;
}
// fel domination
if( from.HaveTalent(Talents.FelDomination))
{
bool bonus = false;
ArrayList al1 = new ArrayList();
AuraEffect af = (AuraEffect)from.GetTalentEffect( Talents.FelDomination );
foreach( Mobile.AuraReleaseTimer art in from.Auras )
if(art.aura.SpecialState == SpecialStates.FelDomination)
{
bonus = true;
al1.Add(art);
}
if (bonus)
{
ct += af.S1;
foreach( Mobile.AuraReleaseTimer art in al1)
from.ReleaseAura(art);
}
}
break;
#endregion
#region shaman
case Classes.Shaman:
// lightining mastery
if (SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 403] || //lightining bolt
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 421 ] )//chain lightining
if ( from.HaveTalent( Talents.LightningMastery) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.LightningMastery );
ct += ae.S1;
}
// improved healing wave
if (SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 331 ] )//healing wave
if ( from.HaveTalent( Talents.ImprovedHealingWave) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedHealingWave );
ct += ae.S1;
}
// improved ghost wolf
if (SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 2645 ] )//ghost wolf
if ( from.HaveTalent( Talents.ImprovedGhostWolf) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedGhostWolf );
ct += ae.S1;
}
break;
#endregion
case Classes.Rogue:break;
#region priest
//.........这里部分代码省略.........
示例3: CriticalCalculationForSpells
public float CriticalCalculationForSpells(Mobile src,Mobile target)
{
#region critical chance + damage + test
int roll = Utility.Random( 100 );
int critical = 0;
int critTalentBonus = 0;
int criticalDamageTalentBonus = 0;
float crit = 1f;
critical = (int)(5 + (float)src.Iq/29) + (int)src.MagicalCriticalBonus;
switch ( this.resistance)
{
case Resistances.Arcane: critical += src.ArcaneCriticalBonus; break;
case Resistances.Frost: critical += src.FrostCriticalBonus; break;
case Resistances.Fire: critical += src.FireCriticalBonus; break;
case Resistances.Nature: critical += src.NatureCriticalBonus; break;
case Resistances.Shadow: critical += src.ShadowCriticalBonus; break;
case Resistances.Light: critical += src.HolyCriticalBonus; break;
}
#region CriticalChanceTalentsHandling
if (src.Level > 9)
{
switch(src.Classe)
{
case Classes.Warlock:
#region Warlock
//devastation
if ( AbilityClasses.abilityClasses[ (int)Id ] == (int)ClassesOfSpells.Destruction )
if ( src.HaveTalent( Talents.Devastation) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.Devastation );
critTalentBonus +=ae.S1;
}
// improved searing pain
if ( src.HaveTalent( Talents.ImprovedSearingPain ) &&
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 5676 ] )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.MasterHealer );
critTalentBonus += ae.S1;
}
#endregion
break;
case Classes.Mage:
#region Mage
// Incinerate
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 2138 ] || // fire blast
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 10205 ])// scorch
if ( src.HaveTalent( Talents.Incinerate ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.Incinerate );
critTalentBonus += ae.S1;
}
// FlameStrike
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 10215 ])// scorch
if ( src.HaveTalent( Talents.ImprovedFlamestrike ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedFlamestrike );
critTalentBonus += ae.S1;
}
// Combustion
if( src.HaveTalent(Talents.Combustion))
{
if(this.resistance == Resistances.Fire)
{
bool bonus = false;
ArrayList al1 = new ArrayList();
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.Combustion );
foreach( Mobile.AuraReleaseTimer art in src.Auras )
if(art.aura.SpecialState == SpecialStates.Combustion)
{
bonus = true;
al1.Add(art);
}
if (bonus)
{
critTalentBonus +=100;
foreach( Mobile.AuraReleaseTimer art in al1)
src.ReleaseAura(art);
}
}
}
#endregion
break;
case Classes.Druid:
#region Druid
#endregion
break;
case Classes.Warrior:
#region warrior
// Improved Overpower
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 7384 ]) // overpower
if ( src.HaveTalent( Talents.ImprovedOverpower ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedOverpower);
critTalentBonus += ae.S1;
}
#endregion
break;
//.........这里部分代码省略.........
示例4: DrainMana
public void DrainMana( Mobile src, Mobile target, float dmg )
{
int heal = MakeManaDamage( src, target, dmg, true );
float damage = 0f;
if ( src.HaveTalent( Talents.ImprovedDrainMana ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedDrainMana );
if(src.TalentLevel(Talents.ImprovedDrainMana) == 1)
damage = (float)(heal*0.15);
else damage = (float)(heal*0.30);
}
if (damage > 0) this.MakeDamage(src,target,damage);
src.GainMana( target, heal );
}
示例5: AbsorbCalculation
public float AbsorbCalculation(float dmg, Mobile src, Mobile target)
{
int realDamage = 0;
switch( resistance )
{
case Resistances.Fire:
realDamage = target.DiminishFireAbsordb( (int)dmg );
if (dmg - realDamage > 0)
{
if (target.HaveTalent(Talents.ImprovedFireWard))
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedFireWard );
float modif = (float)ae.S1/100;
bool haveFWSpell = false;
foreach( Mobile.AuraReleaseTimer art in target.Auras )
if ( art.ae == (AuraEffect)Abilities.abilities[10223])haveFWSpell = true;
if (haveFWSpell) this.MakeDamage(target,src,(dmg - realDamage)*modif);
}
}
realDamage = target.DiminishAbsordbAll( realDamage );
break;
case Resistances.Frost:
realDamage = target.DiminishFrostAbsordb( (int)dmg );
// Improved frost ward
if ( target.Classe == Classes.Mage )
if ( target.HaveTalent( Talents.ImprovedFrostWard ) &&
realDamage != dmg )
{
bool haveFWSpell = false;
foreach( Mobile.AuraReleaseTimer art in target.Auras )
if ( art.ae == (AuraEffect)Abilities.abilities[6143])haveFWSpell = true;
if (haveFWSpell) target.GainMana( target, (int)(( dmg - realDamage ) / 2) );
}
realDamage = target.DiminishAbsordbAll( realDamage );
break;
case Resistances.Light:
realDamage = target.DiminishHolyAbsordb( (int)dmg );
realDamage = target.DiminishAbsordbAll( realDamage );
break;
case Resistances.Arcane:
realDamage = target.DiminishArcaneAbsordb( (int)dmg );
realDamage = target.DiminishAbsordbAll( realDamage );
break;
case Resistances.Shadow:
realDamage = target.DiminishShadowAbsordb( (int)dmg );
realDamage = target.DiminishAbsordbAll( realDamage );
break;
case Resistances.Nature:
realDamage = target.DiminishNatureAbsordb( (int)dmg );
realDamage = target.DiminishAbsordbAll( realDamage );
break;
case Resistances.Armor:
realDamage = target.DiminishAbsorbPhysical( (int)dmg );
realDamage = target.DiminishAbsordbAll( realDamage );
break;
}
realDamage = target.DiminishAbsorbAllDamage(realDamage);
return realDamage;
}
示例6: RangedBlockChanceCalculation
public float RangedBlockChanceCalculation(Mobile m,float dif)
{
float chance = 0f;
if (m.activeShield != null)
{
if (m is Character)
{
chance = (int)((m as Character).BaseBlockChance + BlockBonus - BlockMalus - (int)dif/2);
}
else chance = 5 + BlockBonus - BlockMalus - (int)dif/2;
#if TRACES_COMBAT
Console.WriteLine("Block result: chance: " + chance + " roll");
#endif
}
// shield specialization
if (m.HaveTalent(Talents.ShieldSpecialization))
{
AuraEffect af = (AuraEffect)m.GetTalentEffect(Talents.ShieldSpecialization);
chance +=af.S1;
}
return chance;
}
示例7: CoolDown
public virtual int CoolDown( Mobile from )
{
int coldwn = cooldown;
AuraEffect ae = null;
if(this is SpellTemplate)
{
switch(from.Classe)
{
#region mage
case Classes.Mage:
// improved fireblast
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 2136 ] )// FireBlast
if ( from.HaveTalent( Talents.ImprovedFireBlast ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedFireBlast );
coldwn += ae.S1;
}
// improved frost nova
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 6131 ] )// FireBlast
if ( from.HaveTalent( Talents.ImprovedFrostNova ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedFrostNova );
coldwn += ae.S1;
}
break;
#endregion
#region warrior
case Classes.Warrior:
//improved taunt
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 355 ] )// Taunt
if ( from.HaveTalent( Talents.ImprovedTaunt ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedTaunt );
coldwn += ae.S1;
}
//improved intercept
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 20252 ] )// intercept
if ( from.HaveTalent( Talents.ImprovedIntercept ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedIntercept );
coldwn += ae.S1;
}
break;
#endregion
#region warlock
case Classes.Warlock:
break;
#endregion
}
if(from.SummonedBy != null)
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 4388] )
if(from.SummonedBy.HaveTalent(Talents.ImprovedLashOfPain))
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedLashOfPain );
coldwn += ae.S1;
}
}
int cooldwn = coldwn;
#region Cooldown for ability
foreach(Mobile.AuraReleaseTimer art in from.Auras)
{
if (art.aura.CooldownEffectedAbilityList != 0)
{
if (from.SpecialForAuras[art.aura.CooldownEffectedAbilityList] != null)
{
if (from.SpecialForAuras[art.aura.CooldownEffectedAbilityList] is ArrayList)
{
if((from.SpecialForAuras[art.aura.CooldownEffectedAbilityList] as ArrayList).Contains((int)this.Id))
cooldwn =(int)((cooldwn + art.aura.CooldownBonusForAbility)*art.aura.CooldownModificatorForAbility);
}
if (from.SpecialForAuras[art.aura.CooldownEffectedAbilityList] is int)
{
int list = (int)from.SpecialForAuras[art.aura.CooldownEffectedAbilityList];
if( list == this.Id)
cooldwn = (int)((cooldwn + art.aura.CooldownBonusForAbility)*art.aura.CooldownModificatorForAbility);
}
}
}
if (art.aura.CooldownEffectedAbilityClass != 0)
{
if ( AbilityClasses.abilityClasses[ (int)Id ] == art.aura.CooldownEffectedAbilityClass )
{
cooldwn = (int)((cooldwn + art.aura.CooldownBonusForAbility)*art.aura.CooldownModificatorForAbility);
}
}
}
foreach(PermanentAura art in from.PermanentAuras)
{
if (art.aura.CooldownEffectedAbilityList != 0)
{
if (from.SpecialForAuras[art.aura.CooldownEffectedAbilityList] != null)
{
if (from.SpecialForAuras[art.aura.CooldownEffectedAbilityList] is ArrayList)
{
if((from.SpecialForAuras[art.aura.CooldownEffectedAbilityList] as ArrayList).Contains((int)this.Id))
{
cooldwn =(int)((cooldwn + art.aura.CooldownBonusForAbility)*art.aura.CooldownModificatorForAbility);
}
//.........这里部分代码省略.........
示例8: NatureSpellHealModifier
public float NatureSpellHealModifier( Mobile from )
{
float mod = 1.0f;
AuraEffect ae = null;
if ( from.HaveTalent( Talents.SpiritualHealing ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.SpiritualHealing );
mod += (float)( ae.s1 ) / 100f;
}
if ( from.HaveTalent( Talents.ImprovedHolyLight ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedHolyLight );
mod += (float)( ae.s1 ) / 100f;
}
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 13542 ] )// Mend pet
if ( from.HaveTalent( Talents.ImprovedRenew ) )
{
ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedRenew );
mod += (float)( ae.s1 ) / 100f;
}
return mod;
}
示例9: Range
public int Range( Mobile from )
{
int rng = range;
if ( from.Classe == Classes.Warlock &&
( resistance == Resistances.Fire ||
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 686 ] ||
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 17877 ] ) )
if ( from.HaveTalent( Talents.DestructiveReach ) )
{
AuraEffect ae = (AuraEffect)from.GetTalentEffect( Talents.DestructiveReach );
float r = (float)range;
r += r * -(float)( ae.S1 ) / 100f;
rng = (int)r;
}
return rng;
}
示例10: LifeTap
public void LifeTap( Mobile src, Mobile target, float dmg )
{
target.LooseHits(src,(int)dmg);
if ( src.HaveTalent( Talents.ImprovedLifeTap ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedLifeTap );
float minus = (float)dmg;
minus += ( minus * (float)ae.S1 ) / 100f;
target.GainMana( src, (int)minus);
}
src.GainMana( src, (int)dmg );
}
示例11: MakeDMGSpellTriggers
public void MakeDMGSpellTriggers(Mobile src, Mobile target, LastSpellState state,int dmg)
{
int roll;
#region Additional effects
#region OnCriticalTalentsHandling
if(state == LastSpellState.Critical)
{
if(src.Level > 9)
{
switch (src.Classe)
{
#region mage
case Classes.Mage:
// ignite
if ( resistance == Resistances.Fire)
{
if ( src.HaveTalent( Talents.Ignite ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.Ignite );
AuraEffect af = (AuraEffect)Abilities.abilities[12654];
float modif = (float)ae.S1/100;
af.ApplyDot(src, target, (int)(dmg*modif), af.T1, af.Duration(src));
}
}
break;
#endregion
#region warrior
case Classes.Warrior:
break;
#endregion
}
}
}
#endregion
#region Other Spell effecting Talents
switch (src.Classe)
{
#region mage
case Classes.Mage:
//Impact
if (state == LastSpellState.Normal)
{
if (src.HaveTalent(Talents.Impact))
{
if (this.resistance == Resistances.Fire)
{
AuraEffect af = (AuraEffect)src.GetTalentEffect(Talents.Impact);
roll = Utility.Random( 100 );
if(roll < af.S1)
{
AuraEffect ef = (AuraEffect)Abilities.abilities[(int)af.AdditionalSpell];
Aura aura = new Aura();
aura.ForceStun = true;
target.AddAura(src,ef,aura,true);
}
}
}
// Improved Scorch
if ( src.HaveTalent( Talents.ImprovedScorch ) &&
SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 2948 ] )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedScorch);
roll = Utility.Random( 100 );
if(roll < ae.S1)
{
AuraEffect ef = (AuraEffect)Abilities.abilities[(int)ae.AdditionalSpell];
Aura aura = new Aura();
aura.FireDamageTakenModifier = 1 + (float)ef.S1/100;
target.AddAura(src,ef,aura,true);
}
}
// Arcane Concentration
int ClearingState = 0xd45a45;
if ( src.HaveTalent( Talents.ArcaneConcentration ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ArcaneConcentration);
roll = Utility.Random( 100 );
if(roll < ae.H)
{
src.AdditionnalStates.Add(ClearingState);
}
}
}
break;
#endregion
#region Warlock
case Classes.Warlock:
///aftewmatch
if ( AbilityClasses.abilityClasses[ (int)Id ] == (int)ClassesOfSpells.Destruction )
if ( src.HaveTalent( Talents.Aftermath ) )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.Aftermath );
if ( Utility.Random( 100 ) < ae.H )
{
//.........这里部分代码省略.........
示例12: Heal
public void Heal( Mobile src, Mobile target,float dmg )
{
float spellMod = 1.0f;
dmg +=src.HealGiveIncrease - src.HealGiveDecrease;
dmg *=src.HealGiveModifier;
dmg +=src.HealTakeIncrease - src.HealTakeDecrease;
dmg *=src.HealTakeModifier;
switch( resistance )
{
case Resistances.Light:
spellMod = LightSpellHealModifier( src );
break;
case Resistances.Nature:
spellMod = NatureSpellHealModifier( src );
break;
}
dmg *= spellMod;
if ( src.Classe == Classes.Warlock )
{
#region Warlock Improved HealthStone
if ( src.HaveTalent( Talents.ImprovedHealthstone ) && SpellTemplate.SpellEffects[ 5720 ] == SpellTemplate.SpellEffects[ Id ] )
{
AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedHealthstone );
dmg += dmg * (float)( ae.s1 ) / 100f;
}
#endregion
}
target.GainHealth( src, (int)dmg );
}
示例13: GetManaCost
//need modifications talents modif this too
public int GetManaCost(Mobile c)
{
int mc = manaCost;
switch (c.Classe)
{
#region mage
case Classes.Mage:
// frost channeling
if ( resistance == Resistances.Frost )
{
if ( c.HaveTalent( Talents.FrostChanneling ) )
{
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.FrostChanneling );
mc = (int)(mc * 1 + (float)ae.S1/100);
}
}
//arcane concentration
int ClearingState = 0xd45a45;
if ( c.AdditionnalStates.Contains(ClearingState))
{
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.ArcaneConcentration);
mc +=ae.S1;
c.AdditionnalStates.Remove(ClearingState);
}
// ArcanePower
if( c.HaveTalent(Talents.ArcanePower))
{
bool bonus = false;
ArrayList al1 = new ArrayList();
AuraEffect af = (AuraEffect)c.GetTalentEffect( Talents.ArcanePower );
foreach( Mobile.AuraReleaseTimer art in c.Auras )
if(art.aura.SpecialState == SpecialStates.ArcanePower)
{
bonus = true;
al1.Add(art);
}
if (bonus)
{
mc = (int)(mc * (1 + (float)af.S1/100));
}
}
break;
#endregion
#region warrior
case Classes.Warrior:
// improved heroic strike
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 284 ] )//herroic strike
if ( c.HaveTalent( Talents.ImprovedHeroicStrike) )
{
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.ImprovedHeroicStrike );
mc += ae.S1;
}
//improved thunder clap
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 6343 ] )// Thunder clap
if ( c.HaveTalent( Talents.ImprovedThunderClap ) )
{
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.ImprovedThunderClap );
mc += ae.s1;
}
//improved sunder armor
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 11597 ] )// Sunder aromr
if ( c.HaveTalent( Talents.ImprovedSunderArmor ) )
{
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.ImprovedSunderArmor );
mc += ae.s1;
}
// improved execute
if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 5308 ] )//execute
if ( c.HaveTalent( Talents.ImprovedExecute) )
{
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.ImprovedExecute );
mc += ae.S1;
}
break;
#endregion
#region Warlock
case Classes.Warlock:
if ( AbilityClasses.abilityClasses[ (int)Id ] == (int)ClassesOfSpells.Destruction )
if ( c.HaveTalent( Talents.Cataclysm) )
{
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.Cataclysm );
mc = (int)(mc*(1 + (float)ae.S1/100));
}
// fel domination
if( c.HaveTalent(Talents.FelDomination))
{
bool bonus = false;
ArrayList al1 = new ArrayList();
AuraEffect ae = (AuraEffect)c.GetTalentEffect( Talents.FelDomination );
foreach( Mobile.AuraReleaseTimer art in c.Auras )
if(art.aura.SpecialState == SpecialStates.FelDomination)
{
bonus = true;
al1.Add(art);
}
if (bonus)
//.........这里部分代码省略.........
示例14: Duration
public virtual int Duration( Mobile from )
{
int dur = duration;
switch (from.Classe)
{
case Classes.Mage:
// Permafrost
if ( resistance == Resistances.Frost )
{
if ( from.HaveTalent( Talents.Permafrost ) && SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 12485 ] )
{
AuraEffect ae = (AuraEffect)from.GetTalentEffect( Talents.Permafrost );
return duration + ae.S1;
}
}
break;
case Classes.Warrior:
// Improved shield block
if ( from.HaveTalent( Talents.ImprovedShieldBlock ) && SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 2565 ] )
{
AuraEffect ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedShieldBlock );
return duration + ae.S2;
}
// improved disarm
if ( from.HaveTalent( Talents.ImprovedDisarm ) && SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 676 ] )
{
AuraEffect ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedDisarm );
return duration + ae.S2;
}
// improved shield wall
if ( from.HaveTalent( Talents.ImprovedShieldWall ) && SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 871 ] )
{
AuraEffect ae = (AuraEffect)from.GetTalentEffect( Talents.ImprovedShieldWall );
return duration + ae.S2;
}
break;
}
#region Duration for ability
foreach(Mobile.AuraReleaseTimer art in from.Auras)
{
if (art.aura.DurationEffectedAbilityList != 0)
{
if (from.SpecialForAuras[art.aura.DurationEffectedAbilityList] != null)
{
if (from.SpecialForAuras[art.aura.DurationEffectedAbilityList] is ArrayList)
{
if((from.SpecialForAuras[art.aura.DurationEffectedAbilityList] as ArrayList).Contains((int)this.Id))
dur =(int)((dur + art.aura.DurationBonusForAbility)*art.aura.DurationModificatorForAbility);
}
if (from.SpecialForAuras[art.aura.DurationEffectedAbilityList] is int)
{
int list = (int)from.SpecialForAuras[art.aura.DurationEffectedAbilityList];
if( list == this.Id)
dur = (int)((dur + art.aura.DurationBonusForAbility)*art.aura.DurationModificatorForAbility);
}
}
}
if (art.aura.DurationEffectedAbilityClass != 0)
{
if ( AbilityClasses.abilityClasses[ (int)Id ] == art.aura.DurationEffectedAbilityClass )
{
dur = (int)((dur + art.aura.DurationBonusForAbility)*art.aura.DurationModificatorForAbility);
}
}
}
foreach(PermanentAura art in from.PermanentAuras)
{
if (art.aura.DurationEffectedAbilityList != 0)
{
if (from.SpecialForAuras[art.aura.DurationEffectedAbilityList] != null)
{
if (from.SpecialForAuras[art.aura.DurationEffectedAbilityList] is ArrayList)
{
if((from.SpecialForAuras[art.aura.DurationEffectedAbilityList] as ArrayList).Contains((int)this.Id))
{
dur =(int)((dur + art.aura.DurationBonusForAbility)*art.aura.DurationModificatorForAbility);
}
}
if (from.SpecialForAuras[art.aura.DurationEffectedAbilityList] is int)
{
int list = (int)from.SpecialForAuras[art.aura.DurationEffectedAbilityList];
if( list == this.Id)
dur = (int)((dur + art.aura.DurationBonusForAbility)*art.aura.DurationModificatorForAbility);
}
}
}
if (art.aura.DurationEffectedAbilityClass != 0)
{
if ( AbilityClasses.abilityClasses[ (int)Id ] == art.aura.DurationEffectedAbilityClass )
{
dur = (int)((dur + art.aura.DurationBonusForAbility)*art.aura.DurationModificatorForAbility);
}
}
}
#endregion
//.........这里部分代码省略.........
示例15: ParryChanceCalculation
public float ParryChanceCalculation(Mobile m,float dif)
{
float chance = 0f;
if(m.HaveSpell(3127))
{
if (m is Character) chance = (int)((m as Character).BaseParryChance + ParryBonus - ParryMalus - dif/2);
else chance = 5 + ParryBonus - ParryMalus - (int)dif/2;
#if TRACES_COMBAT
Console.WriteLine("Parry result: parryChance: " + chance + " roll");
#endif
if ( m.HaveTalent( Talents.Deflection) )
{
AuraEffect ae = (AuraEffect)m.GetTalentEffect( Talents.Deflection );
chance = (chance * 1 + (float)ae.S1/100);
}
}
return chance;
}