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


C# NPC.CallPeriodically方法代码示例

本文整理汇总了C#中WCell.RealmServer.Entities.NPC.CallPeriodically方法的典型用法代码示例。如果您正苦于以下问题:C# NPC.CallPeriodically方法的具体用法?C# NPC.CallPeriodically怎么用?C# NPC.CallPeriodically使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WCell.RealmServer.Entities.NPC的用法示例。


在下文中一共展示了NPC.CallPeriodically方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnBeforeAmbusherDeath

		private static bool OnBeforeAmbusherDeath(NPC ambusher)
		{
			if (ambusher.FirstAttacker is Character)
			{
				var killer = (Character)ambusher.FirstAttacker;
				if (!killer.QuestLog.HasActiveQuest(AmbusherQuest))
				{
					// quest isn't active
					return true;
				}

				// say something
				ambusher.Say("Oh kind sir, please don't kill me!");

				// discarded the idea of the backstabber:
				//ambusher.MoveBehindThenExecute(killer,
				//    attacker => attacker.SpellCast.Start(SpellId.ClassSkillBackstabRank1, false, killer));

				// cast some AoE spell (ignoring all restrictions)
				ambusher.SpellCast.Trigger(SpellId.ClassSkillFrostNovaRank6);

				// Is now friendly with everyone
				ambusher.FactionId = FactionId.Friendly;

				// more health than ever before (not necessary here)
				ambusher.BaseHealth = ambusher.Health = 100000;

				// won't do anything stupid anymore
				ambusher.Brain.DefaultState = BrainState.Idle;
				ambusher.Brain.EnterDefaultState();

				// never leave the killer alone: Approach again and again...
				ambusher.CallPeriodically(2000,
					obj => SeekForgiveness(ambusher, killer));

				return false; 		// return false to indicate that the guy didn't die
			}
			return true;			// die
		}
开发者ID:remixod,项目名称:netServer,代码行数:39,代码来源:AmbusherQuestSample.cs


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