Beispiel #1
0
        public void AssignFields(object d2oObject)
        {
            SuperArea superArea = (SuperArea)d2oObject;

            this.Id         = superArea.id;
            this.NameId     = superArea.nameId;
            this.WorldmapId = superArea.worldmapId;
        }
        public override void Execute(TriggerBase trigger)
        {
            Point position = new Point(trigger.Get <int>("x"), trigger.Get <int>("y"));
            bool  flag     = trigger.IsArgumentDefined("outdoor");
            int   index    = trigger.Get <int>("outdoor");

            Character[] targets = base.GetTargets(trigger);
            for (int i = 0; i < targets.Length; i++)
            {
                Character character = targets[i];
                Map       map       = character.Map;
                Map       map2;
                if (trigger.IsArgumentDefined("superarea"))
                {
                    SuperArea superArea = trigger.Get <SuperArea>("superarea");
                    map2 = (flag ? superArea.GetMaps(position, flag).FirstOrDefault <Map>() : superArea.GetMaps(position).ElementAtOrDefault(index));
                }
                else
                {
                    map2 = (flag ? Singleton <World> .Instance.GetMaps(map, position.X, position.Y).ElementAtOrDefault(index) : Singleton <World> .Instance.GetMaps(map, position.X, position.Y, flag).FirstOrDefault <Map>());
                }
                if (map2 == null)
                {
                    trigger.ReplyError("Map x:{0} y:{1} not found", new object[]
                    {
                        position.X,
                        position.Y
                    });
                }
                else
                {
                    Cell cell = trigger.IsArgumentDefined("cell") ? map2.Cells[(int)trigger.Get <short>("cell")] : character.Cell;
                    character.Teleport(new ObjectPosition(map2, cell, character.Direction), true);
                    trigger.Reply("Teleported to {0} {1} ({2}).", new object[]
                    {
                        position.X,
                        position.Y,
                        map2.Id
                    });
                }
            }
        }
Beispiel #3
0
 public Area(int id)
 {
     m_area = DataProvider.Instance.Get<Protocol.Data.Area>(id);
     SuperArea = new SuperArea(SuperAreaId);
 }
Beispiel #4
0
 public Area(int id)
 {
     m_area = ObjectDataManager.Instance.Get<Protocol.Data.Area>(id);
     SuperArea = new SuperArea(SuperAreaId);
 }