Inheritance: GeneralScript
示例#1
0
		/// <summary>
		/// Cancels script and resets session.
		/// </summary>
		public void Clear()
		{
			if (this.Script != null)
				this.Script.Cancel();
			this.Script = null;
			this.Target = null;
		}
示例#2
0
		/// <summary>
		/// Starts session
		/// </summary>
		/// <param name="target"></param>
		/// <param name="creature"></param>
		private bool Start(NPC target, Creature creature)
		{
			this.Target = target;

			if (target.ScriptType == null)
				return false;

			var script = Activator.CreateInstance(target.ScriptType) as NpcScript;
			script.NPC = target;
			script.Player = creature;
			this.Script = script;
			return true;
		}