本文整理汇总了C#中Data.Structures.Player.Player.GetJobLevel方法的典型用法代码示例。如果您正苦于以下问题:C# Player.GetJobLevel方法的具体用法?C# Player.GetJobLevel怎么用?C# Player.GetJobLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data.Structures.Player.Player
的用法示例。
在下文中一共展示了Player.GetJobLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LearnSkill
public void LearnSkill(Player player, int skillId)
{
Skill skill = Data.Data.Skills[skillId];
if (skill == null)
{
Log.Warn("LearnSkill: skill data not found");
return;
}
if (player.GetLevel() < skill.Level)
{
Log.Warn("LearnSkill: player level < skill Level");
return;
}
if (player.GetJobLevel() < skill.JobLevel)
{
Log.Warn("LearnSkill: player Job level < skill Job Level");
return;
}
if (skill.Job != (int)player.PlayerData.Class)
{
Log.Warn("LearnSkill: player Job < skill Job");
return;
}
if (player.SkillPoint < skill.LearnExp && (player.PlayerData.Class != PlayerClass.Hanbi && skill.Id != 1000101))
{
Log.Warn("LearnSkill: player SkillPoint < skill LearnExp");
return;
}
if ((player.PlayerData.Class != PlayerClass.Hanbi && skill.Id != 1000101))
player.SkillPoint -= skill.LearnExp;
switch ((SkillType)skill.Type)
{
case SkillType.Basic:
player.Skills.AddSkill(skill.Id, 1);
break;
case SkillType.Passive:
player.PassiveSkills.AddSkill(skill.Id, 1);
break;
case SkillType.Ascension:
player.AscensionSkills.AddSkill(skill.Id, 1);
break;
}
DataBaseSkill.AddPlayerSkill(player, skill.Id, 1, (SkillType)skill.Type, skill.Index);
}
示例2: CanDress
private bool CanDress(Player player, StorageItem item, bool sendErrors = false)
{
if (player.PlayerData.Class != (PlayerClass)item.ItemTemplate.Class)
{
if(sendErrors)
new SpChatMessage(player, "Can't Equip!!", ChatType.House, true).Send(player.Connection);
return false;
}
if (item.ItemTemplate.Level > player.GetLevel() && item.ItemTemplate.JobLevel > player.GetJobLevel())
{
if (sendErrors)
new SpChatMessage(player, "Can't Equip!!", ChatType.House, true).Send(player.Connection);
return false;
}
return true;
}