コード例 #1
0
        public void AddingDoor(GamePlayer player, byte response)
        {
            if (response != 0x01)
            {
                return;
            }

            int doorType = HandlerDoorId / 100000000;

            if (doorType == 7)
            {
                PositionMgr.CreateDoor(HandlerDoorId, player);
            }
            else
            {
                var door = new DBDoor
                {
                    ObjectId   = null,
                    InternalID = HandlerDoorId,
                    Name       = "door",
                    Type       = HandlerDoorId / 100000000,
                    Level      = 20,
                    Realm      = 6,
                    MaxHealth  = 2545,
                    Health     = 2545,
                    Locked     = 0,
                    X          = player.X,
                    Y          = player.Y,
                    Z          = player.Z,
                    Heading    = player.Heading
                };

                GameServer.Database.AddObject(door);

                player.Out.SendMessage($"Added door {HandlerDoorId} to the database!", eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                DoorMgr.Init();
            }
        }
コード例 #2
0
        public void AddingDoor(GamePlayer player, byte response)
        {
            if (response != 0x01)
            {
                return;
            }

            int doorType = m_handlerDoorID / 100000000;

            if (doorType == 7)
            {
                PositionMgr.CreateDoor(m_handlerDoorID, player);
            }
            else
            {
                var door = new DBDoor();
                door.ObjectId   = null;
                door.InternalID = m_handlerDoorID;
                door.Name       = "door";
                door.Type       = m_handlerDoorID / 100000000;
                door.Level      = 20;
                door.Realm      = 6;
                door.MaxHealth  = 2545;
                door.Health     = 2545;
                door.Locked     = 0;
                door.X          = (int)player.Position.X;
                door.Y          = (int)player.Position.Y;
                door.Z          = (int)player.Position.Z;
                door.Heading    = player.Heading;
                GameServer.Database.AddObject(door);

                player.Out.SendMessage("Added door " + m_handlerDoorID + " to the database!", eChatType.CT_Important,
                                       eChatLoc.CL_SystemWindow);
                DoorMgr.Init();
            }
        }