Пример #1
0
        public void Load(int mapId, WzManager wzMan)
        {
            var wz      = wzMan["Map.wz"];
            var path    = $"Map/Map{mapId / 100000000}/{mapId}.img/portal";
            var portals = wz.ResolvePath(path);

            foreach (WZObject x in portals)
            {
                var p = new Portal
                {
                    nIdx   = Convert.ToInt32(x.Name),
                    sName  = x["pn"].ValueOrDie <string>(),
                    nType  = x["pt"].ValueOrDie <int>(),
                    nTMap  = x["tm"].ValueOrDie <int>(),
                    sTName = x["tn"].ValueOrDie <string>(),
                    ptPos  =
                    {
                        X = (short)x["x"].ValueOrDie <int>(),
                        Y = (short)x["y"].ValueOrDie <int>()
                    }
                };

                Portals.Add(p);
            }
        }
Пример #2
0
        public void Load(int mapId, WzManager wzMan)
        {
            var wz        = wzMan["Map.wz"];
            var path      = $"Map/Map{mapId / 100000000}/{mapId}.img/foothold";
            var footholds = wz.ResolvePath(path);

            foreach (WZObject wz1 in footholds)
            {
                foreach (WZObject wz2 in wz1)
                {
                    foreach (WZObject fh in wz2)
                    {
                        var f = new Foothold
                        {
                            Id   = Convert.ToInt32(fh.Name),
                            Next = fh["next"].ValueOrDie <int>(),
                            Prev = fh["prev"].ValueOrDie <int>(),
                            X1   = (short)fh["x1"].ValueOrDie <int>(),
                            Y1   = (short)fh["y1"].ValueOrDie <int>(),
                            X2   = (short)fh["x2"].ValueOrDie <int>(),
                            Y2   = (short)fh["y2"].ValueOrDie <int>(),
                        };

                        Footholds.Add(f);
                    }
                }
            }
        }
Пример #3
0
        public void Load(int mapId, WzManager wzMan)
        {
            var wz   = wzMan["Map.wz"];
            var path = $"Map/Map{mapId / 100000000}/{mapId}.img/life";
            var life = wz.ResolvePath(path);

            foreach (WZObject node in life)
            {
                var type = node["type"].ValueOrDie <string>();

                if (type != "n")
                {
                    continue;
                }

                var id = node["id"].ValueOrDie <string>();

                var fh = node["fh"].ValueOrDie <int>();
                var x  = node["x"].ValueOrDie <int>();
                var y  = node["y"].ValueOrDie <int>();

                var cy = node["cy"].ValueOrDie <int>();
                //var f = node["f"].ValueOrDie<int>();
                //var hide = node["hide"].ValueOrDie<int>();
                var rx0 = node["rx0"].ValueOrDie <int>();
                var rx1 = node["rx1"].ValueOrDie <int>();
                //var mobTime = node["mobTime"].ValueOrDie<int>();

                var uid = GetUniqueId();

                var cl = new CNpc
                {
                    dwNpcId  = uid,
                    Id       = Convert.ToInt32(id),
                    Type     = type,
                    Foothold = fh,
                    X        = x,
                    Y        = y,
                    Cy       = cy,
                    //F = f,
                    //Hide = hide,
                    Rx0 = rx0,
                    Rx1 = rx1,
                    //MobTime = mobTime
                };

                Add(uid, cl);
            }
        }
Пример #4
0
        public WvsCenter(int channels)
        {
            WzMan = new WzManager();
            WzMan.LoadFile("Map.wz");

            Db       = new MongoDb();
            LoggedIn = new List <PendingLogin>();

            m_login = new WvsLogin(this);
            m_games = new WvsGame[channels];

            for (int i = 0; i < m_games.Length; i++)
            {
                var channel = (byte)i;
                m_games[i] = new WvsGame(this, channel);
            }
        }