本文整理汇总了C#中Server.Items.Item.GetSkillId方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetSkillId方法的具体用法?C# Item.GetSkillId怎么用?C# Item.GetSkillId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.Item
的用法示例。
在下文中一共展示了Item.GetSkillId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkillDifCalculation
public float SkillDifCalculation(Item weapon, Mobile m)
{
float dif = 0f; // i must find some formula for this
if(this is Character)
{
int skid = weapon.GetSkillId();
if ( skid != 0 )
{
Skill sk3 = this.AllSkills[(ushort)skid];
if (sk3 != null)
{
if (m is Character)
{ /* not sure by this formula*/
Skill sk4 = m.AllSkills[(ushort)DefenseSkill.SkillId];
dif = (float)(sk3.CurrentVal(this) - sk4.CurrentVal(m))/5;
}
else
dif = (float)(sk3.CurrentVal(this) - m.Level*5)/5;
}
}
}
else
{
if (m is Character)
{ /* not sure by this formula*/
Skill sk5 = m.AllSkills[(ushort)DefenseSkill.SkillId];
dif = (float)(5*this.Level - sk5.CurrentVal(m))/5;
}
else
dif = (float)(5*this.Level - m.Level*5)/5;
}
return dif;
}
示例2: RangedCriticalChanceCalculation
public float RangedCriticalChanceCalculation(Item weapon,Mobile m)
{
float critChance = 5f; // for creatures base is 5%
if(this is Character)
{
int skid = weapon.GetSkillId();
critChance = (this as Character).BaseCritChance;
if ( skid != 0 )
{
Skill sk2 = this.AllSkills[(ushort)skid];
if (sk2 != null)
{
if (m is Character)
{ /* not sure by this formula*/
Skill sk1 = m.AllSkills[(ushort)DefenseSkill.SkillId];
critChance += (float)(sk2.CurrentVal(this) - sk1.CurrentVal(m))/5;
}
else
critChance += (float)(sk2.CurrentVal(this) - m.Level*5)/5;
}
}
}
else
{
if (m is Character)
{ /* not sure by this formula*/
Skill sk1 = m.AllSkills[(ushort)DefenseSkill.SkillId];
critChance += (float)(5*this.Level - sk1.CurrentVal(m))/5;
}
else
critChance += (float)(5*this.Level - m.Level*5)/5;
}
switch (this.Classe)
{
case Classes.Rogue : break;
case Classes.Hunter : break;
case Classes.Druid : break;
case Classes.Warrior :
if (this.HaveTalent(Talents.AxeSpecialization) && weapon.SubClass == 0 )
{
AuraEffect effect1 = (AuraEffect) this.GetTalentEffect(Talents.AxeSpecialization);
critChance +=effect1.S1;
}
if (this.HaveTalent(Talents.PolearmSpecialization) && weapon.SubClass == 6 )
{
AuraEffect effect1 = (AuraEffect) this.GetTalentEffect(Talents.PolearmSpecialization);
critChance +=effect1.S1;
}
if (this.HaveTalent(Talents.Cruelty) && weapon.ObjectClass == 2)
{
AuraEffect effect1 = (AuraEffect) this.GetTalentEffect(Talents.Cruelty);
critChance +=effect1.S1;
}
break;
}
critChance +=(float)this.PhysicalCriticalBonus;
return critChance;
}
示例3: SkillUpWeapon
public bool SkillUpWeapon(Item weapon)
{
if ( attackTarget == null )
return false;
int prob = Level * 5;
if ( weapon == null )
{
weapon = activeWeapon = ChooseWeapon();
}
if ( this is Character )
{
int skid = weapon.GetSkillId();
if ( skid != 0 )
{
Skill sk = allSkills[ (ushort)skid ];
if ( sk == null )
{
Console.WriteLine("Unknown skill id for weapon {0} = id = {1} class {2}. Please send that to DrNexus !!!!!!!!", weapon.Name, skid, this.Classe );
return false;
}
if ( sk.Current >= sk.Cap( this ) )
return false;
prob = sk.CurrentVal(this);
int diff = Difficulty( prob, attackTarget.Level * 5 );
if ( SkillUp( sk.Current, diff, 0.01 ) )
{
sk.Current++;
if ( this is Character )
( this as Character ).SendSkillUpdate();
}
}
if ( StatUp( str, prob, 1 ) )
str++;
}
return true;
}