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


C# TriggerObject.Dupe方法代码示例

本文整理汇总了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;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:53,代码来源:UberScriptTriggers.cs


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