当前位置: 首页>>代码示例>>C#>>正文


C# Item.GetSkillId方法代码示例

本文整理汇总了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;
		}
开发者ID:karliky,项目名称:wowwow,代码行数:34,代码来源:Mobile.cs

示例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;
		}
开发者ID:karliky,项目名称:wowwow,代码行数:62,代码来源:Mobile.cs

示例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;
		}
开发者ID:karliky,项目名称:wowwow,代码行数:36,代码来源:Mobile.cs


注:本文中的Server.Items.Item.GetSkillId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。