Aura.Channel.Scripting.Scripts.QuestScript.Init C# (CSharp) Метод

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

Initializes the script, loading the information and adding it to the script manager.
public Init ( ) : bool
Результат bool
		public override bool Init()
		{
			this.Load();

			if (this.Id == 0 || ChannelServer.Instance.ScriptManager.QuestScripts.ContainsKey(this.Id))
			{
				Log.Error("{1}.Init: Invalid id or already in use ({0}).", this.Id, this.GetType().Name);
				return false;
			}

			if (this.Objectives.Count == 0)
			{
				Log.Error("{1}.Init: Quest '{0}' doesn't have any objectives.", this.Id, this.GetType().Name);
				return false;
			}

			if (this.ReceiveMethod == Receive.Automatically)
				ChannelServer.Instance.Events.PlayerLoggedIn += this.OnPlayerLoggedIn;

			this.MetaData.SetString("QSTTIP", "N_{0}|D_{1}|A_|R_{2}|T_0", this.Name, this.Description, string.Join(", ", this.GetDefaultRewardGroup().Rewards));

			ChannelServer.Instance.ScriptManager.QuestScripts.Add(this.Id, this);

			return true;
		}