예제 #1
0
        public void FinalizeDataHolder()
        {
            var trigger = AreaTriggerMgr.AreaTriggers.Get(Id);

            if (trigger == null)
            {
                ContentMgr.OnInvalidDBData("AreaTriggerEntry {0} (#{1}, Type: {2}) had invalid AreaTrigger-id.", Name, Id, Type);
                return;
            }
            else
            {
                trigger.Template = this;
            }

            if (TargetPos.IsSet)
            {
                var map = World.GetMapTemplate(TargetMap);
                if (map != null)
                {
                    Type = AreaTriggerType.Teleport;
                    ArrayUtil.AddOnlyOne(ref map.EntrancePositions, TargetPos);
                }
            }

            Handler = AreaTriggerMgr.GetHandler(Type);
        }
예제 #2
0
        public void FinalizeDataHolder()
        {
            AreaTrigger areaTrigger = AreaTriggerMgr.AreaTriggers.Get <AreaTrigger>(this.Id);

            if (areaTrigger == null)
            {
                ContentMgr.OnInvalidDBData("AreaTriggerEntry {0} (#{1}, Type: {2}) had invalid AreaTrigger-id.",
                                           (object)this.Name, (object)this.Id, (object)this.Type);
            }
            else
            {
                areaTrigger.Template = this;
                if (this.TargetPos.IsSet)
                {
                    MapTemplate mapTemplate = WCell.RealmServer.Global.World.GetMapTemplate(this.TargetMap);
                    if (mapTemplate != null)
                    {
                        this.Type = AreaTriggerType.Teleport;
                        int num = (int)ArrayUtil.AddOnlyOne <Vector3>(ref mapTemplate.EntrancePositions,
                                                                      this.TargetPos);
                    }
                }

                this.Handler = AreaTriggerMgr.GetHandler(this.Type);
            }
        }
예제 #3
0
        public static AreaTriggerHandler GetHandler(AreaTriggerType type)
        {
            var handler = Handlers[(int)type];

            if (handler == null)
            {
                handler = NoAction;
            }
            return(handler);
        }
예제 #4
0
파일: ATTemplate.cs 프로젝트: NVN/WCell
		public void FinalizeDataHolder()
		{
			var trigger = AreaTriggerMgr.AreaTriggers.Get(Id);
			if (trigger == null)
			{
				ContentMgr.OnInvalidDBData("AreaTriggerEntry {0} (#{1}, Type: {2}) had invalid AreaTrigger-id.", Name, Id, Type);
				return;
			}
			else
			{
				trigger.Template = this;
			}

			if (TargetPos.IsSet)
			{
				var region = World.GetRegionTemplate(TargetMap);
				if (region != null)
				{
					Type = AreaTriggerType.Teleport;
					ArrayUtil.AddOnlyOne(ref region.EntrancePositions, TargetPos);
				}
			}

			Handler = AreaTriggerMgr.GetHandler(Type);
		}
예제 #5
0
파일: AreaTriggerMgr.cs 프로젝트: NVN/WCell
		public static void SetHandler(AreaTriggerType type, AreaTriggerHandler handler)
		{
			Handlers[(int)type] = handler;
		}
예제 #6
0
파일: AreaTriggerMgr.cs 프로젝트: NVN/WCell
		public static AreaTriggerHandler GetHandler(AreaTriggerType type)
		{
			var handler = Handlers[(int)type];
			if (handler == null)
			{
				handler = NoAction;
			}
			return handler;
		}
예제 #7
0
 public static void SetHandler(AreaTriggerType type, AreaTriggerHandler handler)
 {
     Handlers[(int)type] = handler;
 }
예제 #8
0
 public static AreaTriggerHandler GetHandler(AreaTriggerType type)
 {
     return(AreaTriggerMgr.Handlers[(int)type] ?? new AreaTriggerHandler(AreaTriggerMgr.NoAction));
 }