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); }
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); } }
public static AreaTriggerHandler GetHandler(AreaTriggerType type) { var handler = Handlers[(int)type]; if (handler == null) { handler = NoAction; } return(handler); }
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); }
public static void SetHandler(AreaTriggerType type, AreaTriggerHandler handler) { Handlers[(int)type] = handler; }
public static AreaTriggerHandler GetHandler(AreaTriggerType type) { var handler = Handlers[(int)type]; if (handler == null) { handler = NoAction; } return handler; }
public static AreaTriggerHandler GetHandler(AreaTriggerType type) { return(AreaTriggerMgr.Handlers[(int)type] ?? new AreaTriggerHandler(AreaTriggerMgr.NoAction)); }