本文整理汇总了C#中Server.Engines.XmlSpawner2.TriggerObject.Dupe方法的典型用法代码示例。如果您正苦于以下问题:C# TriggerObject.Dupe方法的具体用法?C# TriggerObject.Dupe怎么用?C# TriggerObject.Dupe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Engines.XmlSpawner2.TriggerObject
的用法示例。
在下文中一共展示了TriggerObject.Dupe方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Trigger
/// <summary>
/// Checks for any triggers existing on "thisMob", returns true if a trigger signalled to override the
/// handler that it came from
/// </summary>
/// <returns>true if a trigger execution signalled to override the handler that called Trigger</returns>
public static bool Trigger(
IEntity thisObj,
Mobile trigMob,
TriggerName trigName,
Item item = null,
string spoken = null,
Spell spell = null,
int damage = 0,
object targeted = null,
SkillName skillName = SkillName.Spellweaving,
double skillValue = 0.0) // spellweaving is just a placeholder
{
var scripts = XmlAttach.GetScripts(thisObj);
bool result = false;
if (scripts != null)
{
TriggerObject trigObject = new TriggerObject
{
TrigName = trigName,
This = thisObj,
TrigMob = trigMob,
TrigItem = item,
Spell = spell,
Damage = damage,
Speech = spoken,
Targeted = targeted,
SkillName = skillName,
SkillValue = skillValue
};
int count = 0;
foreach (XmlScript script in scripts)
{
count++;
// make sure each script has its own TriggerObjects
if (script.Execute(count < scripts.Count ? trigObject.Dupe() : trigObject, true))
{
// returns true if there is an override
result = true;
}
}
}
return result;
}