本文整理汇总了C#中Server.Engines.Craft.CraftSystem.PlayEndingEffect方法的典型用法代码示例。如果您正苦于以下问题:C# CraftSystem.PlayEndingEffect方法的具体用法?C# CraftSystem.PlayEndingEffect怎么用?C# CraftSystem.PlayEndingEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Engines.Craft.CraftSystem
的用法示例。
在下文中一共展示了CraftSystem.PlayEndingEffect方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompleteCraft
//.........这里部分代码省略.........
{
item = new IndecipherableMap();
from.SendLocalizedMessage( 1070800 ); // The map you create becomes mysteriously indecipherable.
}
else
{
item = Activator.CreateInstance( ItemType ) as Item;
}
if ( item != null )
{
if( item is ICraftable )
endquality = ((ICraftable)item).OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
else if ( item.Hue == 0 )
item.Hue = resHue;
if ( maxAmount > 0 )
{
if ( !item.Stackable && item is IUsesRemaining )
((IUsesRemaining)item).UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack( item );
if( from.AccessLevel > AccessLevel.Player )
CommandLogging.WriteLine( from, "Crafting {0} with craft system {1}", CommandLogging.Format( item ), craftSystem.GetType().Name );
//from.PlaySound( 0x57 );
}
if ( num == 0 )
num = craftSystem.PlayEndingEffect( from, false, true, toolBroken, endquality, makersMark, this );
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if ( item is IFactionItem )
{
def = FactionItemDefinition.Identify( item );
if ( def != null )
{
faction = Faction.Find( from );
if ( faction != null )
{
Town town = Town.FromRegion( from.Region );
if ( town != null && town.Owner == faction )
{
Container pack = from.Backpack;
if ( pack != null )
{
availableSilver = pack.GetAmount( typeof( Silver ) );
if ( availableSilver >= def.SilverCost )
queryFactionImbue = Faction.IsNearType( from, def.VendorType, 12 );
}
}
}
}
示例2: CompleteCraft
//.........这里部分代码省略.........
{
toRemove = item;
break;
}
amount++;
}
}
from.SendAsciiMessage("You are overweight and put the {0} on the ground.", item.Name ?? CliLoc.LocToString(item.LabelNumber));
if (toRemove != null)
toRemove.Delete();
else if (amount >= 5 && amount < 20)
from.LocalOverheadMessage(MessageType.Regular, 906, true, string.Format("{0} identical items on the ground detected, no more than 20 is allowed!", amount));
else if (amount >= 20)
{
from.LocalOverheadMessage(MessageType.Regular, 906, true, "Too many identical items on the ground, removing!");
item.Delete();
}
eable.Free();
}
#endregion
if (from.AccessLevel > AccessLevel.Player)
CommandLogging.WriteLine(from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
}
if (num == 0)
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if (item is IFactionItem)
{
def = FactionItemDefinition.Identify(item);
if (def != null)
{
faction = Faction.Find(from);
if (faction != null)
{
Town town = Town.FromRegion(from.Region);
if (town != null && town.Owner == faction)
{
Container pack = from.Backpack;
if (pack != null)
{
availableSilver = pack.GetAmount(typeof(Silver));
if (availableSilver >= def.SilverCost)
queryFactionImbue = Faction.IsNearType(from, def.VendorType, 12);
}
}
}
}
示例3: CompleteCraft
//.........这里部分代码省略.........
((SoftenedReeds)item).PlantHue = PlantHueInfo.GetInfo(m_PlantHue).PlantHue;
}
if (item is BaseContainer && (craftSystem is DefBasketweaving))
{
(item).Hue = PlantHueInfo.GetInfo(m_PlantHue).Hue;
}
CraftContext context = craftSystem.GetContext(from);
if (context.QuestOption == CraftQuestOption.QuestItem)
{
PlayerMobile px = from as PlayerMobile;
if (!QuestHelper.CheckItem(px, item))
from.SendLocalizedMessage(1072355, null, 0x23); // That item does not match any of your quest criteria
}
#endregion
from.AddToBackpack(item);
if (from.IsStaff())
{
CommandLogging.WriteLine(
from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
}
AutoCraftTimer.OnSuccessfulCraft(from);
//from.PlaySound( 0x57 );
}
if (num == 0)
{
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
}
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if (item is IFactionItem)
{
def = FactionItemDefinition.Identify(item);
if (def != null)
{
faction = Faction.Find(from);
if (faction != null)
{
Town town = Town.FromRegion(from.Region);
if (town != null && town.Owner == faction)
{
Container pack = from.Backpack;
if (pack != null)
{
availableSilver = pack.GetAmount(typeof(Silver));
if (availableSilver >= def.SilverCost)
{
queryFactionImbue = Faction.IsNearType(from, def.VendorType, 12);
}
}
示例4: CompleteCraft
//.........这里部分代码省略.........
case CraftResource.Silver: item = new SilverMarble(); break;
case CraftResource.Platinum: item = new PlatinumMarble(); break;
case CraftResource.Mythril: item = new MythrilMarble(); break;
case CraftResource.Obsidian: item = new ObsidianMarble(); break;
case CraftResource.Jade: item = new JadeMarble(); break;
case CraftResource.Moonstone: item = new MoonstoneMarble(); break;
case CraftResource.Sunstone: item = new SunstoneMarble(); break;
case CraftResource.Bloodstone: item = new BloodstoneMarble(); break;
default: item = new Marble(); break;
}
}
//end for new marble system
if( item is ICraftable )
endquality = ((ICraftable)item).OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
else if ( item.Hue == 0 )
item.Hue = resHue;
if ( maxAmount > 0 )
{
if ( !item.Stackable && item is IUsesRemaining )
((IUsesRemaining)item).UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack( item );
//from.PlaySound( 0x57 );
}
if ( num == 0 )
num = craftSystem.PlayEndingEffect( from, false, true, toolBroken, endquality, makersMark, this );
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if ( item is IFactionItem )
{
def = FactionItemDefinition.Identify( item );
if ( def != null )
{
faction = Faction.Find( from );
if ( faction != null )
{
Town town = Town.FromRegion( from.Region );
if ( town != null && town.Owner == faction )
{
Container pack = from.Backpack;
if ( pack != null )
{
availableSilver = pack.GetAmount( typeof( Silver ) );
if ( availableSilver >= def.SilverCost )
queryFactionImbue = Faction.IsNearType( from, def.VendorType, 12 );
}
}
}
}
示例5: CompleteCraft
//.........这里部分代码省略.........
else
{
if (dt is SpecialDyeTub)
{
sdtub.Delete();
((SpecialDyeTub)dt).Uses++;
from.SendMessage("You mix the dye and add it to an existing batch.");
}
else
{
sdtub.StoreColor(m_NameString);
dt.Delete();
from.SendMessage("You successfully mix the dye.");
from.AddToBackpack(item);
}
ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message);
}
}
}
}
if (craftSystem is DefTinkering &&
item is BaseTinkerTrap)
{
//Need to send target cursor to target
//the trappable container
bTinkerTrap = true;
int power = (int)from.Skills[SkillName.Tinkering].Value + Utility.Random(0, 15);
if (power <= 10) power = 10;
((BaseTinkerTrap)item).Power = power;
from.SendMessage("Target the container you wish to trap.");
from.Target = new TrappableContainerTarget(this, item, craftSystem, toolBroken, tool);
}
if (!bTinkerTrap && (!(item is SpecialDyeTub || item is SpecialDye)))
{
from.AddToBackpack(item);
}
//from.PlaySound( 0x57 );
}
if (!bTinkerTrap)
{
int num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, num));
else if (num > 0)
from.SendLocalizedMessage(num);
}
}
else if (!allRequiredSkills)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, 1044153));
else
from.SendLocalizedMessage(1044153); // You don't have the required skills to attempt this item.
}
else
{
ConsumeType consumeType = (UseAllRes ? ConsumeType.Fail : ConsumeType.Half);
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
tool.UsesRemaining--;
if (tool.UsesRemaining < 1)
toolBroken = true;
if (toolBroken)
tool.Delete();
// SkillCheck failed.
int num = craftSystem.PlayEndingEffect(from, true, true, toolBroken, endquality, false, this);
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, num));
else if (num > 0)
from.SendLocalizedMessage(num);
}
}
示例6: CompleteCraft
//.........这里部分代码省略.........
}
#endregion
if (item is ICraftable)
endquality = ((ICraftable)item).OnCraft(quality, makersMark, from, craftSystem, typeRes, tool, this, resHue);
else if (item.Hue == 0)
item.Hue = resHue;
if (maxAmount > 0)
{
if (!item.Stackable && item is IUsesRemaining)
((IUsesRemaining)item).UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack(item);
//I Added FOR CRAFTBAG
Container craftbag = GetCraftBag(from);
if (!craftbag.TryDropItem(from, item, false))
{
from.AddToBackpack(item);
}
//I Added For craftbacg above. The original below
//originaly was there above from.AddToBackpack(item);
if (from.AccessLevel > AccessLevel.Player)
CommandLogging.WriteLine(from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
//from.PlaySound( 0x57 );
}
if (num == 0)
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if (item is IFactionItem)
{
def = FactionItemDefinition.Identify(item);
if (def != null)
{
faction = Faction.Find(from);
if (faction != null)
{
Town town = Town.FromRegion(from.Region);
if (town != null && town.Owner == faction)
{
Container pack = from.Backpack;
if (pack != null)
{
availableSilver = pack.GetAmount(typeof(Silver));
if (availableSilver >= def.SilverCost)
queryFactionImbue = Faction.IsNearType(from, def.VendorType, 12);
}
}
}
}
示例7: CompleteCraft
//.........这里部分代码省略.........
if (tool.UsesRemaining < 1 && tool.BreakOnDepletion)
toolBroken = true;
if (toolBroken)
tool.Delete();
int num = 0;
Item item;
if (customCraft != null)
{
item = customCraft.CompleteCraft(out num);
}
else if (typeof(MapItem).IsAssignableFrom(ItemType) && from.Map != Map.Felucca)
{
item = new IndecipherableMap();
from.SendLocalizedMessage(1070800); // The map you create becomes mysteriously indecipherable.
}
else
{
item = Activator.CreateInstance(ItemType) as Item;
}
if (item != null)
{
if (item is ICraftable)
endquality = ((ICraftable)item).OnCraft(quality, makersMark, from, craftSystem, typeRes, tool, this, resHue);
else if (item.Hue == 0)
item.Hue = resHue;
if (maxAmount > 0)
{
if (!item.Stackable && item is IUsesRemaining)
((IUsesRemaining)item).UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack(item);
if (from.AccessLevel > AccessLevel.Player)
CommandLogging.WriteLine(from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
//from.PlaySound( 0x57 );
}
if (num == 0)
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, num));
else if (num > 0)
from.SendLocalizedMessage(num);
}
else if (!allRequiredSkills)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, 1044153));
else
from.SendLocalizedMessage(1044153); // You don't have the required skills to attempt this item.
}
else
{
ConsumeType consumeType = (UseAllRes ? ConsumeType.Half : ConsumeType.All);
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, true))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
tool.UsesRemaining--;
if (tool.UsesRemaining < 1 && tool.BreakOnDepletion)
toolBroken = true;
if (toolBroken)
tool.Delete();
// SkillCheck failed.
int num = craftSystem.PlayEndingEffect(from, true, true, toolBroken, endquality, false, this);
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, num));
else if (num > 0)
from.SendLocalizedMessage(num);
}
}
示例8: CompleteCraft
//.........这里部分代码省略.........
case CraftResource.Ash: m_TokensAmount *= 4; break;
case CraftResource.Yew: m_TokensAmount *= 5; break;
//case CraftResource.Oak: m_TokensAmount *= 6; break;
case CraftResource.Cherry: m_TokensAmount *= 7; break;
case CraftResource.Cedar: m_TokensAmount *= 8; break;
case CraftResource.Mahogany: m_TokensAmount *= 9; break;
// case CraftResource.PurpleHeart: i_TokensAmount *= 10; break;
// case CraftResource.Redwood: i_TokensAmount *= 11; break;
// case CraftResource.Petrified: i_TokensAmount *= 12; break;
case CraftResource.Heartwood: m_TokensAmount *= 10; break;
case CraftResource.Bloodwood: m_TokensAmount *= 11; break;
case CraftResource.Frostwood: m_TokensAmount *= 12; break;
}
}
m_TokensAmount *= Ressources.GetAt(0).Amount;
double tok = m_TokensAmount;
if (quality == 2)
tok *= 1.35;
tok /= 8;
if (tok >= 1)
m_TokensAmount = (int)tok;
else
m_TokensAmount = 1;
TokenValidate.RewardTokens(from, m_TokensAmount);
}
if (from.AccessLevel > AccessLevel.Player)
CommandLogging.WriteLine(from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
//from.PlaySound( 0x57 );
}
if (num == 0)
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if (item is IFactionItem)
{
def = FactionItemDefinition.Identify(item);
if (def != null)
{
faction = Faction.Find(from);
if (faction != null)
{
Town town = Town.FromRegion(from.Region);
if (town != null && town.Owner == faction)
{
Container pack = from.Backpack;
if (pack != null)
{
availableSilver = pack.GetAmount(typeof(Silver));
if (availableSilver >= def.SilverCost)
queryFactionImbue = Faction.IsNearType(from, def.VendorType, 12);
}
}
}
}