Aura.Channel.Scripting.Scripts.NpcScript.SetAi C# (CSharp) Метод

SetAi() публичный Метод

Changes the NPC's AI.
public SetAi ( string name ) : void
name string
Результат void
		public void SetAi(string name)
		{
			if (this.NPC == null)
				throw new InvalidOperationException("NPC's race has to be set first.");

			if (this.NPC.AI != null)
				this.NPC.AI.Dispose();

			this.NPC.AI = ChannelServer.Instance.ScriptManager.AiScripts.CreateAi(name, this.NPC);
			if (this.NPC.AI == null)
				Log.Error("NpcScript.SetAi: AI '{0}' not found ({1})", name, this.GetType().Name);
		}