本文整理匯總了C#中Server.Engines.Craft.CraftItem.GetExceptionalChance方法的典型用法代碼示例。如果您正苦於以下問題:C# CraftItem.GetExceptionalChance方法的具體用法?C# CraftItem.GetExceptionalChance怎麽用?C# CraftItem.GetExceptionalChance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Engines.Craft.CraftItem
的用法示例。
在下文中一共展示了CraftItem.GetExceptionalChance方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnCraft
public virtual int OnCraft(
int quality,
bool makersMark,
Mobile from,
CraftSystem craftSystem,
Type typeRes,
IBaseTool tool,
CraftItem craftItem,
int resHue)
{
int magery = from.Skills.Magery.BaseFixedPoint;
if (makersMark)
{
Crafter = from;
}
m_Quality = (BookQuality)(quality - 1);
if (craftItem.Recipe != null && craftItem.Recipe.ID == 1001) //Full spellbook
{
Content = ulong.MaxValue;
bool allRequiredSkills = true;
double chance = craftItem.GetSuccessChance(from, typeRes, craftSystem, false, ref allRequiredSkills);
double excepChance = craftItem.GetExceptionalChance(craftSystem, chance, from);
double blessChance = excepChance / 3.0;
if (blessChance < 0.025 && from.Skills[SkillName.Inscribe].Value >= 100.0)
{
blessChance = 0.025;
}
if (Crafter != null && m_Quality == BookQuality.Exceptional && blessChance > Utility.RandomDouble())
{
LootType = LootType.Blessed;
}
}
return quality;
}